This commit is contained in:
@@ -2,6 +2,7 @@ const planningApi = require('../../api/planning')
|
||||
const customersApi = require('../../api/customers')
|
||||
const { markPlanningRefresh } = require('../../utils/planning-refresh')
|
||||
const { showErrorToast, toUserMessage } = require('../../utils/toast')
|
||||
const { showActionModal } = require('../../utils/action-modal')
|
||||
|
||||
function displayValue(value, fallback) {
|
||||
if (value === null || value === undefined) return fallback
|
||||
@@ -127,21 +128,20 @@ Page({
|
||||
this.updateStatus(2)
|
||||
},
|
||||
|
||||
cancel() {
|
||||
async cancel() {
|
||||
if (!this.data.showCancel || this.data.updating) return
|
||||
this._cancelReason = ''
|
||||
wx.showModal({
|
||||
const result = await showActionModal(this, {
|
||||
title: '取消预约',
|
||||
editable: true,
|
||||
placeholderText: '可填写取消原因',
|
||||
content: '',
|
||||
cancelText: '取消',
|
||||
confirmText: '确认取消',
|
||||
success: result => {
|
||||
if (!result.confirm) return
|
||||
this._cancelReason = result.content || ''
|
||||
this.updateStatus(3)
|
||||
}
|
||||
confirmType: 'danger'
|
||||
})
|
||||
if (!result.confirm) return
|
||||
this._cancelReason = result.content || ''
|
||||
this.updateStatus(3)
|
||||
},
|
||||
|
||||
async dialCustomer() {
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
{
|
||||
"navigationBarTitleText": "预约详情"
|
||||
"navigationBarTitleText": "预约详情",
|
||||
"usingComponents": {
|
||||
"action-modal": "/components/action-modal/index"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,4 +85,5 @@
|
||||
<button wx:if="{{showComplete}}" class="secondary-btn" loading="{{updating}}" disabled="{{updating}}" bindtap="complete">{{appointment.historicalBackfill ? '完成补单' : '完成服务'}}</button>
|
||||
<button wx:if="{{showCancel}}" class="danger-btn" loading="{{updating}}" disabled="{{updating}}" bindtap="cancel">取消预约</button>
|
||||
</view>
|
||||
<action-modal id="actionModal" />
|
||||
</view>
|
||||
|
||||
Reference in New Issue
Block a user