From d723a5f2db61a51bf49c4480c42e167ecc5478f3 Mon Sep 17 00:00:00 2001 From: BAKEYi <16298417+bakeyi@user.noreply.gitee.com> Date: Fri, 29 May 2026 13:51:41 +0800 Subject: [PATCH 1/5] 1 --- pages/album/components/videoSlide.nvue | 844 ++----------------------- pages/album/components/videoplayer.vue | 106 ++++ pages/album/index.nvue | 213 +++++-- pages/jingxuan/skill-detail.vue | 416 ++++++++++++ 4 files changed, 734 insertions(+), 845 deletions(-) create mode 100644 pages/album/components/videoplayer.vue create mode 100644 pages/jingxuan/skill-detail.vue diff --git a/pages/album/components/videoSlide.nvue b/pages/album/components/videoSlide.nvue index 6e195c4..ea43006 100644 --- a/pages/album/components/videoSlide.nvue +++ b/pages/album/components/videoSlide.nvue @@ -1,822 +1,88 @@ - \ No newline at end of file diff --git a/pages/album/components/videoplayer.vue b/pages/album/components/videoplayer.vue new file mode 100644 index 0000000..9ae18ef --- /dev/null +++ b/pages/album/components/videoplayer.vue @@ -0,0 +1,106 @@ + + + + + \ No newline at end of file diff --git a/pages/album/index.nvue b/pages/album/index.nvue index 0dda008..97b70ad 100644 --- a/pages/album/index.nvue +++ b/pages/album/index.nvue @@ -1,52 +1,59 @@ @@ -68,6 +75,23 @@ title: "主图", id: 1 }, + { + title: "作品", + id: 3 + }, + { + title: "其他", + id: 4 + } + ], + 2: [{ + title: "全部", + id: 0 + }, + { + title: "主图", + id: 1 + }, { title: "环境", id: 2 @@ -94,7 +118,7 @@ inactiveStyle: { fontWeight: 500, fontSize: "32rpx", - color: "#666666", + color: "#333333", }, current: 1, statusBarHeight: 0, @@ -108,6 +132,7 @@ }; }, async onLoad(options) { + // 获取状态栏高度 const systemInfo = await uni.getSystemInfoSync() this.systemInfo = systemInfo @@ -120,6 +145,12 @@ this.getVideoList() } }, + onShow() { + // // #ifdef APP-PLUS + // plus.screen.unlockOrientation(); //解除屏幕方向的锁定,但是不一定是竖屏; + // plus.screen.lockOrientation('portrait'); //锁死屏幕方向为竖屏 + // // #endif + }, computed: { // 计算swiper的样式 swiperStyle() { @@ -128,8 +159,8 @@ // 注意:100vh 是视口高度,需要先转数值计算,再拼接单位 let viewportHeight = this.pxToRpx(this.systemInfo.windowHeight || window?.innerHeight || document - ?.documentElement?.clientHeight|| 0, screenWidth ) ; - let height = viewportHeight - 88 - this.statusBarHeight; + ?.documentElement?.clientHeight || 0, screenWidth); + let height = viewportHeight - 100 - this.statusBarHeight; return { height: `${height}rpx` }; @@ -141,55 +172,69 @@ swiperStyle2() { if (this.current == 1) { return { - marginTop: `${88 + this.statusBarHeight + 100}rpx`, - height: `${this.viewportHeight-88-this.statusBarHeight-100}rpx` + height: `${this.viewportHeight-100-this.statusBarHeight-100}rpx` }; } return { height: `${this.viewportHeight}rpx` }; }, + swiperStyle3() { + if (this.current == 1) { + return { + width: `750rpx`, + height: `${200 + this.statusBarHeight}rpx`, + }; + } + return { + width: `750rpx`, + height: `${100 + this.statusBarHeight}rpx`, + }; + }, viewportHeight() { let screenWidth = this.systemInfo.screenWidth; // 注意:100vh 是视口高度,需要先转数值计算,再拼接单位 let viewportHeight = this.pxToRpx(this.systemInfo.windowHeight || window?.innerHeight || document - ?.documentElement?.clientHeight|| 0, screenWidth) ; + ?.documentElement?.clientHeight || 0, screenWidth); return viewportHeight }, }, methods: { + goBack() { + uni.navigateBack(-1) + }, + toimg(item) { + console.log(item, 'item'); + uni.previewImage({ + urls: [item.url], // 外面加 [] 变成数组 + current: 0 // 可选,默认第一张 + }) + }, + tovideo(item) { + uni.navigateTo({ + url: '/pages/album/components/videoplayer?url=' + item.url + }) + }, clickTab(item) { this.cardListIndex = item.id }, tabsClick(e) { - this.$nextTick(() => { - - this.current = e.index - if(this.current==1){ - this.activeStyle.color = "#333333" - this.inactiveStyle.color = "#666666" - this.$refs.ideoSlideRrf.nowStopVideo() - } - if(this.current==0){ - this.activeStyle.color = "#fff" - this.inactiveStyle.color = "#ccc" - this.$refs.ideoSlideRrf.nowPlayVideo() - } - }) + console.log('12312312312'); + this.current = e.index + this.activeStyle.color = "#333333" + this.inactiveStyle.color = "#666666" }, swiperChange(e) { this.$nextTick(() => { this.current = e.detail.current - if(this.current==1){ + if (this.current == 1) { this.activeStyle.color = "#333333" this.inactiveStyle.color = "#666666" - this.$refs.ideoSlideRrf.nowStopVideo() } - if(this.current==0){ - this.activeStyle.color = "#fff" - this.inactiveStyle.color = "#ccc" - this.$refs.ideoSlideRrf.nowPlayVideo() + if (this.current == 0) { + this.activeStyle.color = "#333333" + this.inactiveStyle.color = "#666666" } }) @@ -208,12 +253,17 @@ type: 1 }).then(res => { if (res.code == 200) { - this.imagObj = res.data.list[1] - let all = [] - for (let key in res.data.list[1]) { - all = [...all, ...res.data.list[1][key]] + if (res.data.list.length != 0) { + this.imagObj = res.data.list[1] + let all = [] + for (let key in res.data.list[1]) { + all = [...all, ...res.data.list[1][key]] + } + this.imagObj[0] = all + } else { + this.imagObj[0] = [] } - this.imagObj[0] = all + } }) }, @@ -224,8 +274,17 @@ type: 2 }).then(res => { if (res.code == 200) { - for (let key in res.data.list[2]) { - this.videoList = [...this.videoList, ...res.data.list[2][key]] + if (res.data.list.length != 0) { + console.log(res.data, 'res.data'); + for (let key in res.data.list[2]) { + this.videoList = [...this.videoList, ...res.data.list[2][key]] + this.videoList.forEach((item) => { + item.img = item.url + + '?x-oss-process=video/snapshot,t_1000,m_fast,f_jpg,w_600,ar_auto' + }) + } + } else { + this.videoList = [] } } }) @@ -249,7 +308,7 @@ z-index: 9999; background: #f5f5f5; padding: 0 24rpx; - + .left-area { display: flex; align-items: center; @@ -266,10 +325,12 @@ } } } - .videoTop{ + + .videoTop { background: transparent; - ::v-deep .uv-tabs__wrapper__nav__line{ - background: #fff!important; + + ::v-deep .uv-tabs__wrapper__nav__line { + background: #fff !important; } } @@ -306,6 +367,7 @@ .container-content { z-index: 1000; + .swiper { background: #fff; @@ -349,6 +411,47 @@ } } + .swiper-items3 { + flex-wrap: wrap; + flex-direction: row; + display: flex; + padding-bottom: 20rpx; + + .swiper-item3 { + width: 370rpx; + height: 370rpx; + margin-top: 10rpx; + overflow: hidden; + position: relative; + box-sizing: border-box; + border-radius: 20rpx; + + .swiper-item3-video { + width: 370rpx; + height: 370rpx; + } + + .swiper-item3-title { + position: absolute; + left: 0; + top: 0; + height: 33rpx; + padding: 0 8rpx; + background: rgba(0, 0, 0, 0.5); + border-radius: 0rpx 0rpx 10rpx 0rpx; + width: fit-content; + + .swiper-item3-title-text { + font-weight: 400; + font-size: 18rpx; + color: #FFFFFF; + line-height: 33rpx; + + } + } + } + } + .item2Left { margin-right: 9rpx; } @@ -398,6 +501,4 @@ align-items: flex-end; justify-content: space-between; } - - \ No newline at end of file diff --git a/pages/jingxuan/skill-detail.vue b/pages/jingxuan/skill-detail.vue new file mode 100644 index 0000000..d53c949 --- /dev/null +++ b/pages/jingxuan/skill-detail.vue @@ -0,0 +1,416 @@ + + + + + \ No newline at end of file From 2e13ec14aa09aeb2ae99d2c16ac0ab6bdab96fa0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=81=E6=9D=B0?= <727475508@qq.com> Date: Fri, 29 May 2026 14:01:12 +0800 Subject: [PATCH 2/5] =?UTF-8?q?feat:=20=E5=AE=8C=E6=88=90=E5=95=86?= =?UTF-8?q?=E5=AE=B6=E6=94=B9=E7=89=88=E7=9B=B8=E5=85=B3=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E4=B8=8E=E8=AF=B7=E6=B1=82=E5=B7=A5=E5=85=B7=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/artisan/profile.vue | 2 +- pages/my/my.vue | 4 +- pages/ruzhu/ruzhu.vue | 1505 ++++++++++++------------ pages/ruzhu/sj-info.vue | 421 ++++--- pages/ruzhu/successruzhu.vue | 176 +-- pages/shop/business-time.vue | 2 +- pages/shop/qualification_sj_change.vue | 333 +++++- utils/request.js | 24 +- 8 files changed, 1451 insertions(+), 1016 deletions(-) diff --git a/pages/artisan/profile.vue b/pages/artisan/profile.vue index a85a145..b7af875 100644 --- a/pages/artisan/profile.vue +++ b/pages/artisan/profile.vue @@ -475,7 +475,7 @@ console.log('调用接口获取用户信息,type:', type) // 调用接口获取用户信息 - const result = await request.post('/user/getuser', { + const result = await request.post('sj/user/getUser', { type }) diff --git a/pages/my/my.vue b/pages/my/my.vue index 51468d0..67f1fac 100644 --- a/pages/my/my.vue +++ b/pages/my/my.vue @@ -177,13 +177,13 @@ export default { title: "店铺装修", url: "https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/4b558456-2e38-4185-8713-d1f0e6645820.png", // https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/e6e72039-eec4-414c-8a86-aad404602962.png - path: "/pages/shop/staff/distribution-service", + path: "/pages/shop/qualification_sj_change", go_id_type: 1, }, { title: "财务管理", url: "https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/edafae37-8258-4e1c-9dcc-019484117047.png", - path: "/pages/shop/staff/distribution-service", + path: "/pages/wallet/wallet", go_id_type: 1, }, ], diff --git a/pages/ruzhu/ruzhu.vue b/pages/ruzhu/ruzhu.vue index 92ee357..a557eec 100644 --- a/pages/ruzhu/ruzhu.vue +++ b/pages/ruzhu/ruzhu.vue @@ -1,731 +1,774 @@ - - - - - \ No newline at end of file + + + + + diff --git a/pages/ruzhu/sj-info.vue b/pages/ruzhu/sj-info.vue index ae76b31..b0cdc2d 100644 --- a/pages/ruzhu/sj-info.vue +++ b/pages/ruzhu/sj-info.vue @@ -10,9 +10,8 @@ 资质照片 请保证照片上的文字清晰、无遮挡、证件边角可见 - - + + 商户类型 - + 证件号码 - + + mode="aspectFit" @click.stop="showTipPopup('uscc_num')"> 营业名称 - + 注册地区 - - {{ formData.register_region || '请选择' }} + + {{ formData.uscc_dependency || '请选择' }} @@ -59,53 +58,10 @@ 注册详细地址 - + - - - 营业执照有效期至: - - - - - - 永久有效 - - - - - - 指定日期有效 - - - - - - 开始日期 - - - {{ formData.idcard_start_date || '选择日期' }} - - - - - - 结束日期 - - - {{ formData.idcard_end_date || '选择日期' }} - - - - - + @@ -117,8 +73,9 @@ 身份证照片 请保证照片上的文字清晰、无遮挡、证件边角可见 - - + + 请上传身份证正面(人像面) - - + + 法人代表 - + 法人联系方式 + class="input" /> 法人身份证号 - + - 营业执照有效期至: + 身份证有效期: - - - + + 永久有效 - - - + + @@ -182,20 +140,22 @@ 开始日期 - - {{ formData.idcard_start_date || '选择日期' }} + + {{ formData.legal_idcard_expiry_start || '选择日期' }} - 结束日期 - - {{ formData.idcard_end_date || '选择日期' }} + + {{ formData.legal_idcard_expiry_end || '选择日期' }} - @@ -212,30 +172,34 @@ 行业资质 - + - × + × - - + + 添加照片 - - 其他资质 - - - - × - - - - 添加照片 - - - + + 其他资质 + + + + × + + + + 添加照片 + + + @@ -319,35 +283,28 @@ - \ No newline at end of file diff --git a/pages/shop/business-time.vue b/pages/shop/business-time.vue index fdc0739..ed88f68 100644 --- a/pages/shop/business-time.vue +++ b/pages/shop/business-time.vue @@ -125,7 +125,7 @@ export default { // 加载当前营业时间 async loadCurrentTime() { try { - const res = await request.post('/user/getuser', { + const res = await request.post('/sj/user/getuser', { type: 3 // 商家类型 }) console.log('获取用户信息响应:', res) diff --git a/pages/shop/qualification_sj_change.vue b/pages/shop/qualification_sj_change.vue index 96630ee..9bc58e9 100644 --- a/pages/shop/qualification_sj_change.vue +++ b/pages/shop/qualification_sj_change.vue @@ -58,6 +58,27 @@ + + + + 注册地区 + + + + {{ displayData.uscc_dependency || '请选择' }} + + + + + + + + 注册详细地址 + + + @@ -171,6 +192,45 @@ + + + + + + 其他信息 + + + + 行业资质 + + + + × + + + + 添加照片 + + + 其他资质 + + + + × + + + + 添加照片 + + + + @@ -290,6 +350,46 @@ + + + + + + + 选择注册地区 + × + + + + + + {{ item.province }} + + + + + {{ item.city }} + + + + + {{ item.area }} + + + + + + + 取消 + + + 确定 + + + + + 美融融plus 对储存空间/照片权限申请说明 @@ -310,6 +410,7 @@ import uploadImage from '../../utils/uploadImage'; import permissionUtils from '../../utils/per'; import locationService from '../../utils/locationService'; import { recognizeIdCard, recognizeBusinessLicense, formatDateFromNumber, parseValidPeriod } from '../../utils/orc'; +import ChinaCitys from '../../static/data/ChinaCitys.json'; export default { data() { @@ -364,6 +465,12 @@ export default { isShowStoragePer: false, isShowCameraPer: false, + + showRegionPopupFlag: false, + ChinaCitys: ChinaCitys, + regionCitys: [], + regionAreas: [], + regionValue: [0, 0, 0], } }, computed: { @@ -378,6 +485,9 @@ export default { this.hasResubmitted = false; this.backText = ''; + this.regionCitys = this.ChinaCitys[0].citys; + this.regionAreas = this.regionCitys[0].areas; + this.getUserInfo().then(() => { this.loadApplyDetails(); }); @@ -637,7 +747,7 @@ export default { getUserInfo() { return new Promise((resolve, reject) => { const userType = 3; - request.post('/user/getuser', { type: userType }).then(result => { + request.post('/sj/user/getUser', { type: userType }).then(result => { if (result.state === 1) { this.userId = result.data.id; console.log('用户ID获取成功:', this.userId); @@ -661,10 +771,12 @@ export default { // 初始化老数据 this.originalData = { - uscc_type: userData.uscc_type ? String(userData.uscc_type) : null, // 转换为字符串 + uscc_type: userData.uscc_type ? String(userData.uscc_type) : null, uscc_photo: userData.uscc_photo || '', uscc_num: userData.uscc_num || '', uscc_name: userData.uscc_name || '', + uscc_dependency: userData.uscc_dependency || '', + uscc_address: userData.uscc_address || '', uscc_expiry_type: userData.uscc_expiry_type || null, uscc_expiry: userData.uscc_expiry || '', license_start_date: '', @@ -677,15 +789,30 @@ export default { idcard_start_date: '', idcard_end_date: '', legal_idcard_positive: userData.legal_idcard_positive || '', - legal_idcard_negative: userData.legal_idcard_negative || '' + legal_idcard_negative: userData.legal_idcard_negative || '', + qualifications_sector: [], + qualifications_other: [] }; - // 处理营业执照有效期显示 + if (userData.qualifications_sector) { + try { + this.originalData.qualifications_sector = typeof userData.qualifications_sector === 'string' ? JSON.parse(userData.qualifications_sector) : userData.qualifications_sector; + } catch (e) { + this.originalData.qualifications_sector = []; + } + } + if (userData.qualifications_other) { + try { + this.originalData.qualifications_other = typeof userData.qualifications_other === 'string' ? JSON.parse(userData.qualifications_other) : userData.qualifications_other; + } catch (e) { + this.originalData.qualifications_other = []; + } + } + if (this.originalData.uscc_expiry) { this.processLicenseExpiry(this.originalData.uscc_expiry, this.originalData); } - // 处理身份证有效期显示 if (this.originalData.legal_idcard_expiry) { this.processIdcardExpiry(this.originalData.legal_idcard_expiry, this.originalData); } @@ -853,6 +980,8 @@ export default { uscc_photo: detail.uscc_photo || this.originalData.uscc_photo, uscc_num: detail.uscc_num || this.originalData.uscc_num, uscc_name: detail.uscc_name || this.originalData.uscc_name, + uscc_dependency: detail.uscc_dependency || this.originalData.uscc_dependency, + uscc_address: detail.uscc_address || this.originalData.uscc_address, uscc_expiry_type: detail.uscc_expiry_type || this.originalData.uscc_expiry_type, uscc_expiry: detail.uscc_expiry || this.originalData.uscc_expiry, license_start_date: '', @@ -865,9 +994,26 @@ export default { idcard_start_date: '', idcard_end_date: '', legal_idcard_positive: detail.legal_idcard_positive || this.originalData.legal_idcard_positive, - legal_idcard_negative: detail.legal_idcard_negative || this.originalData.legal_idcard_negative + legal_idcard_negative: detail.legal_idcard_negative || this.originalData.legal_idcard_negative, + qualifications_sector: this.originalData.qualifications_sector || [], + qualifications_other: this.originalData.qualifications_other || [] }; + if (detail.qualifications_sector) { + try { + this.pendingData.qualifications_sector = typeof detail.qualifications_sector === 'string' ? JSON.parse(detail.qualifications_sector) : detail.qualifications_sector; + } catch (e) { + this.pendingData.qualifications_sector = this.originalData.qualifications_sector || []; + } + } + if (detail.qualifications_other) { + try { + this.pendingData.qualifications_other = typeof detail.qualifications_other === 'string' ? JSON.parse(detail.qualifications_other) : detail.qualifications_other; + } catch (e) { + this.pendingData.qualifications_other = this.originalData.qualifications_other || []; + } + } + console.log('处理前的pendingData日期字段:', { uscc_expiry: this.pendingData.uscc_expiry, legal_idcard_expiry: this.pendingData.legal_idcard_expiry @@ -891,7 +1037,7 @@ export default { try { console.log('刷新商家最新数据...'); const userType = 3; - const result = await request.post('/user/getuser', { type: userType }); + const result = await request.post('/sj/user/getUser', { type: userType }); if (result.state === 1 && result.data) { const userData = result.data; @@ -936,6 +1082,8 @@ export default { uscc_photo: userData.uscc_photo || '', uscc_num: userData.uscc_num || '', uscc_name: userData.uscc_name || '', + uscc_dependency: userData.uscc_dependency || '', + uscc_address: userData.uscc_address || '', uscc_expiry_type: userData.uscc_expiry_type || null, uscc_expiry: userData.uscc_expiry || '', license_start_date: '', @@ -948,15 +1096,30 @@ export default { idcard_start_date: '', idcard_end_date: '', legal_idcard_positive: userData.legal_idcard_positive || '', - legal_idcard_negative: userData.legal_idcard_negative || '' + legal_idcard_negative: userData.legal_idcard_negative || '', + qualifications_sector: [], + qualifications_other: [] }; - // 处理营业执照有效期显示 + if (userData.qualifications_sector) { + try { + this.originalData.qualifications_sector = typeof userData.qualifications_sector === 'string' ? JSON.parse(userData.qualifications_sector) : userData.qualifications_sector; + } catch (e) { + this.originalData.qualifications_sector = []; + } + } + if (userData.qualifications_other) { + try { + this.originalData.qualifications_other = typeof userData.qualifications_other === 'string' ? JSON.parse(userData.qualifications_other) : userData.qualifications_other; + } catch (e) { + this.originalData.qualifications_other = []; + } + } + if (this.originalData.uscc_expiry) { this.processLicenseExpiry(this.originalData.uscc_expiry, this.originalData); } - // 处理身份证有效期显示 if (this.originalData.legal_idcard_expiry) { this.processIdcardExpiry(this.originalData.legal_idcard_expiry, this.originalData); } @@ -1139,6 +1302,8 @@ export default { uscc_photo: this.displayData.uscc_photo, uscc_num: this.displayData.uscc_num, uscc_name: this.displayData.uscc_name, + uscc_dependency: this.displayData.uscc_dependency, + uscc_address: this.displayData.uscc_address, uscc_expiry_type: this.displayData.uscc_expiry_type, uscc_expiry: this.displayData.uscc_expiry, legal_name: this.displayData.legal_name, @@ -1147,7 +1312,9 @@ export default { legal_idcard_expiry_type: this.displayData.legal_idcard_expiry_type, legal_idcard_expiry: this.displayData.legal_idcard_expiry, legal_idcard_positive: this.displayData.legal_idcard_positive, - legal_idcard_negative: this.displayData.legal_idcard_negative + legal_idcard_negative: this.displayData.legal_idcard_negative, + qualifications_sector: JSON.stringify(this.displayData.qualifications_sector || []), + qualifications_other: JSON.stringify(this.displayData.qualifications_other || []) }; // 处理营业执照有效期 @@ -1232,6 +1399,73 @@ export default { }); }, + showRegionPicker() { + this.regionCitys = this.ChinaCitys[0].citys; + this.regionAreas = this.regionCitys[0].areas; + this.showRegionPopupFlag = true; + }, + + hideRegionPopup() { + this.showRegionPopupFlag = false; + }, + + bindChangeRegion(e) { + this.regionValue = e.detail.value; + let index1 = e.detail.value[0] || 0; + let index2 = e.detail.value[1] || 0; + this.regionCitys = this.ChinaCitys[index1].citys; + this.regionAreas = this.regionCitys[index2].areas; + }, + + confirmRegionSelect() { + let valueArr = this.regionValue; + let index1 = valueArr[0] || 0; + let index2 = valueArr[1] || 0; + let index3 = valueArr[2] || 0; + let province = this.ChinaCitys[index1].province; + let city = this.regionCitys[index2].city; + let area = this.regionAreas[index3].area; + this.$set(this.displayData, 'uscc_dependency', province + '-' + city + '-' + area); + this.hideRegionPopup(); + }, + + chooseMultiImage(type) { + const current = this.displayData[type] || []; + const remaining = 9 - current.length; + if (remaining <= 0) { + uni.showToast({ title: '最多上传9张图片', icon: 'none' }); + return; + } + uni.chooseImage({ + count: remaining, + sizeType: ['compressed'], + sourceType: ['album', 'camera'], + success: async (res) => { + if (!res.tempFilePaths || res.tempFilePaths.length === 0) return; + uni.showLoading({ title: '上传中...' }); + for (const tempFilePath of res.tempFilePaths) { + const file = { path: tempFilePath, size: 0 }; + try { + const url = await this.directUpload(file, this.userId, 3, type); + if (url) { + current.push(url); + } + } catch (e) { + console.error('上传失败:', e); + } + } + this.$set(this.displayData, type, [...current]); + uni.hideLoading(); + } + }); + }, + + removeImage(type, index) { + const list = [...(this.displayData[type] || [])]; + list.splice(index, 1); + this.$set(this.displayData, type, list); + }, + // 表单验证 validateForm() { const validationRules = [ @@ -1239,6 +1473,8 @@ export default { { field: 'uscc_type', message: '请输入商户类型' }, { field: 'uscc_num', message: '请输入营业执照号码' }, { field: 'uscc_name', message: '请输入企业名称' }, + { field: 'uscc_dependency', message: '请选择注册地区' }, + { field: 'uscc_address', message: '请输入注册详细地址' }, { field: 'legal_idcard_positive', message: '请上传身份证正面照片' }, { field: 'legal_idcard_negative', message: '请上传身份证反面照片' }, { field: 'legal_name', message: '请输入法人代表' }, @@ -2411,4 +2647,79 @@ export default { opacity: 1; visibility: visible; } + +.image-list { + display: flex; + flex-wrap: wrap; + gap: 16rpx; + margin-top: 16rpx; +} + +.image-item { + position: relative; + width: 200rpx; + height: 200rpx; +} + +.qualification-image { + width: 200rpx; + height: 200rpx; + border-radius: 12rpx; +} + +.image-delete { + position: absolute; + top: -10rpx; + right: -10rpx; + width: 36rpx; + height: 36rpx; + background: #E8101E; + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + color: #FFFFFF; + font-size: 28rpx; +} + +.image-add { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + border: 2rpx dashed #DDDDDD; + width: 214rpx; + height: 214rpx; + background: #F5F5F5; + border-radius: 20rpx; +} + +.upload-icon-small { + width: 48rpx; + height: 48rpx; + margin-bottom: 8rpx; +} + +.add-text { + font-size: 22rpx; + color: #999999; +} + +.region-body { + margin-top: 20rpx; +} + +.region-body .picker-scroll { + height: 400rpx; +} + +.form-item-image-box { + display: flex; + flex-direction: column; + padding: 24rpx; +} + +.form-item-image-box .label { + margin-bottom: 16rpx; +} \ No newline at end of file diff --git a/utils/request.js b/utils/request.js index 5f05fbc..50b9276 100644 --- a/utils/request.js +++ b/utils/request.js @@ -187,13 +187,22 @@ const request = async (options, isUpdate) => { uni.request({ ...options, success: (res) => { - // #ifdef H5 - if (!options.hideLoading) { - uni.hideLoading() + // #ifdef H5 + if (!options.hideLoading) { + uni.hideLoading() + } + // #endif + try { + const result = responseInterceptor(options, res, resolve, reject) + if (result && typeof result.then === 'function') { + result.then(data => resolve(data)).catch(err => reject(err)) + } else { + resolve(result) } - // #endif - resolve(responseInterceptor(options, res, resolve, reject)) - }, + } catch (err) { + reject(err) + } + }, fail: (err) => { // #ifdef H5 if (!options.hideLoading) { @@ -221,6 +230,7 @@ const request = async (options, isUpdate) => { // 处理 401 未授权 async function handleUnauthorized(originalRequest, resolve, reject) { if (!getToken()) { + reject(new Error('未登录')) return redirectToLogin() } // 如果正在刷新 Token,将请求加入队列 @@ -246,7 +256,7 @@ async function handleUnauthorized(originalRequest, resolve, reject) { } catch (error) { removeToken() redirectToLogin() - // reject(error) + reject(error) return error } finally { isRefreshing = false From ce03c0de2b2a11c7052b479704e951b5983ac573 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=81=E6=9D=B0?= <727475508@qq.com> Date: Fri, 29 May 2026 15:54:23 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=9A=82=E5=81=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/ruzhu/ruzhu.vue | 42 +++++++++++++++++++++++++++++++----- pages/ruzhu/successruzhu.vue | 6 +++--- 2 files changed, 40 insertions(+), 8 deletions(-) diff --git a/pages/ruzhu/ruzhu.vue b/pages/ruzhu/ruzhu.vue index a557eec..b128e40 100644 --- a/pages/ruzhu/ruzhu.vue +++ b/pages/ruzhu/ruzhu.vue @@ -4,7 +4,7 @@ - + @@ -23,6 +23,10 @@ + + + + @@ -77,6 +81,15 @@ + + + + + + 进入平台 + + + @@ -97,7 +110,7 @@ export default { }, data() { return { - currentStep: 3, // 当前步骤索引 + currentStep: 4, // 当前步骤索引 isAgree: false, identity: null, textData: {}, @@ -119,6 +132,7 @@ export default { if (this.currentStep === 0) return 0; if (this.currentStep === 1) return 1; if (this.currentStep === 3) return 2; + if (this.currentStep === 4) return 2; return 0; } }, @@ -542,13 +556,14 @@ export default { const res = await request.post('/sj/userSjAuth/apply', formData); uni.hideLoading(); if (res.state == 1 || res.code == 200) { + this.successData = res.data ? (res.data.customer_service || {}) : {}; uni.showToast({ title: '提交成功', icon: 'none' }); - uni.navigateTo({ - url: '/pages/shop/qualification_sj_change' - }) + setTimeout(() => { + this.currentStep = 4; + }, 1500); } else { uni.showToast({ title: res.msg || '提交失败了', @@ -770,5 +785,22 @@ export default { color: #ffffff; font-size: 32rpx; font-weight: 500; +} +.showziliao{ + width: 690rpx; + height: 98rpx; + background: #FF4767; + border-radius: 49rpx; +} +.showziliaotext{ + height: 40rpx; + font-family: PingFangSC, PingFang SC; + font-weight: 500; + font-size: 32rpx; + color: #FFFFFF; + line-height: 80rpx; + font-style: normal; + margin: 0 0 0 281rpx; + align-items: center; } diff --git a/pages/ruzhu/successruzhu.vue b/pages/ruzhu/successruzhu.vue index 3aa4b2e..b7a04db 100644 --- a/pages/ruzhu/successruzhu.vue +++ b/pages/ruzhu/successruzhu.vue @@ -1,8 +1,8 @@ \ No newline at end of file diff --git a/pages/ruzhu/ruzhu.vue b/pages/ruzhu/ruzhu.vue index b128e40..46efb3b 100644 --- a/pages/ruzhu/ruzhu.vue +++ b/pages/ruzhu/ruzhu.vue @@ -110,7 +110,7 @@ export default { }, data() { return { - currentStep: 4, // 当前步骤索引 + currentStep: 0, // 当前步骤索引 isAgree: false, identity: null, textData: {}, From e79c8eda8a0bb32c8366327e7401ce240d833fcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=81=E6=9D=B0?= <727475508@qq.com> Date: Mon, 1 Jun 2026 13:53:15 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E5=85=A5=E9=A9=BB=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/artisan/profile.vue | 1162 ++++++++++----------- pages/ruzhu/ruzhu.vue | 1279 ++++++++++++------------ pages/ruzhu/sj-info.vue | 191 +++- pages/shop/qualification_sj_change.vue | 621 ++++++++---- 4 files changed, 1836 insertions(+), 1417 deletions(-) diff --git a/pages/artisan/profile.vue b/pages/artisan/profile.vue index 629d01d..7c9d35d 100644 --- a/pages/artisan/profile.vue +++ b/pages/artisan/profile.vue @@ -191,645 +191,645 @@ \ No newline at end of file diff --git a/pages/ruzhu/ruzhu.vue b/pages/ruzhu/ruzhu.vue index 46efb3b..aa64e95 100644 --- a/pages/ruzhu/ruzhu.vue +++ b/pages/ruzhu/ruzhu.vue @@ -95,712 +95,719 @@ + .submit-text { + color: #ffffff; + font-size: 32rpx; + font-weight: 500; + } + + .showziliao { + width: 690rpx; + height: 98rpx; + background: #FF4767; + border-radius: 49rpx; + } + + .showziliaotext { + height: 40rpx; + font-family: PingFangSC, PingFang SC; + font-weight: 500; + font-size: 32rpx; + color: #FFFFFF; + line-height: 96rpx; + font-style: normal; + margin: 0 0 0 281rpx; + align-items: center; + } + \ No newline at end of file diff --git a/pages/ruzhu/sj-info.vue b/pages/ruzhu/sj-info.vue index b0cdc2d..b5496e2 100644 --- a/pages/ruzhu/sj-info.vue +++ b/pages/ruzhu/sj-info.vue @@ -55,11 +55,14 @@ - + 注册详细地址 - + + {{ formData.uscc_address || '请选择' }} + + @@ -295,6 +298,11 @@ export default { uscc_name: '', uscc_dependency: '', uscc_address: '', + uscc_province: '', + uscc_city: '', + uscc_area: '', + longitude: '', + latitude: '', legal_idcard_positive: '', legal_idcard_negative: '', legal_name: '', @@ -318,7 +326,9 @@ export default { isRecognizing: false, recognizeType: '', userId: null, - identity: 3 + identity: 3, + addressListener: null, + sjAddressListener: null } }, @@ -344,6 +354,10 @@ export default { await this.getUserInfo(); this.regionCitys = this.ChinaCitys[0].citys; this.regionAreas = this.regionCitys[0].areas; + this.setupAddressListener(); + }, + beforeDestroy() { + this.removeAddressListener(); }, methods: { @@ -495,6 +509,18 @@ export default { let city = this.regionCitys[index2].city; let area = this.regionAreas[index3].area; this.formData.uscc_dependency = province + '-' + city + '-' + area; + if (this.ChinaCitys[index1] && this.ChinaCitys[index1].code) { + this.formData.uscc_province = String(this.ChinaCitys[index1].code).substring(0, 6); + } + if (this.regionCitys[index2] && this.regionCitys[index2].code) { + this.formData.uscc_city = String(this.regionCitys[index2].code).substring(0, 6); + } + if (this.regionAreas[index3] && this.regionAreas[index3].code) { + this.formData.uscc_area = String(this.regionAreas[index3].code).substring(0, 6); + } + this.formData.uscc_address = ''; + this.formData.longitude = ''; + this.formData.latitude = ''; this.hideRegionPopup(); }, @@ -543,6 +569,163 @@ export default { this.hideDatePicker(); }, + buildRegionTextForSearch() { + const dependency = String(this.formData.uscc_dependency || '').trim(); + if (!dependency) return ''; + const parts = dependency.split('-'); + const province = parts[0] || ''; + const city = parts[1] || ''; + const district = parts[2] || ''; + let regionText = ''; + if (province) regionText += province; + if (city && city !== province) regionText += city; + if (district) regionText += district; + return regionText; + }, + + getAddressValueForSearch() { + const rawAddress = String(this.formData.uscc_address || '').trim(); + if (!rawAddress) return ''; + const dependencyText = String(this.formData.uscc_dependency || '').trim(); + const regionText = this.buildRegionTextForSearch(); + let detail = rawAddress; + if (regionText && detail.indexOf(regionText) === 0) { + detail = detail.slice(regionText.length).trim(); + } else if (dependencyText && detail.indexOf(dependencyText) === 0) { + detail = detail.slice(dependencyText.length).trim(); + } + detail = detail.replace(/^[\s,-]+/, '').trim(); + return detail || rawAddress; + }, + + getAddressInfo() { + const dependency = String(this.formData.uscc_dependency || '').trim(); + const dependencyCode = String(this.formData.uscc_area || '').trim(); + const address = this.getAddressValueForSearch(); + const longitude = String(this.formData.longitude || '').trim(); + const latitude = String(this.formData.latitude || '').trim(); + + const hasDependency = !!dependency; + const hasAddress = !!address; + const hasLocation = !!(longitude && latitude); + + let params = 'source=sj_info'; + + if (hasDependency) { + params += `&dependency=${encodeURIComponent(dependency)}`; + if (dependencyCode) { + params += `&dependency_code=${dependencyCode}`; + } + } + if (hasAddress) { + params += `&address=${encodeURIComponent(address)}`; + } + if (hasLocation) { + params += `&longitude=${longitude}&latitude=${latitude}`; + } + if (!hasDependency && !hasAddress && !hasLocation) { + params += '&init_current_location=1&silent_locate=1'; + } + + uni.navigateTo({ + url: `/pages/address/search?${params}` + }); + }, + + setupAddressListener() { + this.addressListener = (addressData) => { + this.handleAddressSelected(addressData); + }; + this.sjAddressListener = (addressData) => { + this.handleAddressSelected(addressData); + }; + uni.$on('address-selected', this.addressListener); + uni.$on('address-selected-for-sj', this.sjAddressListener); + }, + + removeAddressListener() { + if (this.addressListener) { + uni.$off('address-selected', this.addressListener); + this.addressListener = null; + } + if (this.sjAddressListener) { + uni.$off('address-selected-for-sj', this.sjAddressListener); + this.sjAddressListener = null; + } + }, + + checkAddressData() { + try { + const storedAddress = uni.getStorageSync('sj_selected_address'); + if (storedAddress) { + this.handleAddressSelected(storedAddress); + uni.removeStorageSync('sj_selected_address'); + return; + } + } catch (e) { } + + if (getApp().globalData && getApp().globalData.selectedAddress) { + this.handleAddressSelected(getApp().globalData.selectedAddress); + delete getApp().globalData.selectedAddress; + } + + try { + const selectedAddress = uni.getStorageSync('selectedAddress'); + if (selectedAddress) { + this.handleAddressSelected(selectedAddress); + uni.removeStorageSync('selectedAddress'); + } + } catch (e) { } + }, + + handleAddressSelected(addressData) { + if (!addressData) return; + + let detailAddress = ''; + if (addressData.address) { + detailAddress = String(addressData.address).trim(); + } else if (addressData.name) { + detailAddress = String(addressData.name).trim(); + const regionParts = []; + if (addressData.pname) regionParts.push(addressData.pname); + if (addressData.cityname && addressData.cityname !== addressData.pname) regionParts.push(addressData.cityname); + if (addressData.adname) regionParts.push(addressData.adname); + const regionText = regionParts.join(''); + if (regionText && detailAddress.indexOf(regionText) === 0) { + detailAddress = detailAddress.slice(regionText.length).trim(); + } + detailAddress = detailAddress.replace(/^[\s,-]+/, '').trim(); + } + + this.$set(this.formData, 'uscc_address', detailAddress); + + if (addressData.location) { + const [longitude, latitude] = String(addressData.location).split(','); + this.$set(this.formData, 'longitude', longitude || ''); + this.$set(this.formData, 'latitude', latitude || ''); + } + + if (addressData.pname || addressData.cityname || addressData.adname) { + const locationParts = []; + if (addressData.pname) locationParts.push(addressData.pname); + if (addressData.cityname) locationParts.push(addressData.cityname); + if (addressData.adname) locationParts.push(addressData.adname); + this.$set(this.formData, 'uscc_dependency', locationParts.join('-')); + } + + if (addressData.provinceCode) { + this.$set(this.formData, 'uscc_province', String(addressData.provinceCode).substring(0, 6)); + } + if (addressData.cityCode) { + this.$set(this.formData, 'uscc_city', String(addressData.cityCode).substring(0, 6)); + } + if (addressData.districtCode) { + this.$set(this.formData, 'uscc_area', String(addressData.districtCode).substring(0, 6)); + } + + this.$forceUpdate(); + }, + async recognizeBusinessLicense(imageUrl) { try { this.isRecognizing = true; diff --git a/pages/shop/qualification_sj_change.vue b/pages/shop/qualification_sj_change.vue index 9bc58e9..de7f180 100644 --- a/pages/shop/qualification_sj_change.vue +++ b/pages/shop/qualification_sj_change.vue @@ -6,7 +6,7 @@ 请变更您需要变更的信息 - + @@ -23,8 +23,11 @@ - - + + 请上传营业执照原件 @@ -36,27 +39,31 @@ 商户类型 - + 证件号码 - + - + 企业名称 - + - + @@ -72,12 +79,17 @@ - + 注册详细地址 - + + + {{ displayData.uscc_address || '请选择' }} + + + @@ -94,25 +106,31 @@ 身份证照片 请保证图片上的文字清晰、无遮挡、证件边角可见 - + - - + + 请上传身份证正面(人像面) - + - - + + 请上传身份证反面(国徽面) @@ -125,22 +143,24 @@ 法人代表 - + - + 法人联系方式 - + 法人身份证号 - + @@ -149,13 +169,17 @@ - + 长久有效 - + 指定日期有效 @@ -169,23 +193,25 @@ 开始日期 - {{formatDateForDisplay(displayData.idcard_start_date) || '请选择日期'}} + {{ formatDateForDisplay(displayData.idcard_start_date) || '请选择日期' }} - + 结束日期 - + - {{formatDateForDisplay(displayData.idcard_end_date) || '请选择日期'}} + {{ formatDateForDisplay(displayData.idcard_end_date) || '请选择日期' }} - @@ -200,10 +226,11 @@ 其他信息 - + 行业资质 - + × @@ -231,7 +258,7 @@ - + @@ -283,12 +310,14 @@ - + - + - {{item.label}} + {{ item.label }} @@ -310,16 +339,16 @@ 确定 - + - {{year}}年 + {{ year }}年 - {{month}}月 + {{ month }}月 - {{day}}日 + {{ day }}日 @@ -331,8 +360,10 @@ - - + + {{ tipTitle }} @@ -392,13 +423,13 @@ - 美融融plus 对储存空间/照片权限申请说明 - 便于您使用该功能上传您的照片/图片/视频以及用于更换头像、发布商品等场景中读取相册和文件内容。 + 美融融plus 对储存空间/照片权限申请说明 + 便于您使用该功能上传您的照片/图片/视频以及用于更换头像、发布商品等场景中读取相册和文件内容。 - 美融融plus 对相机拍摄权限申请说明 - 便于您使用该功能上传您的照片/图片/视频以及用于更换头像、发布商品等场景中所需内容。 + 美融融plus 对相机拍摄权限申请说明 + 便于您使用该功能上传您的照片/图片/视频以及用于更换头像、发布商品等场景中所需内容。 @@ -416,10 +447,10 @@ export default { data() { const currentDate = new Date(); const currentYear = new Date().getFullYear(); - const years = Array.from({length: 130}, (_, i) => 1970 + i); - const months = Array.from({length: 12}, (_, i) => i + 1); - const days = Array.from({length: 31}, (_, i) => i + 1); - + const years = Array.from({ length: 130 }, (_, i) => 1970 + i); + const months = Array.from({ length: 12 }, (_, i) => i + 1); + const days = Array.from({ length: 31 }, (_, i) => i + 1); + return { // 页面状态 editable: false, @@ -432,7 +463,7 @@ export default { buttonAreaHeight: 120, backText: '', hasResubmitted: false, - + // 数据管理 originalData: {}, pendingData: {}, @@ -471,6 +502,8 @@ export default { regionCitys: [], regionAreas: [], regionValue: [0, 0, 0], + addressListener: null, + sjAddressListener: null, } }, computed: { @@ -481,13 +514,15 @@ export default { onLoad(options) { console.log('资质信息变更页面开始加载...'); this.identity = getApp().globalData.artisanType; - + this.hasResubmitted = false; this.backText = ''; - + this.regionCitys = this.ChinaCitys[0].citys; this.regionAreas = this.regionCitys[0].areas; - + + this.setupAddressListener(); + this.getUserInfo().then(() => { this.loadApplyDetails(); }); @@ -496,19 +531,18 @@ export default { this.getButtonAreaHeight(); }, onShow() { - // 只有在非编辑状态下才重新加载数据 + this.checkAddressData(); if (!this.editable) { - console.log('非编辑状态,刷新数据'); this.loadApplyDetails(); - if (this.auditStatus !== 3) { this.backText = ''; this.hasResubmitted = false; } - } else { - console.log('编辑状态,保持当前状态不刷新'); } }, + onUnload() { + this.removeAddressListener(); + }, methods: { /** * 识别营业执照 @@ -517,7 +551,7 @@ export default { try { this.isRecognizing = true; this.recognizeType = 'business_license'; - + // 调用OCR接口 const result = await recognizeBusinessLicense(imageUrl); console.log('营业执照识别结果:', result); @@ -532,7 +566,7 @@ export default { this.isRecognizing = false; return; } - + // 填充营业执照信息 let recognizedFields = 0; @@ -544,12 +578,12 @@ export default { // 如果是"无"或空值,设置为空字符串 this.displayData.uscc_name = ''; } - + if (result.uscc_num && result.uscc_num.trim()) { this.displayData.uscc_num = result.uscc_num; recognizedFields++; } - + // if (result.legal_name && result.legal_name.trim()) { // this.displayData.legal_name = result.legal_name; // recognizedFields++; @@ -570,14 +604,14 @@ export default { duration: 3000 }); } - + } catch (error) { uni.showToast({ title: error.message || '识别失败,请手动填写', icon: 'none', }); console.error('营业执照识别失败:', error); - + } finally { this.isRecognizing = false; } @@ -586,16 +620,16 @@ export default { // 检查营业执照识别结果是否有效 checkBusinessLicenseRecognition(result) { const requiredFields = ['uscc_num', 'uscc_name', 'legal_name', 'uscc_type']; - + for (const field of requiredFields) { if (result[field] && result[field].trim()) { return true; } } - + return false; }, - + /** * 识别身份证正面 */ @@ -603,18 +637,18 @@ export default { try { this.isRecognizing = true; this.recognizeType = 'idcard_front'; - + uni.showLoading({ title: '正在识别身份证正面...', mask: true }); - + // 调用OCR接口 const result = await recognizeIdCard(imageUrl, 1); // 验证是否真的识别到了数据 const hasRecognizedData = this.checkIdCardFrontRecognition(result); - + if (!hasRecognizedData) { uni.hideLoading(); uni.showToast({ @@ -625,22 +659,22 @@ export default { this.isRecognizing = false; return; } - + // 填充身份证正面信息 if (result.name) { this.displayData.legal_name = result.name; } - + if (result.id_number) { this.displayData.legal_idcard_num = result.id_number; } - + uni.hideLoading(); uni.showToast({ title: '身份证正面识别成功', icon: 'none' }); - + } catch (error) { console.error('身份证正面识别失败:', error); uni.hideLoading(); @@ -658,7 +692,7 @@ export default { checkIdCardFrontRecognition(result) { return (result.name && result.name.trim()) || (result.id_number && result.id_number.trim()); }, - + /** * 识别身份证反面 */ @@ -666,18 +700,18 @@ export default { try { this.isRecognizing = true; this.recognizeType = 'idcard_back'; - + uni.showLoading({ title: '正在识别身份证反面...', mask: true }); - + // 调用OCR接口 const result = await recognizeIdCard(imageUrl, 2); // 验证是否真的识别到了数据 const hasRecognizedData = this.checkIdCardBackRecognition(result); - + if (!hasRecognizedData) { uni.hideLoading(); uni.showToast({ @@ -688,15 +722,15 @@ export default { this.isRecognizing = false; return; } - + // 解析有效期 const validPeriod = parseValidPeriod(result.start_date, result.end_date); - + // 填充有效期数据 if (validPeriod.startDate) { this.displayData.idcard_start_date = validPeriod.startDate; } - + if (validPeriod.isPermanent) { this.displayData.legal_idcard_expiry_type = 1; this.displayData.idcard_end_date = '长久有效'; @@ -704,20 +738,20 @@ export default { this.displayData.legal_idcard_expiry_type = 2; this.displayData.idcard_end_date = validPeriod.endDate; } - + // 如果是长期有效,自动选择对应的选项 if (validPeriod.isPermanent) { this.setIdcardValidType('permanent'); } else { this.setIdcardValidType('date'); } - + uni.hideLoading(); uni.showToast({ title: '身份证反面识别成功', icon: 'none' }); - + } catch (error) { console.error('身份证反面识别失败:', error); uni.hideLoading(); @@ -733,8 +767,8 @@ export default { // 检查身份证反面识别结果是否有效 checkIdCardBackRecognition(result) { - return (result.start_date && result.start_date.trim()) || - (result.end_date && result.end_date.trim()); + return (result.start_date && result.start_date.trim()) || + (result.end_date && result.end_date.trim()); }, // 获取商户类型文本 @@ -751,7 +785,7 @@ export default { if (result.state === 1) { this.userId = result.data.id; console.log('用户ID获取成功:', this.userId); - + this.populateFormDataFromUserInfo(result.data); resolve(this.userId); } else { @@ -768,7 +802,7 @@ export default { // 从用户信息中填充表单数据 populateFormDataFromUserInfo(userData) { console.log('从用户信息填充表单数据:', userData); - + // 初始化老数据 this.originalData = { uscc_type: userData.uscc_type ? String(userData.uscc_type) : null, @@ -777,6 +811,11 @@ export default { uscc_name: userData.uscc_name || '', uscc_dependency: userData.uscc_dependency || '', uscc_address: userData.uscc_address || '', + uscc_province: userData.uscc_province || '', + uscc_city: userData.uscc_city || '', + uscc_area: userData.uscc_area || '', + longitude: userData.longitude || '', + latitude: userData.latitude || '', uscc_expiry_type: userData.uscc_expiry_type || null, uscc_expiry: userData.uscc_expiry || '', license_start_date: '', @@ -831,18 +870,18 @@ export default { // 处理营业执照有效期 processLicenseExpiry(expiry, targetData) { if (!expiry) return; - + console.log('处理营业执照有效期:', expiry); - + // 处理多种可能的分隔符 if (expiry.includes('——') || expiry.includes('--') || expiry.includes('-')) { const separator = expiry.includes('——') ? '——' : (expiry.includes('--') ? '--' : '-'); const [startStr, endStr] = expiry.split(separator); const startDate = startStr.trim(); const endDate = endStr.trim(); - + console.log('营业执照开始日期:', startDate, '结束日期:', endDate); - + if (endDate === '长久' || !endDate) { targetData.uscc_expiry_type = 1; targetData.license_start_date = this.formatDateFromBackend(startDate); @@ -861,18 +900,18 @@ export default { // 处理身份证有效期 processIdcardExpiry(expiry, targetData) { if (!expiry) return; - + console.log('处理身份证有效期:', expiry); - + // 处理多种可能的分隔符 if (expiry.includes('——') || expiry.includes('--') || expiry.includes('-')) { const separator = expiry.includes('——') ? '——' : (expiry.includes('--') ? '--' : '-'); const [startStr, endStr] = expiry.split(separator); const startDate = startStr.trim(); const endDate = endStr.trim(); - + console.log('身份证开始日期:', startDate, '结束日期:', endDate); - + if (endDate === '长久' || !endDate) { targetData.legal_idcard_expiry_type = 1; targetData.idcard_start_date = this.formatDateFromBackend(startDate); @@ -907,19 +946,19 @@ export default { }); console.log('资质信息申请详情接口返回:', res); - + if (res.code === 200) { if (res.data) { const detail = res.data; console.log('找到申请记录:', detail); - + const statusCheck = this.intelligentStatusCheck(detail); - + if (statusCheck.isValid) { this.applyId = detail.id; this.auditStatus = statusCheck.status; this.backText = statusCheck.backText; - + console.log('申请记录状态:', { auditStatus: this.auditStatus, backText: this.backText @@ -930,9 +969,9 @@ export default { this.backText = ''; this.hasResubmitted = false; } - + this.updatePendingDataFromDetail(detail); - + if (this.auditStatus === 2) { this.originalData = { ...this.pendingData }; console.log('审核通过,同步originalData到pendingData'); @@ -959,10 +998,10 @@ export default { this.backText = ''; this.applyId = null; } - + await this.refreshUserData(); this.updatePageStatus(); - + } catch (error) { console.error('加载申请详情失败:', error); this.backText = ''; @@ -974,7 +1013,7 @@ export default { // 从申请记录详情更新 pendingData updatePendingDataFromDetail(detail) { console.log('从申请记录更新pendingData:', detail); - + this.pendingData = { uscc_type: detail.uscc_type ? String(detail.uscc_type) : this.originalData.uscc_type, uscc_photo: detail.uscc_photo || this.originalData.uscc_photo, @@ -982,6 +1021,11 @@ export default { uscc_name: detail.uscc_name || this.originalData.uscc_name, uscc_dependency: detail.uscc_dependency || this.originalData.uscc_dependency, uscc_address: detail.uscc_address || this.originalData.uscc_address, + uscc_province: detail.uscc_province || this.originalData.uscc_province, + uscc_city: detail.uscc_city || this.originalData.uscc_city, + uscc_area: detail.uscc_area || this.originalData.uscc_area, + longitude: detail.longitude || this.originalData.longitude || '', + latitude: detail.latitude || this.originalData.latitude || '', uscc_expiry_type: detail.uscc_expiry_type || this.originalData.uscc_expiry_type, uscc_expiry: detail.uscc_expiry || this.originalData.uscc_expiry, license_start_date: '', @@ -1042,9 +1086,9 @@ export default { if (result.state === 1 && result.data) { const userData = result.data; console.log('获取到商家最新数据:', userData); - + this.updateOriginalDataFromUser(userData); - + // 只有在审核通过时才同步 pendingData 到 originalData if (this.auditStatus === 2) { this.pendingData = { ...this.originalData }; @@ -1052,7 +1096,7 @@ export default { } else { console.log('非审核通过状态,保持pendingData不变'); } - + console.log('刷新后的数据状态:', { originalData: this.originalData, pendingData: this.pendingData, @@ -1076,7 +1120,7 @@ export default { // 从用户数据更新原始数据 updateOriginalDataFromUser(userData) { console.log('从用户数据更新原始数据:', userData); - + this.originalData = { uscc_type: userData.uscc_type ? String(userData.uscc_type) : null, uscc_photo: userData.uscc_photo || '', @@ -1084,6 +1128,11 @@ export default { uscc_name: userData.uscc_name || '', uscc_dependency: userData.uscc_dependency || '', uscc_address: userData.uscc_address || '', + uscc_province: userData.uscc_province || '', + uscc_city: userData.uscc_city || '', + uscc_area: userData.uscc_area || '', + longitude: userData.longitude || '', + latitude: userData.latitude || '', uscc_expiry_type: userData.uscc_expiry_type || null, uscc_expiry: userData.uscc_expiry || '', license_start_date: '', @@ -1139,12 +1188,12 @@ export default { backText: '' }; } - + if (detail.apply_time) { const applyDate = new Date(detail.apply_time); const now = new Date(); const daysDiff = (now - applyDate) / (1000 * 60 * 60 * 24); - + if (daysDiff > 7 && this.originalData.uscc_name !== detail.uscc_name) { console.log('智能判断:申请记录已过期,忽略历史记录'); return { @@ -1154,7 +1203,7 @@ export default { }; } } - + return { isValid: true, status: detail.apply_state, @@ -1206,7 +1255,7 @@ export default { } this.updateNavTitle(); - + console.log('最终页面状态:', { auditStatus: this.auditStatus, backText: this.backText, @@ -1230,7 +1279,7 @@ export default { startChange() { this.editable = true; this.buttonType = 'edit'; - this.displayData = { ...this.pendingData }; + this.displayData = { ...this.pendingData }; this.updateNavTitle(); }, @@ -1246,7 +1295,7 @@ export default { togglePendingData() { this.showPendingData = !this.showPendingData; console.log('切换显示待审核数据:', this.showPendingData); - + if (this.showPendingData) { // 显示待审核数据 this.displayData = { ...this.pendingData }; @@ -1262,11 +1311,11 @@ export default { // 提交变更 async submitChange() { console.log('开始提交资质信息变更...'); - + if (!this.validateForm()) { return; } - + try { uni.showLoading({ title: '提交中...' @@ -1277,7 +1326,7 @@ export default { name: this.displayData.legal_name, idcard: this.displayData.legal_idcard_num }); - + if (checkRes.Code == '401') { uni.hideLoading(); uni.showToast({ @@ -1286,7 +1335,7 @@ export default { }); return; } - + if (checkRes.ResultObject?.BizCode != '1') { uni.hideLoading(); uni.showToast({ @@ -1295,7 +1344,7 @@ export default { }); return; } - + const submitData = { apply_type: this.applyType, uscc_type: this.displayData.uscc_type, @@ -1304,6 +1353,9 @@ export default { uscc_name: this.displayData.uscc_name, uscc_dependency: this.displayData.uscc_dependency, uscc_address: this.displayData.uscc_address, + uscc_province: this.displayData.uscc_province, + uscc_city: this.displayData.uscc_city, + uscc_area: this.displayData.uscc_area, uscc_expiry_type: this.displayData.uscc_expiry_type, uscc_expiry: this.displayData.uscc_expiry, legal_name: this.displayData.legal_name, @@ -1336,17 +1388,17 @@ export default { } console.log('提交的数据:', submitData); - + const res = await request.post('/sj/userSjAuth/apply', submitData); - + uni.hideLoading(); - + if (res.code === 200) { uni.showToast({ title: '提交成功', icon: 'none' }); - + // 先更新 pendingData,再设置其他状态 this.pendingData = { ...this.displayData }; console.log('提交成功,更新pendingData:', this.pendingData); @@ -1355,21 +1407,21 @@ export default { this.backText = ''; this.hasResubmitted = true; this.applyId = res.data?.id || this.applyId; - + console.log('申请ID:', this.applyId); - + this.editable = false; this.buttonType = 'view'; this.showAuditTip = true; this.showPendingData = false; this.displayData = { ...this.originalData }; - + this.updateNavTitle(); - + setTimeout(() => { this.loadApplyDetails(); }, 1500); - + } else { uni.showToast({ title: res.msg || '提交失败', @@ -1387,16 +1439,16 @@ export default { }, showPermissionDialog(title, content) { - return new Promise((resolve) => { - uni.showModal({ - title, - content, - confirmText: '去开启', - success(res) { - resolve(res.confirm); - } - }); + return new Promise((resolve) => { + uni.showModal({ + title, + content, + confirmText: '去开启', + success(res) { + resolve(res.confirm); + } }); + }); }, showRegionPicker() { @@ -1426,6 +1478,18 @@ export default { let city = this.regionCitys[index2].city; let area = this.regionAreas[index3].area; this.$set(this.displayData, 'uscc_dependency', province + '-' + city + '-' + area); + if (this.ChinaCitys[index1] && this.ChinaCitys[index1].code) { + this.$set(this.displayData, 'uscc_province', String(this.ChinaCitys[index1].code).substring(0, 6)); + } + if (this.regionCitys[index2] && this.regionCitys[index2].code) { + this.$set(this.displayData, 'uscc_city', String(this.regionCitys[index2].code).substring(0, 6)); + } + if (this.regionAreas[index3] && this.regionAreas[index3].code) { + this.$set(this.displayData, 'uscc_area', String(this.regionAreas[index3].code).substring(0, 6)); + } + this.$set(this.displayData, 'uscc_address', ''); + this.$set(this.displayData, 'longitude', ''); + this.$set(this.displayData, 'latitude', ''); this.hideRegionPopup(); }, @@ -1480,13 +1544,13 @@ export default { { field: 'legal_name', message: '请输入法人代表' }, { field: 'legal_phone', message: '请输入法人联系方式' }, { field: 'legal_idcard_num', message: '请输入法人身份证号' }, - { - condition: () => !this.displayData.legal_idcard_expiry_type, - message: '请选择身份证有效期类型' + { + condition: () => !this.displayData.legal_idcard_expiry_type, + message: '请选择身份证有效期类型' }, - { - condition: () => !this.displayData.idcard_start_date, - message: '请选择身份证开始日期' + { + condition: () => !this.displayData.idcard_start_date, + message: '请选择身份证开始日期' }, { condition: () => { @@ -1496,14 +1560,14 @@ export default { // 如果选择长久有效,则不需要结束日期 return false; }, - message: '请选择身份证结束日期' + message: '请选择身份证结束日期' }, ]; for (let rule of validationRules) { let isValid = true; - + if (rule.field) { if (!this.displayData[rule.field]) { isValid = false; @@ -1513,7 +1577,7 @@ export default { isValid = false; } } - + if (!isValid) { uni.showToast({ title: rule.message, @@ -1522,7 +1586,7 @@ export default { return false; } } - + // 验证手机号格式 if (!/^1[3-9]\d{9}$/.test(this.displayData.legal_phone)) { uni.showToast({ @@ -1531,7 +1595,7 @@ export default { }); return false; } - + // 验证身份证格式 if (!/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(this.displayData.legal_idcard_num)) { uni.showToast({ @@ -1540,7 +1604,7 @@ export default { }); return false; } - + return true; }, @@ -1568,7 +1632,7 @@ export default { } } }, - + // 设置身份证有效期类型 setIdcardValidType(type) { if (type === 'permanent') { @@ -1586,12 +1650,12 @@ export default { formatDateForDisplay(dateStr) { if (!dateStr) return ''; if (dateStr === '长久有效') return '长久有效'; - + if (dateStr.includes('-')) { const [year, month, day] = dateStr.split('-'); return `${year}年${parseInt(month)}月${parseInt(day)}日`; } - + return dateStr; }, @@ -1599,7 +1663,7 @@ export default { formatDateForBackend(dateStr) { if (!dateStr) return ''; if (dateStr === '长久有效') return ''; - + const match = dateStr.match(/(\d+)年(\d+)月(\d+)日/); if (match) { const year = match[1]; @@ -1607,17 +1671,17 @@ export default { const day = match[3].padStart(2, '0'); return `${year}-${month}-${day}`; } - + return dateStr; }, // 打开日期选择器 openDatePicker(field) { this.currentDateField = field; - + const currentDate = new Date(); let initialDate = currentDate; - + if (this.displayData[field] && this.displayData[field] !== '长久有效') { const dateStr = this.displayData[field]; const match = dateStr.match(/(\d+)年(\d+)月(\d+)日/); @@ -1625,28 +1689,28 @@ export default { initialDate = new Date(parseInt(match[1]), parseInt(match[2]) - 1, parseInt(match[3])); } } - + const yearIndex = this.years.indexOf(initialDate.getFullYear()); const monthIndex = initialDate.getMonth(); const dayIndex = initialDate.getDate() - 1; - + this.dateValue = [ yearIndex >= 0 ? yearIndex : 0, monthIndex, dayIndex ]; - + this.showDatePickerFlag = true; }, - + hideDatePicker() { this.showDatePickerFlag = false; }, - + bindDateChange(e) { this.dateValue = e.detail.value; }, - + confirmDate() { const [yearIndex, monthIndex, dayIndex] = this.dateValue; const year = this.years[yearIndex]; @@ -1656,7 +1720,7 @@ export default { const selectedDate = new Date(year, month - 1, day); const today = new Date(); today.setHours(0, 0, 0, 0); - + if (this.currentDateField.endsWith('_start_date')) { if (selectedDate > today) { uni.showToast({ @@ -1665,7 +1729,7 @@ export default { }); return; } - + const relatedEndField = this.currentDateField.replace('_start_date', '_end_date'); if (this.displayData[relatedEndField] && this.displayData[relatedEndField] !== '长久有效') { const endDateStr = this.displayData[relatedEndField]; @@ -1681,7 +1745,7 @@ export default { } } } - + // 如果是身份证开始日期,自动计算20年后的结束日期 if (this.currentDateField === 'idcard_start_date') { const endYear = year + 20; @@ -1714,7 +1778,7 @@ export default { } } } - + this.displayData[this.currentDateField] = dateStr; this.hideDatePicker(); }, @@ -1723,15 +1787,15 @@ export default { showMerchantTypePicker() { this.showMerchantTypePickerFlag = true; }, - + hideMerchantTypePicker() { this.showMerchantTypePickerFlag = false; }, - + selectMerchantType(item) { this.displayData.uscc_type = item.value; }, - + confirmMerchantType() { this.hideMerchantTypePicker(); }, @@ -1752,7 +1816,7 @@ export default { image: 'https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/24859872-da37-4beb-8e33-7743813bb5a1' } }; - + if (tipConfig[field]) { this.tipTitle = tipConfig[field].title; this.tipImage = tipConfig[field].image; @@ -1764,6 +1828,163 @@ export default { this.showTipPopupFlag = false; }, + buildRegionTextForSearch() { + const dependency = String(this.displayData.uscc_dependency || '').trim(); + if (!dependency) return ''; + const parts = dependency.split('-'); + const province = parts[0] || ''; + const city = parts[1] || ''; + const district = parts[2] || ''; + let regionText = ''; + if (province) regionText += province; + if (city && city !== province) regionText += city; + if (district) regionText += district; + return regionText; + }, + + getAddressValueForSearch() { + const rawAddress = String(this.displayData.uscc_address || '').trim(); + if (!rawAddress) return ''; + const dependencyText = String(this.displayData.uscc_dependency || '').trim(); + const regionText = this.buildRegionTextForSearch(); + let detail = rawAddress; + if (regionText && detail.indexOf(regionText) === 0) { + detail = detail.slice(regionText.length).trim(); + } else if (dependencyText && detail.indexOf(dependencyText) === 0) { + detail = detail.slice(dependencyText.length).trim(); + } + detail = detail.replace(/^[\s,-]+/, '').trim(); + return detail || rawAddress; + }, + + getAddressInfo() { + const dependency = String(this.displayData.uscc_dependency || '').trim(); + const dependencyCode = String(this.displayData.uscc_area || '').trim(); + const address = this.getAddressValueForSearch(); + const longitude = String(this.displayData.longitude || '').trim(); + const latitude = String(this.displayData.latitude || '').trim(); + + const hasDependency = !!dependency; + const hasAddress = !!address; + const hasLocation = !!(longitude && latitude); + + let params = 'source=sj_change'; + + if (hasDependency) { + params += `&dependency=${encodeURIComponent(dependency)}`; + if (dependencyCode) { + params += `&dependency_code=${dependencyCode}`; + } + } + if (hasAddress) { + params += `&address=${encodeURIComponent(address)}`; + } + if (hasLocation) { + params += `&longitude=${longitude}&latitude=${latitude}`; + } + if (!hasDependency && !hasAddress && !hasLocation) { + params += '&init_current_location=1&silent_locate=1'; + } + + uni.navigateTo({ + url: `/pages/address/search?${params}` + }); + }, + + setupAddressListener() { + this.addressListener = (addressData) => { + this.handleAddressSelected(addressData); + }; + this.sjAddressListener = (addressData) => { + this.handleAddressSelected(addressData); + }; + uni.$on('address-selected', this.addressListener); + uni.$on('address-selected-for-sj', this.sjAddressListener); + }, + + removeAddressListener() { + if (this.addressListener) { + uni.$off('address-selected', this.addressListener); + this.addressListener = null; + } + if (this.sjAddressListener) { + uni.$off('address-selected-for-sj', this.sjAddressListener); + this.sjAddressListener = null; + } + }, + + checkAddressData() { + try { + const storedAddress = uni.getStorageSync('sj_selected_address'); + if (storedAddress) { + this.handleAddressSelected(storedAddress); + uni.removeStorageSync('sj_selected_address'); + return; + } + } catch (e) { } + + if (getApp().globalData && getApp().globalData.selectedAddress) { + this.handleAddressSelected(getApp().globalData.selectedAddress); + delete getApp().globalData.selectedAddress; + } + + try { + const selectedAddress = uni.getStorageSync('selectedAddress'); + if (selectedAddress) { + this.handleAddressSelected(selectedAddress); + uni.removeStorageSync('selectedAddress'); + } + } catch (e) { } + }, + + handleAddressSelected(addressData) { + if (!addressData) return; + + let detailAddress = ''; + if (addressData.address) { + detailAddress = String(addressData.address).trim(); + } else if (addressData.name) { + detailAddress = String(addressData.name).trim(); + const regionParts = []; + if (addressData.pname) regionParts.push(addressData.pname); + if (addressData.cityname && addressData.cityname !== addressData.pname) regionParts.push(addressData.cityname); + if (addressData.adname) regionParts.push(addressData.adname); + const regionText = regionParts.join(''); + if (regionText && detailAddress.indexOf(regionText) === 0) { + detailAddress = detailAddress.slice(regionText.length).trim(); + } + detailAddress = detailAddress.replace(/^[\s,-]+/, '').trim(); + } + + this.$set(this.displayData, 'uscc_address', detailAddress); + + if (addressData.location) { + const [longitude, latitude] = String(addressData.location).split(','); + this.$set(this.displayData, 'longitude', longitude || ''); + this.$set(this.displayData, 'latitude', latitude || ''); + } + + if (addressData.pname || addressData.cityname || addressData.adname) { + const locationParts = []; + if (addressData.pname) locationParts.push(addressData.pname); + if (addressData.cityname) locationParts.push(addressData.cityname); + if (addressData.adname) locationParts.push(addressData.adname); + this.$set(this.displayData, 'uscc_dependency', locationParts.join('-')); + } + + if (addressData.provinceCode) { + this.$set(this.displayData, 'uscc_province', String(addressData.provinceCode).substring(0, 6)); + } + if (addressData.cityCode) { + this.$set(this.displayData, 'uscc_city', String(addressData.cityCode).substring(0, 6)); + } + if (addressData.districtCode) { + this.$set(this.displayData, 'uscc_area', String(addressData.districtCode).substring(0, 6)); + } + + this.$forceUpdate(); + }, + // 图片上传方法 async chooseImage(type) { if (!this.editable) return; @@ -1862,12 +2083,12 @@ export default { console.log('_openCamera - 开始上传图片,字段类型:', type, '用户ID:', this.userId); const result = await this.directUpload(file, this.userId, 3, type); - + uni.hideLoading(); if (result) { this.displayData[type] = result; - + // 上传成功后自动识别 if (type === 'uscc_photo') { await this.recognizeBusinessLicense(result); @@ -1880,7 +2101,7 @@ export default { } catch (err) { uni.hideLoading(); console.log('上传图片错误:', err); - + if (!err.errMsg || !err.errMsg.includes('cancel')) { uni.showToast({ title: '上传失败,请重试', @@ -1897,7 +2118,7 @@ export default { let artisan = type == 1 ? 'yh' : type == 2 ? 'syr' : type == 3 ? 'sj' : ''; console.log('directUpload - artisan类型:', artisan, '原始type:', type); - + let fileExtension = 'jpg'; if (file.path.includes('.')) { let parts = file.path.split('.'); @@ -1906,15 +2127,15 @@ export default { fileExtension = ext; } } - + // 添加时间戳确保文件名唯一 const timestamp = Date.now(); const random = Math.floor(Math.random() * 10000); let name = `${userId}_${artisan}_${fieldName}_${timestamp}_${random}.${fileExtension}`; console.log('唯一文件名(包含时间戳):', name); - const ossConfig = await request.post('/user/getalioss', {type: type, kind: 1}); - + const ossConfig = await request.post('/user/getalioss', { type: type, kind: 1 }); + return await new Promise((resolve, reject) => { uni.uploadFile({ url: ossConfig.host, @@ -1939,7 +2160,7 @@ export default { fail: reject }); }); - + } catch (error) { console.error('直接上传失败:', error); throw error; @@ -2196,8 +2417,13 @@ export default { } @keyframes spin { - 0% { transform: rotate(0deg); } - 100% { transform: rotate(360deg); } + 0% { + transform: rotate(0deg); + } + + 100% { + transform: rotate(360deg); + } } .picker-content { @@ -2385,7 +2611,9 @@ export default { margin-top: 20rpx; } -.change-info-btn, .view-change-btn, .resubmit-btn { +.change-info-btn, +.view-change-btn, +.resubmit-btn { background: linear-gradient(180deg, #f52540 0%, #e8101e 100%); } @@ -2513,7 +2741,8 @@ export default { color: #FFFFFF; } -.cancel-text, .confirm-text { +.cancel-text, +.confirm-text { font-size: 32rpx; padding: 16rpx; } @@ -2643,9 +2872,9 @@ export default { } .permission.transform { - top: calc(var(--status-bar-height) + 88rpx + 20rpx); - opacity: 1; - visibility: visible; + top: calc(var(--status-bar-height) + 88rpx + 20rpx); + opacity: 1; + visibility: visible; } .image-list {