订单相关修改提测
This commit is contained in:
@@ -79,7 +79,7 @@
|
||||
<view class="remark">
|
||||
<view class="remark_bg">
|
||||
<view class="remark_title">订单备注</view>
|
||||
<u-textarea class="remark_value" placeholder="请填写口味、偏好等要求" :type="'textarea'" v-model="remark" :border="false" :clearable="true"/>
|
||||
<u-textarea class="remark_value" placeholder="请填写口味、偏好等要求" :type="'textarea'" v-model="remark" :border="textareaBorder" :clearable="true"/>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -170,7 +170,7 @@
|
||||
{ name: "团购优惠", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/groupOffer.png"},
|
||||
],
|
||||
paymentMethodList:[
|
||||
{ name: "会员卡支付", type: "1", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/wechat.png"},
|
||||
{ name: "余额支付", type: "1", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/wechat.png"},
|
||||
{ name: "微信支付", type: "2", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/weChat.png"},
|
||||
],
|
||||
order: {
|
||||
@@ -191,7 +191,8 @@
|
||||
payPasswordShow: false,
|
||||
amountVIP: null, // 会员信息
|
||||
listinfoid: null,
|
||||
paymentBtnText: "会员卡支付",
|
||||
paymentBtnText: "余额支付",
|
||||
isSocket: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -210,9 +211,13 @@
|
||||
uni.$off('message')
|
||||
},
|
||||
onLoad(e) {
|
||||
console.log(JSON.parse(e.cartList))
|
||||
this.listinfo.name = JSON.parse(e.storeInfo).shopName;
|
||||
this.listinfo.details = JSON.parse(e.cartList).data;
|
||||
this.listinfo.payAmount = JSON.parse(e.cartList).amount;
|
||||
},
|
||||
onShow() {
|
||||
console.log(this.listinfoid)
|
||||
if (this.listinfoid) {
|
||||
uni.$on('message', this.getMessage)
|
||||
this.orderorderInfo()
|
||||
@@ -244,6 +249,7 @@
|
||||
} else {
|
||||
switch (msg.type) {
|
||||
case 'createOrder':
|
||||
this.isSocket = true;
|
||||
this.listinfoid = msg.data.id
|
||||
console.log(msg)
|
||||
this.listinfo.details = msg.data.detailList;
|
||||
@@ -253,7 +259,7 @@
|
||||
break;
|
||||
case 'addCart':
|
||||
console.log("商品列表===",msg)
|
||||
|
||||
this.isSocket = true;
|
||||
if (this.listinfoid) {
|
||||
this.orderorderInfo()
|
||||
} else {
|
||||
@@ -276,6 +282,7 @@
|
||||
this.listinfo.details = msg.data;
|
||||
this.listinfo.payAmount = msg.amount;
|
||||
}
|
||||
this.isSocket = true;
|
||||
break;
|
||||
}
|
||||
this.$set(this, 'cartLists', msg)
|
||||
@@ -298,7 +305,7 @@
|
||||
*/
|
||||
groupChange(n) {
|
||||
this.radiovalue = n;
|
||||
this.paymentBtnText = n==1?'会员卡支付':'微信支付'
|
||||
this.paymentBtnText = n==1?'余额支付':'微信支付'
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -309,7 +316,7 @@
|
||||
this.socketTicket ? this.socketTicket.Close() : null
|
||||
this.socketTicket = new webSocketUtils(`${uni.conf.baseUrlwws}`, 5000, {
|
||||
tableId: uni.cache.get('tableCode'),
|
||||
shopId: uni.cache.get('shopUser'),
|
||||
shopId: uni.cache.get('shopId'),
|
||||
userId: uni.cache.get('userInfo').id,
|
||||
"type": "connect",
|
||||
})
|
||||
@@ -331,7 +338,7 @@
|
||||
*/
|
||||
async getAount() {
|
||||
let res = await this.api.shopUserInfo({
|
||||
"shopId": uni.cache.get('shopUser'),
|
||||
"shopId": uni.cache.get('shopId'),
|
||||
"userId": uni.cache.get('userInfo').id,
|
||||
})
|
||||
if (res.code == 0) {
|
||||
@@ -365,7 +372,7 @@
|
||||
// 判断是否绑定手机,只有下单时候有,会员列表肯定有
|
||||
// console.log(this.amountVIP.isVip, '调试1')
|
||||
uni.pro.navigateTo('/pages/member/index', {
|
||||
shopId: uni.cache.get('shopUser')
|
||||
shopId: uni.cache.get('shopId')
|
||||
})
|
||||
},
|
||||
|
||||
@@ -374,6 +381,13 @@
|
||||
*/
|
||||
orderdetail() {
|
||||
console.log(this.listinfo.details)
|
||||
if (!this.isSocket) {
|
||||
uni.showToast({
|
||||
title: "当前网络异常,请稍后再试",
|
||||
icon: "none",
|
||||
})
|
||||
return;
|
||||
}
|
||||
if ( this.listinfo.details.length == 0) {
|
||||
uni.showToast({
|
||||
title: "购物车为空,请添加商品",
|
||||
@@ -390,7 +404,7 @@
|
||||
"isYhq": 0, // 是否使用优惠券( 1: 使用, 0: 不使用),
|
||||
"isBuyYhq": 0, // 是否购买优惠券( 1: 购买, 0: 不够买)
|
||||
"productId": '', //商品id
|
||||
"shopId": uni.cache.get('shopUser'),
|
||||
"shopId": uni.cache.get('shopId'),
|
||||
"userId": uni.cache.get('userInfo').id,
|
||||
}
|
||||
uni.$u.debounce(this.socketSendMsg(data), 500)
|
||||
|
||||
Reference in New Issue
Block a user