|
@@ -18,23 +18,37 @@
|
|
|
})
|
|
})
|
|
|
} else {
|
|
} else {
|
|
|
if (this.item) {
|
|
if (this.item) {
|
|
|
- console.log(this.item)
|
|
|
|
|
- // this.$emit('buyAction', [{uuid: item.uuid, batchCode: item.batchCode, number: item.minBuyQty}])
|
|
|
|
|
if (isBuy) {
|
|
if (isBuy) {
|
|
|
- // this.$store.dispatch('user/getBuyInfo', [{uuid: item.uuid, batchCode: item.batchCode, number: item.minBuyQty}])
|
|
|
|
|
this.$http.post('trade/order/buyNow', [{
|
|
this.$http.post('trade/order/buyNow', [{
|
|
|
uuid: this.item.uuid,
|
|
uuid: this.item.uuid,
|
|
|
batchCode: this.item.batchCode,
|
|
batchCode: this.item.batchCode,
|
|
|
number: this.item.minBuyQty,
|
|
number: this.item.minBuyQty,
|
|
|
storeid: this.item.storeid,
|
|
storeid: this.item.storeid,
|
|
|
- currencyName: this.item.currencyName
|
|
|
|
|
|
|
+ storeUuid: this.item.storeid,
|
|
|
|
|
+ currencyName: this.item.currencyName,
|
|
|
|
|
+ minPackQty: this.item.minPackQty
|
|
|
}])
|
|
}])
|
|
|
.then(response => {
|
|
.then(response => {
|
|
|
// window.location.href = '/user#/order/pay/' + this.enidfilter(response.data.orderid)
|
|
// window.location.href = '/user#/order/pay/' + this.enidfilter(response.data.orderid)
|
|
|
- if (response.data.message) {
|
|
|
|
|
- this.$message.error(response.data.message)
|
|
|
|
|
|
|
+ if (response.data.success) {
|
|
|
|
|
+ if (response.data.message) {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ message: response.data.message,
|
|
|
|
|
+ type: 'success'
|
|
|
|
|
+ })
|
|
|
|
|
+ let _self = this
|
|
|
|
|
+ window.setTimeout(function () {
|
|
|
|
|
+ window.location.href = '/user#/order/pay/' + _self.enidfilter(response.data.data.orderid)
|
|
|
|
|
+ }, 1000)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ window.location.href = '/user#/order/pay/' + this.enidfilter(response.data.data.orderid)
|
|
|
|
|
+ }
|
|
|
} else {
|
|
} else {
|
|
|
- window.location.href = '/user#/order/pay/' + this.enidfilter(response.data.data.orderid)
|
|
|
|
|
|
|
+ if (response.data.data && response.data.data.unvailable === 1) {
|
|
|
|
|
+ this.$message.error('产品信息已失效')
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.error(response.data.message)
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}, err => {
|
|
}, err => {
|
|
|
console.log(err)
|
|
console.log(err)
|
|
@@ -46,13 +60,15 @@
|
|
|
batchCode: this.item.batchCode,
|
|
batchCode: this.item.batchCode,
|
|
|
number: this.item.minBuyQty,
|
|
number: this.item.minBuyQty,
|
|
|
storeid: this.item.storeid,
|
|
storeid: this.item.storeid,
|
|
|
- currencyName: this.item.currencyName
|
|
|
|
|
|
|
+ storeUuid: this.item.storeid,
|
|
|
|
|
+ currencyName: this.item.currencyName,
|
|
|
|
|
+ minPackQty: this.item.minPackQty
|
|
|
})
|
|
})
|
|
|
.then(response => {
|
|
.then(response => {
|
|
|
if (response.data.success) {
|
|
if (response.data.success) {
|
|
|
if (response.data.message) {
|
|
if (response.data.message) {
|
|
|
this.$message({
|
|
this.$message({
|
|
|
- message: response.data.message,
|
|
|
|
|
|
|
+ message: '添加购物车成功,但商品信息有更新',
|
|
|
type: 'success'
|
|
type: 'success'
|
|
|
})
|
|
})
|
|
|
} else {
|
|
} else {
|
|
@@ -63,7 +79,6 @@
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
this.$message.error(response.data.message)
|
|
this.$message.error(response.data.message)
|
|
|
- // console.log(response.data.message)
|
|
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|