完善店员申请关联与预约页面
This commit is contained in:
@@ -50,6 +50,11 @@ Page({
|
||||
},
|
||||
|
||||
onShow() {
|
||||
if (this._waitingForEmployeeCreate) {
|
||||
this._waitingForEmployeeCreate = false
|
||||
this.loadEmployees()
|
||||
if (this.data.reviewExpanded) this.loadReviewApplications()
|
||||
}
|
||||
const app = getApp()
|
||||
if (!this.data.isManager || !app.globalData.openEmployeeReview) return
|
||||
app.globalData.openEmployeeReview = false
|
||||
@@ -128,12 +133,13 @@ Page({
|
||||
})
|
||||
if (!artists.length) {
|
||||
this.setData({ associationSheetVisible: false })
|
||||
await confirmModal({
|
||||
title: '暂时无法通过',
|
||||
content: '当前门店没有未关联微信的美甲师档案,请先新增美甲师,再审核这条申请。',
|
||||
confirmText: '知道了',
|
||||
showCancel: false
|
||||
const result = await confirmModal({
|
||||
title: '需要先新建美甲师',
|
||||
content: '当前门店没有未关联微信的美甲师档案。新建后将自动关联这条申请并通过审核。',
|
||||
confirmText: '去新建',
|
||||
cancelText: '稍后处理'
|
||||
})
|
||||
if (result.confirm) this.createEmployeeForApplication(applicationId, application && application.applicationNo)
|
||||
}
|
||||
} catch (error) {
|
||||
this.setData({ associationError: error.message || '未关联美甲师加载失败' })
|
||||
@@ -291,6 +297,15 @@ Page({
|
||||
}
|
||||
},
|
||||
|
||||
createEmployeeForApplication(applicationId, applicationNo) {
|
||||
if (!applicationId) return
|
||||
this._waitingForEmployeeCreate = true
|
||||
wx.navigateTo({
|
||||
url: `/pages/employee-create/index?applicationId=${encodeURIComponent(applicationId)}&applicationNo=${encodeURIComponent(applicationNo || '')}`,
|
||||
fail: () => { this._waitingForEmployeeCreate = false }
|
||||
})
|
||||
},
|
||||
|
||||
onEmployeeAvatarError(event) {
|
||||
const index = Number(event.currentTarget.dataset.index)
|
||||
if (!Number.isInteger(index) || !this.data.employees[index]) return
|
||||
|
||||
@@ -5,6 +5,7 @@ const path = require('path')
|
||||
const modalChoices = []
|
||||
const toasts = []
|
||||
const modals = []
|
||||
const navigations = []
|
||||
global.wx = {
|
||||
getAccountInfoSync: () => ({ miniProgram: { envVersion: 'develop' } }),
|
||||
getDeviceInfo: () => ({ platform: 'devtools' }),
|
||||
@@ -12,7 +13,8 @@ global.wx = {
|
||||
showModal: options => {
|
||||
modals.push(options)
|
||||
options.success({ confirm: modalChoices.shift() !== false })
|
||||
}
|
||||
},
|
||||
navigateTo: options => navigations.push(options.url)
|
||||
}
|
||||
global.getApp = () => ({ globalData: { userInfo: { type: 2 }, openEmployeeReview: false } })
|
||||
|
||||
@@ -83,7 +85,8 @@ async function run() {
|
||||
page.data.reviewApplications = [application]
|
||||
await page.approveApplication({ currentTarget: { dataset: { id: 12 } } })
|
||||
assert.strictEqual(page.data.associationSheetVisible, false)
|
||||
assert(modals.some(item => String(item.content || '').includes('当前门店没有未关联微信的美甲师档案')))
|
||||
assert(modals.some(item => item.confirmText === '去新建'))
|
||||
assert.strictEqual(navigations.pop(), '/pages/employee-create/index?applicationId=12&applicationNo=')
|
||||
}
|
||||
|
||||
run().catch(error => {
|
||||
|
||||
@@ -97,6 +97,8 @@
|
||||
}
|
||||
|
||||
.review-item {
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
gap: 14rpx;
|
||||
min-width: 0;
|
||||
flex-wrap: wrap;
|
||||
@@ -115,7 +117,9 @@
|
||||
}
|
||||
|
||||
.review-info {
|
||||
box-sizing: border-box;
|
||||
min-width: 0;
|
||||
width: 0;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
}
|
||||
@@ -142,7 +146,9 @@
|
||||
}
|
||||
|
||||
.review-actions {
|
||||
box-sizing: border-box;
|
||||
flex: 0 0 auto;
|
||||
max-width: 100%;
|
||||
gap: 8rpx;
|
||||
margin-left: auto;
|
||||
}
|
||||
@@ -199,6 +205,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 391px) {
|
||||
.review-actions {
|
||||
max-width: 230rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.review-retry {
|
||||
width: 150rpx;
|
||||
min-width: 150rpx;
|
||||
|
||||
Reference in New Issue
Block a user