小程序预约详情支持图片预览、编辑预约与完成收款拆分
This commit is contained in:
@@ -82,20 +82,58 @@ page.applyAppointment({
|
||||
assignmentStatus: 'ASSIGNED',
|
||||
status: 4,
|
||||
statusText: '服务中',
|
||||
historicalBackfill: true,
|
||||
paymentStatus: 'UNPAID',
|
||||
payAmount: 268,
|
||||
canEdit: false,
|
||||
canCancel: true
|
||||
})
|
||||
assert.strictEqual(page.data.showTransfer, false)
|
||||
assert.strictEqual(page.data.showComplete, true)
|
||||
assert.strictEqual(page.data.showCollect, true)
|
||||
assert.strictEqual(page.data.showComplete, false)
|
||||
assert.strictEqual(page.data.showCancel, true)
|
||||
assert.strictEqual(page.data.appointment.paymentStatusText, '未收款')
|
||||
|
||||
page.applyAppointment({
|
||||
artistId: 9,
|
||||
assignmentStatus: 'ASSIGNED',
|
||||
status: 1,
|
||||
statusText: '待服务',
|
||||
paymentStatus: 'PAID',
|
||||
paidAmount: 268,
|
||||
canEdit: true,
|
||||
canCancel: true
|
||||
})
|
||||
assert.strictEqual(page.data.showCollect, false)
|
||||
assert.strictEqual(page.data.showComplete, true)
|
||||
assert.strictEqual(page.data.showEdit, true)
|
||||
assert.strictEqual(page.data.appointment.paymentStatusText, '已收款 ¥268')
|
||||
|
||||
global.wx.previewImage = options => {
|
||||
global.__preview = options
|
||||
}
|
||||
page.data.coverImages = ['https://cdn/a.png', 'https://cdn/b.png', 'https://cdn/c.png']
|
||||
page._coverFailedIndexes = { 1: true }
|
||||
page.previewCoverImage({ currentTarget: { dataset: { index: 2 } } })
|
||||
assert.deepStrictEqual(global.__preview.urls, ['https://cdn/a.png', 'https://cdn/c.png'])
|
||||
assert.strictEqual(global.__preview.current, 'https://cdn/c.png')
|
||||
|
||||
page.data.coverImages = ['', '']
|
||||
let toastTitle = ''
|
||||
global.wx.showToast = options => { toastTitle = options.title }
|
||||
page.previewCoverImage({ currentTarget: { dataset: { index: 0 } } })
|
||||
assert.strictEqual(toastTitle, '暂无可预览的图片')
|
||||
|
||||
const markup = fs.readFileSync(path.join(__dirname, 'index.wxml'), 'utf8')
|
||||
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, /bindtap="previewCoverImage"/)
|
||||
assert.match(markup, /class="cover-thumb/)
|
||||
assert.match(markup, /bindtap="collect">完成收款/)
|
||||
assert.match(markup, /bindtap="goEdit"/)
|
||||
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*\{/)
|
||||
assert.match(styles, /\.cover-thumb\s*\{/)
|
||||
|
||||
Reference in New Issue
Block a user