扫码下单
This commit is contained in:
@@ -5,16 +5,17 @@ const proxyApi = "/api"
|
|||||||
// #ifdef MP-WEIXIN || APP
|
// #ifdef MP-WEIXIN || APP
|
||||||
// const proxyApi = 'http://192.168.2.133:9889/cashierService' // 王伟
|
// const proxyApi = 'http://192.168.2.133:9889/cashierService' // 王伟
|
||||||
// const proxyApi = 'http://101.37.12.135:9889/cashierService' // 帆哥
|
// const proxyApi = 'http://101.37.12.135:9889/cashierService' // 帆哥
|
||||||
const proxyApi = 'https://wxcashiertest.sxczgkj.cn/cashierService'
|
const proxyApi = 'https://wxcashiertest.sxczgkj.cn/cashierService' // 测试
|
||||||
|
const proxyApiwws = 'ws://wxcashiertest.sxczgkj.cn/cashierService' // 测试
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
const baseUrl = debug ? proxyApi : "https://wxcashiertest.sxczgkj.cn/cashierService"
|
const baseUrl = debug ? proxyApi : "https://wxcashiertest.sxczgkj.cn/cashierService"
|
||||||
const baseUrlwws = 'wss://cashier.sxczgkj.cn/cashierService' // 线上
|
const baseUrlwws = 'ws://cashier.sxczgkj.cn/cashierService'
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef APP || MP-WEIXIN
|
// #ifdef APP || MP-WEIXIN
|
||||||
const baseUrl = debug ? proxyApi : 'https://wxcashiertest.sxczgkj.cn/cashierService'
|
const baseUrl = debug ? proxyApi : 'https://cashier.sxczgkj.cn/cashierService'// 线上
|
||||||
const baseUrlwws = 'wss://wxcashiertest.sxczgkj.cn/cashierService' // 线上
|
const baseUrlwws = debug ? proxyApiwws : 'wss://cashier.sxczgkj.cn/cashierService' // 线上
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
// import VConsole from "./vConsole.js"
|
// import VConsole from "./vConsole.js"
|
||||||
|
|||||||
@@ -92,10 +92,13 @@ async function request(options) {
|
|||||||
title: res.message || res.msg,
|
title: res.message || res.msg,
|
||||||
icon: "none",
|
icon: "none",
|
||||||
success: () => {
|
success: () => {
|
||||||
uni.cache.clear();
|
setTimeout(res => {
|
||||||
uni.redirectTo({
|
uni.cache.clear();
|
||||||
url: '/pages/login/login'
|
uni.redirectTo({
|
||||||
});
|
url: '/pages/login/login'
|
||||||
|
});
|
||||||
|
}, 1000)
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else if (res.code == 482) {
|
} else if (res.code == 482) {
|
||||||
|
|||||||
@@ -6,7 +6,8 @@
|
|||||||
<view>可使用红包</view>
|
<view>可使用红包</view>
|
||||||
<text>{{totalnumber}}张</text>
|
<text>{{totalnumber}}张</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="containertopboxitem flex-start" v-for="(item,index) in list" :key="index">
|
<view class="containertopboxitem flex-start" v-for="(item,index) in list" :key="index"
|
||||||
|
@click="clickiconone(item)">
|
||||||
<view class="containertopboxitemleft flex-colum"
|
<view class="containertopboxitemleft flex-colum"
|
||||||
:class="item.status == 0?'':'containertopboxitemlefts'">
|
:class="item.status == 0?'':'containertopboxitemlefts'">
|
||||||
<view class="containertopboxitemleft_one"
|
<view class="containertopboxitemleft_one"
|
||||||
@@ -57,7 +58,7 @@
|
|||||||
{{item.name}}
|
{{item.name}}
|
||||||
</view>
|
</view>
|
||||||
<view class="containerbottombox_bottombox flex-start" v-for="(item1,index1) in item.listdata"
|
<view class="containerbottombox_bottombox flex-start" v-for="(item1,index1) in item.listdata"
|
||||||
:key="index1">
|
:key="index1" @click="clickicon(item1)">
|
||||||
<view class="containerbottombox_bottomthere">
|
<view class="containerbottombox_bottomthere">
|
||||||
<view class="containerbottombox_bottomthere_topitem">
|
<view class="containerbottombox_bottomthere_topitem">
|
||||||
<view class="onecontainerbottombox_bottomthere_topitem">
|
<view class="onecontainerbottombox_bottomthere_topitem">
|
||||||
@@ -81,7 +82,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="therecontainerbottombox_bottomthere_topitem flex-around" @click="clickicon(item1)">
|
<view class="therecontainerbottombox_bottomthere_topitem flex-around">
|
||||||
<u-icon v-if="item1.id == item1id" name="checkmark-circle" color="#F1CB66"
|
<u-icon v-if="item1.id == item1id" name="checkmark-circle" color="#F1CB66"
|
||||||
size="45"></u-icon>
|
size="45"></u-icon>
|
||||||
<text v-else class="theretext"></text>
|
<text v-else class="theretext"></text>
|
||||||
@@ -113,16 +114,53 @@
|
|||||||
size: 10, //页容量
|
size: 10, //页容量
|
||||||
status: 'loadmore'
|
status: 'loadmore'
|
||||||
},
|
},
|
||||||
|
orderfood: '', //等于0扫码点餐下单
|
||||||
|
amount: '' //下单金额传来的值
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
onLoad(e) {
|
||||||
|
try {
|
||||||
|
this.orderfood = e.orderfood //等于0扫码点餐下单
|
||||||
|
this.amount = e.amount
|
||||||
|
} catch (e) {
|
||||||
|
//TODO handle the exception
|
||||||
|
}
|
||||||
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.ordermineCouponsthis()
|
this.ordermineCouponsthis()
|
||||||
this.ordergetYhqParass()
|
this.ordergetYhqParass()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
clickicon(e){
|
clickicon(e) { //团购优惠卷
|
||||||
this.item1id = e.id
|
this.item1id = e.id
|
||||||
|
e.clickiconone = 1
|
||||||
|
let data = e
|
||||||
|
if (this.orderfood == 0) { //等于0扫码点餐下单
|
||||||
|
if (this.amount > e.couponsAmount) {
|
||||||
|
uni.$emit('emitclickorderfood', e)
|
||||||
|
uni.navigateBack()
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: '此优惠卷不能用于目前订单',
|
||||||
|
icon: "none",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
clickiconone(e) { //自己优惠劵处理
|
||||||
|
e.clickiconone = 0
|
||||||
|
let data = e
|
||||||
|
if (this.orderfood == 0) { //等于0扫码点餐下单
|
||||||
|
if (this.amount > e.couponsAmount) {
|
||||||
|
uni.$emit('emitclickorderfood', data)
|
||||||
|
uni.navigateBack()
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: '此优惠卷不能用于目前订单',
|
||||||
|
icon: "none",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
async ordergetYhqParass() { //类型列表
|
async ordergetYhqParass() { //类型列表
|
||||||
let res = await this.api.ordergetYhqPara()
|
let res = await this.api.ordergetYhqPara()
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<view class="card">
|
<view class="card" v-if="listinfo.tableName">
|
||||||
<view class="head">
|
<view class="head">
|
||||||
<text class="title">
|
<text class="title">
|
||||||
<text>{{listinfo.tableName || '空'}}</text>
|
<text>{{listinfo.tableName || '空'}}</text>
|
||||||
@@ -50,15 +50,15 @@
|
|||||||
<view class="shop-info">
|
<view class="shop-info">
|
||||||
<view class="item" v-for="(item,index) in listinfo.detailList" :key="index">
|
<view class="item" v-for="(item,index) in listinfo.detailList" :key="index">
|
||||||
<view class="cover">
|
<view class="cover">
|
||||||
<c-image width="120" height="120" radius="16" :src='item.productImg'></c-image>
|
<c-image width="120" height="120" radius="16" :src='item.coverImg'></c-image>
|
||||||
</view>
|
</view>
|
||||||
<view class="info">
|
<view class="info">
|
||||||
<text>{{item.productName}}</text>
|
<text>{{item.name}}</text>
|
||||||
<text class="n">x{{item.num}}</text>
|
<text class="n">x{{item.number}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="price">
|
<view class="price">
|
||||||
<text class="i">¥</text>
|
<text class="i">¥</text>
|
||||||
<text class="num">{{item.price}}</text>
|
<text class="num">{{item.salePrice}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -66,10 +66,18 @@
|
|||||||
<view class="price">
|
<view class="price">
|
||||||
<text>合计:</text>
|
<text>合计:</text>
|
||||||
<text class="i">¥</text>
|
<text class="i">¥</text>
|
||||||
<text class="num">{{listinfo.amount}}</text>
|
<text class="num">{{listinfo.amounts}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="sixcontent">
|
||||||
|
<view class="sixcontentone flex-between" style="padding: 0 0;" @click="orderfoodindex">
|
||||||
|
<view class="sixcontent_one" style="padding: 0 0;">
|
||||||
|
优惠卷
|
||||||
|
</view>
|
||||||
|
<text style="color: red;">{{emitorderfoodform.couponsPrice}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
<view class="sixcontent" v-if="listinfo.status == 'unpaid'">
|
<view class="sixcontent" v-if="listinfo.status == 'unpaid'">
|
||||||
<view class="sixcontentone flex-between">
|
<view class="sixcontentone flex-between">
|
||||||
<view class="sixcontent_one">
|
<view class="sixcontent_one">
|
||||||
@@ -112,8 +120,11 @@
|
|||||||
<view class="fixedview_onetow">
|
<view class="fixedview_onetow">
|
||||||
<text>¥</text>{{listinfo.amount}}
|
<text>¥</text>{{listinfo.amount}}
|
||||||
</view>
|
</view>
|
||||||
|
<view class="fixedview_onethere" v-if="emitorderfoodform.couponsPrice">
|
||||||
|
以优惠¥{{emitorderfoodform.couponsPrice}}
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="fixedview_tow" @tap="$u.debounce(showpopupclick,1000)">
|
<view class="fixedview_tow" @click="showpopupclick">
|
||||||
立即付款
|
立即付款
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -129,34 +140,89 @@
|
|||||||
height: '',
|
height: '',
|
||||||
pay_type: 1,
|
pay_type: 1,
|
||||||
info: {},
|
info: {},
|
||||||
listinfo: {}
|
listinfo: {
|
||||||
|
detailList: [],
|
||||||
|
amount: '',
|
||||||
|
amounts: ''
|
||||||
|
},
|
||||||
|
emitorderfoodform: {
|
||||||
|
clickiconone: ''
|
||||||
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
// onUnload() {
|
onUnload() {
|
||||||
// uni.$off('createOrdermessage')
|
uni.$off('createOrdermessage')
|
||||||
// },
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
console.log(e,140)
|
console.log(e, 140)
|
||||||
let res = JSON.parse(e.tableId)
|
let res = JSON.parse(e.tableId)
|
||||||
console.log(res)
|
// .toFixed(2)
|
||||||
this.listinfo = res
|
this.listinfo.detailList = res
|
||||||
// uni.$on('createOrdermessage', res => {
|
this.listinfo.amount = e.amount
|
||||||
// console.log(1111111)
|
this.listinfo.amounts = e.amount
|
||||||
// console.log(res)
|
this.handlemessage()
|
||||||
// this.listinfo = res
|
// uni.$on('createOrdermessage', this.creategetMessage)
|
||||||
// })
|
|
||||||
// uni.$on('createOrdermessage', this.getMessagess)
|
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
// uni.$on('createOrdermessage', res => {
|
|
||||||
// console.log(1111111)
|
},
|
||||||
// console.log(res)
|
created() {
|
||||||
// this.listinfo = res
|
uni.$on('emitclickorderfood', (num) => {
|
||||||
// })
|
console.log(num)
|
||||||
|
// 总金额 couponsAmount 优惠卷购买金额 couponsPrice优惠金额
|
||||||
|
if (num.clickiconone == 1) {
|
||||||
|
this.listinfo.amount = (Number(this.listinfo.amounts) - Number(num.couponsPrice)).toFixed(2)
|
||||||
|
} else {
|
||||||
|
this.listinfo.amount = (Number(this.listinfo.amounts) + Number(num.couponsAmount) - Number(num
|
||||||
|
.couponsPrice)).toFixed(2)
|
||||||
|
}
|
||||||
|
this.emitorderfoodform = num
|
||||||
|
// this.num += num
|
||||||
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
creategetMessage(msg) {
|
||||||
|
if (msg.status != 'success') {
|
||||||
|
uni.showToast({
|
||||||
|
title: msg.msg,
|
||||||
|
icon: "none",
|
||||||
|
})
|
||||||
|
this.socketTicket.Close()
|
||||||
|
uni.$off('createOrdermessage')
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
switch (msg.type) {
|
||||||
|
case 'createOrder': //去结算
|
||||||
|
this.showpopupclickdd()
|
||||||
|
// let item = JSON.stringify(msg.data)
|
||||||
|
// uni.redirectTo({
|
||||||
|
// url: '/pages/order_detail/order_detail?tableId=' + item
|
||||||
|
// });
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handlemessage() {
|
||||||
|
this.socketTicket ? this.socketTicket.Close() : null //调用前先判断是否有socket正在进行 先关闭后链接
|
||||||
|
this.socketTicket = new webSocketUtils(
|
||||||
|
`${uni.conf.baseUrlwws}/websocket/table/${this.tableCode}/${uni.cache.get('shopUser')}/${uni.cache.get('userInfo').id}`,
|
||||||
|
5000)
|
||||||
|
|
||||||
|
},
|
||||||
|
// 数据处理
|
||||||
|
socketSendMsg(data) {
|
||||||
|
if (this.socketTicket) {
|
||||||
|
this.socketTicket.send(data);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
orderfoodindex() {
|
||||||
|
uni.pro.navigateTo('index/coupons/index', {
|
||||||
|
orderfood: 0,
|
||||||
|
amount: this.listinfo.amounts
|
||||||
|
|
||||||
|
})
|
||||||
|
},
|
||||||
async ordercreatOrder() {
|
async ordercreatOrder() {
|
||||||
let res = await this.api.ordercreatOrder({
|
let res = await this.api.ordercreatOrder({
|
||||||
tableId: this.info.tableId,
|
tableId: this.info.tableId,
|
||||||
@@ -181,15 +247,25 @@
|
|||||||
orderId: this.listinfo.id
|
orderId: this.listinfo.id
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
async showpopupclick() {
|
// 去结算
|
||||||
// const data = { //定义socket数据传参
|
showpopupclick() {
|
||||||
// "skuId": res.data.id,
|
|
||||||
// "num": a == '-' ? Number(b) - 1 : Number(b) + 1, //数量
|
let data = { //定义socket数据传参
|
||||||
// "type": "addcart", //“addcart:添加购物车,create0rder:生成订单,clearCart:庆康购物车”,
|
"skuId": '',
|
||||||
// "productId": item.id, //商品id
|
"num": '', //数量
|
||||||
// "shopId": uni.cache.get('shopUser').shopId,
|
"type": "createOrder", //“addcart:添加购物车,create0rder:生成订单,clearCart:庆康购物车”,
|
||||||
// "userId": uni.cache.get('userInfo').id
|
"couponsId": this.emitorderfoodform.id ? this.emitorderfoodform.id : '', //优惠券ID,
|
||||||
// };
|
"isYhq": this.emitorderfoodform.id ? 1 : 0, // 是否使用优惠券( 1: 使用, 0: 不使用),
|
||||||
|
"isBuyYhq": this.emitorderfoodform.clickiconone == 1 ? 1 : 0, // 是否购买优惠券( 1: 购买, 0: 不够买)
|
||||||
|
"productId": '', //商品id
|
||||||
|
"shopId": uni.cache.get('shopUser'),
|
||||||
|
"userId": uni.cache.get('userInfo').id
|
||||||
|
}
|
||||||
|
console.log(data)
|
||||||
|
uni.$u.debounce(this.socketSendMsg(data), 500)
|
||||||
|
},
|
||||||
|
async showpopupclickdd() {
|
||||||
|
|
||||||
let res = await this.api.payorderPay({
|
let res = await this.api.payorderPay({
|
||||||
orderId: this.listinfo.id,
|
orderId: this.listinfo.id,
|
||||||
}) //判断是否支付成功
|
}) //判断是否支付成功
|
||||||
@@ -394,6 +470,10 @@
|
|||||||
.sixcontentone {
|
.sixcontentone {
|
||||||
padding-bottom: 28rpx;
|
padding-bottom: 28rpx;
|
||||||
border-bottom: 1px solid #F7F7F7;
|
border-bottom: 1px solid #F7F7F7;
|
||||||
|
font-size: 28rpx;
|
||||||
|
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #333333;
|
||||||
|
|
||||||
.sixcontent_one {
|
.sixcontent_one {
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
@@ -436,6 +516,7 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 24rpx 28rpx;
|
padding: 24rpx 28rpx;
|
||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
|
||||||
.fixedview_one {
|
.fixedview_one {
|
||||||
.fixedview_oneone {
|
.fixedview_oneone {
|
||||||
@@ -456,6 +537,13 @@
|
|||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.fixedview_onethere {
|
||||||
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 24rpx;
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.fixedview_tow {
|
.fixedview_tow {
|
||||||
|
|||||||
@@ -98,24 +98,29 @@
|
|||||||
<view class="cart-wrap">
|
<view class="cart-wrap">
|
||||||
<view class="cart-content">
|
<view class="cart-content">
|
||||||
<view class="left">
|
<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>
|
</image>
|
||||||
<text class="i">¥</text>
|
<text class="i">¥</text>
|
||||||
<text class="num">{{cartLists.amount}}</text>
|
<text class="num">{{cartLists.amount}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="btn" @tap="$u.debounce(orderdetail, 500)">
|
<view class="btn" @tap="$u.debounce(orderdetail, 500)">
|
||||||
<text class="t">去结算</text>
|
<text class="t">提交订单</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<u-popup :show="showCart" :round="20" :zIndex="98" :overlayStyle="{ zIndex: 98 }" @close="showCart = false">
|
<u-popup :show="showCart" :round="20" :zIndex="98" :overlayStyle="{ zIndex: 98 }" @close="showCart = false">
|
||||||
<view class="cart-list-wrap">
|
<view class="cart-list-wrap">
|
||||||
<view class="cart-header" @click="cartclear">
|
<view class="cart-header">
|
||||||
<view class="clear">
|
<!-- <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>
|
<u-icon name="trash" color="#999"></u-icon>
|
||||||
<text class="t">清空购物车</text>
|
<text class="t">清空购物车</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<scroll-view scroll-y class="scroll-view">
|
<scroll-view scroll-y class="scroll-view">
|
||||||
<view class="list-wrap">
|
<view class="list-wrap">
|
||||||
<view class="shop-item" v-for="(item,index) in cartLists.data" :key="item.id">
|
<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
|
url: '/pages/order_detail/order_detail?tableId=' + item
|
||||||
});
|
});
|
||||||
break;
|
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':
|
case 'addcart':
|
||||||
this.cartLists = msg
|
this.cartLists = msg
|
||||||
if (msg.data.length != 0) {
|
if (msg.data.length != 0) {
|
||||||
@@ -554,17 +569,29 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
orderdetail() {
|
orderdetail() {
|
||||||
|
// uni.pro.navigateTo('order_detail/order_detail', {
|
||||||
|
// tableId: item
|
||||||
|
// })
|
||||||
|
// if (this.showCart) {
|
||||||
let data = { //定义socket数据传参
|
let data = { //定义socket数据传参
|
||||||
"skuId": '',
|
"skuId": '',
|
||||||
"num": '', //数量
|
"num": '', //数量
|
||||||
"type": "createOrder", //“addcart:添加购物车,create0rder:生成订单,clearCart:庆康购物车”,
|
"type": "queryCart", //“addcart:添加购物车,create0rder:生成订单,clearCart:庆康购物车”,
|
||||||
"productId": '', //商品id
|
"productId": '', //商品id
|
||||||
"shopId": uni.cache.get('shopUser'),
|
"shopId": uni.cache.get('shopUser'),
|
||||||
"userId": uni.cache.get('userInfo').id
|
"userId": uni.cache.get('userInfo').id
|
||||||
}
|
}
|
||||||
uni.$u.debounce(this.socketSendMsg(data), 500)
|
uni.$u.debounce(this.socketSendMsg(data), 500)
|
||||||
|
// } else {
|
||||||
|
// this.showCart = true
|
||||||
|
// }
|
||||||
|
|
||||||
},
|
},
|
||||||
|
orderfoodindex() {
|
||||||
|
uni.pro.navigateTo('index/coupons/index', {
|
||||||
|
orderfood: 0
|
||||||
|
})
|
||||||
|
},
|
||||||
async cartclear() {
|
async cartclear() {
|
||||||
try {
|
try {
|
||||||
const data = { //定义socket数据传参
|
const data = { //定义socket数据传参
|
||||||
@@ -984,7 +1011,7 @@
|
|||||||
.cart-list-wrap {
|
.cart-list-wrap {
|
||||||
.cart-header {
|
.cart-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: space-between;
|
||||||
background-color: #f4eddf;
|
background-color: #f4eddf;
|
||||||
padding: 20upx $paddingSize;
|
padding: 20upx $paddingSize;
|
||||||
border-radius: 20upx 20upx 0 0;
|
border-radius: 20upx 20upx 0 0;
|
||||||
|
|||||||
@@ -113,7 +113,7 @@
|
|||||||
})
|
})
|
||||||
if (res.data.pages < this.form.page) {
|
if (res.data.pages < this.form.page) {
|
||||||
this.form.status = 'nomore'
|
this.form.status = 'nomore'
|
||||||
if (res.data.pageNum == 1) {
|
if (this.form.page == 1 && res.data.list == 0) {
|
||||||
this.is_end = true
|
this.is_end = true
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user