Sanakey
2021-02-06 a50a5b3b9a589356da21bfc55700d037e3f6dd27
pages/orderDetailEdit/orderDetailEdit.js
@@ -89,12 +89,12 @@
    //     utils.requestFail(errmsg,'/shopping/getEmployeePerformanceList.do');
    //   }
    // })
    detailId = options.doccode;
    formid = options.formid || '';
    console.log(detailId,formid);
  },
  getOrderDetail(){
    wx.showLoading();
@@ -130,7 +130,7 @@
          orderDetail: res.data,
          PayableAmount:res.data.PayableAmount,
          TransCosts:res.data.TransCosts,
          // orderStatus:
          // orderStatus:
        })
        this.newTotalMoney();
        orderStatus = res.data.StatusWhenSharing
@@ -146,7 +146,10 @@
  handleOrderData(){
    this.data.orderDetail
  },
  showDialog(){
    let dialogLayer =  this.selectComponent('#dialogLayer');
    dialogLayer.showDialog();
  },
  //立即购买
  goPay: function(e) {
    wx.navigateTo({
@@ -159,6 +162,31 @@
    let matcode = e.currentTarget.dataset.matcode;
    let rowid = e.currentTarget.dataset.rowid;
    let quantity = e.currentTarget.dataset.quantity;
    let index = e.currentTarget.dataset.index;
    let list = this.data.orderDetail.list;
    let skuIds = {}
    let data = {
        matcode,
        quantity,
        formid
      };
    if (list[index].skuId1){
      for (let i = 0; i < 10; i++) {
        let item = list[index]['skuId'+(i +1)];
        if (item){
          skuIds['skuId'+(i +1)] = list[index]['skuId'+(i +1)]
        } else{
          skuIds['skuId'+(i +1)] = ''
        }
      }
      console.log(skuIds);
      data = {
        matcode,
        quantity,
        formid,
        ...skuIds
      }
    }
    wx.showLoading();
    wx.request({
@@ -166,11 +194,7 @@
      header: {
        "Cookie": "JSESSIONID=" + wx.getStorageSync('sessionID')
      },
      data: {
        matcode,
        quantity,
        formid
      },
      data,
      success: res=> {
        wx.hideLoading();
        if(!utils.requestError(res)){
@@ -198,7 +222,7 @@
  //   })
  // },
  goReceipt: function(e) {
    wx.showLoading();
    wx.request({
      url: utils.getUrl('/shopping/orderReceipt.do'),
@@ -218,7 +242,7 @@
            title: '收货成功',
          })
        }
      },
      fail: function(errmsg) {
        utils.requestFail(errmsg,'/shopping/orderReceipt.do');
@@ -249,7 +273,7 @@
  //     },
  //     success: res => {
  //       utils.requestError(res);
  //       if (res.data.isLogin) {
  //         this.setData({
  //           cltcode:res.data.cltcode
@@ -336,7 +360,7 @@
    let price = e.detail.value;
    if(price.trim()==''||parseFloat(price)<0){
      price = 0;
    }
    // if(price<0){
    //   price = 0
@@ -393,7 +417,7 @@
          // console.log(this.data.orderDetail);
          this.handleRequest();
        }
      })
      })
    } catch (error) {
      console.log(error);
      this.handleRequest();
@@ -486,7 +510,7 @@
  //   //       utils.showModal(resData['error']['warning'],'提示',false);
  //   //       return false;
  //   //     }
  //   //   },
  //   //   fail: function ({ errMsg }) {
@@ -508,7 +532,7 @@
  //         // console.log(res.data)
  //         let data = JSON.parse(res.data);
  //         this.setData({
  //         })
  //         // wx.hideLoading()
  //         // wx.navigateTo({
@@ -527,7 +551,7 @@
  //   }
  // },
  // TotalMoney(){
  //   let total = this.orderDetail.TotalMoney + 1
@@ -609,6 +633,6 @@
      }
    }
    }
})