优化长链接
This commit is contained in:
@@ -125,7 +125,6 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <view class="sixcontent" >
|
||||
<view class="sixcontentone flex-between">
|
||||
<view class="sixcontent_one">
|
||||
@@ -252,7 +251,7 @@
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
s groupChange(n) {
|
||||
groupChange(n) {
|
||||
// console.log('groupChange', n);
|
||||
this.radiovalue1 = n
|
||||
uni.cache.set('radiovalue1', n)
|
||||
@@ -290,8 +289,7 @@ s groupChange(n) {
|
||||
|
||||
} else if (msg.type == 'createOrder') {
|
||||
console.log(msg, 'createOrder执行')
|
||||
uni.cache.set('order_detailinfoid', msg.data.id);
|
||||
// this.listinfoid = msg.data.id //下单需要的id
|
||||
this.listinfoid = msg.data.id //下单需要的id
|
||||
this.orderInfo = msg.data
|
||||
if (this.radiovalue1 == 1) {
|
||||
this.showpopupclickdds() //微信支付
|
||||
@@ -300,7 +298,7 @@ s groupChange(n) {
|
||||
}
|
||||
},
|
||||
handlemessage() {
|
||||
// this.socketTicket ? this.socketTicket.Close() : null //调用前先判断是否有socket正在进行 先关闭后链接
|
||||
this.socketTicket ? this.socketTicket.Close() : null //调用前先判断是否有socket正在进行 先关闭后链接
|
||||
this.socketTicket = new webSocketUtils(
|
||||
`${uni.conf.baseUrlwws}/websocket/table/${uni.cache.get('tableCode')}/${uni.cache.get('shopUser')}/${uni.cache.get('userInfo').id}`,
|
||||
5000)
|
||||
@@ -315,7 +313,7 @@ s groupChange(n) {
|
||||
orderfoodindex() {
|
||||
uni.pro.navigateTo('index/coupons/index', {
|
||||
orderfood: 0,
|
||||
orderId: uni.cache.get('order_detailinfoid'),
|
||||
orderId: this.listinfoid,
|
||||
amount: this.listinfo.amounts
|
||||
})
|
||||
},
|
||||
@@ -332,7 +330,7 @@ s groupChange(n) {
|
||||
},
|
||||
async paymodfiyOrderInfo() {
|
||||
let res = await this.api.paymodfiyOrderInfo({
|
||||
orderId: uni.cache.get('order_detailinfoid')
|
||||
orderId: this.listinfoid
|
||||
})
|
||||
},
|
||||
// 去结算
|
||||
@@ -370,7 +368,7 @@ s groupChange(n) {
|
||||
shopId_id: uni.cache.get('shopUser')
|
||||
})
|
||||
} else {
|
||||
if (this.amountVIP.amount >= this.listinfo.amount) {
|
||||
if (this.amountVIP.amount > this.listinfo.amount) {
|
||||
this.ispws = true
|
||||
this.showpopupclick() //生成订单
|
||||
this.$nextTick(() => {
|
||||
@@ -378,7 +376,6 @@ s groupChange(n) {
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: "余额不足"
|
||||
})
|
||||
}
|
||||
@@ -389,7 +386,7 @@ s groupChange(n) {
|
||||
// 微信支付
|
||||
async showpopupclickdds() {
|
||||
let res = await this.api.payorderPay({
|
||||
orderId: uni.cache.get('order_detailinfoid')
|
||||
orderId: this.listinfoid
|
||||
}) //判断是否支付成功
|
||||
if (res.code == 0) {
|
||||
// uni.showLoading({
|
||||
@@ -420,8 +417,8 @@ s groupChange(n) {
|
||||
// .radiovalue1
|
||||
// });
|
||||
uni.redirectTo({
|
||||
url: '/pages/order/order_detail?orderId=' + uni.cache
|
||||
.get('order_detailinfoid')
|
||||
url: '/pages/order/order_detail?orderId=' + this
|
||||
.listinfoid
|
||||
});
|
||||
}, 500)
|
||||
// uni.redirectTo({
|
||||
@@ -442,8 +439,8 @@ s groupChange(n) {
|
||||
// .radiovalue1
|
||||
// });
|
||||
uni.redirectTo({
|
||||
url: '/pages/order/order_detail?orderId=' + uni.cache
|
||||
.get('order_detailinfoid')
|
||||
url: '/pages/order/order_detail?orderId=' + this
|
||||
.listinfoid
|
||||
});
|
||||
}, 500)
|
||||
},
|
||||
@@ -458,7 +455,7 @@ s groupChange(n) {
|
||||
async accountPayevent(pwd) {
|
||||
this.ispws = false
|
||||
let res = await this.api.accountPay({
|
||||
orderId: uni.cache.get('order_detailinfoid'),
|
||||
orderId: this.listinfoid,
|
||||
memberId: this.amountVIP.id,
|
||||
pwd: pwd
|
||||
})
|
||||
@@ -475,26 +472,22 @@ s groupChange(n) {
|
||||
// .radiovalue1
|
||||
// });
|
||||
uni.redirectTo({
|
||||
url: '/pages/order/order_detail?orderId=' + uni.cache
|
||||
.get('order_detailinfoid')
|
||||
url: '/pages/order/order_detail?orderId=' + this
|
||||
.listinfoid
|
||||
});
|
||||
}, 500)
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
} else {
|
||||
setTimeout(res => {
|
||||
uni.redirectTo({
|
||||
url: '/pages/order/order_detail?orderId=' + uni.cache.get(
|
||||
'order_detailinfoid')
|
||||
});
|
||||
}, 500)
|
||||
} else if (res.data == 1) {
|
||||
setTimeout(() => {
|
||||
// 去充值
|
||||
this.goRecharge()
|
||||
}, 2000)
|
||||
}
|
||||
// else if (res.data == 1) {
|
||||
// setTimeout(() => {
|
||||
// // 去充值
|
||||
// this.goRecharge()
|
||||
// }, 2000)
|
||||
// }
|
||||
|
||||
|
||||
},
|
||||
|
||||
clickselect(b) {
|
||||
@@ -791,19 +784,4 @@ s groupChange(n) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.u-popupflex-colum {
|
||||
width: 400rpx;
|
||||
padding: 80rpx 40rpx;
|
||||
border-radius: 50rpx;
|
||||
background: #FFFFFF;
|
||||
|
||||
.u-popupflex-columview {
|
||||
font-family: SourceHanSansCN-Bold-, SourceHanSansCN-Bold;
|
||||
font-weight: normal;
|
||||
color: #000;
|
||||
font-weight: bold;
|
||||
margin-bottom: 50rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user