This commit is contained in:
@@ -33,25 +33,34 @@ const page = {
|
||||
|
||||
async function run() {
|
||||
page.onInput({ currentTarget: { dataset: { field: 'phone' } }, detail: { value: '13800138000' } })
|
||||
assert.strictEqual(page.data.form.account, '13800138000')
|
||||
page.onInput({ currentTarget: { dataset: { field: 'account' } }, detail: { value: 'staff_zhou' } })
|
||||
page.onInput({ currentTarget: { dataset: { field: 'phone' } }, detail: { value: '13900139000' } })
|
||||
assert.strictEqual(page.data.form.account, 'staff_zhou')
|
||||
assert.strictEqual(page.data.form.phone, '13800138000')
|
||||
assert.strictEqual(page.data.form.account, undefined)
|
||||
assert.strictEqual(page.data.form.password, undefined)
|
||||
assert.strictEqual(page.data.form.color, '#8FB89A')
|
||||
|
||||
Object.assign(page.data.form, {
|
||||
nickname: '小周',
|
||||
phone: '13800138000',
|
||||
account: '13800138000',
|
||||
password: 'Fingertip@123',
|
||||
wechatId: ''
|
||||
})
|
||||
let createPayload
|
||||
employeesApi.createUser = async payload => {
|
||||
createPayload = payload
|
||||
assert.strictEqual(payload.wechatId, '')
|
||||
assert.strictEqual(payload.color, '#8FB89A')
|
||||
return 88
|
||||
}
|
||||
employeesApi.unassociatedApplications = async () => []
|
||||
await page.submit()
|
||||
assert.deepStrictEqual(createPayload, {
|
||||
nickname: '小周',
|
||||
phone: '13800138000',
|
||||
contactPhone: '13800138000',
|
||||
wechatId: '',
|
||||
color: '#8FB89A',
|
||||
avatar: undefined,
|
||||
type: 3
|
||||
})
|
||||
assert.strictEqual(page.data.onboardingVisible, true)
|
||||
assert.strictEqual(emitted, undefined)
|
||||
|
||||
@@ -69,6 +78,25 @@ async function run() {
|
||||
assert.deepStrictEqual(emitted.value, { id: 88, name: '小周', title: '小周', avatar: '', autoSelect: true, scheduleSaved: true })
|
||||
assert.strictEqual(navigatedBack, true)
|
||||
|
||||
let associatedApplication
|
||||
employeesApi.unassociatedApplications = async () => [{
|
||||
id: 42,
|
||||
applicantNickname: '微信昵称',
|
||||
applicantMaskedPhone: '138****8000',
|
||||
applicationNo: 'SALON-042'
|
||||
}]
|
||||
employeesApi.preAssociateApplication = async (applicationId, employeeId) => {
|
||||
associatedApplication = { applicationId, employeeId }
|
||||
}
|
||||
page.setData({ onboardingVisible: false, associationSheetVisible: false })
|
||||
await page.offerPendingAssociation()
|
||||
assert.strictEqual(page.data.associationSheetVisible, true)
|
||||
assert.strictEqual(page.data.associationItems[0].title, '微信昵称')
|
||||
await page.selectAssociation({ detail: { item: { id: 42 } } })
|
||||
assert.deepStrictEqual(associatedApplication, { applicationId: 42, employeeId: 88 })
|
||||
assert.strictEqual(page.data.associationSheetVisible, false)
|
||||
assert.strictEqual(page.data.onboardingVisible, true)
|
||||
|
||||
page.data.onboardingVisible = true
|
||||
page.data.createdEmployee = { id: 88, name: '小周' }
|
||||
page.data.appointmentContext = { date: '2026-10-12', time: '14:00', durationMinutes: '60' }
|
||||
|
||||
Reference in New Issue
Block a user