优化店务小程序预约作品交互
This commit is contained in:
@@ -7,6 +7,7 @@ Page({
|
||||
id: '',
|
||||
employee: {},
|
||||
loadError: '',
|
||||
deleteConfirmVisible: false,
|
||||
deletingEmployee: false
|
||||
},
|
||||
|
||||
@@ -54,21 +55,25 @@ Page({
|
||||
if (this.data.deletingEmployee) {
|
||||
return
|
||||
}
|
||||
wx.showModal({
|
||||
title: '删除员工',
|
||||
content: '确定要删除该员工吗?该操作只移除当前店铺员工关系,不会删除登录账号。',
|
||||
confirmText: '删除',
|
||||
confirmColor: '#BF4949',
|
||||
success: (result) => {
|
||||
if (result.confirm) {
|
||||
this.confirmDeleteEmployee()
|
||||
}
|
||||
}
|
||||
})
|
||||
this.setData({ deleteConfirmVisible: true })
|
||||
},
|
||||
|
||||
closeDeleteConfirm() {
|
||||
if (this.data.deletingEmployee) {
|
||||
return
|
||||
}
|
||||
this.setData({ deleteConfirmVisible: false })
|
||||
},
|
||||
|
||||
stopTap() {
|
||||
},
|
||||
|
||||
async confirmDeleteEmployee() {
|
||||
if (this.data.deletingEmployee) {
|
||||
return
|
||||
}
|
||||
if (!this.data.id) {
|
||||
wx.showToast({ title: '缺少员工 ID,无法删除', icon: 'none' })
|
||||
return
|
||||
}
|
||||
this.setData({ deletingEmployee: true })
|
||||
@@ -77,6 +82,7 @@ Page({
|
||||
if (!success) {
|
||||
throw new Error('员工不存在或已被删除')
|
||||
}
|
||||
this.setData({ deleteConfirmVisible: false })
|
||||
wx.showToast({ title: '员工已删除', icon: 'success' })
|
||||
setTimeout(() => {
|
||||
wx.navigateBack()
|
||||
|
||||
Reference in New Issue
Block a user