接入微信订阅消息并完善预约通知
自动发布开发环境 Nacos 配置 / publish (push) Successful in 20s

This commit is contained in:
2026-11-02 12:11:23 +08:00
parent 3e439543bc
commit 19ca9e2965
29 changed files with 721 additions and 18 deletions
@@ -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() {
+3
View File
@@ -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 })
+7 -4
View File
@@ -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) {