对齐月历显示控制项
This commit is contained in:
@@ -1,4 +1,6 @@
|
|||||||
const assert = require('assert')
|
const assert = require('assert')
|
||||||
|
const fs = require('fs')
|
||||||
|
const path = require('path')
|
||||||
const planningApi = require('../../api/planning')
|
const planningApi = require('../../api/planning')
|
||||||
const dateUtil = require('../../utils/date')
|
const dateUtil = require('../../utils/date')
|
||||||
|
|
||||||
@@ -43,6 +45,12 @@ function createPage(data = {}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function run() {
|
async function run() {
|
||||||
|
const planningWxml = fs.readFileSync(path.join(__dirname, 'index.wxml'), 'utf8')
|
||||||
|
const toolbarMarkup = planningWxml.match(/<view class="month-toolbar">([\s\S]*?)<\/view>\s*<view class="month-card/)
|
||||||
|
assert.ok(toolbarMarkup)
|
||||||
|
assert.ok(toolbarMarkup[1].indexOf('month-toolbar-title') < toolbarMarkup[1].indexOf('month-toolbar-controls'))
|
||||||
|
assert.ok(toolbarMarkup[1].indexOf('month-mode-switch') < toolbarMarkup[1].indexOf('row-name-switch'))
|
||||||
|
|
||||||
assert.deepStrictEqual(definition.data.viewModes.map(item => item.value), ['month', 'week', 'day'])
|
assert.deepStrictEqual(definition.data.viewModes.map(item => item.value), ['month', 'week', 'day'])
|
||||||
assert.strictEqual(definition.data.viewMode, 'month')
|
assert.strictEqual(definition.data.viewMode, 'month')
|
||||||
|
|
||||||
|
|||||||
@@ -144,6 +144,7 @@
|
|||||||
<view wx:if="{{viewMode === 'month'}}" class="section">
|
<view wx:if="{{viewMode === 'month'}}" class="section">
|
||||||
<view class="month-toolbar">
|
<view class="month-toolbar">
|
||||||
<text class="month-toolbar-title">月历显示</text>
|
<text class="month-toolbar-title">月历显示</text>
|
||||||
|
<view class="month-toolbar-controls">
|
||||||
<view class="month-mode-switch">
|
<view class="month-mode-switch">
|
||||||
<view wx:for="{{monthDisplayModes}}" wx:key="value" class="month-mode {{monthDisplayMode === item.value ? 'active' : ''}}" data-mode="{{item.value}}" bindtap="switchMonthDisplay">{{item.label}}</view>
|
<view wx:for="{{monthDisplayModes}}" wx:key="value" class="month-mode {{monthDisplayMode === item.value ? 'active' : ''}}" data-mode="{{item.value}}" bindtap="switchMonthDisplay">{{item.label}}</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -152,6 +153,7 @@
|
|||||||
<view class="switch-track"><view class="switch-thumb"></view></view>
|
<view class="switch-track"><view class="switch-thumb"></view></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
<view class="month-card card">
|
<view class="month-card card">
|
||||||
<view class="month-week-head">
|
<view class="month-week-head">
|
||||||
<text wx:for="{{weekLabels}}" wx:key="*this">{{item}}</text>
|
<text wx:for="{{weekLabels}}" wx:key="*this">{{item}}</text>
|
||||||
|
|||||||
@@ -533,20 +533,30 @@
|
|||||||
.month-toolbar {
|
.month-toolbar {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
|
||||||
gap: 8rpx;
|
gap: 8rpx;
|
||||||
margin-bottom: 14rpx;
|
margin-bottom: 14rpx;
|
||||||
padding: 0 4rpx;
|
padding: 0 4rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.month-toolbar-title {
|
.month-toolbar-title {
|
||||||
|
flex: 0 0 auto;
|
||||||
|
margin-right: auto;
|
||||||
color: #615a51;
|
color: #615a51;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
font-weight: 800;
|
font-weight: 800;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.month-toolbar-controls {
|
||||||
|
display: inline-flex;
|
||||||
|
flex: 0 0 auto;
|
||||||
|
align-items: center;
|
||||||
|
gap: 12rpx;
|
||||||
|
margin-left: auto;
|
||||||
|
}
|
||||||
|
|
||||||
.month-mode-switch {
|
.month-mode-switch {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
|
flex: 0 0 auto;
|
||||||
gap: 6rpx;
|
gap: 6rpx;
|
||||||
padding: 6rpx;
|
padding: 6rpx;
|
||||||
border-radius: 999rpx;
|
border-radius: 999rpx;
|
||||||
|
|||||||
@@ -412,3 +412,7 @@
|
|||||||
|
|
||||||
- 款式图片列表改为固定高度的横向滚动区,新增图片不再换行并撑高弹层。
|
- 款式图片列表改为固定高度的横向滚动区,新增图片不再换行并撑高弹层。
|
||||||
- 图片和“点击添加图片”入口统一为正方形尺寸,添加入口位于列表末尾;保留封面标识、删除、预览和最多 9 张规则。
|
- 图片和“点击添加图片”入口统一为正方形尺寸,添加入口位于列表末尾;保留封面标识、删除、预览和最多 9 张规则。
|
||||||
|
|
||||||
|
## 2026-10-29 Salon 月历显示工具栏对齐
|
||||||
|
|
||||||
|
- 月历显示模式切换与姓名开关合并为右侧控制组,姓名开关开启时模式切换紧邻其左侧,标题维持左对齐。
|
||||||
|
|||||||
Reference in New Issue
Block a user