This commit is contained in:
@@ -2,6 +2,7 @@ const employeesApi = require('../../api/employees')
|
||||
const planningApi = require('../../api/planning')
|
||||
const dateUtil = require('../../utils/date')
|
||||
const { showErrorToast, toUserMessage } = require('../../utils/toast')
|
||||
const { showActionModal } = require('../../utils/action-modal')
|
||||
|
||||
const EMPLOYEE_COLORS = ['#7AA9C2', '#8EB99B', '#BDA7D8', '#D7B17D', '#D98D8D']
|
||||
|
||||
@@ -16,12 +17,6 @@ function formatApplicationTime(value) {
|
||||
return String(value).replace('T', ' ').slice(0, 16)
|
||||
}
|
||||
|
||||
function confirmModal(options) {
|
||||
return new Promise(resolve => {
|
||||
wx.showModal({ ...options, success: resolve, fail: () => resolve({ confirm: false }) })
|
||||
})
|
||||
}
|
||||
|
||||
Page({
|
||||
data: {
|
||||
employees: [],
|
||||
@@ -134,7 +129,7 @@ Page({
|
||||
})
|
||||
if (!artists.length) {
|
||||
this.setData({ associationSheetVisible: false })
|
||||
const result = await confirmModal({
|
||||
const result = await showActionModal(this, {
|
||||
title: '需要先新建美甲师',
|
||||
content: '当前门店没有未关联微信的美甲师档案。新建后将自动关联这条申请并通过审核。',
|
||||
confirmText: '去新建',
|
||||
@@ -203,7 +198,7 @@ Page({
|
||||
useApplicantNickname ? '采用申请昵称' : '保留门店姓名',
|
||||
useApplicantAvatar ? '采用申请头像' : '保留门店头像'
|
||||
].join('\n')
|
||||
const confirmed = await confirmModal({ title: '确认关联并通过', content: summary, confirmText: '确认通过' })
|
||||
const confirmed = await showActionModal(this, { title: '确认关联并通过', content: summary, confirmText: '确认通过' })
|
||||
if (!confirmed.confirm) return
|
||||
|
||||
this.setData({ associationSheetVisible: false })
|
||||
@@ -215,7 +210,7 @@ Page({
|
||||
},
|
||||
|
||||
askProfileAdoption(field, value) {
|
||||
return confirmModal({
|
||||
return showActionModal(this, {
|
||||
title: `采用申请${field}?`,
|
||||
content: field === '昵称' ? `申请昵称为“${value}”,采用后会替换门店员工姓名。` : '采用后会替换门店员工当前头像。',
|
||||
confirmText: `采用申请${field}`,
|
||||
@@ -226,12 +221,14 @@ Page({
|
||||
async rejectApplication(event) {
|
||||
const id = event.currentTarget.dataset.id
|
||||
if (!id || this.data.reviewingId) return
|
||||
const result = await confirmModal({
|
||||
const result = await showActionModal(this, {
|
||||
title: '驳回美甲师申请',
|
||||
content: '',
|
||||
editable: true,
|
||||
placeholderText: '请输入驳回原因',
|
||||
confirmText: '确认驳回'
|
||||
cancelText: '取消',
|
||||
confirmText: '确认驳回',
|
||||
confirmType: 'danger'
|
||||
})
|
||||
if (!result.confirm) return
|
||||
const reason = String(result.content || '').trim()
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"navigationBarTitleText": "美甲师",
|
||||
"usingComponents": {
|
||||
"entity-selector-sheet": "/components/entity-selector-sheet/index"
|
||||
"entity-selector-sheet": "/components/entity-selector-sheet/index",
|
||||
"action-modal": "/components/action-modal/index"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,4 +84,5 @@
|
||||
bind:close="closeApprovalAssociation"
|
||||
/>
|
||||
|
||||
<action-modal id="actionModal" />
|
||||
</view>
|
||||
|
||||
Reference in New Issue
Block a user