初始化配置优化
parent
9e3b887aee
commit
cee6bcd550
34
App.vue
34
App.vue
|
|
@ -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/',
|
||||
|
||||
// 静态资源地址(如系统根目录不在public目录下面请在静态地址后面加public目录、如:https://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 经度
|
||||
|
|
|
|||
|
|
@ -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 = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue