修复管理师端预约与登录体验
This commit is contained in:
@@ -7,14 +7,6 @@ function canCreateAppointment() {
|
||||
return Number(userInfo.type) !== 3
|
||||
}
|
||||
|
||||
function buildEmptyCalendar() {
|
||||
return {
|
||||
artists: [],
|
||||
appointments: [],
|
||||
daySummaries: []
|
||||
}
|
||||
}
|
||||
|
||||
function resolveCalendarErrorMessage(error) {
|
||||
return error && error.message ? error.message : '规划数据加载失败'
|
||||
}
|
||||
@@ -153,7 +145,7 @@ Page({
|
||||
this.applyCalendar(data)
|
||||
this.setData({ calendarError: '' })
|
||||
} catch (error) {
|
||||
this.applyCalendar(buildEmptyCalendar())
|
||||
this.clearCalendarView()
|
||||
this.setData({
|
||||
calendarError: resolveCalendarErrorMessage(error),
|
||||
selectedArtistId: '',
|
||||
@@ -168,6 +160,23 @@ Page({
|
||||
}
|
||||
},
|
||||
|
||||
clearCalendarView() {
|
||||
this.setData({
|
||||
businessStartTime: '10:00',
|
||||
businessEndTime: '22:00',
|
||||
artists: [],
|
||||
appointments: [],
|
||||
daySummaries: [],
|
||||
monthDays: [],
|
||||
weekDays: [],
|
||||
dayLanes: [],
|
||||
hours: [],
|
||||
dayTotal: 0,
|
||||
freeArtistCount: 0,
|
||||
pendingCount: 0
|
||||
})
|
||||
},
|
||||
|
||||
resolveRange() {
|
||||
const current = this.data.currentDateText
|
||||
if (this.data.viewMode === 'week') {
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
<button class="calendar-error-action" bindtap="loadCalendar">重试</button>
|
||||
</view>
|
||||
|
||||
<block wx:if="{{!calendarError}}">
|
||||
<view wx:if="{{viewMode === 'day'}}" class="section">
|
||||
<view class="day-summary">
|
||||
<view class="summary-item card">
|
||||
@@ -146,6 +147,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<button wx:if="{{canCreateAppointment}}" class="fab" bindtap="createAppointment">+</button>
|
||||
<button wx:if="{{canCreateAppointment && !calendarError}}" class="fab" bindtap="createAppointment">+</button>
|
||||
</view>
|
||||
|
||||
Reference in New Issue
Block a user