Commit 2a8be8f6 by songbingqi

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

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