This commit is contained in:
@@ -135,13 +135,17 @@ Page({
|
||||
async dialCustomer() {
|
||||
const appointment = this.data.appointment || {}
|
||||
if (this.data.dialing) return
|
||||
if (!appointment.customerPhoneAvailable || !appointment.customerId || !appointment.orderId) {
|
||||
if (!appointment.customerPhoneAvailable || !appointment.orderId) {
|
||||
wx.showToast({ title: '该客户暂无可拨打的手机号', icon: 'none' })
|
||||
return
|
||||
}
|
||||
this.setData({ dialing: true })
|
||||
try {
|
||||
const result = await customersApi.dialCustomer(appointment.customerId, appointment.orderId)
|
||||
const result = await customersApi.dialCustomer({
|
||||
customerId: appointment.customerId,
|
||||
appointmentId: appointment.orderItemId,
|
||||
orderId: appointment.orderId
|
||||
})
|
||||
if (!result || !result.dialNumber) {
|
||||
throw new Error('未获取到可拨打号码')
|
||||
}
|
||||
|
||||
@@ -95,4 +95,7 @@ const styles = fs.readFileSync(path.join(__dirname, 'index.wxss'), 'utf8')
|
||||
;['订单编号', '服务项目', '美甲师', '时长', '成交金额', '取消原因', 'remarkText', 'customerPhoneText'].forEach(text => assert(markup.includes(text)))
|
||||
assert.match(markup, /class="primary-btn transfer-action"/)
|
||||
assert.match(markup, /class="danger-btn"/)
|
||||
assert.match(markup, /appointment\.customerPhoneAvailable && appointment\.orderId/)
|
||||
assert.strictEqual(markup.includes('appointment.customerId && appointment.orderId'), false)
|
||||
assert.match(styles, /\.transfer-action\s*\{[^}]*box-shadow/)
|
||||
assert.match(styles, /\.call-btn\s*\{/)
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<view class="phone-row">
|
||||
<text class="phone">{{appointment.customerPhoneText}}</text>
|
||||
<button
|
||||
wx:if="{{appointment.customerPhoneAvailable && appointment.customerId && appointment.orderId}}"
|
||||
wx:if="{{appointment.customerPhoneAvailable && appointment.orderId}}"
|
||||
class="call-btn"
|
||||
size="mini"
|
||||
loading="{{dialing}}"
|
||||
|
||||
Reference in New Issue
Block a user