update api
This commit is contained in:
@@ -38,6 +38,7 @@
|
||||
</view>
|
||||
<view class="cart-btn" v-if="status == '编辑'" @click="settlement">结算</view>
|
||||
<view class="delete-btn" v-if="status == '完成'" @click="deleteGoods">删除</view>
|
||||
<u-toast ref="uToast" />
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -62,7 +63,7 @@ export default {
|
||||
})
|
||||
checkedGoods = checkedGoods.concat(temp);
|
||||
})
|
||||
// console.log(checkedGoods);
|
||||
console.log(checkedGoods);
|
||||
this.checkedGoods = checkedGoods;
|
||||
},
|
||||
deep: true
|
||||
@@ -88,9 +89,23 @@ export default {
|
||||
})
|
||||
},
|
||||
deleteGoods() {
|
||||
if(!this.checkedGoods.length) return false;
|
||||
let id = [];
|
||||
this.checkedGoods.forEach(item => {
|
||||
id.push(item.cart_id);
|
||||
})
|
||||
// console.log(id);
|
||||
|
||||
this.$u.api.deleteCart({ id }).then(res => {
|
||||
if (res.errCode == 0) {
|
||||
if(!res.data.msg) {
|
||||
this.getCartList();
|
||||
} else {
|
||||
this.$refs.uToast.show({
|
||||
title: res.data.msg,
|
||||
type: 'error',
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user