完善小程序登录排班与个人资料流程
This commit is contained in:
@@ -68,6 +68,34 @@ async function run() {
|
||||
page.buildViewState({ artists: [], appointments: [], daySummaries: [] })
|
||||
assert.deepStrictEqual([monthBuilds, weekBuilds, dayBuilds], [0, 1, 0])
|
||||
|
||||
const closedWeekPage = createPage({ viewMode: 'week', currentDateText: '2026-10-12' })
|
||||
const closedWeek = Array.from({ length: 7 }, (_, index) => ({
|
||||
date: dateUtil.formatDate(dateUtil.addDays(dateUtil.startOfWeek(closedWeekPage.data.currentDateText), index)),
|
||||
shopOpen: false,
|
||||
shopStartTime: null,
|
||||
shopEndTime: null
|
||||
}))
|
||||
const closedWeekState = closedWeekPage.buildViewState({
|
||||
businessStartTime: '10:00',
|
||||
businessEndTime: '22:00',
|
||||
artists: [],
|
||||
appointments: [],
|
||||
daySummaries: closedWeek
|
||||
})
|
||||
assert.strictEqual(closedWeekState.businessHoursConfigured, false)
|
||||
assert.strictEqual(closedWeekState.weekDays.every(day => day.statusText === '休'), true)
|
||||
|
||||
const openWeekState = closedWeekPage.buildViewState({
|
||||
businessStartTime: '10:00',
|
||||
businessEndTime: '22:00',
|
||||
artists: [],
|
||||
appointments: [],
|
||||
daySummaries: closedWeek.map((day, index) => index === 2
|
||||
? { ...day, shopOpen: true, shopStartTime: '10:00', shopEndTime: '22:00' }
|
||||
: day)
|
||||
})
|
||||
assert.strictEqual(openWeekState.businessHoursConfigured, true)
|
||||
|
||||
page.data.viewMode = 'month'
|
||||
page.data.monthDisplayMode = 'count'
|
||||
const monthDays = definition.buildMonthDays.call(page, {
|
||||
@@ -117,6 +145,16 @@ async function run() {
|
||||
assert.strictEqual(missingHoursEmptyState.hours.length, 0)
|
||||
assert.strictEqual(missingHoursEmptyState.dayLanes.length, 0)
|
||||
assert.strictEqual(missingHoursEmptyState.hasTimedAppointments, false)
|
||||
const closedDaySummaryPage = createPage({ currentDateText: '2026-10-12' })
|
||||
const closedDayState = closedDaySummaryPage.buildViewState({
|
||||
businessStartTime: '10:00',
|
||||
businessEndTime: '22:00',
|
||||
artists: [],
|
||||
appointments: [],
|
||||
daySummaries: [{ date: '2026-10-12', shopOpen: false, shopStartTime: null, shopEndTime: null }]
|
||||
})
|
||||
assert.strictEqual(closedDayState.businessHoursConfigured, false)
|
||||
assert.strictEqual(closedDayState.currentShopOpen, false)
|
||||
missingHoursPage.clearCalendarView()
|
||||
assert.strictEqual(missingHoursPage.data.businessHoursText, '营业时间暂不可用')
|
||||
const missingHoursWithBookingState = missingHoursPage.buildDayView({
|
||||
@@ -156,7 +194,8 @@ async function run() {
|
||||
assert.match(planningWxml, /class="lane-unassigned-tag">不占档期/)
|
||||
assert.match(planningWxml, /门店营业时间未设置/)
|
||||
assert.match(planningWxml, /bindtap="openShopSettings"/)
|
||||
assert.match(planningWxml, /class="week-unassigned-count">待分配 \{\{item\.unassignedCount\}\}/)
|
||||
assert.match(planningWxml, /class="week-unassigned-count">待 \{\{item\.unassignedCount\}\}/)
|
||||
assert.match(planningWxml, /wx:if="\{\{canCreateAppointment && businessHoursConfigured && !calendarError && \(viewMode !== 'day' \|\| currentShopOpen\)\}\}" class="fab" bindtap="createAppointment"/)
|
||||
assert.match(planningWxml, /class="month-unassigned-count">待 \{\{item\.unassignedCount\}\}/)
|
||||
assert.doesNotMatch(planningWxss, /background-size:\s*100% 240rpx/)
|
||||
assert.match(planningWxss, /\.control-card\s*\{[^}]*padding:\s*8rpx 14rpx;/)
|
||||
@@ -239,9 +278,14 @@ async function run() {
|
||||
assert.strictEqual(navigations.pop(), '/pages/shop-settings/index')
|
||||
assert.strictEqual(unconfiguredPage._refreshCalendarOnShow, true)
|
||||
|
||||
const closedDayAppointmentPage = createPage({ viewMode: 'day', canCreateAppointment: true, businessHoursConfigured: true, currentShopOpen: false })
|
||||
closedDayAppointmentPage.createAppointment()
|
||||
assert.strictEqual(navigations.length, 0)
|
||||
assert.strictEqual(toasts.pop(), '该日期门店休息,不能新建普通预约')
|
||||
|
||||
assert.match(planningWxml, /bindtap="selectMonthDate" aria-label="查看\{\{item\.date\}\}日程"/)
|
||||
assert.match(planningWxml, /bindtap="selectWeekDate" aria-label="查看\{\{item\.date\}\}日程"/)
|
||||
assert.match(planningWxml, /class="fab" bindtap="createAppointment"/)
|
||||
assert.match(planningWxss, /grid-template-columns:\s*repeat\(7,\s*minmax\(0,\s*1fr\)\)/)
|
||||
}
|
||||
|
||||
run().catch(error => {
|
||||
|
||||
Reference in New Issue
Block a user