修改页面

This commit is contained in:
2025-05-13 10:12:15 +08:00
parent 00ab75efbc
commit a079f9d9fe
183 changed files with 2701 additions and 2212 deletions

View File

@ -39,8 +39,16 @@
</view>
</view>
</view>
<view class="column-end" @click.stop="addCart(item)">
<u-icon name="plus-circle-fill" color="#254062" size="48"></u-icon>
<view class="column-end">
<view @click.stop="addCartFun(item)">
<u-icon name="plus-circle-fill" color="#254062" size="48" ></u-icon>
</view>
<!-- <u-button @click="openSpec(item.name)" hover-class="none"
:customStyle="{width: '116rpx', height: '46rpx', lineHeight: '46rpx', fontSize: '24rpx', backgroundColor: themeColor, color: '#fff', border: 'none', paddingTop: '8rpx'}"
:hair-line="false"
shape="circle">
选规格
</u-button> -->
</view>
</view>
</navigator>
@ -124,7 +132,8 @@
</view>
</view>
</u-popup>
<shop-spec v-model="showSpec" @close="showSpec = false"></shop-spec>
<shop-spec v-model="showSpec" :name="goodsName" :spec="goods_spec" @close="showSpec = false" @confirm="confirmSpec"></shop-spec>
</view>
</template>
@ -164,13 +173,15 @@
selectIndex: 0,
cateList: [],
goodsList: [],
goods_spec: [],
cateName: '',
numberVal: 1,
showCart: false,
showSpec: false,
goods_num: 0,
cartLists: [],
totalPrice: 0
totalPrice: 0,
goodsName: '',
}
},
created() {
@ -230,16 +241,16 @@
showCartPopup() {
if (this.cartLists.length > 0) {
this.showCart = true
}
// else {
// this.$toast({
// title: '请先添加商品'
// });
// }
}
else {
this.$toast({
title: '请先添加商品'
});
}
},
// 添加到购物车(默认商品数量+1,可以让后端连表查询商品数量字段)
async addCart(item) {
async addCartFun(item) {
const {
code,
data,
@ -253,6 +264,12 @@
}
},
// 打开规格弹窗
openSpec(name) {
this.showSpec = true
this.goodsName = name
},
// 购物车商品里面的数量
countChange({value}, cartId, item) {
console.log("countChange", value, cartId, item);