zhashaonan преди 7 години
родител
ревизия
475ae08b88
променени са 3 файла, в които са добавени 15 реда и са изтрити 4 реда
  1. 2 1
      app.js
  2. 4 1
      pages/confirmOrder/confirmOrder.js
  3. 9 2
      pages/details/details.js

+ 2 - 1
app.js

@@ -112,7 +112,8 @@ App({
       unionid:''
     },
     userInfo: {},
-    defaultAddress: null
+    defaultAddress: null,
+    fcodeErr: ''
   },
   checkDefaultAddress(address) {
     this.globalData.defaultAddress = address

+ 4 - 1
pages/confirmOrder/confirmOrder.js

@@ -73,12 +73,15 @@ Page({
 
       }
       else {
+        
         wx.showToast({
           icon: 'none',
           title: res.message,
           duration: 2000
         })
-        wx.navigateBack()
+        appInstance.globalData.fcodeErr = res.message
+        wx.navigateBack()      
+
       }
     }, function () {
       wx.navigateBack()

+ 9 - 2
pages/details/details.js

@@ -1,6 +1,6 @@
 // pages/details/details.js
 const getReq = require('./../../config.js').getReq
-
+let appInstance = getApp()
 Page({
 
   /**
@@ -217,7 +217,14 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
-
+    if (appInstance.globalData.fcodeErr) {
+      wx.showToast({
+        icon: 'none',
+        title: appInstance.globalData.fcodeErr,
+        duration: 2000
+      })
+      appInstance.globalData.fcodeErr = ''
+    }
   },
 
   /**