|
@@ -1,9 +1,9 @@
|
|
<template>
|
|
<template>
|
|
<view :style="{ minHeight: sys.windowHeight + 'px' }" :class="[$tm.vx.state().tmVuetify.black ? 'black' : ' ']">
|
|
<view :style="{ minHeight: sys.windowHeight + 'px' }" :class="[$tm.vx.state().tmVuetify.black ? 'black' : ' ']">
|
|
- <tm-menubars title="消息列表" :shadow="0" :showback="true"></tm-menubars>
|
|
|
|
|
|
+ <tm-menubars title="购物车列表" :shadow="0" :showback="true"></tm-menubars>
|
|
<view class="zhuti shangpin" v-if="test.length>0">
|
|
<view class="zhuti shangpin" v-if="test.length>0">
|
|
- <tm-sheet :padding="[0, 0]" class="jiaoxi xiao" >
|
|
|
|
- <view v-for="item in test" >
|
|
|
|
|
|
+ <tm-sheet :padding="[0, 0]" class="jiaoxi xiao">
|
|
|
|
+ <view v-for="item in test">
|
|
<tm-checkbox @change="choose" style="float: left;padding:2px !important;margin-top:9%;"
|
|
<tm-checkbox @change="choose" style="float: left;padding:2px !important;margin-top:9%;"
|
|
v-model="item.checked" label=""></tm-checkbox>
|
|
v-model="item.checked" label=""></tm-checkbox>
|
|
<tm-cartCellListFood @change="shuliangjia(item)" class="shuliang" :typeclick="typeclick"
|
|
<tm-cartCellListFood @change="shuliangjia(item)" class="shuliang" :typeclick="typeclick"
|
|
@@ -60,12 +60,12 @@
|
|
data: {}
|
|
data: {}
|
|
}).then(res => {
|
|
}).then(res => {
|
|
if (res.data.code == 200) {
|
|
if (res.data.code == 200) {
|
|
- console.log(res.data.data,'33');
|
|
|
|
|
|
+ console.log(res.data.data, '33');
|
|
that.$refs.toast.show({
|
|
that.$refs.toast.show({
|
|
model: 'success',
|
|
model: 'success',
|
|
label: res.data.msg
|
|
label: res.data.msg
|
|
})
|
|
})
|
|
- // this.getList()
|
|
|
|
|
|
+ this.getList()
|
|
} else {
|
|
} else {
|
|
that.$refs.toast.show({
|
|
that.$refs.toast.show({
|
|
model: 'error',
|
|
model: 'error',
|
|
@@ -77,29 +77,37 @@
|
|
goPay() {
|
|
goPay() {
|
|
var that = this,
|
|
var that = this,
|
|
data = this.test,
|
|
data = this.test,
|
|
- goods = [];
|
|
|
|
|
|
+ goods = [],
|
|
|
|
+ gw_id = [];
|
|
for (let i = 0; i < data.length; i++) {
|
|
for (let i = 0; i < data.length; i++) {
|
|
if (data[i].checked) {
|
|
if (data[i].checked) {
|
|
- goods.push(data[i])
|
|
|
|
- console.log(data, goods, '数据');
|
|
|
|
|
|
+ console.log(that.zongjia, 'ss');
|
|
|
|
+ goods.push(
|
|
|
|
+ {
|
|
|
|
+ order_remark: '',
|
|
|
|
+ order_money:data[i].buy*data[i].price,
|
|
|
|
+ pay_money:data[i].buy*data[i].price,
|
|
|
|
+ buy_num: data[i].buy,
|
|
|
|
+ goods_id: data[i].goods_id,
|
|
|
|
+ }
|
|
|
|
+ )
|
|
|
|
+ gw_id.push(data[i].id)
|
|
|
|
+ console.log(goods, gw_id, '下单数据');
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (goods.length == 0) {
|
|
if (goods.length == 0) {
|
|
that.$refs.toast.show({
|
|
that.$refs.toast.show({
|
|
- model: 'success',
|
|
|
|
|
|
+ model: 'warn',
|
|
label: '请选择商品'
|
|
label: '请选择商品'
|
|
})
|
|
})
|
|
return
|
|
return
|
|
- } else if (goods.length == 1) {
|
|
|
|
|
|
+ } else {
|
|
myRequest({
|
|
myRequest({
|
|
url: "/api/Order/addOrder",
|
|
url: "/api/Order/addOrder",
|
|
method: 'post',
|
|
method: 'post',
|
|
data: {
|
|
data: {
|
|
- order_remark: '',
|
|
|
|
- order_money: that.zongjia,
|
|
|
|
- pay_money: that.zongjia,
|
|
|
|
- buy_num: goods[0].buy,
|
|
|
|
- goods_id: goods[0].goods_id
|
|
|
|
|
|
+ gw_id: gw_id,
|
|
|
|
+ good: goods
|
|
}
|
|
}
|
|
}).then(res => {
|
|
}).then(res => {
|
|
if (res.data.code == 200) {
|
|
if (res.data.code == 200) {
|
|
@@ -107,7 +115,7 @@
|
|
model: 'success',
|
|
model: 'success',
|
|
label: res.data.msg
|
|
label: res.data.msg
|
|
})
|
|
})
|
|
- this.shanchu()
|
|
|
|
|
|
+ this.getList()
|
|
} else {
|
|
} else {
|
|
that.$refs.toast.show({
|
|
that.$refs.toast.show({
|
|
model: 'error',
|
|
model: 'error',
|
|
@@ -115,8 +123,6 @@
|
|
})
|
|
})
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- } else {
|
|
|
|
- console.log('不止一个');
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
shanchu() {
|
|
shanchu() {
|
|
@@ -132,7 +138,7 @@
|
|
console.log(data, '数据');
|
|
console.log(data, '数据');
|
|
if (ids.length == 0) {
|
|
if (ids.length == 0) {
|
|
that.$refs.toast.show({
|
|
that.$refs.toast.show({
|
|
- model: 'success',
|
|
|
|
|
|
+ model: 'warn',
|
|
label: '请选择商品'
|
|
label: '请选择商品'
|
|
})
|
|
})
|
|
return
|
|
return
|
|
@@ -196,7 +202,7 @@
|
|
buy: res.data.data[i].goods_num,
|
|
buy: res.data.data[i].goods_num,
|
|
itemId: res.data.data[i].id,
|
|
itemId: res.data.data[i].id,
|
|
checked: false,
|
|
checked: false,
|
|
- goods_id:res.data.data[i].goods_id
|
|
|
|
|
|
+ goods_id: res.data.data[i].goods_id
|
|
};
|
|
};
|
|
that.test.push(obj)
|
|
that.test.push(obj)
|
|
}
|
|
}
|