Browse Source

确认页立即购买

yangc 7 years ago
parent
commit
4a4859fc7e
2 changed files with 4 additions and 4 deletions
  1. 1 1
      components/applyPurchase/BatchPublish.vue
  2. 3 3
      utils/baseUtils.js

+ 1 - 1
components/applyPurchase/BatchPublish.vue

@@ -1038,7 +1038,7 @@
         this.onInput(index)
       },
       buyNow: function (goods, index) {
-        this.baseUtils.buyOrCar(true, null, this, goods)
+        this.baseUtils.buyOrCar(true, null, this, goods, null, this.fragments[index].num)
       },
       linkSaler: function (commodity) {
         this.baseUtils.goLinkUser(this, commodity.enUU)

+ 3 - 3
utils/baseUtils.js

@@ -7,7 +7,7 @@ const NULL_ARR = ['空', '没', '无', '-', '—', 'null', '#N/A']
  *  $this: 当前对象
  *  item: 操作对象
  * */
-const _buyOrCar = function (isBuy, event, $this, item, url = '/user#/order/pay/') {
+const _buyOrCar = function (isBuy, event, $this, item, url = '/user#/order/pay/', buyCount) {
   if (event) event.stopPropagation()
   if (!$this.$store.state.option.user.logged) {
     $this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
@@ -21,7 +21,7 @@ const _buyOrCar = function (isBuy, event, $this, item, url = '/user#/order/pay/'
         $this.$http.post('/trade/order/buyNow', [{
           uuid: item.uuid,
           batchCode: item.batchCode,
-          number: item.minBuyQty,
+          number: buyCount || item.minBuyQty,
           storeid: item.storeid ? item.storeid : item.storeId,
           storeUuid: item.storeid ? item.storeid : item.storeId,
           currencyName: item.currencyName,
@@ -59,7 +59,7 @@ const _buyOrCar = function (isBuy, event, $this, item, url = '/user#/order/pay/'
         $this.$http.post('/trade/cart/add', {
           uuid: item.uuid,
           batchCode: item.batchCode,
-          number: item.minBuyQty,
+          number: buyCount || item.minBuyQty,
           storeid: item.storeid ? item.storeid : item.storeId,
           storeUuid: item.storeid ? item.storeid : item.storeId,
           currencyName: item.currencyName,