移除省市区
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import Toast from 'tdesign-miniprogram/toast/index';
|
||||
import { fetchDeliveryAddress } from '../../../../services/address/fetchAddress';
|
||||
import { areaData } from '../../../../config/index';
|
||||
import { resolveAddress, rejectAddress } from './util';
|
||||
|
||||
const innerPhoneReg = '^1(?:3\\d|4[4-9]|5[0-35-9]|6[67]|7[0-8]|8\\d|9\\d)\\d{8}$';
|
||||
@@ -36,9 +35,7 @@ Page({
|
||||
isOrderDetail: false,
|
||||
isOrderSure: false,
|
||||
},
|
||||
areaData: areaData,
|
||||
labels: labelsOptions,
|
||||
areaPickerVisible: false,
|
||||
submitActive: false,
|
||||
visible: false,
|
||||
labelValue: '',
|
||||
@@ -78,44 +75,19 @@ Page({
|
||||
},
|
||||
onInputValue(e) {
|
||||
const { item } = e.currentTarget.dataset;
|
||||
if (item === 'address') {
|
||||
const { selectedOptions = [] } = e.detail;
|
||||
this.setData(
|
||||
{
|
||||
'locationState.provinceCode': selectedOptions[0].value,
|
||||
'locationState.provinceName': selectedOptions[0].label,
|
||||
'locationState.cityName': selectedOptions[1].label,
|
||||
'locationState.cityCode': selectedOptions[1].value,
|
||||
'locationState.districtCode': selectedOptions[2].value,
|
||||
'locationState.districtName': selectedOptions[2].label,
|
||||
areaPickerVisible: false,
|
||||
},
|
||||
() => {
|
||||
const { isLegal, tips } = this.onVerifyInputLegal();
|
||||
this.setData({
|
||||
submitActive: isLegal,
|
||||
});
|
||||
this.privateData.verifyTips = tips;
|
||||
},
|
||||
);
|
||||
} else {
|
||||
const { value = '' } = e.detail;
|
||||
this.setData(
|
||||
{
|
||||
[`locationState.${item}`]: value,
|
||||
},
|
||||
() => {
|
||||
const { isLegal, tips } = this.onVerifyInputLegal();
|
||||
this.setData({
|
||||
submitActive: isLegal,
|
||||
});
|
||||
this.privateData.verifyTips = tips;
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
onPickArea() {
|
||||
this.setData({ areaPickerVisible: true });
|
||||
const { value = '' } = e.detail;
|
||||
this.setData(
|
||||
{
|
||||
[`locationState.${item}`]: value,
|
||||
},
|
||||
() => {
|
||||
const { isLegal, tips } = this.onVerifyInputLegal();
|
||||
this.setData({
|
||||
submitActive: isLegal,
|
||||
});
|
||||
this.privateData.verifyTips = tips;
|
||||
},
|
||||
);
|
||||
},
|
||||
onPickLabels(e) {
|
||||
const { item } = e.currentTarget.dataset;
|
||||
|
||||
Reference in New Issue
Block a user