|
@@ -111,6 +111,9 @@ Page({
|
|
|
}
|
|
|
}).catch(error=>{
|
|
|
console.log(error);
|
|
|
+ if (error.data.code === '2000') {
|
|
|
+ this.scoreClick()
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
},
|
|
@@ -420,51 +423,57 @@ getphoneClick() {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- } else {
|
|
|
- this.setData({
|
|
|
- loading: true,
|
|
|
- bgStatus: true
|
|
|
- })
|
|
|
-
|
|
|
- setTimeout(() => {
|
|
|
- // #ifdef H5
|
|
|
- window.location.href = arr.message;
|
|
|
- // #endif
|
|
|
-
|
|
|
- // #ifdef MP-WEIXIN
|
|
|
- const version = wx.getSystemInfoSync().SDKVersion
|
|
|
-
|
|
|
- if (this.compareVersion(version, '2.20.1') >= 0) {
|
|
|
- wx.openEmbeddedMiniProgram({
|
|
|
- appId: arr.data.appId,
|
|
|
- path: arr.data.path,
|
|
|
- extraData: arr.data.extraData,
|
|
|
- success(res) {
|
|
|
- // 打开成功
|
|
|
- },
|
|
|
- fail() {}
|
|
|
- })
|
|
|
- } else {
|
|
|
- // 如果希望用户在最新版本的客户端上体验您的小程序,可以这样子提示
|
|
|
- wx.navigateToMiniProgram({
|
|
|
- appId: arr.data.appId,
|
|
|
- path: arr.data.path,
|
|
|
- extraData: arr.data.extraData,
|
|
|
- success(res) {
|
|
|
- // 打开成功
|
|
|
- },
|
|
|
- fail() {
|
|
|
-
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- // #endif
|
|
|
- this.hideModal()
|
|
|
- this.loading = false
|
|
|
- }, 4000)
|
|
|
- }
|
|
|
+ }
|
|
|
}).catch(error => {
|
|
|
console.log(error)
|
|
|
+ let arr = error.data
|
|
|
+ console.log(arr)
|
|
|
+ if(arr.code ==='2000'){
|
|
|
+ this.setData({
|
|
|
+ scorePhone: false,
|
|
|
+ loading: true,
|
|
|
+ bgStatus: true
|
|
|
+ })
|
|
|
+
|
|
|
+ setTimeout(() => {
|
|
|
+ // #ifdef H5
|
|
|
+ // window.location.href = arr.message;
|
|
|
+ // #endif
|
|
|
+
|
|
|
+ // #ifdef MP-WEIXIN
|
|
|
+ const version = wx.getSystemInfoSync().SDKVersion
|
|
|
+
|
|
|
+ if (this.compareVersion(version, '2.20.1') >= 0) {
|
|
|
+ wx.openEmbeddedMiniProgram({
|
|
|
+ appId: arr.data.appId,
|
|
|
+ path: arr.data.path,
|
|
|
+ extraData: arr.data.extraData,
|
|
|
+ success(res) {
|
|
|
+ // 打开成功
|
|
|
+ },
|
|
|
+ fail() {}
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ // 如果希望用户在最新版本的客户端上体验您的小程序,可以这样子提示
|
|
|
+ wx.navigateToMiniProgram({
|
|
|
+ appId: arr.data.appId,
|
|
|
+ path: arr.data.path,
|
|
|
+ extraData: arr.data.extraData,
|
|
|
+ success(res) {
|
|
|
+ // 打开成功
|
|
|
+ },
|
|
|
+ fail() {
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // #endif
|
|
|
+ this.hideModal()
|
|
|
+ this.setData({
|
|
|
+ loading: false
|
|
|
+ })
|
|
|
+ }, 4000)
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
},
|
|
@@ -874,6 +883,31 @@ paymentClick() {
|
|
|
wx.navigateTo({
|
|
|
url: '../integral/exchange?obj=' + JSON.stringify(obj)
|
|
|
})
|
|
|
- }
|
|
|
+ },
|
|
|
+ compareVersion(v1, v2) {
|
|
|
+ v1 = v1.split('.')
|
|
|
+ v2 = v2.split('.')
|
|
|
+ const len = Math.max(v1.length, v2.length)
|
|
|
+
|
|
|
+ while (v1.length < len) {
|
|
|
+ v1.push('0')
|
|
|
+ }
|
|
|
+ while (v2.length < len) {
|
|
|
+ v2.push('0')
|
|
|
+ }
|
|
|
+
|
|
|
+ for (let i = 0; i < len; i++) {
|
|
|
+ const num1 = parseInt(v1[i])
|
|
|
+ const num2 = parseInt(v2[i])
|
|
|
+
|
|
|
+ if (num1 > num2) {
|
|
|
+ return 1
|
|
|
+ } else if (num1 < num2) {
|
|
|
+ return -1
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return 0
|
|
|
+ },
|
|
|
|
|
|
})
|