许成详 6 年前
父节点
当前提交
cd78150b23
共有 2 个文件被更改,包括 42 次插入37 次删除
  1. 41
    36
      src/pages/user/placeOrder/index.vue
  2. 1
    1
      src/pages/user/placeOrderDetail/index.vue

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

@@ -95,6 +95,7 @@ export default {
95 95
   data () {
96 96
     const _self = this
97 97
     return {
98
+      ajaxOff: true,
98 99
       postData: {
99 100
         info: {
100 101
           CaseId: decodeURI(_self.$route.query.caseid),
@@ -274,44 +275,48 @@ export default {
274 275
       })
275 276
     },
276 277
     placeOrder (Remark) { // 下单
277
-      this.postData.info.OrgId = this.orgId
278
-      this.postData.info.UserId = this.userInfo.CustomerId
279
-      this.postData.info.UserName = this.userInfo.customer.CustomerName
280
-      this.postData.info.PayType = 'sys user'
281
-      this.postData.info.Remark = Remark
282
-      var orderInfo = this.selGoods
283
-      this.postData.detail = []
284
-      var amount = 0
285
-      var num = 0
286
-      for (var n = 0; n < orderInfo.length; n++) {
287
-        this.postData.detail.push({
288
-          GoodsId: orderInfo[n].id,
289
-          GoodsName: orderInfo[n].name,
290
-          SpecId: orderInfo[n].spec,
291
-          SpecName: orderInfo[n].specname,
292
-          Number: orderInfo[n].num - 0,
293
-          Price: String(orderInfo[n].price - 0),
278
+      if(this.ajaxOff){
279
+        this.ajaxOff = false
280
+        this.postData.info.OrgId = this.orgId
281
+        this.postData.info.UserId = this.userInfo.CustomerId
282
+        this.postData.info.UserName = this.userInfo.customer.CustomerName
283
+        this.postData.info.PayType = 'sys user'
284
+        this.postData.info.Remark = Remark
285
+        var orderInfo = this.selGoods
286
+        this.postData.detail = []
287
+        var amount = 0
288
+        var num = 0
289
+        for (var n = 0; n < orderInfo.length; n++) {
290
+          this.postData.detail.push({
291
+            GoodsId: orderInfo[n].id,
292
+            GoodsName: orderInfo[n].name,
293
+            SpecId: orderInfo[n].spec,
294
+            SpecName: orderInfo[n].specname,
295
+            Number: orderInfo[n].num - 0,
296
+            Price: String(orderInfo[n].price - 0),
297
+          })
298
+          amount += (orderInfo[n].price - 0) * orderInfo[n].num
299
+          num += orderInfo[n].num - 0
300
+        }
301
+        this.postData.info.Amount = String(amount)
302
+        this.postData.info.OrdersNum = num
303
+        // console.log(JSON.stringify(this.postData))
304
+        this.toPay({
305
+          info: JSON.stringify(this.postData.info),
306
+          detail: JSON.stringify(this.postData.detail),
307
+          coupon: JSON.stringify(this.postData.coupon)
308
+        }).then((res) => {
309
+          this.ajaxOff = true
310
+          this.showCalcMenu = false
311
+          this.showSuccessPopup = true
312
+          // this.$dialog.alert({
313
+          //   message: '下单成功!',
314
+          //   confirmButtonText: '返回等待'
315
+          // }).then(() => {
316
+
317
+          // })
294 318
         })
295
-        amount += (orderInfo[n].price - 0) * orderInfo[n].num
296
-        num += orderInfo[n].num - 0
297 319
       }
298
-      this.postData.info.Amount = String(amount)
299
-      this.postData.info.OrdersNum = num
300
-      // console.log(JSON.stringify(this.postData))
301
-      this.toPay({
302
-        info: JSON.stringify(this.postData.info),
303
-        detail: JSON.stringify(this.postData.detail),
304
-        coupon: JSON.stringify(this.postData.coupon)
305
-      }).then((res) => {
306
-        this.showCalcMenu = false
307
-        this.showSuccessPopup = true
308
-        // this.$dialog.alert({
309
-        //   message: '下单成功!',
310
-        //   confirmButtonText: '返回等待'
311
-        // }).then(() => {
312
-
313
-        // })
314
-      })
315 320
     },
316 321
     popBack () {
317 322
       this.showSuccessPopup = false

+ 1
- 1
src/pages/user/placeOrderDetail/index.vue 查看文件

@@ -245,7 +245,7 @@ export default {
245 245
           //   window.history.go(-2)
246 246
           // })
247 247
         }).catch(() => {
248
-          this.ajaxoff = true
248
+          // this.ajaxoff = true
249 249
         })
250 250
       }
251 251
     },