|
|
@@ -61,7 +61,7 @@
|
|
|
<span class="name">数 量</span>:
|
|
|
<div class="input-group" style="width: 120px">
|
|
|
<div class="input-group-addon operate" @click="subNum()" :disabled="!fragment.canAdd">-</div>
|
|
|
- <input type="text" class="form-control" placeholder="数量" v-model="fragment.num" @change="inputNum()"/>
|
|
|
+ <input type="text" class="form-control" placeholder="数量" v-model="fragment.num" @change="inputNum()"style="padding: 0;min-width: 100px;text-align: center;"/>
|
|
|
<div class="input-group-addon operate" @click="addNum()" :disabled="!fragment.canSub">+</div>
|
|
|
</div>
|
|
|
×
|
|
|
@@ -136,8 +136,6 @@ function initFragment (commodity) {
|
|
|
}
|
|
|
return fragment
|
|
|
}
|
|
|
-import axios from '~/plugins/axios'
|
|
|
-import {Message} from 'element-ui'
|
|
|
function getFragment (commodity, fragment) {
|
|
|
// 判断是否小于第一分段的起订量
|
|
|
if (commodity.prices[0].start > fragment.num) {
|
|
|
@@ -238,7 +236,7 @@ export default {
|
|
|
// this.$emit('buyAction', [{uuid: item.uuid, batchCode: item.batchCode, number: item.minBuyQty}])
|
|
|
if (isBuy) {
|
|
|
// this.$store.dispatch('user/getBuyInfo', [{uuid: item.uuid, batchCode: item.batchCode, number: item.minBuyQty}])
|
|
|
- axios.post('trade/order/buyNow', [{uuid: item.uuid, batchCode: item.batchCode, number: this.fragment.num}])
|
|
|
+ this.$http.post('trade/order/buyNow', [{uuid: item.uuid, batchCode: item.batchCode, number: this.fragment.num}])
|
|
|
.then(response => {
|
|
|
window.location.href = '/user#/order/pay/' + this.enidfilter(response.data.orderid)
|
|
|
}, err => {
|
|
|
@@ -251,16 +249,16 @@ export default {
|
|
|
})
|
|
|
} else {
|
|
|
// this.$store.dispatch('user/addCar', {uuid: item.uuid, batchCode: item.batchCode, number: item.minBuyQty})
|
|
|
- axios.post('trade/cart/add', {uuid: item.uuid, batchCode: item.batchCode, number: this.fragment.num})
|
|
|
+ this.$http.post('trade/cart/add', {uuid: item.uuid, batchCode: item.batchCode, number: this.fragment.num})
|
|
|
.then(response => {
|
|
|
console.log(response.data)
|
|
|
if (response.data.success) {
|
|
|
- Message({
|
|
|
+ this.$message({
|
|
|
message: '添加购物车成功',
|
|
|
type: 'success'
|
|
|
})
|
|
|
} else {
|
|
|
- Message.error(response.data.message)
|
|
|
+ this.$message.error(response.data.message)
|
|
|
// console.log(response.data.message)
|
|
|
}
|
|
|
})
|
|
|
@@ -342,14 +340,13 @@ export default {
|
|
|
<style scoped>
|
|
|
.container.commodity {
|
|
|
width: 1190px;
|
|
|
- padding-left: 0px;
|
|
|
- padding-right: 0px;
|
|
|
- font-family: "Microsoft Yahei", "微软雅黑";
|
|
|
+ padding-left: 0;
|
|
|
+ padding-right: 0;
|
|
|
}
|
|
|
.commodity .commodity-detail {
|
|
|
width: 100%;
|
|
|
display: inline-block;
|
|
|
- font-size: 0px;
|
|
|
+ font-size: 0;
|
|
|
}
|
|
|
|
|
|
.commodity-detail .img{
|
|
|
@@ -386,7 +383,6 @@ export default {
|
|
|
|
|
|
.commodity-detail .content .com-info {
|
|
|
font-size: 14px;
|
|
|
- font-family: "Microsoft Yahei", "微软雅黑";
|
|
|
line-height: 26px;
|
|
|
}
|
|
|
|
|
|
@@ -403,13 +399,13 @@ export default {
|
|
|
}
|
|
|
|
|
|
.input-group .input-group-operate:last-child {
|
|
|
- border-bottom-left-radius: 0px;
|
|
|
- border-top-left-radius: 0px;
|
|
|
+ border-bottom-left-radius: 0;
|
|
|
+ border-top-left-radius: 0;
|
|
|
}
|
|
|
|
|
|
.input-group .input-group-operate:first-child {
|
|
|
- border-bottom-right-radius: 0px;
|
|
|
- border-top-right-radius: 0px;
|
|
|
+ border-bottom-right-radius: 0;
|
|
|
+ border-top-right-radius: 0;
|
|
|
}
|
|
|
|
|
|
.content .com-info .name {
|