地区选择分包

master
gongfuxiang 2025-04-24 15:47:39 +08:00
parent dba04ae130
commit 29e15a09d6
5 changed files with 39 additions and 19 deletions

View File

@ -168,6 +168,9 @@
// key
cache_userlocation_key: 'cache_userlocation_key',
// key
cache_region_picker_choice_key: 'cache_region_picker_choice_key',
// key
cache_page_pay_key: 'cache_page_pay_key',

View File

@ -72,9 +72,12 @@
var current_page = app.globalData.current_page();
//
if(user != null && current_page.indexOf('pages/plugins/certificate/') == -1 && current_page.indexOf('pages/web-view/web-view') == -1 && (this.config || null) != null && (this.config.user_auth_business_data || null) != null && (this.config.business_type_data || null) != null) {
this.setData({
popup_status: true,
});
//
if(!this.config.user_auth_business_data.auth_status && this.config.user_auth_business_data.is_select) {
this.setData({
popup_status: true,
});
}
}
}
return this.popup_status;

View File

@ -250,7 +250,13 @@
"path": "user-address-save",
"style": {
"enablePullDownRefresh": false,
"navigationBarTitleText": ""
"navigationBarTitleText": "",
"usingComponents": {
"component-region-picker": "/pages/common/components/region-picker/region-picker"
},
"componentPlaceholder": {
"component-region-picker": "view"
}
}
}
]

View File

@ -39,6 +39,8 @@ export default {
//
columns_index: [[0], [0], [0]],
indicatorStyle: `height: ${uni.upx2px(88)}px;`,
// key
cache_key: app.globalData.data.cache_region_picker_choice_key,
};
},
components: {
@ -201,8 +203,13 @@ export default {
let province = this.columns[0][this.columns_index[0]];
let city = this.columns[1][this.columns_index[1]];
let areal = this.columns[2][this.columns_index[2]];
uni.setStorageSync(this.cache_key, {
province: province,
city: city,
areal: areal
});
this.popup_close_event();
this.$emit("call-back", province, city, areal);
this.$emit("call-back");
},
},
};

View File

@ -167,7 +167,7 @@
const app = getApp();
import componentCommon from '@/components/common/common';
import componentNoData from '@/components/no-data/no-data';
import componentRegionPicker from '@/components/region-picker/region-picker';
import componentRegionPicker from '@/pages/common/components/region-picker/region-picker';
import componentChoiceLocation from '@/components/choice-location/choice-location';
var common_static_url = app.globalData.get_static_url('common');
const theme_color = app.globalData.get_theme_color();
@ -736,23 +736,24 @@
region_picker_show: false,
});
},
region_event(address1, address2, address3) {
if((address1 || null) == null) {
address1 = {};
region_event(address1, address2, address3) {
let data = uni.getStorageSync(app.globalData.data.cache_region_picker_choice_key) || {};
if((data.province || null) == null) {
data.province = {};
}
if((address2 || null) == null) {
address2 = {};
if((data.city || null) == null) {
data.city = {};
}
if((address3 || null) == null) {
address3 = {};
if((data.areal || null) == null) {
data.areal = {};
}
this.setData({
province_id: address1.id || null,
city_id: address2.id || null,
county_id: address3.id || null,
province_name: address1.name || '',
city_name: address2.name || '',
county_name: address3.name || '',
province_id: data.province.id || null,
city_id: data.city.id || null,
county_id: data.areal.id || null,
province_name: data.province.name || '',
city_name: data.city.name || '',
county_name: data.areal.name || '',
});
},
//