Commit ad9ab5bd by 李嘉林

优化

parent e0f9e699
...@@ -8,13 +8,18 @@ import { themeColor, checkShowConditionIds, getStoreInfo, setStoreInfo } from "@ ...@@ -8,13 +8,18 @@ import { themeColor, checkShowConditionIds, getStoreInfo, setStoreInfo } from "@
import { query_isEntry } from "@/utils/mayi_fenxiao"; import { query_isEntry } from "@/utils/mayi_fenxiao";
export default { export default {
data() {
return {
extConfig: {},
}
},
async created() { async created() {
wx.setStorageSync("firstView", 1); wx.setStorageSync("firstView", 1);
console.log(new Date().getTime(),'load-----app-created') console.log(new Date().getTime(),'load-----app-created')
// NODE_ENV // NODE_ENV
let extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {}; this.extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {};
console.log(extConfig, "-----------extConfig"); console.log(this.extConfig, "-----------this.extConfig");
if (JSON.stringify(extConfig) == "{}") { if (JSON.stringify(this.extConfig) == "{}") {
let shopItem = { let shopItem = {
// development: { mixid: "IR8rkL", "shopid": 3813}, //道可测试1 // development: { mixid: "IR8rkL", "shopid": 3813}, //道可测试1
// development: { mixid: "iLntd3", "shopid": 3814}, //道可测试2 // development: { mixid: "iLntd3", "shopid": 3814}, //道可测试2
...@@ -39,14 +44,14 @@ export default { ...@@ -39,14 +44,14 @@ export default {
xhyx_prod: { "mixid":"xhyxshop", "shopid": 1 }, xhyx_prod: { "mixid":"xhyxshop", "shopid": 1 },
wly_prod: { "mixid":"WLYSWT", "shopid": 2 } wly_prod: { "mixid":"WLYSWT", "shopid": 2 }
} }
extConfig = shopItem[process.env.NODE_ENV]; this.extConfig = shopItem[process.env.NODE_ENV];
wx.setStorageSync("extConfig", JSON.stringify(extConfig));
} }
wx.setStorageSync("extConfig", JSON.stringify(this.extConfig));
console.log("1444444444", extConfig); console.log("extConfig->", this.extConfig);
this.$store.commit("setExtConfig", extConfig.mixid); this.$store.commit("setExtConfig", this.extConfig.mixid);
this.$store.commit('setExtConfigInfo', extConfig) this.$store.commit('setExtConfigInfo', this.extConfig)
// 调用API从本地缓存中获取数据 // 调用API从本地缓存中获取数据
/* /*
* 平台 api 差异的处理方式: api 方法统一挂载到 mpvue 名称空间, 平台判断通过 mpvuePlatform 特征字符串 * 平台 api 差异的处理方式: api 方法统一挂载到 mpvue 名称空间, 平台判断通过 mpvuePlatform 特征字符串
...@@ -70,12 +75,12 @@ export default { ...@@ -70,12 +75,12 @@ export default {
mpvue.setStorageSync("logs", logs); mpvue.setStorageSync("logs", logs);
} }
// 初始 // 初始
await this.getShopInfo(extConfig); await this.getShopInfo(this.extConfig);
// 页面配置信息 // 页面配置信息
this.getThemePage(extConfig); this.getThemePage(this.extConfig);
let mpApp = getApp(); let mpApp = getApp();
console.log(mpApp, "this.mpApp"); console.log(mpApp, "this.mpApp");
mpApp.getShopInfo = this.getShopInfo mpApp.getShopInfo = this.getShopInfo
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment