| @@ -1,12 +1,12 @@ | |||||
| const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {} | const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {} | ||||
| let weappId = extConfig.weappId; | |||||
| let weappId; | |||||
| let configUrls; | let configUrls; | ||||
| console.log(Object.keys(extConfig).length) | |||||
| if (Object.keys(extConfig).length == 0){ | if (Object.keys(extConfig).length == 0){ | ||||
| weappId = 'wx649b3be73c1afe47'; | weappId = 'wx649b3be73c1afe47'; | ||||
| configUrls = 'https://ctest.malls.iformall.com/C/api'; | configUrls = 'https://ctest.malls.iformall.com/C/api'; | ||||
| }else{ | }else{ | ||||
| configUrls = extConfig.attr.configUrl; | configUrls = extConfig.attr.configUrl; | ||||
| weappId = extConfig.weappId; | |||||
| } | } | ||||
| var config = { | var config = { | ||||
| url: configUrls, | url: configUrls, | ||||
| @@ -149,12 +149,12 @@ Page({ | |||||
| data: {} | data: {} | ||||
| }) | }) | ||||
| .then(res => { | .then(res => { | ||||
| console.log(res); | |||||
| if(res.code == 200){ | if(res.code == 200){ | ||||
| that.setData({ | that.setData({ | ||||
| showPage:true | showPage:true | ||||
| }) | }) | ||||
| } | } | ||||
| console.log(res.data.address); | |||||
| var reg = RegExp(/address/); | var reg = RegExp(/address/); | ||||
| if (res.data.address.match(reg)) { | if (res.data.address.match(reg)) { | ||||
| that.setData({ | that.setData({ | ||||
| @@ -198,6 +198,7 @@ Page({ | |||||
| } | } | ||||
| }) | }) | ||||
| .catch(error=>{ | .catch(error=>{ | ||||
| console.log(error) | |||||
| wx.showModal({ | wx.showModal({ | ||||
| title: '提示', | title: '提示', | ||||
| content: error.errMsg, | content: error.errMsg, | ||||
| @@ -103,8 +103,6 @@ Page({ | |||||
| */ | */ | ||||
| onShow: function() { | onShow: function() { | ||||
| let that = this; | let that = this; | ||||
| console.log(extConfig.appVersion) | |||||
| console.log(appVersion) | |||||
| that.setData({ | that.setData({ | ||||
| appVersion: extConfig.appVersion ? extConfig.appVersion : appVersion | appVersion: extConfig.appVersion ? extConfig.appVersion : appVersion | ||||
| }) | }) | ||||