|
@@ -318,19 +318,19 @@ const seeDetail = new Vue({
|
|
|
},
|
|
|
//修改sku
|
|
|
handleChangeSku(row){
|
|
|
- console.log('skuId',row.skuId)
|
|
|
+ const _this = this
|
|
|
let skus = row.skus
|
|
|
console.log('skus',skus)
|
|
|
skus.forEach((sku)=>{
|
|
|
if(row.skuId === sku.skuId){
|
|
|
if(sku.ladderPriceFlag === 1){
|
|
|
- row.price = sku.ladderPriceList[0].buyPrice
|
|
|
+ row.price = _this.handeleToFixed(sku.ladderPriceList[0].buyPrice)
|
|
|
row.count = sku.minBuyNumber
|
|
|
row.minBuyNumber = sku.minBuyNumber
|
|
|
row.ladderPriceFlag = sku.ladderPriceFlag
|
|
|
row.ladderPriceList = sku.ladderPriceList
|
|
|
}else{
|
|
|
- row.price = sku.price
|
|
|
+ row.price = _this.handeleToFixed(sku.price)
|
|
|
row.count = sku.minBuyNumber
|
|
|
row.minBuyNumber = sku.minBuyNumber
|
|
|
row.ladderPriceFlag = sku.ladderPriceFlag
|
|
@@ -341,29 +341,34 @@ const seeDetail = new Vue({
|
|
|
},
|
|
|
// 修改数量判断阶梯价
|
|
|
handleChangeNumber(row){
|
|
|
+ const _this = this
|
|
|
if (row.count < row.minBuyNumber) {
|
|
|
row.count = row.minBuyNumber
|
|
|
if (row.ladderPriceFlag === 1) {
|
|
|
row.ladderPriceList.forEach((item) => {
|
|
|
if (row.count >= item.buyNum) {
|
|
|
- row.price = item.buyPrice
|
|
|
+ row.price = _this.handeleToFixed(item.buyPrice)
|
|
|
}
|
|
|
})
|
|
|
} else {
|
|
|
- row.price = row.price
|
|
|
+ row.price = _this.handeleToFixed(row.price)
|
|
|
}
|
|
|
} else {
|
|
|
if (row.ladderPriceFlag === 1) {
|
|
|
row.ladderPriceList.forEach((item) => {
|
|
|
if (row.count >= item.buyNum) {
|
|
|
- row.price = item.buyPrice
|
|
|
+ row.price = _this.handeleToFixed(item.buyPrice)
|
|
|
}
|
|
|
})
|
|
|
} else {
|
|
|
- row.price = row.price
|
|
|
+ row.price = _this.handeleToFixed(row.price)
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ // 保留小数点后两位数
|
|
|
+ handeleToFixed(value){
|
|
|
+ return value.toFixed(2)
|
|
|
+ },
|
|
|
//确认选择商品
|
|
|
handleAddProConfirm(){
|
|
|
this.checkedProductList = [...this.checkedProductList,...this.productRadio]
|
|
@@ -420,6 +425,7 @@ const seeDetail = new Vue({
|
|
|
const data = response.data
|
|
|
_this.productsList = data.results.map((pros)=>{
|
|
|
pros.count = pros.minBuyNumber
|
|
|
+ pros.price = _this.handeleToFixed(pros.price)
|
|
|
return pros
|
|
|
})
|
|
|
_this.total = data.totalRecord
|