扫码下单
This commit is contained in:
@@ -98,24 +98,29 @@
|
||||
<view class="cart-wrap">
|
||||
<view class="cart-content">
|
||||
<view class="left">
|
||||
<image class="icon" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/icon_cart.png" mode="aspectFit" @click="showCart = !showCart">
|
||||
<image class="icon" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/icon_cart.png"
|
||||
mode="aspectFit" @click="showCart = !showCart">
|
||||
</image>
|
||||
<text class="i">¥</text>
|
||||
<text class="num">{{cartLists.amount}}</text>
|
||||
</view>
|
||||
<view class="btn" @tap="$u.debounce(orderdetail, 500)">
|
||||
<text class="t">去结算</text>
|
||||
<text class="t">提交订单</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-popup :show="showCart" :round="20" :zIndex="98" :overlayStyle="{ zIndex: 98 }" @close="showCart = false">
|
||||
<view class="cart-list-wrap">
|
||||
<view class="cart-header" @click="cartclear">
|
||||
<view class="clear">
|
||||
<view class="cart-header">
|
||||
<!-- <view class="clear" @click="orderfoodindex">
|
||||
<text class="t" style="color: #ffd100;">可用优惠劵</text>
|
||||
</view> -->
|
||||
<view class="clear" @click="cartclear">
|
||||
<u-icon name="trash" color="#999"></u-icon>
|
||||
<text class="t">清空购物车</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<scroll-view scroll-y class="scroll-view">
|
||||
<view class="list-wrap">
|
||||
<view class="shop-item" v-for="(item,index) in cartLists.data" :key="item.id">
|
||||
@@ -349,6 +354,16 @@
|
||||
url: '/pages/order_detail/order_detail?tableId=' + item
|
||||
});
|
||||
break;
|
||||
case 'queryCart': //待提交
|
||||
// let queryCart = JSON.stringify(msg.data)
|
||||
// uni.pro.navigateTo('order_detail/order_detail', {
|
||||
// tableId: JSON.stringify(msg.data)
|
||||
// })
|
||||
uni.redirectTo({
|
||||
url: '/pages/order_detail/order_detail?tableId=' + JSON.stringify(msg.data) +
|
||||
'&amount=' + msg.amount
|
||||
});
|
||||
break;
|
||||
case 'addcart':
|
||||
this.cartLists = msg
|
||||
if (msg.data.length != 0) {
|
||||
@@ -554,17 +569,29 @@
|
||||
}
|
||||
},
|
||||
orderdetail() {
|
||||
// uni.pro.navigateTo('order_detail/order_detail', {
|
||||
// tableId: item
|
||||
// })
|
||||
// if (this.showCart) {
|
||||
let data = { //定义socket数据传参
|
||||
"skuId": '',
|
||||
"num": '', //数量
|
||||
"type": "createOrder", //“addcart:添加购物车,create0rder:生成订单,clearCart:庆康购物车”,
|
||||
"type": "queryCart", //“addcart:添加购物车,create0rder:生成订单,clearCart:庆康购物车”,
|
||||
"productId": '', //商品id
|
||||
"shopId": uni.cache.get('shopUser'),
|
||||
"userId": uni.cache.get('userInfo').id
|
||||
}
|
||||
uni.$u.debounce(this.socketSendMsg(data), 500)
|
||||
// } else {
|
||||
// this.showCart = true
|
||||
// }
|
||||
|
||||
},
|
||||
orderfoodindex() {
|
||||
uni.pro.navigateTo('index/coupons/index', {
|
||||
orderfood: 0
|
||||
})
|
||||
},
|
||||
async cartclear() {
|
||||
try {
|
||||
const data = { //定义socket数据传参
|
||||
@@ -984,7 +1011,7 @@
|
||||
.cart-list-wrap {
|
||||
.cart-header {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
justify-content: space-between;
|
||||
background-color: #f4eddf;
|
||||
padding: 20upx $paddingSize;
|
||||
border-radius: 20upx 20upx 0 0;
|
||||
|
||||
Reference in New Issue
Block a user