|
|
@@ -21,12 +21,18 @@
|
|
|
<button v-if="applyStatus === 'approved'" class="btn-center" @click="goToCenter">
|
|
|
进入服务商中心
|
|
|
</button>
|
|
|
+ <button v-if="applyStatus === 'approved'" class="btn-add-role" @click="handleAddRole">
|
|
|
+ 申请其他角色
|
|
|
+ </button>
|
|
|
<button class="btn-back" @click="goBack">返回首页</button>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
<!-- 申请表单 -->
|
|
|
<view v-else class="form-wrap">
|
|
|
+ <view v-if="hasApprovedRole" class="multi-role-hint">
|
|
|
+ <text>📌 您当前已是 {{ approvedRoleLabel }},可勾选下方新增其他角色</text>
|
|
|
+ </view>
|
|
|
<view class="header">
|
|
|
<text class="title">服务角色申请</text>
|
|
|
<text class="subtitle">选择申请角色,提交资质信息</text>
|
|
|
@@ -181,6 +187,18 @@ export default {
|
|
|
const s = this.applyRecord.status
|
|
|
return s === 0 ? 'pending' : s === 1 ? 'approved' : 'rejected'
|
|
|
},
|
|
|
+ hasApprovedRole() {
|
|
|
+ return this.applyRecord && this.applyRecord.status === 1
|
|
|
+ },
|
|
|
+ approvedRoleLabel() {
|
|
|
+ if (!this.applyRecord || !this.applyRecord.roles) return ''
|
|
|
+ try {
|
|
|
+ const roles = JSON.parse(this.applyRecord.roles)
|
|
|
+ // 取第一个角色名称作为展示
|
|
|
+ const roleMap = { planner: '规划师', nutritionist: '营养师', butler: '管家', vendor: '服务商', article_admin: '文章管理员', activity_provider: '活动提供商' }
|
|
|
+ return roles.map(r => roleMap[r] || r).join('、') || '服务商'
|
|
|
+ } catch (e) { return '服务商' }
|
|
|
+ },
|
|
|
statusIcon() {
|
|
|
return { pending: '⏳', approved: '✅', rejected: '❌' }[this.applyStatus] || '📋'
|
|
|
},
|
|
|
@@ -190,7 +208,7 @@ export default {
|
|
|
statusDesc() {
|
|
|
return {
|
|
|
pending: '您的申请正在审核中,请留意消息通知',
|
|
|
- approved: '恭喜!您已成功通过审核,可以开始使用服务商功能',
|
|
|
+ approved: '已开通服务商身份,可继续申请其他服务角色',
|
|
|
rejected: '您的申请未通过审核,可查看原因后重新提交'
|
|
|
}[this.applyStatus] || ''
|
|
|
}
|
|
|
@@ -216,10 +234,11 @@ export default {
|
|
|
this.applyRecord = res.data
|
|
|
const status = res.data.status
|
|
|
if (status === 0) {
|
|
|
+ // 审核中,展示进度
|
|
|
this.showStatusView = true
|
|
|
} else if (status === 1) {
|
|
|
- // 已通过,跳转服务商中心
|
|
|
- setTimeout(() => uni.redirectTo({ url: '/pages/vendor/center' }), 800)
|
|
|
+ // 已通过:不再强制跳转,显示当前身份卡片 + 允许申请其他角色
|
|
|
+ this.showStatusView = true
|
|
|
} else if (status === 2) {
|
|
|
// 已拒绝,显示原因
|
|
|
this.showStatusView = true
|
|
|
@@ -370,6 +389,13 @@ export default {
|
|
|
},
|
|
|
goToCenter() {
|
|
|
uni.redirectTo({ url: '/pages/vendor/center' })
|
|
|
+ },
|
|
|
+ handleAddRole() {
|
|
|
+ // 清空申请状态,展示表单,提示可多选
|
|
|
+ this.applyRecord = null
|
|
|
+ this.showStatusView = false
|
|
|
+ this.selectedRoles = []
|
|
|
+ uni.showToast({ title: '可多选新增角色', icon: 'none', duration: 2000 })
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -746,4 +772,19 @@ export default {
|
|
|
font-size: 24rpx;
|
|
|
color: #9CA3AF;
|
|
|
}
|
|
|
+.multi-role-hint {
|
|
|
+ background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
|
|
|
+ border: 2rpx solid #BFDBFE;
|
|
|
+ border-radius: 12rpx;
|
|
|
+ padding: 18rpx 24rpx;
|
|
|
+ margin-bottom: 20rpx;
|
|
|
+}
|
|
|
+.multi-role-hint text {
|
|
|
+ font-size: 26rpx;
|
|
|
+ color: #1D4ED8;
|
|
|
+}
|
|
|
+.btn-add-role {
|
|
|
+ background: linear-gradient(135deg, #6366F1, #818CF8);
|
|
|
+ color: #fff;
|
|
|
+}
|
|
|
</style>
|