From d01b04bce0441f993d1b69e938400e1889a35a1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=81=E6=9D=B0?= <727475508@qq.com> Date: Mon, 15 Jun 2026 14:01:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E7=8A=B6=E6=80=81=E7=AD=89?= =?UTF-8?q?=E4=B8=80=E7=B3=BB=E5=88=97bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/artisan/profile.vue | 206 +++++++++++++++++---------- pages/home/components/brand-card.vue | 2 +- pages/home/components/skill-card.vue | 4 +- pages/home/home.vue | 17 ++- pages/jingxuan/brand-detail.vue | 4 +- pages/jingxuan/selected-brands.vue | 26 +++- pages/jingxuan/selected-skills.vue | 12 +- pages/my/my.vue | 140 +++++++++--------- pages/order/userorder-list.vue | 52 +++---- pages/ruzhu/successruzhu.vue | 3 +- pages/search_common/search.vue | 26 +++- pages/shop/business-time.vue | 27 +++- pages/shop/service-skills.vue | 8 +- pages/shop/staff/addStaff.vue | 7 +- 14 files changed, 317 insertions(+), 217 deletions(-) diff --git a/pages/artisan/profile.vue b/pages/artisan/profile.vue index ba700bb..8e4e9f4 100644 --- a/pages/artisan/profile.vue +++ b/pages/artisan/profile.vue @@ -158,17 +158,16 @@ 资质信息 - - - - {{ userInfo.credentials_state === 0 ? '待完善' : userInfo.credentials_state === 1 ? '审核中' : - '已认证' }} - + + + + {{ qualificationStatusText() }} + @@ -199,12 +198,15 @@ import request from "../../utils/request"; export default { data() { return { - identity: '', - currentUserId: '', // 当前用户ID - userInfo: {}, // 用户信息 - sharing: false // 添加分享状态标记 - } - }, + identity: '', + currentUserId: '', // 当前用户ID + userInfo: {}, // 用户信息 + authDetails: null, + qualificationAuditStatus: null, + isQualificationAuditLoaded: false, + sharing: false // 添加分享状态标记 + } + }, onLoad() { // 页面显示时重新加载身份信息,确保数据最新 this.loadIdentity() @@ -492,12 +494,18 @@ export default { type }) - if (result.data && result.data.id) { - this.userInfo = result.data - this.currentUserId = result.data.id - - // 存储到本地,避免重复调用 - uni.setStorageSync('userInfo', result.data) + if (result.data && result.data.id) { + this.userInfo = result.data + this.currentUserId = result.data.id + this.fetchQualificationApplyDetails() + if (this.isSettled()) { + this.fetchAuthDetails() + } else { + this.authDetails = null + } + + // 存储到本地,避免重复调用 + uni.setStorageSync('userInfo', result.data) console.log('从接口获取用户信息成功:', this.userInfo) } else { console.log('接口返回数据异常:', result) @@ -512,8 +520,8 @@ export default { }, // 备用方案:从其他位置获取用户信息 - tryAlternativeUserInfo() { - try { + tryAlternativeUserInfo() { + try { const app = getApp() // 方法1: 从全局数据获取用户ID @@ -544,10 +552,60 @@ export default { console.log('所有获取用户信息的方法都失败了') } catch (e) { console.log('备用方案获取用户信息失败:', e) - } - }, - - loadIdentity() { + } + }, + + fetchAuthDetails() { + return request.post("/sj/userSjAuth/details", { + type: 1, + id_type: '1' + }).then(res => { + if (res.code == 200 && res.data) { + this.authDetails = res.data; + } + return res; + }); + }, + + 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); + } else { + this.qualificationAuditStatus = null; + } + this.isQualificationAuditLoaded = true; + return res; + }).catch(error => { + console.log('获取资质信息申请详情失败:', error); + this.qualificationAuditStatus = null; + this.isQualificationAuditLoaded = true; + }); + }, + + isSettled() { + return typeof this.userInfo.id_type !== 'undefined' && this.userInfo.id_type !== 0; + }, + + isCertified() { + return typeof this.userInfo.id_type !== 'undefined' && this.userInfo.id_type > 0; + }, + + isUnderReview() { + return this.authDetails && Object.keys(this.authDetails).length > 0; + }, + + async ensureAuthDetails() { + if (this.identity != '2' || !this.isSettled() || this.isUnderReview()) { + return; + } + await this.fetchAuthDetails(); + }, + + loadIdentity() { // 从全局数据获取身份 const app = getApp() const globalIdentity = app.globalData.artisanType @@ -630,50 +688,50 @@ export default { }) }, - navigateToQualification() { - const idType = this.userInfo.id_type; - const credentialsState = this.userInfo.credentials_state; - - if (idType < 0 && credentialsState === 0) { - // 驳回 + 仅填写基础信息 → 去完成资质认证 - uni.navigateTo({ - url: '/pages/ruzhu/ruzhu?type=2' - }); - } else if (idType < 0 && credentialsState === 1) { - // 驳回 + 审核中 → 客服页面 - uni.navigateTo({ - url: '/pages/ruzhu/ruzhu?type=1' - }); - } else if (idType === 0 && credentialsState === 0) { - // 从未入驻 - uni.navigateTo({ - url: '/pages/ruzhu/ruzhu' - }); - } else if (idType > 0 && credentialsState === 0) { - // 已入驻 + 待完善 - uni.navigateTo({ - url: '/pages/shop/qualification_sj_change' - }); - } else if (idType > 0 && credentialsState === 1) { - // 已入驻 + 申请中 - uni.navigateTo({ - url: '/pages/shop/qualification_sj_change' - }); - } else if (idType > 0 && credentialsState === 2) { - // 已入驻 + 已完善 - uni.navigateTo({ - url: '/pages/shop/qualification_sj_change' - }); - } - }, - - navigateToBelongShop() { // 手艺人:所属门店 - uni.navigateTo({ - url: '/pages/artisan/belong_shop' - }) - } - } -} + async navigateToQualification() { + if (this.identity != '2' || this.isCertified()) { + uni.navigateTo({ + url: '/pages/shop/qualification_sj_change' + }); + return; + } + + await this.ensureAuthDetails(); + if (!this.isSettled()) { + uni.navigateTo({ + url: '/pages/ruzhu/ruzhu' + }); + } else if (this.isUnderReview()) { + uni.navigateTo({ + url: '/pages/ruzhu/ruzhu?type=1' + }); + } else { + uni.navigateTo({ + url: '/pages/ruzhu/ruzhu?step=3' + }); + } + }, + navigateToBelongShop() { // 手艺人:所属门店 + uni.navigateTo({ + url: '/pages/artisan/belong_shop' + }) + }, + 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 '审核中'; + 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'; + return '#389930'; + } + } +} \ No newline at end of file + diff --git a/pages/home/components/brand-card.vue b/pages/home/components/brand-card.vue index 067acab..0a73cfd 100644 --- a/pages/home/components/brand-card.vue +++ b/pages/home/components/brand-card.vue @@ -187,7 +187,7 @@ export default { } .brand-name { - font-size: 26rpx; + font-size: 28rpx; font-weight: 500; color: #333333; line-height: 34rpx; diff --git a/pages/home/components/skill-card.vue b/pages/home/components/skill-card.vue index 2ec1994..fce4095 100644 --- a/pages/home/components/skill-card.vue +++ b/pages/home/components/skill-card.vue @@ -88,7 +88,7 @@ export default { \ No newline at end of file + diff --git a/pages/jingxuan/selected-brands.vue b/pages/jingxuan/selected-brands.vue index fc1f677..3a2d46c 100644 --- a/pages/jingxuan/selected-brands.vue +++ b/pages/jingxuan/selected-brands.vue @@ -28,16 +28,16 @@ 发布时间 - - + + 浏览量 - - + + @@ -153,9 +153,21 @@ export default { // ============ 排序逻辑 ============ toggleSort(type) { if (type === 'time') { - this.orderType = this.orderType === 1 ? 2 : 1; + if (this.orderType === 1) { + this.orderType = 2; + } else if (this.orderType === 2) { + this.orderType = 0; + } else { + this.orderType = 1; + } } else if (type === 'view') { - this.orderType = this.orderType === 3 ? 4 : 3; + if (this.orderType === 3) { + this.orderType = 4; + } else if (this.orderType === 4) { + this.orderType = 0; + } else { + this.orderType = 3; + } } this.refreshBrandList(); }, @@ -522,4 +534,4 @@ export default { width: 36rpx !important; height: 36rpx !important; } - \ No newline at end of file + diff --git a/pages/jingxuan/selected-skills.vue b/pages/jingxuan/selected-skills.vue index 798e80f..444aa73 100644 --- a/pages/jingxuan/selected-skills.vue +++ b/pages/jingxuan/selected-skills.vue @@ -28,16 +28,16 @@ 发布时间 - - + + 浏览量 - - + + @@ -176,9 +176,11 @@ export default { toggleSort(type) { if (type === 'time') { if (this.orderType === 1) this.orderType = 2 + else if (this.orderType === 2) this.orderType = 0 else this.orderType = 1 } else if (type === 'view') { if (this.orderType === 3) this.orderType = 4 + else if (this.orderType === 4) this.orderType = 0 else this.orderType = 3 } this.fetchData(true) @@ -574,4 +576,4 @@ export default { width: 36rpx !important; height: 36rpx !important; } - \ No newline at end of file + diff --git a/pages/my/my.vue b/pages/my/my.vue index 8cf6a29..d3cceaf 100644 --- a/pages/my/my.vue +++ b/pages/my/my.vue @@ -781,17 +781,55 @@ export default { }); this.getInviteList(); }, - // 获取入驻详情 - fetchAuthDetails() { - request.post("/sj/userSjAuth/details", { - type: 1, - id_type: '1' - }).then(res => { - if (res.code == 200 && res.data) { - this.authDetails = res.data; - } - }); - }, + // 获取入驻详情 + fetchAuthDetails() { + return request.post("/sj/userSjAuth/details", { + type: 1, + id_type: '1' + }).then(res => { + if (res.code == 200 && res.data) { + this.authDetails = res.data; + } + return res; + }); + }, + async ensureAuthDetails() { + if (!this.isSettled || (this.authDetails && Object.keys(this.authDetails).length > 0)) { + return; + } + await this.fetchAuthDetails(); + }, + navigateToCertificationForm() { + if (this.isSettled) { + uni.navigateTo({ + url: '/pages/ruzhu/ruzhu?step=3' + }); + } else { + uni.navigateTo({ + url: '/pages/ruzhu/ruzhu' + }); + } + }, + async navigateToCertificationProcess() { + if (this.isCertified) { + uni.navigateTo({ + url: '/pages/shop/qualification_sj_change' + }); + return; + } + await this.ensureAuthDetails(); + if (!this.isSettled) { + uni.navigateTo({ + url: '/pages/ruzhu/ruzhu' + }); + } else if (this.isUnderReview) { + uni.navigateTo({ + url: '/pages/ruzhu/ruzhu?type=1' + }); + } else { + this.navigateToCertificationForm(); + } + }, async goLogin() { // 添加访问检查 if (this.isAccountDisabled) { @@ -841,11 +879,17 @@ export default { return; } - // 2. 未登录 → 提示 - if (!this.isLogin) { - uni.showToast({ - title: `您暂未登录,无法使用${item.title || item.text || ''}!`, - icon: "none", + // 2. 未登录 → 提示 + if (!this.isLogin) { + if (item.path == "/pages/ruzhu/ruzhu") { + uni.navigateTo({ + url: "/pages/blogPopup/blogPopup", + }); + return; + } + uni.showToast({ + title: `您暂未登录,无法使用${item.title || item.text || ''}!`, + icon: "none", }); return; } @@ -920,41 +964,9 @@ export default { url: "/pages/artisan/profile", }); }, - toruzhu() { - const idType = this.userInfo.id_type; - const credentialsState = this.userInfo.credentials_state; - if (idType < 0 && credentialsState === 0) { - // 驳回 + 仅填写基础信息 → 去完成资质认证 - uni.navigateTo({ - url: '/pages/ruzhu/ruzhu?type=2' - }); - } else if (idType < 0 && credentialsState === 1) { - // 驳回 + 审核中 → 客服页面 - uni.navigateTo({ - url: '/pages/ruzhu/ruzhu?type=1' - }); - } else if (idType === 0 && credentialsState === 0) { - // 从未入驻 - uni.navigateTo({ - url: '/pages/ruzhu/ruzhu' - }); - } else if (idType > 0 && credentialsState === 0) { - // 已入驻 + 待完善 - uni.navigateTo({ - url: '/pages/shop/qualification_sj_change' - }); - } else if (idType > 0 && credentialsState === 1) { - // 已入驻 + 申请中 - uni.navigateTo({ - url: '/pages/shop/qualification_sj_change' - }); - } else if (idType > 0 && credentialsState === 2) { - // 已入驻 + 已完善 - uni.navigateTo({ - url: '/pages/shop/qualification_sj_change' - }); - } - }, + toruzhu() { + this.navigateToCertificationProcess(); + }, closeSetupModal() { this.showSetupModal = false; }, @@ -970,24 +982,10 @@ export default { url: '/pages/shop/service-skills' }); }, - goToAuth() { - this.showSetupModal = false; - if (this.isUnderReview) { - uni.navigateTo({ - url: '/pages/ruzhu/ruzhu?type=1' - }); - } else { - if (this.isSettled) { - uni.navigateTo({ - url: '/pages/ruzhu/ruzhu?step=3' - }); - } else { - uni.navigateTo({ - url: '/pages/ruzhu/ruzhu' - }); - } - } - }, + goToAuth() { + this.showSetupModal = false; + this.navigateToCertificationProcess(); + }, goToInviteList() { // 添加访问检查 if (this.isAccountDisabled) { @@ -1705,7 +1703,7 @@ button::after { gap: 12rpx; margin-top: 10rpx; width: auto; - height: 36rpx; + height: 46rpx; padding: 0 8rpx 0 8rpx; background-image: url('https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/378a6936-a543-4ff5-9aa0-cfcb4d4e14b3.png'); background-size: 100% 100%; @@ -1891,4 +1889,4 @@ button::after { } } } - \ No newline at end of file + diff --git a/pages/order/userorder-list.vue b/pages/order/userorder-list.vue index 1e70faa..53f36d7 100644 --- a/pages/order/userorder-list.vue +++ b/pages/order/userorder-list.vue @@ -1,5 +1,5 @@