入驻流程优化

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

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

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;

File diff suppressed because it is too large Load Diff