This commit is contained in:
duan
2024-05-31 11:36:24 +08:00
parent 9804c20671
commit 65be66ba91

View File

@@ -333,6 +333,28 @@
orderId: this.listinfoid
})
},
creactorder(){
let data = { //定义socket数据传参
"skuId": '',
"num": '', //数量
"type": "createOrder", //“addcart:添加购物车create0rder:生成订单clearCart:庆康购物车”,
"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,
// tableId:uni.cache.get('tableCode')
}
let res = 0
if(res.code==0){
this.listinfoid = msg.data.id //下单需要的id
this.orderInfo = msg.data
if (this.radiovalue1 == 1) {
this.showpopupclickdds() //微信支付
}
}
},
// 去结算
showpopupclick() {
let data = { //定义socket数据传参
@@ -359,7 +381,8 @@
showpopupclickdd() {
console.log(this.radiovalue1, 'radiovalue1的值')
if (this.radiovalue1 == 1) {
this.showpopupclick() //生成订单
// this.showpopupclick() //生成订单
this.creactorder()
} else {
// 判断是否有绑定支付密码
// 先判断是否设置支付密码。0是没设置。没设置的情况下跳转到设置页面。有的话输入支付密码
@@ -370,7 +393,8 @@
} else {
if (this.amountVIP.amount > this.listinfo.amount) {
this.ispws = true
this.showpopupclick() //生成订单
// this.showpopupclick() //生成订单
this.creactorder()
this.$nextTick(() => {
this.$refs.payPwd.onPayUp();
})