Kaynağa Gözat

数据处理

kk.shi 3 yıl önce
ebeveyn
işleme
231a74262a
2 değiştirilmiş dosya ile 24 ekleme ve 107 silme
  1. 23 106
      pages/integral/integral.js
  2. 1 1
      pages/integral/integral.wxml

+ 23 - 106
pages/integral/integral.js

@@ -605,26 +605,15 @@ paymentClick() {
                     }
                     // this.getPaySend()
                 } else {
-                    console.log(res.data.message)
+                    console.log(res.message)
                     console.log(this.data.integralNum,this.data.mobile,JSON.stringify(data))
                     // log.error(`${res.data.message}`)
                     // log.error(`${this.data.integralNum},${this.data.mobile},${JSON.stringify(data)}`)
-                    this.setData({
-                        showToastObj: {
-                            icon: 'iconSueecss',
-                            title: res.data.message,
-                            status: true
-                        }
+                   
+                    wx.showToast({
+                        icon: 'none',
+                        title: res.message
                     })
-                    setTimeout(() => {
-                        this.setData({
-                            showToastObj: {
-                                icon: 'iconSueecss',
-                                title: res.data.message,
-                                status: false
-                            }
-                        })
-                    }, 2500)
                 }
 
             }).catch(error=>{
@@ -685,22 +674,10 @@ paymentClick() {
                         })
                     } else {
                         wx.hideLoading();
-                        this.setData({
-                            showToastObj: {
-                                icon: 'iconSueecss',
-                                title: res.message,
-                                status: true
-                            }
+                        wx.showToast({
+                            icon: 'none',
+                            title: res.message
                         })
-                        setTimeout(() => {
-                            this.setData({
-                                showToastObj: {
-                                    icon: 'iconSueecss',
-                                    title: res.message,
-                                    status: false
-                                }
-                            })
-                        }, 2500)
                     }
             }).catch(error => {
                 let res = error.data;
@@ -728,22 +705,10 @@ paymentClick() {
                     })
                     this.codeSetInterval(60)
                 } else {
-                    this.setData({
-                        showToastObj: {
-                            icon: 'iconSueecss',
-                            title: res.message,
-                            status: true
-                        }
+                    wx.showToast({
+                        icon: 'none',
+                        title: res.message
                     })
-                    setTimeout(() => {
-                        this.setData({
-                            showToastObj: {
-                                icon: 'iconSueecss',
-                                title: res.message,
-                                status: false
-                            }
-                        })
-                    }, 2500)
                 }
             }).catch(error => {
                let res = error.data;
@@ -793,22 +758,10 @@ paymentClick() {
                             })
                             this.codeSetInterval(60)
                         } else {
-                            this.setData({
-                                showToastObj: {
-                                    icon: 'iconSueecss',
-                                    title: res.message,
-                                    status: true
-                                }
+                            wx.showToast({
+                                icon: 'none',
+                                title: res.message
                             })
-                            setTimeout(() => {
-                                this.setData({
-                                    showToastObj: {
-                                        icon: 'iconSueecss',
-                                        title: res.message,
-                                        status: false
-                                    }
-                                })
-                            }, 2500)
                         }
                 }).catch(error=>{
                     console.log('duanxin')
@@ -835,22 +788,10 @@ paymentClick() {
                         obj.date = Math.round(new Date().getTime() / 1000).toString()
                         wx.setStorageSync('orderDetails', JSON.stringify(obj))
                     } else {
-                        this.setData({
-                            showToastObj: {
-                                icon: 'iconSueecss',
-                                title: res.message,
-                                status: true
-                            }
+                        wx.showToast({
+                            icon: 'none',
+                            title: res.message
                         })
-                        setTimeout(() => {
-                            this.setData({
-                                showToastObj: {
-                                    icon: 'iconSueecss',
-                                    title: res.message,
-                                    status: false
-                                }
-                            })
-                        }, 2500)
                     }
             }).catch(error=>{
                 console.log('chongxin')
@@ -867,22 +808,10 @@ paymentClick() {
                             this.codeName = '60s后重新获取'
                             this.codeSetInterval(60)
                         } else {
-                            this.setData({
-                                showToastObj: {
-                                    icon: 'iconSueecss',
-                                    title: res.message,
-                                    status: true
-                                }
+                            wx.showToast({
+                                icon: 'none',
+                                title: res.message
                             })
-                            setTimeout(() => {
-                                this.setData({
-                                    showToastObj: {
-                                        icon: 'iconSueecss',
-                                        title: res.message,
-                                        status: false
-                                    }
-                                })
-                            }, 2500)
                         }
                 }).catch(error=>{
                     console.log('chongxin')
@@ -901,22 +830,10 @@ paymentClick() {
                             })
                             this.codeSetInterval(60)
                         } else {
-                            this.setData({
-                                showToastObj: {
-                                    icon: 'iconSueecss',
-                                    title: res.message,
-                                    status: true
-                                }
+                            wx.showToast({
+                                icon: 'none',
+                                title: res.message
                             })
-                            setTimeout(() => {
-                                this.setData({
-                                    showToastObj: {
-                                        icon: 'iconSueecss',
-                                        title: res.message,
-                                        status: false
-                                    }
-                                })
-                            }, 2500)
                         }
                 }).catch(error=>{
                     console.log('chongxin')

+ 1 - 1
pages/integral/integral.wxml

@@ -171,7 +171,7 @@
         <text class="payment-iconfont payment-iconyanzhengma payment-code-input-text"></text>
         <input type="payment-number" model:value="{{active1code}}" focus="true" maxlength="6" placeholder="输入6位数验证码" />
       </view>
-      <view class="payment-code-input" wx:if="{{activeNum === 1}}">
+      <view class="payment-code-input" wx:elif="{{activeNum === 1}}">
         <text class="payment-iconfont payment-iconyanzhengma payment-code-input-text"></text>
         <input type="payment-number" model:value="{{active2code}}" focus="true" maxlength="6" placeholder="输入6位数验证码" />
       </view>