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] =?UTF-8?q?feat:=20=E5=AE=8C=E6=88=90=E5=95=86=E5=AE=B6?= =?UTF-8?q?=E6=94=B9=E7=89=88=E7=9B=B8=E5=85=B3=E9=A1=B5=E9=9D=A2=E4=B8=8E?= =?UTF-8?q?=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