增加确认订单页面菜品折叠,修改商品购物车数量显示

This commit is contained in:
2025-12-24 14:40:29 +08:00
parent a4580bdd1c
commit e1000c6b40
4 changed files with 101 additions and 41 deletions

View File

@@ -40,9 +40,19 @@
:nowCarts="nowCarts"
:limitDiscount="cartStore.limitTimeDiscount"
></orderItemVue> -->
<orderItemVue :useVipPrice="useVipPrice" v-if="cartStore.allGoods.length" :nowCarts="cartStore.allGoods"
<orderItemVue :useVipPrice="useVipPrice" v-if="nowCarts" :nowCarts="nowCarts"
:shopInfo="cartStore.shopInfo" :shopUserInfo="cartStore.shopUserInfo"
:limitDiscount="cartStore.limitTimeDiscount"></orderItemVue>
<view class="u-flex u-row-center u-m-t-16 u-font-28">
<view class="u-flex u-col-baseline" @click="showAllGoods=!showAllGoods">
<text>{{showAllGoods?'收起':'展开'}}</text>
<view class="guodu u-m-l-10 u-m-t-2" :class="{rotate:!showAllGoods}">
<up-icon name="arrow-down" size="14"></up-icon>
</view>
</view>
</view>
<template v-if="listinfo.id&&listinfo.status=='done'">
<view class="cell-item" v-if="is_type != 0">
@@ -328,7 +338,9 @@
import {
BigNumber
} from "bignumber.js";
const showAllGoods=ref(false)
let hasCouponCanUse = ref(false);
const usePoints = ref(false);
@@ -852,6 +864,16 @@
await getConsumeDiscount();
getDiscountActivity();
});
const nowCarts=computed(()=>{
if(cartStore.allGoods.length<=0){
return []
}
if(showAllGoods.value){
return cartStore.allGoods
}
return cartStore.allGoods.slice(0,4)
})
</script>
<style lang="scss" scoped>
@@ -1587,4 +1609,11 @@
}
}
}
.guodu{
transition:all .3s linear;
padding-top: 2rpx;
}
.rotate{
transform: rotate(-90deg);
}
</style>