Merge branch 'mrr_sj_develop_hjy_20260520_商家改版' of https://gitee.com/qtvbidt/mrr.sj.front into mrr_sj_develop_hjy_20260520_商家改版

This commit is contained in:
BAKEYi 2026-06-01 13:55:31 +08:00
commit 0a8e130c33
8 changed files with 2117 additions and 1217 deletions

View File

@ -47,14 +47,17 @@
<image <image
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/338d957b-cbb6-409b-9e7a-ef5faa0f9b70.png" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/338d957b-cbb6-409b-9e7a-ef5faa0f9b70.png"
mode="widthFix" mode="widthFix"
style="width:26rpx;margin-top: 26rpx;position: relative;top: 4rpx;left: -10rpx;"> style="width:26rpx;margin-top: 26rpx;position: relative;top: 4rpx;left: -10rpx;"
v-if="!userInfo.business_time">
</image> </image>
<text style="margin-right: 16rpx; color: #ec5d57;">待完善</text> <text style="margin-right: 16rpx;"
:style="{ color: userInfo.business_time ? '#c9c9c9' : '#ec5d57' }">
{{ userInfo.business_time ? '已设置' : '待完善' }}
</text>
<image class="arrow-right" src="/static/images/arrow_right.png" mode="aspectFit"> <image class="arrow-right" src="/static/images/arrow_right.png" mode="aspectFit">
</image> </image>
</view> </view>
</view> </view>
<!-- 服务技能 -->
<view class="info-item" @click="navigateToServiceSkill"> <view class="info-item" @click="navigateToServiceSkill">
<view class="info-left"> <view class="info-left">
<image class="item-icon" <image class="item-icon"
@ -66,9 +69,14 @@
<image <image
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/338d957b-cbb6-409b-9e7a-ef5faa0f9b70.png" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/338d957b-cbb6-409b-9e7a-ef5faa0f9b70.png"
mode="widthFix" mode="widthFix"
style="width:26rpx;margin-top: 26rpx;position: relative;top: 4rpx;left: -10rpx;"> style="width:26rpx;margin-top: 26rpx;position: relative;top: 4rpx;left: -10rpx;"
v-if="!userInfo.servers_kill_arr || userInfo.servers_kill_arr.length === 0">
</image> </image>
<text style="margin-right: 16rpx; color: #389930;">已认证</text> <text style="margin-right: 16rpx;"
:style="{ color: (userInfo.servers_kill_arr && userInfo.servers_kill_arr.length > 0) ? '#333333' : '#ec5d57' }">
{{ (userInfo.servers_kill_arr && userInfo.servers_kill_arr.length > 0) ? '已设置' :
'待完善' }}
</text>
<image class="arrow-right" src="/static/images/arrow_right.png" mode="aspectFit"> <image class="arrow-right" src="/static/images/arrow_right.png" mode="aspectFit">
</image> </image>
</view> </view>
@ -153,9 +161,14 @@
<image <image
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/338d957b-cbb6-409b-9e7a-ef5faa0f9b70.png" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/338d957b-cbb6-409b-9e7a-ef5faa0f9b70.png"
mode="widthFix" mode="widthFix"
style="width:26rpx;margin-top: 26rpx;position: relative;top: 4rpx;left: -10rpx;"> style="width:26rpx;margin-top: 26rpx;position: relative;top: 4rpx;left: -10rpx;"
v-if="userInfo.credentials_state === 0">
</image> </image>
<text style="margin-right: 16rpx; color: #e59e45;">审核中</text> <text style="margin-right: 16rpx;"
:style="{ color: userInfo.credentials_state === 0 ? '#ec5d57' : userInfo.credentials_state === 1 ? '#e59e45' : '#c9c9c9' }">
{{ userInfo.credentials_state === 0 ? '待完善' : userInfo.credentials_state === 1 ? '审核中' :
'已认证' }}
</text>
<image class="arrow-right" src="/static/images/arrow_right.png" mode="aspectFit"> <image class="arrow-right" src="/static/images/arrow_right.png" mode="aspectFit">
</image> </image>
</view> </view>
@ -475,7 +488,7 @@
console.log('调用接口获取用户信息type:', type) console.log('调用接口获取用户信息type:', type)
// //
const result = await request.post('/user/getuser', { const result = await request.post('/sj/user/getUser', {
type type
}) })
@ -494,6 +507,7 @@
// ID // ID
this.tryAlternativeUserInfo() this.tryAlternativeUserInfo()
uni.hideLoading();
} }
}, },
@ -617,15 +631,15 @@
}, },
navigateToQualification() { // navigateToQualification() { //
if (this.identity == '2') { if (this.userInfo.credentials_state == '1') {
// //
uni.navigateTo({ uni.navigateTo({
url: '/pages/shop/qualification_sj_change' url: '/pages/ruzhu/ruzhu?type=1'
}) })
} else { } else {
// //
uni.navigateTo({ uni.navigateTo({
url: '/pages/artisan/qualification_syr_change' url: '/pages/shop/qualification_sj_change'
}) })
} }
}, },

View File

@ -177,13 +177,13 @@ export default {
title: "店铺装修", title: "店铺装修",
url: "https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/4b558456-2e38-4185-8713-d1f0e6645820.png", 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 // 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, go_id_type: 1,
}, },
{ {
title: "财务管理", title: "财务管理",
url: "https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/edafae37-8258-4e1c-9dcc-019484117047.png", 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, go_id_type: 1,
}, },
], ],

File diff suppressed because it is too large Load Diff

View File

@ -10,9 +10,8 @@
<view class="form-item-one box-cont"> <view class="form-item-one box-cont">
<text class="label required">资质照片</text> <text class="label required">资质照片</text>
<text class="upload-desc">请保证照片上的文字清晰无遮挡证件边角可见</text> <text class="upload-desc">请保证照片上的文字清晰无遮挡证件边角可见</text>
<view class="" @click="chooseImage('business_license')"> <view class="" @click="chooseImage('uscc_photo')">
<image v-if="formData.business_license" :src="formData.business_license" mode="aspectFill" <image v-if="formData.uscc_photo" :src="formData.uscc_photo" mode="aspectFill" class="upload-preview"></image>
class="upload-preview"></image>
<view class="" v-else> <view class="" v-else>
<image <image
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/fa75ea1c-8f9d-4b2a-8d0c-b94de516afd0.png" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/fa75ea1c-8f9d-4b2a-8d0c-b94de516afd0.png"
@ -24,88 +23,48 @@
<view class="form-item-two box-cont"> <view class="form-item-two box-cont">
<text class="label required">商户类型</text> <text class="label required">商户类型</text>
<input type="text" v-model="formData.household_type" placeholder="请输入商户类型" placeholder-class="placeholder" <input type="text" v-model="formData.uscc_type" placeholder="请输入商户类型" placeholder-class="placeholder"
class="input" @input="saveFormDataToLocalDebounce" /> class="input" />
</view> </view>
<view class="form-item-two box-cont"> <view class="form-item-two box-cont">
<text class="label required">证件号码</text> <text class="label required">证件号码</text>
<view class="picker-content"> <view class="picker-content">
<input type="text" v-model="formData.license_number" placeholder="请输入营业执照的证件号码" <input type="text" v-model="formData.uscc_num" placeholder="请输入营业执照的证件号码" placeholder-class="placeholder"
placeholder-class="placeholder" class="input" @input="saveFormDataToLocalDebounce" /> class="input" />
<image class="label-icon" <image class="label-icon"
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/25bd7f38-1a3e-4282-84ea-190d7f820108" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/25bd7f38-1a3e-4282-84ea-190d7f820108"
mode="aspectFit" @click.stop="showTipPopup('license_number')"></image> mode="aspectFit" @click.stop="showTipPopup('uscc_num')"></image>
</view> </view>
</view> </view>
<view class="form-item-two box-cont"> <view class="form-item-two box-cont">
<text class="label required">营业名称</text> <text class="label required">营业名称</text>
<input type="text" v-model="formData.business_name" placeholder="请输入营业执照的企业名称" placeholder-class="placeholder" <input type="text" v-model="formData.uscc_name" placeholder="请输入营业执照的企业名称" placeholder-class="placeholder"
class="input" @input="saveFormDataToLocalDebounce" /> class="input" />
</view> </view>
<view class="form-item-two box-cont" @click="showRegionPicker"> <view class="form-item-two box-cont" @click="showRegionPicker">
<text class="label required">注册地区</text> <text class="label required">注册地区</text>
<view class="picker-content"> <view class="picker-content">
<text :class="formData.register_region ? 'picker-value' : 'placeholder1'"> <text :class="formData.uscc_dependency ? 'picker-value' : 'placeholder1'">
{{ formData.register_region || '请选择' }} {{ formData.uscc_dependency || '请选择' }}
</text> </text>
<image src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/dccc4513-377c-4bfa-9fd2-a5cfdb9798f3" <image src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/dccc4513-377c-4bfa-9fd2-a5cfdb9798f3"
class="arrow-right" mode="aspectFit"></image> class="arrow-right" mode="aspectFit"></image>
</view> </view>
</view> </view>
<view class="form-item-two box-cont"> <view class="form-item-two box-cont" @click="getAddressInfo">
<text class="label required">注册详细地址</text> <text class="label required">注册详细地址</text>
<view class="picker-content"> <view class="picker-content">
<input type="text" v-model="formData.register_address" placeholder="请输入注册地址" placeholder-class="placeholder" <text :class="formData.uscc_address ? 'picker-value' : 'placeholder'">
class="input" @input="saveFormDataToLocalDebounce" /> {{ formData.uscc_address || '请选择' }}
</text>
<image src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/dccc4513-377c-4bfa-9fd2-a5cfdb9798f3"
class="arrow-right" mode="aspectFit"></image>
</view> </view>
</view> </view>
<view class="form-item-column box-cont">
<text class="label required">营业执照有效期至</text>
<view class="radio-group">
<view class="radio-item" @click="setIdcardExpiryType('permanent')">
<view class="radio" :class="{ checked: formData.legal_idcard_expiry_type === 'permanent' }">
<image v-if="formData.legal_idcard_expiry_type === 'permanent'"
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/cb185ec8-9d30-4e53-b5dc-14b546013a60"
class="radio-icon-image" mode="aspectFit"></image>
</view>
<text class="radio-label">永久有效</text>
</view>
<view class="radio-item" @click="setIdcardExpiryType('date')">
<view class="radio" :class="{ checked: formData.legal_idcard_expiry_type === 'date' }">
<image v-if="formData.legal_idcard_expiry_type === 'date'"
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/cb185ec8-9d30-4e53-b5dc-14b546013a60"
class="radio-icon-image" mode="aspectFit"></image>
</view>
<text class="radio-label">指定日期有效</text>
</view>
</view>
</view>
<view class="date-row box-cont">
<view class="date-col" @click="showDatePicker('start')">
<text class="date-label">开始日期</text>
<view class="date-input-box">
<text :class="formData.idcard_start_date ? 'date-value' : 'date-placeholder'">
{{ formData.idcard_start_date || '选择日期' }}
</text>
<image src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/5b01823b-7672-4e60-b6cc-a4de52294605.png"
class="date-icon" mode="aspectFit"></image>
</view>
</view>
<view class="date-col" @click="showDatePicker('end')">
<text class="date-label">结束日期</text>
<view class="date-input-box">
<text :class="formData.idcard_end_date ? 'date-value' : 'date-placeholder'">
{{ formData.idcard_end_date || '选择日期' }}
</text>
<image src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/5b01823b-7672-4e60-b6cc-a4de52294605.png"
class="date-icon" mode="aspectFit"></image>
</view>
</view>
</view>
</view> </view>
<view class="section"> <view class="section">
@ -117,8 +76,9 @@
<view class="form-item-one box-cont"> <view class="form-item-one box-cont">
<text class="label required">身份证照片</text> <text class="label required">身份证照片</text>
<text class="upload-desc">请保证照片上的文字清晰无遮挡证件边角可见</text> <text class="upload-desc">请保证照片上的文字清晰无遮挡证件边角可见</text>
<view class="upload-area" @click="chooseImage('id_card_front')"> <view class="upload-area" @click="chooseImage('legal_idcard_positive')">
<image v-if="formData.id_card_front" :src="formData.id_card_front" mode="aspectFill" class="upload-preview"> <image v-if="formData.legal_idcard_positive" :src="formData.legal_idcard_positive" mode="aspectFill"
class="upload-preview">
</image> </image>
<view class="" v-else> <view class="" v-else>
<image <image
@ -127,8 +87,9 @@
</view> </view>
<text class="placeholder1 required">请上传身份证正面(人像面)</text> <text class="placeholder1 required">请上传身份证正面(人像面)</text>
</view> </view>
<view class="upload-area" @click="chooseImage('id_card_back')" style="margin-top: 48rpx;"> <view class="upload-area" @click="chooseImage('legal_idcard_negative')" style="margin-top: 48rpx;">
<image v-if="formData.id_card_back" :src="formData.id_card_back" mode="aspectFill" class="upload-preview"> <image v-if="formData.legal_idcard_negative" :src="formData.legal_idcard_negative" mode="aspectFill"
class="upload-preview">
</image> </image>
<view class="" v-else> <view class="" v-else>
<image <image
@ -141,36 +102,36 @@
<view class="form-item-two box-cont"> <view class="form-item-two box-cont">
<text class="label required">法人代表</text> <text class="label required">法人代表</text>
<input type="text" v-model="formData.legal_person" placeholder="请输入营业执照的法人代表" placeholder-class="placeholder" <input type="text" v-model="formData.legal_name" placeholder="请输入营业执照的法人代表" placeholder-class="placeholder"
class="input" @input="saveFormDataToLocalDebounce" /> class="input" />
</view> </view>
<view class="form-item-two box-cont"> <view class="form-item-two box-cont">
<text class="label required">法人联系方式</text> <text class="label required">法人联系方式</text>
<input type="number" v-model="formData.legal_phone" placeholder="请输入法人的联系方式" placeholder-class="placeholder" <input type="number" v-model="formData.legal_phone" placeholder="请输入法人的联系方式" placeholder-class="placeholder"
class="input" @input="saveFormDataToLocalDebounce" /> class="input" />
</view> </view>
<view class="form-item-two box-cont"> <view class="form-item-two box-cont">
<text class="label required">法人身份证号</text> <text class="label required">法人身份证号</text>
<input type="text" v-model="formData.legal_id_number" placeholder="请输入法人的身份证号码" placeholder-class="placeholder" <input type="text" v-model="formData.legal_idcard_num" placeholder="请输入法人的身份证号码" placeholder-class="placeholder"
class="input" @input="saveFormDataToLocalDebounce" /> class="input" />
</view> </view>
<view class="form-item-column box-cont"> <view class="form-item-column box-cont">
<text class="label required">营业执照有效期至</text> <text class="label required">身份证有效期</text>
<view class="radio-group"> <view class="radio-group">
<view class="radio-item" @click="setIdcardExpiryType('permanent')"> <view class="radio-item" @click="setIdcardExpiryType('1')">
<view class="radio" :class="{ checked: formData.legal_idcard_expiry_type === 'permanent' }"> <view class="radio" :class="{ checked: formData.legal_idcard_expiry_type === '1' }">
<image v-if="formData.legal_idcard_expiry_type === 'permanent'" <image v-if="formData.legal_idcard_expiry_type === '1'"
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/cb185ec8-9d30-4e53-b5dc-14b546013a60" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/cb185ec8-9d30-4e53-b5dc-14b546013a60"
class="radio-icon-image" mode="aspectFit"></image> class="radio-icon-image" mode="aspectFit"></image>
</view> </view>
<text class="radio-label">永久有效</text> <text class="radio-label">永久有效</text>
</view> </view>
<view class="radio-item" @click="setIdcardExpiryType('date')"> <view class="radio-item" @click="setIdcardExpiryType('2')">
<view class="radio" :class="{ checked: formData.legal_idcard_expiry_type === 'date' }"> <view class="radio" :class="{ checked: formData.legal_idcard_expiry_type === '2' }">
<image v-if="formData.legal_idcard_expiry_type === 'date'" <image v-if="formData.legal_idcard_expiry_type === '2'"
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/cb185ec8-9d30-4e53-b5dc-14b546013a60" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/cb185ec8-9d30-4e53-b5dc-14b546013a60"
class="radio-icon-image" mode="aspectFit"></image> class="radio-icon-image" mode="aspectFit"></image>
</view> </view>
@ -182,20 +143,22 @@
<view class="date-col" @click="showDatePicker('start')"> <view class="date-col" @click="showDatePicker('start')">
<text class="date-label">开始日期</text> <text class="date-label">开始日期</text>
<view class="date-input-box"> <view class="date-input-box">
<text :class="formData.idcard_start_date ? 'date-value' : 'date-placeholder'"> <text :class="formData.legal_idcard_expiry_start ? 'date-value' : 'date-placeholder'">
{{ formData.idcard_start_date || '选择日期' }} {{ formData.legal_idcard_expiry_start || '选择日期' }}
</text> </text>
<image src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/5b01823b-7672-4e60-b6cc-a4de52294605.png" <image
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/5b01823b-7672-4e60-b6cc-a4de52294605.png"
class="date-icon" mode="aspectFit"></image> class="date-icon" mode="aspectFit"></image>
</view> </view>
</view> </view>
<view class="date-col" @click="showDatePicker('end')"> <view class="date-col" @click="showDatePicker('end')">
<text class="date-label">结束日期</text> <text class="date-label">结束日期</text>
<view class="date-input-box"> <view class="date-input-box">
<text :class="formData.idcard_end_date ? 'date-value' : 'date-placeholder'"> <text :class="formData.legal_idcard_expiry_end ? 'date-value' : 'date-placeholder'">
{{ formData.idcard_end_date || '选择日期' }} {{ formData.legal_idcard_expiry_end || '选择日期' }}
</text> </text>
<image src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/5b01823b-7672-4e60-b6cc-a4de52294605.png" <image
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/5b01823b-7672-4e60-b6cc-a4de52294605.png"
class="date-icon" mode="aspectFit"></image> class="date-icon" mode="aspectFit"></image>
</view> </view>
</view> </view>
@ -212,30 +175,34 @@
<view class="form-item-one box-cont"> <view class="form-item-one box-cont">
<text class="label required">行业资质</text> <text class="label required">行业资质</text>
<view class="image-list"> <view class="image-list">
<view class="image-item" v-for="(img, index) in formData.industry_qualifications" :key="'industry-' + index"> <view class="image-item" v-for="(img, index) in formData.qualifications_sector" :key="'industry-' + index">
<image :src="img" mode="aspectFill" class="qualification-image"></image> <image :src="img" mode="aspectFill" class="qualification-image"></image>
<view class="image-delete" @click="removeImage('industry_qualifications', index)">×</view> <view class="image-delete" @click="removeImage('qualifications_sector', index)">×</view>
</view> </view>
<view class="image-add" @click="chooseMultiImage('industry_qualifications')" <view class="image-add" @click="chooseMultiImage('qualifications_sector')"
v-if="formData.industry_qualifications.length < 9"> v-if="(formData.qualifications_sector || []).length < 9">
<image src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/0d4af728-c7bf-447d-85b2-e7c682471b86.png" mode="aspectFit" class="upload-icon-small"></image> <image
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/0d4af728-c7bf-447d-85b2-e7c682471b86.png"
mode="aspectFit" class="upload-icon-small"></image>
<text class="add-text">添加照片</text> <text class="add-text">添加照片</text>
</view> </view>
</view> </view>
<text class="label" style="margin-top: 30rpx;">其他资质</text> <text class="label" style="margin-top: 30rpx;">其他资质</text>
<view class="image-list"> <view class="image-list">
<view class="image-item" v-for="(img, index) in formData.other_qualifications" :key="'other-' + index"> <view class="image-item" v-for="(img, index) in formData.qualifications_other" :key="'other-' + index">
<image :src="img" mode="aspectFill" class="qualification-image"></image> <image :src="img" mode="aspectFill" class="qualification-image"></image>
<view class="image-delete" @click="removeImage('other_qualifications', index)">×</view> <view class="image-delete" @click="removeImage('qualifications_other', index)">×</view>
</view> </view>
<view class="image-add" @click="chooseMultiImage('other_qualifications')" <view class="image-add" @click="chooseMultiImage('qualifications_other')"
v-if="formData.other_qualifications.length < 9"> v-if="(formData.qualifications_other || []).length < 9">
<image src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/0d4af728-c7bf-447d-85b2-e7c682471b86.png" mode="aspectFit" class="upload-icon-small"></image> <image
<text class="add-text">添加照片</text> src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/0d4af728-c7bf-447d-85b2-e7c682471b86.png"
</view> mode="aspectFit" class="upload-icon-small"></image>
</view> <text class="add-text">添加照片</text>
</view> </view>
</view>
</view> </view>
</view>
<view class="popup" :class="{ show: showRegionPopupFlag }"> <view class="popup" :class="{ show: showRegionPopupFlag }">
<view class="popup-mask" @click="hideRegionPopup"></view> <view class="popup-mask" @click="hideRegionPopup"></view>
@ -319,35 +286,33 @@
<script> <script>
import request from '../../utils/request'; import request from '../../utils/request';
import ChinaCitys from '../../static/data/ChinaCitys.json'; import ChinaCitys from '../../static/data/ChinaCitys.json';
import { import { recognizeIdCard, recognizeBusinessLicense, parseValidPeriod } from '../../utils/orc';
debounce
} from '@/utils/debounce.js';
export default { export default {
data() { data() {
const loadedData = this.loadFormDataFromLocal();
return { return {
formData: loadedData || { formData: {
business_license: '', uscc_photo: '',
household_type: '', uscc_type: '',
license_number: '', uscc_num: '',
business_name: '', uscc_name: '',
register_region: '', uscc_dependency: '',
register_address: '', uscc_address: '',
register_province: '', uscc_province: '',
register_city: '', uscc_city: '',
register_area: '', uscc_area: '',
id_card_front: '', longitude: '',
id_card_back: '', latitude: '',
legal_person: '', legal_idcard_positive: '',
legal_idcard_negative: '',
legal_name: '',
legal_phone: '', legal_phone: '',
legal_id_number: '', legal_idcard_num: '',
legal_idcard_expiry_type: 'permanent', legal_idcard_expiry_type: '1',
idcard_start_date: '', legal_idcard_expiry_start: '',
idcard_end_date: '', legal_idcard_expiry_end: '',
industry_qualifications: [], qualifications_sector: [],
other_qualifications: [] qualifications_other: []
}, },
ChinaCitys: ChinaCitys, ChinaCitys: ChinaCitys,
regionCitys: [], regionCitys: [],
@ -358,8 +323,12 @@ export default {
currentPickerType: 'start', currentPickerType: 'start',
datePickerValue: [0, 0, 0], datePickerValue: [0, 0, 0],
indicatorStyle: 'height: 68rpx;', indicatorStyle: 'height: 68rpx;',
isRecognizing: false,
recognizeType: '',
userId: null, userId: null,
identity: 3 identity: 3,
addressListener: null,
sjAddressListener: null
} }
}, },
@ -385,6 +354,10 @@ export default {
await this.getUserInfo(); await this.getUserInfo();
this.regionCitys = this.ChinaCitys[0].citys; this.regionCitys = this.ChinaCitys[0].citys;
this.regionAreas = this.regionCitys[0].areas; this.regionAreas = this.regionCitys[0].areas;
this.setupAddressListener();
},
beforeDestroy() {
this.removeAddressListener();
}, },
methods: { methods: {
@ -396,29 +369,6 @@ export default {
}); });
}, },
loadFormDataFromLocal() {
try {
const stored = uni.getStorageSync('sj_info_form_data');
if (stored) return stored;
} catch (e) { }
return null;
},
saveFormDataToLocal() {
try {
uni.setStorageSync('sj_info_form_data', this.formData);
} catch (e) { }
},
saveFormDataToLocalDebounce() {
if (!this._saveDebounce) {
this._saveDebounce = debounce(() => {
this.saveFormDataToLocal();
}, 500);
}
this._saveDebounce();
},
chooseImage(type) { chooseImage(type) {
uni.chooseImage({ uni.chooseImage({
count: 1, count: 1,
@ -434,7 +384,13 @@ export default {
const url = await this.directUpload(file, this.userId, 3); const url = await this.directUpload(file, this.userId, 3);
if (url) { if (url) {
this.$set(this.formData, type, url); this.$set(this.formData, type, url);
this.saveFormDataToLocal(); if (type === 'uscc_photo') {
await this.recognizeBusinessLicense(url);
} else if (type === 'legal_idcard_positive') {
await this.recognizeIdCardFront(url);
} else if (type === 'legal_idcard_negative') {
await this.recognizeIdCardBack(url);
}
} }
} }
}); });
@ -474,7 +430,6 @@ export default {
} }
} }
this.$set(this.formData, type, current); this.$set(this.formData, type, current);
this.saveFormDataToLocal();
uni.hideLoading(); uni.hideLoading();
} }
}); });
@ -484,7 +439,6 @@ export default {
const list = [...this.formData[type]]; const list = [...this.formData[type]];
list.splice(index, 1); list.splice(index, 1);
this.$set(this.formData, type, list); this.$set(this.formData, type, list);
this.saveFormDataToLocal();
}, },
async directUpload(file, userId, type) { async directUpload(file, userId, type) {
@ -554,14 +508,19 @@ export default {
let province = this.ChinaCitys[index1].province; let province = this.ChinaCitys[index1].province;
let city = this.regionCitys[index2].city; let city = this.regionCitys[index2].city;
let area = this.regionAreas[index3].area; let area = this.regionAreas[index3].area;
this.formData.register_region = province + '-' + city + '-' + area; this.formData.uscc_dependency = province + '-' + city + '-' + area;
this.formData.register_province = this.ChinaCitys[index1].code ? this.ChinaCitys[index1].code.toString() if (this.ChinaCitys[index1] && this.ChinaCitys[index1].code) {
.substring(0, 6) : ''; this.formData.uscc_province = String(this.ChinaCitys[index1].code).substring(0, 6);
this.formData.register_city = this.regionCitys[index2].code ? this.regionCitys[index2].code.toString() }
.substring(0, 6) : ''; if (this.regionCitys[index2] && this.regionCitys[index2].code) {
this.formData.register_area = this.regionAreas[index3].code ? this.regionAreas[index3].code.toString() this.formData.uscc_city = String(this.regionCitys[index2].code).substring(0, 6);
.substring(0, 6) : ''; }
this.saveFormDataToLocal(); 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(); this.hideRegionPopup();
}, },
@ -575,14 +534,13 @@ export default {
setIdcardExpiryType(type) { setIdcardExpiryType(type) {
this.$set(this.formData, 'legal_idcard_expiry_type', type); this.$set(this.formData, 'legal_idcard_expiry_type', type);
if (type === 'permanent') { if (type === '1') {
this.formData.idcard_end_date = '长久有效'; this.formData.legal_idcard_expiry_end = '长久有效';
} else { } else {
if (this.formData.idcard_end_date === '长久有效') { if (this.formData.legal_idcard_expiry_end === '长久有效') {
this.formData.idcard_end_date = ''; this.formData.legal_idcard_expiry_end = '';
} }
} }
this.saveFormDataToLocal();
}, },
showDatePicker(type) { showDatePicker(type) {
@ -604,78 +562,359 @@ export default {
const day = this.days[this.datePickerValue[2]]; const day = this.days[this.datePickerValue[2]];
const dateStr = `${year}${month < 10 ? '0' + month : month}${day < 10 ? '0' + day : day}`; const dateStr = `${year}${month < 10 ? '0' + month : month}${day < 10 ? '0' + day : day}`;
if (this.currentPickerType === 'start') { if (this.currentPickerType === 'start') {
this.formData.idcard_start_date = dateStr; this.formData.legal_idcard_expiry_start = dateStr;
} else { } else {
this.formData.idcard_end_date = dateStr; this.formData.legal_idcard_expiry_end = dateStr;
} }
this.saveFormDataToLocal();
this.hideDatePicker(); 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;
this.recognizeType = 'uscc_photo';
uni.showLoading({ title: '正在识别营业执照...', mask: true });
const result = await recognizeBusinessLicense(imageUrl);
console.log('营业执照识别结果:', result);
const hasRecognizedData = this.checkBusinessLicenseRecognition(result);
if (!hasRecognizedData) {
uni.hideLoading();
uni.showToast({ title: '未识别到营业执照信息,请手动填写或重新拍摄', icon: 'none', duration: 3000 });
this.isRecognizing = false;
return;
}
let recognizedFields = 0;
if (result.uscc_name && result.uscc_name.trim() && result.uscc_name !== '无') {
this.$set(this.formData, 'uscc_name', result.uscc_name);
recognizedFields++;
}
if (result.uscc_num && result.uscc_num.trim()) {
this.$set(this.formData, 'uscc_num', result.uscc_num);
recognizedFields++;
}
if (result.uscc_type && result.uscc_type.trim()) {
this.$set(this.formData, 'uscc_type', result.uscc_type);
recognizedFields++;
}
uni.hideLoading();
if (recognizedFields > 0) {
uni.showToast({ title: '营业执照识别成功', icon: 'none', duration: 2000 });
} else {
uni.showToast({ title: '识别完成,但未获取到有效信息', icon: 'none', duration: 3000 });
}
} catch (error) {
console.error('营业执照识别失败:', error);
uni.hideLoading();
uni.showToast({ title: error.message || '识别失败,请手动填写', icon: 'none', duration: 3000 });
} finally {
this.isRecognizing = false;
}
},
checkBusinessLicenseRecognition(result) {
const requiredFields = ['uscc_num', 'uscc_name', 'uscc_type'];
for (const field of requiredFields) {
if (result[field] && result[field].trim()) return true;
}
return false;
},
async recognizeIdCardFront(imageUrl) {
try {
this.isRecognizing = true;
this.recognizeType = 'legal_idcard_positive';
uni.showLoading({ title: '正在识别身份证正面...', mask: true });
const result = await recognizeIdCard(imageUrl, 1);
const hasRecognizedData = (result.name && result.name.trim()) || (result.id_number && result.id_number.trim());
if (!hasRecognizedData) {
uni.hideLoading();
uni.showToast({ title: '未识别到身份证信息,请手动填写或重新拍摄', icon: 'none', duration: 3000 });
this.isRecognizing = false;
return;
}
if (result.name) {
this.$set(this.formData, 'legal_name', result.name);
}
if (result.id_number) {
this.$set(this.formData, 'legal_idcard_num', result.id_number);
}
uni.hideLoading();
uni.showToast({ title: '身份证正面识别成功', icon: 'none' });
} catch (error) {
console.error('身份证正面识别失败:', error);
uni.hideLoading();
uni.showToast({ title: error.message || '识别失败,请手动填写', icon: 'none', duration: 3000 });
} finally {
this.isRecognizing = false;
}
},
async recognizeIdCardBack(imageUrl) {
try {
this.isRecognizing = true;
this.recognizeType = 'legal_idcard_negative';
uni.showLoading({ title: '正在识别身份证反面...', mask: true });
const result = await recognizeIdCard(imageUrl, 2);
const hasRecognizedData = (result.start_date && result.start_date.trim()) || (result.end_date && result.end_date.trim());
if (!hasRecognizedData) {
uni.hideLoading();
uni.showToast({ title: '未识别到身份证有效期信息,请手动填写或重新拍摄', icon: 'none', duration: 3000 });
this.isRecognizing = false;
return;
}
const validPeriod = parseValidPeriod(result.start_date, result.end_date);
if (validPeriod.startDate) {
this.$set(this.formData, 'legal_idcard_expiry_start', validPeriod.startDate);
}
if (validPeriod.isPermanent) {
this.$set(this.formData, 'legal_idcard_expiry_type', '1');
this.$set(this.formData, 'legal_idcard_expiry_end', '长久有效');
} else if (validPeriod.endDate) {
this.$set(this.formData, 'legal_idcard_expiry_type', '2');
this.$set(this.formData, 'legal_idcard_expiry_end', validPeriod.endDate);
}
uni.hideLoading();
uni.showToast({ title: '身份证反面识别成功', icon: 'none' });
} catch (error) {
console.error('身份证反面识别失败:', error);
uni.hideLoading();
uni.showToast({ title: error.message || '识别失败,请手动填写', icon: 'none', duration: 3000 });
} finally {
this.isRecognizing = false;
}
},
showTipPopup(field) { }, showTipPopup(field) { },
getFormData() { getFormData() {
return this.formData; return this.formData;
}, },
setData(data) {
if (!data) return;
const keys = Object.keys(this.formData);
keys.forEach(key => {
if (data[key] !== undefined && data[key] !== null) {
this.$set(this.formData, key, data[key]);
}
});
},
saveFormData() { saveFormData() {
if (!this.formData.business_license) { if (!this.formData.uscc_photo) {
uni.showToast({ uni.showToast({
title: '请上传营业执照', title: '请上传营业执照',
icon: 'none' icon: 'none'
}); });
return false; return false;
} }
if (!this.formData.household_type) { if (!this.formData.uscc_type) {
uni.showToast({ uni.showToast({
title: '请选择户主类型', title: '请选择户主类型',
icon: 'none' icon: 'none'
}); });
return false; return false;
} }
if (!this.formData.license_number) { if (!this.formData.uscc_num) {
uni.showToast({ uni.showToast({
title: '请输入证件号码', title: '请输入证件号码',
icon: 'none' icon: 'none'
}); });
return false; return false;
} }
if (!this.formData.business_name) { if (!this.formData.uscc_name) {
uni.showToast({ uni.showToast({
title: '请输入营业名称', title: '请输入营业名称',
icon: 'none' icon: 'none'
}); });
return false; return false;
} }
if (!this.formData.register_region) { if (!this.formData.uscc_dependency) {
uni.showToast({ uni.showToast({
title: '请选择注册地区', title: '请选择注册地区',
icon: 'none' icon: 'none'
}); });
return false; return false;
} }
if (!this.formData.register_address) { if (!this.formData.uscc_address) {
uni.showToast({ uni.showToast({
title: '请输入注册详细地址', title: '请输入注册详细地址',
icon: 'none' icon: 'none'
}); });
return false; return false;
} }
if (!this.formData.id_card_front) { if (!this.formData.legal_idcard_positive) {
uni.showToast({ uni.showToast({
title: '请上传法人身份证正面', title: '请上传法人身份证正面',
icon: 'none' icon: 'none'
}); });
return false; return false;
} }
if (!this.formData.id_card_back) { if (!this.formData.legal_idcard_negative) {
uni.showToast({ uni.showToast({
title: '请上传法人身份证反面', title: '请上传法人身份证反面',
icon: 'none' icon: 'none'
}); });
return false; return false;
} }
if (!this.formData.legal_person) { if (!this.formData.legal_name) {
uni.showToast({ uni.showToast({
title: '请输入法人代表', title: '请输入法人代表',
icon: 'none' icon: 'none'
@ -696,35 +935,34 @@ export default {
}); });
return false; return false;
} }
if (!this.formData.legal_id_number) { if (!this.formData.legal_idcard_num) {
uni.showToast({ uni.showToast({
title: '请输入法人身份证号', title: '请输入法人身份证号',
icon: 'none' icon: 'none'
}); });
return false; return false;
} }
if (!this.formData.idcard_start_date) { if (!this.formData.legal_idcard_expiry_start) {
uni.showToast({ uni.showToast({
title: '请选择开始日期', title: '请选择开始日期',
icon: 'none' icon: 'none'
}); });
return false; return false;
} }
if (!this.formData.idcard_end_date) { if (!this.formData.legal_idcard_expiry_end) {
uni.showToast({ uni.showToast({
title: '请选择结束日期', title: '请选择结束日期',
icon: 'none' icon: 'none'
}); });
return false; return false;
} }
if (!this.formData.industry_qualifications || this.formData.industry_qualifications.length === 0) { if (!this.formData.qualifications_sector || this.formData.qualifications_sector.length === 0) {
uni.showToast({ uni.showToast({
title: '请上传行业资质', title: '请上传行业资质',
icon: 'none' icon: 'none'
}); });
return false; return false;
} }
this.saveFormDataToLocal();
return true; return true;
} }
} }
@ -1052,10 +1290,10 @@ export default {
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
border: 2rpx dashed #DDDDDD; border: 2rpx dashed #DDDDDD;
width: 214rpx; width: 214rpx;
height: 214rpx; height: 214rpx;
background: #F5F5F5; background: #F5F5F5;
border-radius: 20rpx; border-radius: 20rpx;
} }

View File

@ -1,94 +1,110 @@
<template> <template>
<view class="pages"> <view class="pages">
<custom-navbar title="入驻成功" :showBack="true"></custom-navbar> <custom-navbar :title="infoData.top" :showBack="true"></custom-navbar>
<view class="title-icon">恭喜您</view> <view class="title-icon">{{infoData.title}}</view>
<!-- <view class="title-icon">{{data.residency_notice}}</view> --> <view class="title-content">{{infoData.notice}}</view>
<view class="title-content">成功入驻成为美融融门店</view>
<!-- <view class="title-content">{{data.approve_notice}}</view> -->
<view class="erweimabox"> <view class="erweimabox">
<view class="erweimab"> <view class="erweimab">
<!-- <image src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/26bd4004-c7aa-4997-9f31-8562060e7659.jpeg" mode="" style="width: 404rpx;height: 404rpx;"></image> --> <image :src="infoData.photo" mode="widthFix"
<image :src="data.photo" mode="widthFix" style="width: 404rpx;border-radius:25rpx ;margin: 37rpx 0 0 36rpx;"></image> style="width: 404rpx;border-radius:25rpx ;margin: 37rpx 0 0 36rpx;"></image>
</view> </view>
<view class="kefubtn">扫码联系专属客服</view> <view class="kefubtn">扫码联系专属客服</view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
export default { import request from '../../utils/request';
// props
props: { export default {
data: { props: {
type: Object, // data: {
default: () => ({}) // type: Object,
} default: () => ({})
}, }
},
onLoad() { data() {
// JS 使 return {
console.log(this.data,'--------------------') infoData: {}
} }
} },
mounted() {
this.getCustomerService();
},
methods: {
async getCustomerService() {
try {
const res = await request.post('/sj/userSjAuth/getCustomerService');
console.log('客服接口返回:', JSON.stringify(res));
if (res && (res.state == 1 || res.code == 200)) {
this.infoData = res.data || {};
}
} catch (e) {
console.error('获取客服信息失败:', e);
}
}
}
}
</script> </script>
<style> <style>
.kefubtn{ .kefubtn {
height: 42rpx; height: 42rpx;
font-family: PingFangSC, PingFang SC; font-family: PingFangSC, PingFang SC;
font-weight: 400; font-weight: 400;
font-size: 30rpx; font-size: 30rpx;
color: #5A5A5A; color: #5A5A5A;
line-height: 42rpx; line-height: 42rpx;
text-align: center; text-align: center;
font-style: normal; font-style: normal;
margin-top: 23rpx; margin-top: 23rpx;
} }
.pages {
background-image: url('https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/467f6b5f-32dc-4ba3-847a-22be4569c45e.png');
background-size: 100%;
background-repeat: no-repeat;
}
.erweimab { .pages {
margin: 70rpx 0 0 103rpx; background-image: url('https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/467f6b5f-32dc-4ba3-847a-22be4569c45e.png');
width: 477rpx; background-size: 100%;
height: 477rpx; background-repeat: no-repeat;
background-image: url('https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/e5461570-10e3-4e11-a6ca-8543f106639a.png'); }
background-size: 100%;
background-repeat: no-repeat;
}
.erweimabox { .erweimab {
margin: 71rpx 0 0 6rpx; margin: 70rpx 0 0 103rpx;
width: 690rpx; width: 477rpx;
height: 690rpx; height: 477rpx;
background: #FFFFFF; background-image: url('https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/e5461570-10e3-4e11-a6ca-8543f106639a.png');
border-radius: 62rpx; background-size: 100%;
border: 1rpx solid #F2F4F6; background-repeat: no-repeat;
} }
.title-icon { .erweimabox {
margin-left: 283rpx; margin: 71rpx 0 0 6rpx;
height: 67rpx; width: 690rpx;
font-family: PingFangSC, PingFang SC; height: 690rpx;
font-weight: 500; background: #FFFFFF;
font-size: 48rpx; border-radius: 62rpx;
color: #333333; border: 1rpx solid #F2F4F6;
line-height: 67rpx; }
text-align: left;
font-style: normal;
}
.title-content { .title-icon {
margin: 14rpx 0 0 195rpx; /* margin-left: 283rpx; */
height: 42rpx; height: 67rpx;
font-family: PingFangSC, PingFang SC; font-family: PingFangSC, PingFang SC;
font-weight: 400; font-weight: 500;
font-size: 30rpx; font-size: 48rpx;
color: #666666; color: #333333;
line-height: 42rpx; line-height: 67rpx;
text-align: left; text-align: center;
font-style: normal; font-style: normal;
} }
.title-content {
margin: 14rpx 0 0 0rpx;
height: 42rpx;
font-family: PingFangSC, PingFang SC;
font-weight: 400;
font-size: 30rpx;
color: #666666;
line-height: 42rpx;
text-align: center;
font-style: normal;
}
</style> </style>

View File

@ -125,7 +125,7 @@ export default {
// //
async loadCurrentTime() { async loadCurrentTime() {
try { try {
const res = await request.post('/user/getuser', { const res = await request.post('/sj/user/getuser', {
type: 3 // type: 3 //
}) })
console.log('获取用户信息响应:', res) console.log('获取用户信息响应:', res)

File diff suppressed because it is too large Load Diff

View File

@ -187,13 +187,22 @@ const request = async (options, isUpdate) => {
uni.request({ uni.request({
...options, ...options,
success: (res) => { success: (res) => {
// #ifdef H5 // #ifdef H5
if (!options.hideLoading) { if (!options.hideLoading) {
uni.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 } catch (err) {
resolve(responseInterceptor(options, res, resolve, reject)) reject(err)
}, }
},
fail: (err) => { fail: (err) => {
// #ifdef H5 // #ifdef H5
if (!options.hideLoading) { if (!options.hideLoading) {
@ -221,6 +230,7 @@ const request = async (options, isUpdate) => {
// 处理 401 未授权 // 处理 401 未授权
async function handleUnauthorized(originalRequest, resolve, reject) { async function handleUnauthorized(originalRequest, resolve, reject) {
if (!getToken()) { if (!getToken()) {
reject(new Error('未登录'))
return redirectToLogin() return redirectToLogin()
} }
// 如果正在刷新 Token将请求加入队列 // 如果正在刷新 Token将请求加入队列
@ -246,7 +256,7 @@ async function handleUnauthorized(originalRequest, resolve, reject) {
} catch (error) { } catch (error) {
removeToken() removeToken()
redirectToLogin() redirectToLogin()
// reject(error) reject(error)
return error return error
} finally { } finally {
isRefreshing = false isRefreshing = false