xiaohuangmao 4 éve
szülő
commit
e8ae746042
2 módosított fájl, 10 hozzáadás és 8 törlés
  1. 6 5
      config.js
  2. 4 3
      pages/postage/postage.js

+ 6 - 5
config.js

@@ -5,7 +5,7 @@ let api = "https://www.xyzshops.cn/mobile/index.php";
 let app = getApp();
 function getReq(data, callback, method)
 {
-  let options = {
+  let options = { 
     client_type: 'mini'
   }
   data = Object.assign({}, options, data);
@@ -68,6 +68,7 @@ function buyVGoods(goods_id,goods_num, other, successCallback, failCallback)
     invoice_id: 0,
     ...other
   }
+  console.table(params)
 
   params = Object.assign({}, params);
   getReq(params, function (res) {
@@ -103,10 +104,10 @@ function buyVGoods(goods_id,goods_num, other, successCallback, failCallback)
         title: res.message,
         duration: 2000
       })
-      app.globalData.fcodeErr = res.message
-      setTimeout(() => {
-        wx.navigateBack()
-      }, 2000);
+      // app.globalData.fcodeErr = res.message
+      // setTimeout(() => {
+      //   wx.navigateBack()
+      // }, 2000);
     }
   })
 }

+ 4 - 3
pages/postage/postage.js

@@ -97,12 +97,13 @@ Page({
     //   title: `goods_id: ${this.data.goods_id}, card_no: ${this.data.card_no}`,
     //   duration: 2000
     // })
-    const { goods_id, card_no } = this.data
+    const { goods_id, card_no, card_type } = this.data
     if(!card_no){
       app.showToast('卡号不能为空')
       return
     }
     buyVGoods(goods_id,1,{ card_no,card_type }, (res) => {
+      console.table({card_no,card_type})
       // console.log('res',res)  成功回调
     }, (err) => {
       // 失败回调
@@ -122,10 +123,10 @@ Page({
   onShow: function () {
     if(!this.data.firstLoad) {
       const record = app.globalData.record || {}
-      const { card_no = '' } = record
+      const { card_no = '', card_type = '' } = record
       app.setFromSource(this.data.fromSource)
       if (record) {
-        this.setData({ card_no })
+        this.setData({ card_no, card_type })
       }
     }
   },