入驻流程优化

This commit is contained in:
丁杰 2026-06-01 13:53:15 +08:00
parent 21425c0306
commit e79c8eda8a
4 changed files with 1836 additions and 1417 deletions

View File

@ -631,15 +631,15 @@ export default {
},
navigateToQualification() { //
if (this.identity == '2') {
if (this.userInfo.credentials_state == '1') {
//
uni.navigateTo({
url: '/pages/shop/qualification_sj_change'
url: '/pages/ruzhu/ruzhu?type=1'
})
} else {
//
uni.navigateTo({
url: '/pages/artisan/qualification_syr_change'
url: '/pages/shop/qualification_sj_change'
})
}
},

View File

@ -137,6 +137,10 @@ export default {
}
},
async onLoad(options) {
console.log(options, 'options---');
if (options.type == 1) {
this.currentStep = 4
}
this.identity = 2;
await this.getUserInfoSync()
// 访 identity
@ -546,6 +550,7 @@ export default {
delete formData.contact_phone
delete formData.contact_type
delete formData.contact_name
delete formData.invite_code_other
if (Array.isArray(formData.qualifications_sector)) {
formData.qualifications_sector = JSON.stringify(formData.qualifications_sector);
}
@ -786,19 +791,21 @@ export default {
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;
line-height: 96rpx;
font-style: normal;
margin: 0 0 0 281rpx;
align-items: center;

View File

@ -55,11 +55,14 @@
</view>
</view>
<view class="form-item-two box-cont">
<view class="form-item-two box-cont" @click="getAddressInfo">
<text class="label required">注册详细地址</text>
<view class="picker-content">
<input type="text" v-model="formData.uscc_address" placeholder="请输入注册地址" placeholder-class="placeholder"
class="input" />
<text :class="formData.uscc_address ? 'picker-value' : 'placeholder'">
{{ 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>
@ -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;

View File

@ -23,8 +23,11 @@
<view class="upload-container">
<view class="upload-box" @click="editable && chooseImage('uscc_photo')">
<view class="upload-camera license-upload">
<image v-if="displayData.uscc_photo" :src="displayData.uscc_photo" mode="aspectFill" class="preview-image"></image>
<image v-else src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/92bd4268-b4d7-4725-8664-9e44f828c7d9" mode="aspectFit" class="camera-icon"></image>
<image v-if="displayData.uscc_photo" :src="displayData.uscc_photo" mode="aspectFill"
class="preview-image"></image>
<image v-else
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/92bd4268-b4d7-4725-8664-9e44f828c7d9"
mode="aspectFit" class="camera-icon"></image>
</view>
</view>
<text class="upload-label required">请上传营业执照原件</text>
@ -36,27 +39,31 @@
<view class="label-wrapper">
<text class="label required">商户类型</text>
</view>
<input type="text" v-model="displayData.uscc_type" placeholder="请输入商户类型"
:disabled="!editable" placeholder-class="placeholder" class="input" />
<input type="text" v-model="displayData.uscc_type" placeholder="请输入商户类型" :disabled="!editable"
placeholder-class="placeholder" class="input" />
</view>
<!-- 营业执照信息 -->
<view class="form-item-one box-cont">
<view class="label-wrapper">
<text class="label required">证件号码</text>
<image class="label-icon" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/25bd7f38-1a3e-4282-84ea-190d7f820108" mode="aspectFit" @click="showTipPopup('uscc_num')"></image>
<image class="label-icon"
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/25bd7f38-1a3e-4282-84ea-190d7f820108"
mode="aspectFit" @click="showTipPopup('uscc_num')"></image>
</view>
<input type="text" v-model="displayData.uscc_num" placeholder="请输入营业执照的证件号码"
:disabled="!editable" placeholder-class="placeholder" class="input" />
<input type="text" v-model="displayData.uscc_num" placeholder="请输入营业执照的证件号码" :disabled="!editable"
placeholder-class="placeholder" class="input" />
</view>
<view class="form-item-one box-cont">
<view class="label-wrapper">
<text class="label required">企业名称</text>
<image class="label-icon" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/25bd7f38-1a3e-4282-84ea-190d7f820108" mode="aspectFit" @click="showTipPopup('uscc_name')"></image>
<image class="label-icon"
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/25bd7f38-1a3e-4282-84ea-190d7f820108"
mode="aspectFit" @click="showTipPopup('uscc_name')"></image>
</view>
<input type="text" v-model="displayData.uscc_name" placeholder="请输入营业执照的企业名称"
:disabled="!editable" placeholder-class="placeholder" class="input" />
<input type="text" v-model="displayData.uscc_name" placeholder="请输入营业执照的企业名称" :disabled="!editable"
placeholder-class="placeholder" class="input" />
</view>
<view class="form-item-one box-cont" @click="editable && showRegionPicker()">
@ -72,12 +79,17 @@
</view>
</view>
<view class="form-item-one box-cont">
<view class="form-item-one box-cont" @click="editable && getAddressInfo()">
<view class="label-wrapper">
<text class="label required">注册详细地址</text>
</view>
<input type="text" v-model="displayData.uscc_address" placeholder="请输入注册地址"
:disabled="!editable" placeholder-class="placeholder" class="input" />
<view class="picker-content">
<text :class="displayData.uscc_address ? 'picker-value' : 'placeholder'">
{{ displayData.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>
@ -100,8 +112,11 @@
<view class="idcard-upload-vertical-item">
<view class="upload-box" @click="editable && chooseImage('legal_idcard_positive')">
<view class="upload-camera idcard-front">
<image v-if="displayData.legal_idcard_positive" :src="displayData.legal_idcard_positive" mode="aspectFill" class="preview-image"></image>
<image v-else src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/043b0c97-79c1-4f95-810f-c33e3d5269a3" mode="aspectFit" class="camera-icon"></image>
<image v-if="displayData.legal_idcard_positive" :src="displayData.legal_idcard_positive"
mode="aspectFill" class="preview-image"></image>
<image v-else
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/043b0c97-79c1-4f95-810f-c33e3d5269a3"
mode="aspectFit" class="camera-icon"></image>
</view>
</view>
<text class="upload-label required">请上传身份证正面人像面</text>
@ -111,8 +126,11 @@
<view class="idcard-upload-vertical-item">
<view class="upload-box" @click="editable && chooseImage('legal_idcard_negative')">
<view class="upload-camera idcard-back">
<image v-if="displayData.legal_idcard_negative" :src="displayData.legal_idcard_negative" mode="aspectFill" class="preview-image"></image>
<image v-else src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/203cfdf4-2501-44e6-8565-ad251c6bf0fa" mode="aspectFit" class="camera-icon"></image>
<image v-if="displayData.legal_idcard_negative" :src="displayData.legal_idcard_negative"
mode="aspectFill" class="preview-image"></image>
<image v-else
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/203cfdf4-2501-44e6-8565-ad251c6bf0fa"
mode="aspectFit" class="camera-icon"></image>
</view>
</view>
<text class="upload-label required">请上传身份证反面国徽面</text>
@ -125,22 +143,24 @@
<view class="form-item-one box-cont">
<view class="label-wrapper">
<text class="label required">法人代表</text>
<image class="label-icon" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/25bd7f38-1a3e-4282-84ea-190d7f820108" mode="aspectFit" @click="showTipPopup('legal_name')"></image>
<image class="label-icon"
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/25bd7f38-1a3e-4282-84ea-190d7f820108"
mode="aspectFit" @click="showTipPopup('legal_name')"></image>
</view>
<input type="text" v-model="displayData.legal_name" placeholder="请输入营业执照的法人代表"
:disabled="!editable" placeholder-class="placeholder" class="input" />
<input type="text" v-model="displayData.legal_name" placeholder="请输入营业执照的法人代表" :disabled="!editable"
placeholder-class="placeholder" class="input" />
</view>
<view class="form-item-one box-cont">
<text class="label required">法人联系方式</text>
<input type="number" v-model="displayData.legal_phone" placeholder="请输入法人的联系方式"
:disabled="!editable" placeholder-class="placeholder" class="input" />
<input type="number" v-model="displayData.legal_phone" placeholder="请输入法人的联系方式" :disabled="!editable"
placeholder-class="placeholder" class="input" />
</view>
<view class="form-item-one box-cont">
<text class="label required">法人身份证号</text>
<input type="idcard" v-model="displayData.legal_idcard_num" placeholder="请输入法人身份证号"
:disabled="!editable" placeholder-class="placeholder" class="input" />
<input type="idcard" v-model="displayData.legal_idcard_num" placeholder="请输入法人身份证号" :disabled="!editable"
placeholder-class="placeholder" class="input" />
</view>
<!-- 身份证有效期 -->
@ -149,13 +169,17 @@
<view class="radio-group">
<view class="radio-item" @click="editable && setIdcardValidType('permanent')">
<view class="radio" :class="{ checked: displayData.legal_idcard_expiry_type === 1 }">
<image v-if="displayData.legal_idcard_expiry_type === 1" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/cb185ec8-9d30-4e53-b5dc-14b546013a60" class="radio-icon-image" mode="aspectFit"></image>
<image v-if="displayData.legal_idcard_expiry_type === 1"
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="editable && setIdcardValidType('date')">
<view class="radio" :class="{ checked: displayData.legal_idcard_expiry_type === 2 }">
<image v-if="displayData.legal_idcard_expiry_type === 2" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/cb185ec8-9d30-4e53-b5dc-14b546013a60" class="radio-icon-image" mode="aspectFit"></image>
<image v-if="displayData.legal_idcard_expiry_type === 2"
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>
@ -172,7 +196,9 @@
{{ formatDateForDisplay(displayData.idcard_start_date) || '请选择日期' }}
</text>
<view class="date-divider"></view>
<image src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/ce52b49f-2261-49ca-96ed-e9ad47049649" class="date-arrow" mode="aspectFit"></image>
<image
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/ce52b49f-2261-49ca-96ed-e9ad47049649"
class="date-arrow" mode="aspectFit"></image>
</view>
</view>
<view class="date-item">
@ -203,7 +229,8 @@
<view class="form-item-image-box box-cont">
<text class="label required">行业资质</text>
<view class="image-list">
<view class="image-item" v-for="(img, index) in displayData.qualifications_sector" :key="'industry-' + index">
<view class="image-item" v-for="(img, index) in displayData.qualifications_sector"
:key="'industry-' + index">
<image :src="img" mode="aspectFill" class="qualification-image"></image>
<view class="image-delete" v-if="editable" @click="removeImage('qualifications_sector', index)">×</view>
</view>
@ -286,7 +313,9 @@
<view class="radio-item" v-for="(item, index) in merchantTypeList" :key="index"
@click="selectMerchantType(item)">
<view class="radio" :class="{ checked: displayData.uscc_type === item.value }">
<image v-if="displayData.uscc_type === item.value" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/cb185ec8-9d30-4e53-b5dc-14b546013a60" class="radio-icon-image" mode="aspectFit"></image>
<image v-if="displayData.uscc_type === item.value"
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">{{ item.label }}</text>
</view>
@ -331,7 +360,9 @@
<view class="tip-popup-mask" @click="hideTipPopup"></view>
<view class="tip-popup-content">
<!-- 弹窗背景图片 -->
<image class="tip-popup-bg" src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/ab410a5d-5819-47f2-a0fc-3fd6b90d6770" mode="aspectFit"></image>
<image class="tip-popup-bg"
src="https://mrrplus.oss-cn-beijing.aliyuncs.com/photo/system/ab410a5d-5819-47f2-a0fc-3fd6b90d6770"
mode="aspectFit"></image>
<!-- 弹窗内容 -->
<view class="tip-popup-body">
@ -471,6 +502,8 @@ export default {
regionCitys: [],
regionAreas: [],
regionValue: [0, 0, 0],
addressListener: null,
sjAddressListener: null,
}
},
computed: {
@ -488,6 +521,8 @@ export default {
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: {
/**
* 识别营业执照
@ -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: '',
@ -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: '',
@ -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: '',
@ -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,
@ -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();
},
@ -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;
@ -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;
}