Commit e847eef4 authored by Mac's avatar Mac

购物车修改

parent 783e1f89
...@@ -40,7 +40,8 @@ ...@@ -40,7 +40,8 @@
</u-checkbox-group> </u-checkbox-group>
</view> </view>
<view class="cartList_item" v-for="(item, index) in c.GoodsList" :key="index" :name="item.GoodsName" > <view class="cartList_item" v-for="(item, index) in c.GoodsList" :key="index" :name="item.GoodsName" >
<view style="width: 40px;text-align: center;" v-if="(item.GoodsStatus == 1 && editType == true) || (item.InventoryNum!=0&&editType == false)"> <!-- <view style="width: 40px;text-align: center;" v-if="(item.GoodsStatus == 1 && editType == true) || (item.InventoryNum!=0&&editType == false)"> -->
<view style="width: 40px;text-align: center;" v-if="(item.GoodsStatus == 1 && item.InventoryNum!=0) || (editType == true)">
<u-checkbox-group @change="clickcheckbox(item.checked, item.Price, index, i)"> <u-checkbox-group @change="clickcheckbox(item.checked, item.Price, index, i)">
<u-checkbox v-model="item.checked" shape="circle" :active-color="mc"></u-checkbox> <u-checkbox v-model="item.checked" shape="circle" :active-color="mc"></u-checkbox>
</u-checkbox-group> </u-checkbox-group>
...@@ -445,7 +446,7 @@ export default { ...@@ -445,7 +446,7 @@ export default {
this.list[i].GoodsList.forEach(x => { this.list[i].GoodsList.forEach(x => {
if (x.GoodsStatus == 1) { if (x.GoodsStatus == 1 && x.InventoryNum>0) {
if (x.checked == false) { if (x.checked == false) {
this.TotalPrice += parseFloat((x.Price * x.Number).toFixed(2)); this.TotalPrice += parseFloat((x.Price * x.Number).toFixed(2));
x.checked = true; x.checked = true;
...@@ -516,7 +517,7 @@ export default { ...@@ -516,7 +517,7 @@ export default {
list.forEach(x => { list.forEach(x => {
x.checked = true; x.checked = true;
x.GoodsList.forEach(j => { x.GoodsList.forEach(j => {
if (j.GoodsStatus == 1) { if (j.GoodsStatus == 1&& j.InventoryNum>0) {
j.checked = true; j.checked = true;
this.checkCount++; this.checkCount++;
this.TotalPrice += parseFloat((j.Price * j.Number).toFixed(2)); this.TotalPrice += parseFloat((j.Price * j.Number).toFixed(2));
......
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