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