初始化配置优化

master
gongfuxiang 2024-10-11 20:18:53 +08:00
parent 9e3b887aee
commit cee6bcd550
2 changed files with 32 additions and 53 deletions

34
App.vue
View File

@ -7,12 +7,12 @@
data: {
//
//
request_url: 'http://shopxo.com/',
// request_url:'https://new.shopxo.vip/',
//request_url: 'http://shopxo.com/',
request_url:'https://new.shopxo.vip/',
// publicpublichttps://d1.shopxo.vip/public/
static_url: 'http://shopxo.com/',
// static_url:'https://new.shopxo.vip/',
//static_url: 'http://shopxo.com/',
static_url:'https://new.shopxo.vip/',
// default
system_type: 'default',
@ -1433,12 +1433,20 @@
is_config(object, method, params) {
var self = this;
var count = 0;
var is_config_count = 0;
var timer = setInterval(function () {
if (self.get_config('status') == 1) {
clearInterval(timer);
if (typeof object === 'object' && (method || null) != null) {
object[method](true, params);
}
} else {
//
if(is_config_count < 1 && self.data.common_data_init_status == 1) {
is_config_count++;
self.data.common_data_init_status = 0;
self.init_config();
}
}
count++;
if (count >= 100) {
@ -1447,24 +1455,6 @@
}, 100);
},
/**
* 初始化 配置信息后回调
* object 回调操作对象
* method 回调操作对象的函数
* params 回调操请求参数
*/
init_config_back(object, method, params) {
var self = this;
self.data.common_data_init_back_timer = setInterval(function () {
if (self.data.common_data_init_status == 1) {
clearInterval(self.data.common_data_init_back_timer);
if (typeof object === 'object' && (method || null) != null) {
object[method](params);
}
}
}, 1000);
},
/**
* 火星坐标GCJ02到百度坐标BD-09(高德谷歌腾讯坐标 -> 百度)
* lng 经度

View File

@ -53,7 +53,6 @@
is_show_privacy: false,
privacy_content: null,
key: '',
load_status: 0,
is_tabbar: false,
app_tabber: null,
footer_height_value: 0,
@ -92,6 +91,15 @@
this.init_config();
},
methods: {
//
on_show() {
//tabbar
app.globalData.system_hide_tabbar();
//
this.init_config();
},
//
init_config(status) {
if ((status || false) == true) {
@ -102,20 +110,20 @@
}
},
//
//
init() {
//
if(this.load_status == 0) {
app.globalData.init_config_back(this, 'init');
}
//
this.setData({
load_status: 1,
});
//
this.footer_init();
// app
if (this.propIsAppAdmin && (this.$refs.app_admin || null) != null) {
this.$refs.app_admin.init();
}
//
if (this.propIsUserBase && (this.$refs.user_base || null) != null) {
this.$refs.user_base.init();
}
// #ifdef MP-WEIXIN
//
@ -134,25 +142,6 @@
// #endif
},
//
on_show() {
//tabbar
app.globalData.system_hide_tabbar();
//
this.footer_init();
// app
if (this.propIsAppAdmin && (this.$refs.app_admin || null) != null) {
this.$refs.app_admin.init();
}
//
if (this.propIsUserBase && (this.$refs.user_base || null) != null) {
this.$refs.user_base.init();
}
},
//
footer_init() {
var upd_data = {