@@ -46,7 +46,7 @@ Page({
|
||||
return
|
||||
}
|
||||
try {
|
||||
await planningApi.updateStatus(this.data.appointment.orderId, status)
|
||||
await planningApi.updateStatus(this.data.appointment.orderId, status, this._cancelReason || '')
|
||||
markPlanningRefresh()
|
||||
wx.showToast({ title: '已更新' })
|
||||
this.loadDetail()
|
||||
@@ -65,7 +65,18 @@ Page({
|
||||
},
|
||||
|
||||
cancel() {
|
||||
this.updateStatus(3)
|
||||
wx.showModal({
|
||||
title: '取消预约',
|
||||
editable: true,
|
||||
placeholderText: '可填写取消原因',
|
||||
content: '',
|
||||
confirmText: '确认取消',
|
||||
success: result => {
|
||||
if (!result.confirm) return
|
||||
this._cancelReason = result.content || ''
|
||||
this.updateStatus(3)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
goTransfer() {
|
||||
|
||||
@@ -2,6 +2,7 @@ const authApi = require('../../api/auth')
|
||||
const auth = require('../../utils/auth')
|
||||
const { BRAND_CONFIG } = require('../../utils/config')
|
||||
const loginFlow = require('../../utils/login-flow')
|
||||
const { requestSubscribeMessages } = require('../../utils/subscribe-message')
|
||||
|
||||
function wxLoginCode() {
|
||||
return new Promise((resolve, reject) => wx.login({
|
||||
@@ -146,6 +147,8 @@ Page({
|
||||
async quickLogin() {
|
||||
if (this.data.loading || !(await this.ensureCanLogin())) return
|
||||
this._presentedLoginState = ''
|
||||
// 订阅授权是可选的,拒绝时仍继续登录;调用必须发生在用户点击登录链路中。
|
||||
await requestSubscribeMessages()
|
||||
const rememberMe = await this.chooseRememberMode()
|
||||
if (rememberMe === null) return
|
||||
this.setData({ rememberMe, loading: true })
|
||||
|
||||
@@ -835,18 +835,21 @@ Page({
|
||||
if (!appointment) return
|
||||
wx.showModal({
|
||||
title: '取消预约',
|
||||
content: '确定取消这条预约吗?',
|
||||
editable: true,
|
||||
placeholderText: '可填写取消原因',
|
||||
content: '',
|
||||
confirmText: '确认取消',
|
||||
success: result => {
|
||||
if (result.confirm) {
|
||||
this.updateAppointmentStatus(appointment.orderId, 3)
|
||||
this.updateAppointmentStatus(appointment.orderId, 3, result.content || '')
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
async updateAppointmentStatus(orderId, status) {
|
||||
async updateAppointmentStatus(orderId, status, cancelReason) {
|
||||
try {
|
||||
await planningApi.updateStatus(orderId, status)
|
||||
await planningApi.updateStatus(orderId, status, cancelReason)
|
||||
wx.showToast({ title: '预约已取消', icon: 'success' })
|
||||
this.loadCalendar()
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user