地区选择分包
parent
dba04ae130
commit
29e15a09d6
3
App.vue
3
App.vue
|
|
@ -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',
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
@ -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 || '',
|
||||
});
|
||||
},
|
||||
// 地址粘贴板
|
||||
|
|
|
|||
Loading…
Reference in New Issue