|
@@ -88,7 +88,7 @@
|
|
|
<span>{{(calculate || 0)}}</span>
|
|
<span>{{(calculate || 0)}}</span>
|
|
|
</span>
|
|
</span>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="button" ng-controller="GoodsPickUpCtrl">
|
|
|
|
|
|
|
+ <div class="button">
|
|
|
<button class="btn btn-default btn-primary" @click="buyNow(false, commodity)">加入购物车</button>
|
|
<button class="btn btn-default btn-primary" @click="buyNow(false, commodity)">加入购物车</button>
|
|
|
<button class="btn btn-default btn-now" @click="buyNow(true, commodity)">立即购买</button>
|
|
<button class="btn btn-default btn-now" @click="buyNow(true, commodity)">立即购买</button>
|
|
|
</div>
|
|
</div>
|
|
@@ -214,7 +214,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
changeNum: function (newNum) {
|
|
changeNum: function (newNum) {
|
|
|
- let pack = this.commodity.perQty
|
|
|
|
|
|
|
+ let pack = this.commodity.perQty || this.commodity.minPackQty
|
|
|
let buy = this.commodity.minBuyQty
|
|
let buy = this.commodity.minBuyQty
|
|
|
let reserve = this.commodity.reserve
|
|
let reserve = this.commodity.reserve
|
|
|
if (newNum < buy) {
|
|
if (newNum < buy) {
|
|
@@ -258,12 +258,14 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
subNum () {
|
|
subNum () {
|
|
|
- let newNum = this.fragment.num - this.commodity.perQty
|
|
|
|
|
|
|
+ let pack = this.commodity.perQty || this.commodity.minPackQty
|
|
|
|
|
+ let newNum = this.fragment.num - pack
|
|
|
this.changeNum(newNum)
|
|
this.changeNum(newNum)
|
|
|
getFragment(this.commodity, this.fragment)
|
|
getFragment(this.commodity, this.fragment)
|
|
|
},
|
|
},
|
|
|
addNum () {
|
|
addNum () {
|
|
|
- let newNum = this.fragment.num + this.commodity.perQty
|
|
|
|
|
|
|
+ let pack = this.commodity.perQty || this.commodity.minPackQty
|
|
|
|
|
+ let newNum = this.fragment.num + pack
|
|
|
this.changeNum(newNum)
|
|
this.changeNum(newNum)
|
|
|
getFragment(this.commodity, this.fragment)
|
|
getFragment(this.commodity, this.fragment)
|
|
|
},
|
|
},
|