课程价格重新写

This commit is contained in:
@fawn-nine
2024-06-25 17:06:30 +08:00
parent 8e58d4af88
commit 0374ef034a
9 changed files with 487 additions and 196 deletions

View File

@@ -1,10 +1,16 @@
<template>
<view>
<z-nav-bar backState="2000" title="购物车"></z-nav-bar>
<z-nav-bar backState="2000" title="购物车">
<view class="curseSet" slot="right" @click="manaCart = !manaCart" style="margin-right: 10px;">
<text v-show="!manaCart">管理</text>
<text v-show="manaCart">完成</text>
</view>
</z-nav-bar>
</z-nav-bar>
<view class="shopCarContent">
<scroll-view scroll-y="true">
<view class="cartItem" v-for="(item,index) in cartList" :key="index">
<view class="select">
<view class="select" v-show="manaCart">
<checkbox :checked="item.checked" @click="checkboxGroupChange(index,item)"
class="round checkedItem" />
</view>
@@ -64,7 +70,8 @@
totalPrice: 0, // 总价
all: false, // 是否全选
isCartDelShow: false, // 是否展示删除按钮
cartList: [] // 购物车列表
cartList: [], // 购物车列表
manaCart:false,
};
},
//第一次加载
@@ -104,15 +111,24 @@
},
// 是否全选
isSelectAll(e) {
console.log(e,'e')
if (this.cartList.length > 0) {
this.all = !this.all
this.cartList.forEach((item, index) => {
item.checked = this.all
})
// if(){
// this.cartList.forEach((item, index) => {
// item.checked = false
// })
// this.manaCart = false
// }
this.isCartDelShow = this.all
this.total()
this.manaCart = this.all
} else {
this.all = false
}
},
// 选中单独商品
@@ -214,6 +230,7 @@
this.totalPrice = 0
this.getCartList()
uni.hideLoading()
this.manaCart = false
})
} else {
console.log('cancel') //点击取消之后执行的代码