调支付

This commit is contained in:
魏啾
2024-05-28 16:40:02 +08:00
parent 219dce9b2f
commit 407a5c7e52

View File

@@ -171,7 +171,7 @@
以优惠¥{{emitorderfoodform.couponsPrice}} 以优惠¥{{emitorderfoodform.couponsPrice}}
</view> </view>
</view> </view>
<view class="fixedview_tow" @tap="$u.debounce(showpopupclick, 1000)"> <view class="fixedview_tow" @tap="$u.debounce(showpopupclick, 500)">
立即付款 立即付款
</view> </view>
</view> </view>
@@ -210,7 +210,6 @@
// 输入支付密码 123 // 输入支付密码 123
passwordArr: [], passwordArr: [],
ispws: false, ispws: false,
numValue: 0
}; };
}, },
@@ -222,7 +221,7 @@
// }) // })
}, },
onLoad(e) { onLoad(e) {
// console.log(e, 140) // console.log(e, 140)
let res = JSON.parse(e.tableId) let res = JSON.parse(e.tableId)
this.listinfo.detailList = res this.listinfo.detailList = res
@@ -255,11 +254,11 @@
}) })
}, },
methods: { methods: {
fangdouevent() { // fangdouevent() {
this.$u.debounce(() => { // this.$u.debounce(() => {
this.showpopupclick() // this.showpopupclick()
}, 1000) // }, 1000)
}, // },
async getcoupon() { async getcoupon() {
let res = await this.api.userCoupon({ let res = await this.api.userCoupon({
"orderNum": this.listinfo.amount, "orderNum": this.listinfo.amount,
@@ -320,7 +319,7 @@
orderfoodindex() { orderfoodindex() {
uni.pro.navigateTo('index/coupons/index', { uni.pro.navigateTo('index/coupons/index', {
orderfood: 0, orderfood: 0,
orderId :this.listinfoid, orderId: this.listinfoid,
amount: this.listinfo.amounts amount: this.listinfo.amounts
}) })
}, },
@@ -342,24 +341,19 @@
}, },
// 去结算 // 去结算
showpopupclick() { showpopupclick() {
if (this.numValue == 0) { let data = { //定义socket数据传参
let data = { //定义socket数据传参 "skuId": '',
"skuId": '', "num": '', //数量
"num": '', //数量 "type": "createOrder", //“addcart:添加购物车create0rder:生成订单clearCart:庆康购物车”,
"type": "createOrder", //“addcart:添加购物车create0rder:生成订单clearCart:庆康购物车”, "couponsId": this.emitorderfoodform.id ? this.emitorderfoodform.id : '', //优惠券ID,
"couponsId": this.emitorderfoodform.id ? this.emitorderfoodform.id : '', //优惠券ID, "isYhq": this.emitorderfoodform.id ? 1 : 0, // 是否使用优惠券( 1 使用, 0 不使用),
"isYhq": this.emitorderfoodform.id ? 1 : 0, // 是否使用优惠券( 1 使用 0使用), "isBuyYhq": this.emitorderfoodform.clickiconone == 1 ? 1 : 0, // 是否购买优惠券( 1 购买 0够买)
"isBuyYhq": this.emitorderfoodform.clickiconone == 1 ? 1 : 0, // 是否购买优惠券( 1 购买, 0 不够买) "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, // tableId:uni.cache.get('tableCode')
// tableId:uni.cache.get('tableCode')
}
this.numValue = 1
uni.$u.debounce(this.socketSendMsg(data), 500)
} else {
this.showpopupclickdd()
} }
this.socketSendMsg(data)
}, },
// 去充值 // 去充值
goRecharge() { goRecharge() {
@@ -369,7 +363,6 @@
}, },
async showpopupclickdd(i) { async showpopupclickdd(i) {
if (this.radiovalue1 == 1) { if (this.radiovalue1 == 1) {
let res = await this.api.payorderPay({ let res = await this.api.payorderPay({
orderId: this.listinfoid orderId: this.listinfoid
@@ -399,7 +392,8 @@
uni.redirectTo({ uni.redirectTo({
url: '/pages/order/successful?orderId=' + this url: '/pages/order/successful?orderId=' + this
.listinfoid + '&orderInfo=' + JSON.stringify( .listinfoid + '&orderInfo=' + JSON.stringify(
this.orderInfo) + '&payType' + this.radiovalue1 this.orderInfo) + '&payType' + this
.radiovalue1
}); });
}, 1000) }, 1000)
// uni.redirectTo({ // uni.redirectTo({
@@ -408,11 +402,11 @@
// }); // });
}, },
fail: (err) => { fail: (err) => {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: '支付失败' title: '支付失败'
}) })
uni.hideLoading() uni.hideLoading()
// uni.redirectTo({ // uni.redirectTo({
// url: '/pages/order/order_detail?orderId=' + this.listinfoid // url: '/pages/order/order_detail?orderId=' + this.listinfoid
// }); // });
@@ -426,7 +420,7 @@
} else { } else {
// 判断是否有绑定支付密码 // 判断是否有绑定支付密码
// 先判断是否设置支付密码。0是没设置。没设置的情况下跳转到设置页面。有的话输入支付密码 // 先判断是否设置支付密码。0是没设置。没设置的情况下跳转到设置页面。有的话输入支付密码
let isVip = uni.cache.get('userInfo').isPwd let isVip = uni.cache.get('userInfo').isPwd
if (isVip == 0) { if (isVip == 0) {
uni.pro.navigateTo('/pages/user/repairpassword', { uni.pro.navigateTo('/pages/user/repairpassword', {
shopId_id: uni.cache.get('shopUser') shopId_id: uni.cache.get('shopUser')
@@ -456,7 +450,8 @@
uni.redirectTo({ uni.redirectTo({
url: '/pages/order/successful?orderId=' + this url: '/pages/order/successful?orderId=' + this
.listinfoid + '&orderInfo=' + JSON.stringify( .listinfoid + '&orderInfo=' + JSON.stringify(
this.orderInfo)+ '&radiovalue1=' + this.radiovalue1 this.orderInfo) + '&radiovalue1=' + this
.radiovalue1
}); });
}, 1000) }, 1000)