+
-
+
-
+
-
@@ -114,6 +114,9 @@ export default {
}
},
methods: {
+ back() {
+ NavgateTo("1")
+ },
submitOrder() {
NavgateTo("../submitOrder/index")
},
@@ -129,7 +132,7 @@ export default {
})
},
- // 单个修改
+ // 单个修改
changeChecked(item, index) {
this.shopCarList[index].checked = !this.shopCarList[index].checked
this.calcTotal()
@@ -156,11 +159,40 @@ export default {
let total = 0
this.shopCarList.forEach(item => {
if (item.checked) {
- total += item.sales_price * item.count
+ total += item.commodity_goods_info.sales_price * item.count
}
});
this.shopMoney = total
},
+
+ deleteItem() {
+ let that = this
+ uni.showModal({
+ title: '提示',
+ content: '确定删除所选商品吗',
+ success: function (res) {
+ if (res.confirm) {
+ let ids = []
+ that.shopCarList.forEach(item => {
+ if(item.checked){
+ ids.push(item.id)
+ }
+ })
+ request(apiArr.deleteCar, "POST", {
+ ids
+ }).then(res=>{
+ uni.showToast({
+ title: '删除成功',
+ duration: 2000
+ });
+ that.getShopCar()
+ })
+ } else if (res.cancel) {
+ console.log('用户点击取消');
+ }
+ }
+ });
+ },
},
onLoad(options) {
const meun = menuButtonInfo();
{{ item.goods_name }}
- {{ item.goods_intro }}
+ {{ item.commodity_goods_info.goods_name }}
+ {{ item.commodity_goods_info.goods_intro }}
- ¥{{ item.sales_price }} /{{ item.goods_unit }}
+ ¥{{ item.commodity_goods_info.sales_price }} /{{ item.commodity_goods_info.goods_unit }}