瀏覽代碼

bug修改

wangfei 6 年之前
父節點
當前提交
050eefb6b9
共有 1 個檔案被更改,包括 50 行新增36 行删除
  1. 50
    36
      src/pages/user/placeOrder/index.vue

+ 50
- 36
src/pages/user/placeOrder/index.vue 查看文件

@@ -144,7 +144,8 @@ export default {
144 144
         freeModeMomentumVelocityRatio: 2,
145 145
       },
146 146
       selGoods: [],
147
-      showSuccessPopup: false
147
+      showSuccessPopup: false,
148
+      ordersid: '',
148 149
     }
149 150
   },
150 151
   computed: {
@@ -254,6 +255,7 @@ export default {
254 255
               this.ajaxOff = true
255 256
               this.$router.push({ name: 'placeOrderDetail', query: { info: JSON.stringify(this.selGoods), caseid: encodeURI(this.caseId), areaid: encodeURI(this.areaId), areaname: encodeURI(this.areaName), areaid: encodeURI(this.areaId), tableid: encodeURI(this.tableId), tableno: encodeURI(this.tableNo), ordersid: res.OrdersId } })
256 257
             } else {
258
+              this.ordersid = res.OrdersId
257 259
               this.showCalcMenu = true
258 260
             }
259 261
           }).catch(() => {
@@ -319,49 +321,61 @@ export default {
319 321
     placeOrder (Remark) { // 下单
320 322
       if (this.ajaxOff) {
321 323
         this.ajaxOff = false
322
-        this.postData.info.OrgId = this.orgId
323
-        this.postData.info.UserId = this.userInfo.CustomerId
324
-        this.postData.info.UserName = this.userInfo.customer.CustomerName
325
-        this.postData.info.PayType = 'sys user'
326
-        this.postData.info.Remark = Remark
327
-        this.postData.from = sessionStorage.getItem('from') ? sessionStorage.getItem('from') : ''
328
-        var orderInfo = this.selGoods
329
-        this.postData.detail = []
330
-        var amount = 0
331
-        var num = 0
332
-        for (var n = 0; n < orderInfo.length; n++) {
333
-          this.postData.detail.push({
334
-            GoodsId: orderInfo[n].id,
335
-            GoodsName: orderInfo[n].name,
336
-            SpecId: orderInfo[n].spec,
337
-            SpecName: orderInfo[n].specname,
338
-            Number: orderInfo[n].num - 0,
339
-            Price: String(orderInfo[n].price - 0),
340
-          })
341
-          amount += (orderInfo[n].price - 0) * orderInfo[n].num
342
-          num += orderInfo[n].num - 0
343
-        }
344
-        this.postData.info.Amount = String(amount)
345
-        this.postData.info.OrdersNum = num
346
-        // console.log(JSON.stringify(this.postData))
347 324
         this.toPay({
348
-          info: JSON.stringify(this.postData.info),
349
-          detail: JSON.stringify(this.postData.detail),
350
-          customercouponid: '',
351
-          from: this.postData.from
325
+          id: this.ordersid,
326
+          remark: Remark,
352 327
         }).then((res) => {
353 328
           this.ajaxOff = true
354 329
           this.showCalcMenu = false
355 330
           this.showSuccessPopup = true
356
-          // this.$dialog.alert({
357
-          //   message: '下单成功!',
358
-          //   confirmButtonText: '返回等待'
359
-          // }).then(() => {
360
-
361
-          // })
362 331
         }).catch(() => {
363 332
           this.ajaxOff = true
364 333
         })
334
+
335
+
336
+        // this.postData.info.OrgId = this.orgId
337
+        // this.postData.info.UserId = this.userInfo.CustomerId
338
+        // this.postData.info.UserName = this.userInfo.customer.CustomerName
339
+        // this.postData.info.PayType = 'sys user'
340
+        // this.postData.info.Remark = Remark
341
+        // this.postData.from = sessionStorage.getItem('from') ? sessionStorage.getItem('from') : ''
342
+        // var orderInfo = this.selGoods
343
+        // this.postData.detail = []
344
+        // var amount = 0
345
+        // var num = 0
346
+        // for (var n = 0; n < orderInfo.length; n++) {
347
+        //   this.postData.detail.push({
348
+        //     GoodsId: orderInfo[n].id,
349
+        //     GoodsName: orderInfo[n].name,
350
+        //     SpecId: orderInfo[n].spec,
351
+        //     SpecName: orderInfo[n].specname,
352
+        //     Number: orderInfo[n].num - 0,
353
+        //     Price: String(orderInfo[n].price - 0),
354
+        //   })
355
+        //   amount += (orderInfo[n].price - 0) * orderInfo[n].num
356
+        //   num += orderInfo[n].num - 0
357
+        // }
358
+        // this.postData.info.Amount = String(amount)
359
+        // this.postData.info.OrdersNum = num
360
+        // // console.log(JSON.stringify(this.postData))
361
+        // this.toPay({
362
+        //   info: JSON.stringify(this.postData.info),
363
+        //   detail: JSON.stringify(this.postData.detail),
364
+        //   customercouponid: '',
365
+        //   from: this.postData.from
366
+        // }).then((res) => {
367
+        //   this.ajaxOff = true
368
+        //   this.showCalcMenu = false
369
+        //   this.showSuccessPopup = true
370
+        //   // this.$dialog.alert({
371
+        //   //   message: '下单成功!',
372
+        //   //   confirmButtonText: '返回等待'
373
+        //   // }).then(() => {
374
+
375
+        //   // })
376
+        // }).catch(() => {
377
+        //   this.ajaxOff = true
378
+        // })
365 379
       }
366 380
     },
367 381
     popBack () {