完善管理师预约项目与美甲师创建
This commit is contained in:
@@ -2,6 +2,12 @@ const planningApi = require('../../api/planning')
|
||||
const dateUtil = require('../../utils/date')
|
||||
const mock = require('../../utils/mock')
|
||||
|
||||
function canCreateAppointment() {
|
||||
const app = getApp()
|
||||
const userInfo = app.globalData.userInfo || {}
|
||||
return Number(userInfo.type) !== 3
|
||||
}
|
||||
|
||||
Page({
|
||||
data: {
|
||||
viewMode: 'month',
|
||||
@@ -40,10 +46,12 @@ Page({
|
||||
dayTotal: 0,
|
||||
freeArtistCount: 0,
|
||||
pendingCount: 0,
|
||||
canCreateAppointment: true,
|
||||
loading: false
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
this.setData({ canCreateAppointment: canCreateAppointment() })
|
||||
this.loadCalendar()
|
||||
},
|
||||
|
||||
@@ -327,6 +335,10 @@ Page({
|
||||
},
|
||||
|
||||
createAppointment() {
|
||||
if (!this.data.canCreateAppointment) {
|
||||
wx.showToast({ title: '美甲师账号只能查看预约', icon: 'none' })
|
||||
return
|
||||
}
|
||||
wx.navigateTo({
|
||||
url: `/pages/appointment-form/index?date=${this.data.currentDateText}&artistId=${this.data.selectedArtistId || ''}`
|
||||
})
|
||||
|
||||
@@ -139,5 +139,5 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<button class="fab" bindtap="createAppointment">+</button>
|
||||
<button wx:if="{{canCreateAppointment}}" class="fab" bindtap="createAppointment">+</button>
|
||||
</view>
|
||||
|
||||
Reference in New Issue
Block a user