diff --git a/pages/artisan/profile.vue b/pages/artisan/profile.vue index 8e4e9f4..46ca4a2 100644 --- a/pages/artisan/profile.vue +++ b/pages/artisan/profile.vue @@ -66,20 +66,19 @@ 服务技能 - - - - {{ (userInfo.servers_kill_arr && userInfo.servers_kill_arr.length > 0) ? '已设置' : - '待完善' }} - - - - + + + + {{ serviceSkillStatusText() }} + + + + @@ -162,7 +161,7 @@ src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/338d957b-cbb6-409b-9e7a-ef5faa0f9b70.png" mode="widthFix" style="width:26rpx;margin-top: 26rpx;position: relative;top: 4rpx;left: -10rpx;" - v-if="userInfo.credentials_state === 0 || userInfo.id_type < 0 || qualificationAuditStatus == 3"> + v-if="shouldShowQualificationWarningIcon()"> @@ -202,6 +201,8 @@ export default { currentUserId: '', // 当前用户ID userInfo: {}, // 用户信息 authDetails: null, + serviceSkillAuditStatus: null, + isServiceSkillAuditLoaded: false, qualificationAuditStatus: null, isQualificationAuditLoaded: false, sharing: false // 添加分享状态标记 @@ -497,6 +498,7 @@ export default { if (result.data && result.data.id) { this.userInfo = result.data this.currentUserId = result.data.id + this.fetchServiceSkillApplyDetails() this.fetchQualificationApplyDetails() if (this.isSettled()) { this.fetchAuthDetails() @@ -567,13 +569,34 @@ export default { }); }, + fetchServiceSkillApplyDetails() { + this.isServiceSkillAuditLoaded = false; + return request.post('/sj/userSjAuth/details', { + apply_type: 2 + }).then(res => { + if ((res.code == 200 || res.state == 1) && res.data) { + const status = Number(res.data.apply_state); + this.serviceSkillAuditStatus = Number.isNaN(status) ? null : status; + } else { + this.serviceSkillAuditStatus = null; + } + this.isServiceSkillAuditLoaded = true; + return res; + }).catch(error => { + console.log('获取服务技能申请详情失败:', error); + this.serviceSkillAuditStatus = null; + this.isServiceSkillAuditLoaded = true; + }); + }, + fetchQualificationApplyDetails() { this.isQualificationAuditLoaded = false; return request.post('/sj/userSjAuth/details', { apply_type: 4 }).then(res => { if ((res.code == 200 || res.state == 1) && res.data) { - this.qualificationAuditStatus = Number(res.data.apply_state); + const statusCheck = this.getQualificationApplyStatus(res.data); + this.qualificationAuditStatus = statusCheck.isValid ? statusCheck.status : null; } else { this.qualificationAuditStatus = null; } @@ -604,6 +627,27 @@ export default { } await this.fetchAuthDetails(); }, + getQualificationApplyStatus(detail) { + const status = Number(detail.apply_state); + if (Number.isNaN(status)) { + return { + isValid: false, + status: null + }; + } + + if (status === 2) { + return { + isValid: true, + status + }; + } + + return { + isValid: true, + status + }; + }, loadIdentity() { // 从全局数据获取身份 @@ -716,19 +760,49 @@ export default { url: '/pages/artisan/belong_shop' }) }, + hasServiceSkills() { + return this.userInfo.servers_kill_arr && this.userInfo.servers_kill_arr.length > 0; + }, + serviceSkillStatusText() { + if (this.serviceSkillAuditStatus === 1) return '审核中'; + if (this.serviceSkillAuditStatus === 3) return '审核未通过'; + return this.hasServiceSkills() ? '已设置' : '待完善'; + }, + serviceSkillStatusColor() { + const statusText = this.serviceSkillStatusText(); + if (statusText === '审核未通过' || statusText === '待完善') return '#ec5d57'; + if (statusText === '审核中') return '#e59e45'; + return '#c9c9c9'; + }, + shouldShowServiceSkillWarningIcon() { + const statusText = this.serviceSkillStatusText(); + return statusText === '审核未通过' || statusText === '待完善'; + }, + getCredentialsState() { + const state = Number(this.userInfo.credentials_state); + return Number.isNaN(state) ? null : state; + }, qualificationStatusText() { - if (this.qualificationAuditStatus == 3) return '审核未通过'; - if (this.userInfo.id_type < 0) return '审核未通过'; - if (this.qualificationAuditStatus == 1) return '审核中'; if (!this.isQualificationAuditLoaded) return ''; - if (this.userInfo.credentials_state === 0) return '待完善'; - if (this.userInfo.credentials_state === 1) return '审核中'; + if (this.qualificationAuditStatus === 1) return '审核中'; + if (this.qualificationAuditStatus === 2) return '已认证'; + if (this.qualificationAuditStatus === 3) return '审核未通过'; + + const credentialsState = this.getCredentialsState(); + if (credentialsState === 0) return '待完善'; + if (credentialsState === 1) return '审核中'; + if (this.userInfo.id_type < 0) return '审核未通过'; return '已认证'; }, qualificationStatusColor() { - if (this.qualificationAuditStatus == 3 || this.userInfo.id_type < 0 || this.userInfo.credentials_state === 0) return '#ec5d57'; - if (this.qualificationAuditStatus == 1 || this.userInfo.credentials_state === 1) return '#e59e45'; + const statusText = this.qualificationStatusText(); + if (statusText === '审核未通过' || statusText === '待完善') return '#ec5d57'; + if (statusText === '审核中') return '#e59e45'; return '#389930'; + }, + shouldShowQualificationWarningIcon() { + const statusText = this.qualificationStatusText(); + return statusText === '审核未通过' || statusText === '待完善'; } } } diff --git a/pages/jingxuan/selected-brands.vue b/pages/jingxuan/selected-brands.vue index 3a2d46c..5065c9a 100644 --- a/pages/jingxuan/selected-brands.vue +++ b/pages/jingxuan/selected-brands.vue @@ -206,6 +206,7 @@ export default { if (this.activeId === id) return; this.activeId = id; this.currentSecondClass = ""; + this.selectedSecondIds = []; this.getSecondClassList(); this.refreshBrandList(); }, @@ -229,6 +230,12 @@ export default { }); if (this.$refs.brandListRef) { + // CommonList 会合并旧 queryData,清空筛选时需要同步移除旧字段。 + ['first_class', 'second_class', 'order_type'].forEach(key => { + if (!Object.prototype.hasOwnProperty.call(params, key) && this.$refs.brandListRef.queryData) { + this.$delete(this.$refs.brandListRef.queryData, key); + } + }); this.$refs.brandListRef.manualRefresh(params); } }, diff --git a/pages/shop/service-skills.vue b/pages/shop/service-skills.vue index 833a182..2075f04 100644 --- a/pages/shop/service-skills.vue +++ b/pages/shop/service-skills.vue @@ -149,13 +149,10 @@ export default { }, // 控制驳回提示是否显示 shouldShowRejectReason() { - // 只有在审核驳回状态、不显示待审核技能、且技能未变更时才显示驳回提示 - return this.auditStatus === 3 && + // 审核驳回时直接显示驳回原因,避免自动进入填写页面后隐藏原因 + return Number(this.auditStatus) === 3 && !this.showPendingSkills && - !this.hasChanges && this.backText; - // 检查是否有待处理的申请(基于时间) - !this.hasPendingApply(); }, // 检查是否有待处理的申请(基于时间) hasPendingApply() { @@ -163,9 +160,12 @@ export default { // 如果最后申请时间在驳回时间之后,说明有新的申请 return true; }, - // 处于服务技能变更审核中时,不自动进入添加/编辑步骤 + // 处于服务技能变更审核中或驳回时,不自动进入添加/编辑步骤 isChangeUnderReview() { - return this.auditStatus === 1 || this.showAuditTip || this.buttonType === 'view'; + return Number(this.auditStatus) === 1 || + Number(this.auditStatus) === 3 || + this.showAuditTip || + this.buttonType === 'view'; } }, async onLoad() { @@ -311,7 +311,8 @@ export default { if (res.code === 200 && res.data) { const detail = res.data; this.applyId = detail.id; - this.auditStatus = detail.apply_state; + const auditStatus = Number(detail.apply_state); + this.auditStatus = Number.isNaN(auditStatus) ? null : auditStatus; this.backText = detail.back_text || ''; // 获取驳回原因 console.log('审核状态:', this.auditStatus);