Commit 2a8be8f6 by songbingqi

修复订单详情再来一单数量/报错问题

parent f9e2d711
......@@ -250,7 +250,7 @@ export default {
let shopCarNum = (type=='add'?1:0)
shopCarInfo.forEach(item=> shopCarNum+=item.num)
let countOfOrder = uni.getStorageSync('countOfOrder');
if ((this.size + shopCarNum) <= countOfOrder) {
if ((Number(this.size) + Number(shopCarNum)) <= countOfOrder) {
return true
} else {
this.showToast({
......@@ -368,7 +368,7 @@ export default {
.topBar{
// border: 1px solid red;
position: fixed;
z-index: 10;
z-index: 99999999;
width: 100%;
display: flex;
align-items: center;
......
......@@ -174,7 +174,7 @@ export default {
const numObj = {}
const { id, shopId, orderDetails } = item;
orderDetails.forEach(item => {
orderDe = tails[item.skuId] = item.num
orderDetails[item.skuId] = Number(item.num)
})
const { data } = await Order.moreOrder({ orderId: id, shopId });
if(!data || !data.data){
......
......@@ -95,11 +95,12 @@ export default {
}
},
onShow() {
// this.getList()
console.log(1)
this.getList()
},
mounted() {
this.orderBottom = uni.getStorageSync('orderBottom')
this.getList()
// this.getList()
},
computed: {
userms() {
......@@ -148,7 +149,7 @@ export default {
const numObj = {}
const { id, shopId, orderDetails } = item;
orderDetails.forEach(item => {
orderDetails[item.skuId] = item.num
orderDetails[item.skuId] = Number(item.num)
})
const { data } = await order.moreOrder({ orderId: id, shopId });
if(!data || !data.data){
......
......@@ -63,7 +63,7 @@ export default {
if (shopCarInfo) {
let currentGoods = shopCarInfo.find((v) => v.goodsId == Obj.goodsId && v.skuId == Obj.skuId);
if (currentGoods) {
currentGoods.num += 1;
currentGoods.num += Obj.num;
} else {
shopCarInfo.push(Obj);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment