支付修改

This commit is contained in:
魏啾
2024-05-30 15:12:31 +08:00
parent 6402da83aa
commit 1efdcca59c
3 changed files with 58 additions and 40 deletions

View File

@@ -60,7 +60,7 @@
</view> </view>
</view> </view>
<view class="fivecontent flex-colum"> <view class="fivecontent">
<!-- <view class="fivecontent" :style="{'height':seighT + 'px'}"> --> <!-- <view class="fivecontent" :style="{'height':seighT + 'px'}"> -->
<!-- <scroll-view :style="{'height':seighT + 'px'}" scroll-y @scrolltolower="loadMore" <!-- <scroll-view :style="{'height':seighT + 'px'}" scroll-y @scrolltolower="loadMore"
scroll-with-animation> --> scroll-with-animation> -->
@@ -490,14 +490,12 @@
async viewHistory(item, index) { async viewHistory(item, index) {
this.viewHistoryindex = index this.viewHistoryindex = index
if (item.dictName == 'allCity') { if (item.dictName == 'allCity') {
console.log(item, 111)
let res = await this.api.locationdistrict({ let res = await this.api.locationdistrict({
keywords: uni.cache.get('getLocationstorage').address keywords: uni.cache.get('getLocationstorage').address
}) })
this.clickhometoplistmenulist.detail = res.data this.clickhometoplistmenulist.detail = res.data
this.clickhometoplistmenulist.quilt = '1' this.clickhometoplistmenulist.quilt = '1'
} else { } else {
console.log(item, 222)
this.clickhometoplistmenulist.detail = item.detail this.clickhometoplistmenulist.detail = item.detail
this.clickhometoplistmenulist.quilt = '' this.clickhometoplistmenulist.quilt = ''
} }
@@ -506,9 +504,10 @@
duration: 300 duration: 300
}); });
if (item.isChild) { if (item.isChild) {
this.form.type = '' //先清空后赋值
this.showproductlist = true this.showproductlist = true
} else { } else {
this.form.type = item.value //附近1KM 1选中 0不选中 this.form.type = item.value == this.form.type ? "" : item.value //附近1KM 1选中 0不选中
this.form.page = 1 this.form.page = 1
this.form.size = 10 this.form.size = 10
this.form.status = 'loadmore' this.form.status = 'loadmore'

View File

@@ -175,11 +175,11 @@
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
uni.requestPayment({ uni.requestPayment({
provider: 'wxpay', //支付类型-固定值 provider: 'wxpay', //支付类型-固定值
partnerid: res.data.payAppId, // 微信支付商户号 partnerid: res.data.appId, // 微信支付商户号
timeStamp: res.data.payTimeStamp, // 时间戳(单位:秒) timeStamp: res.data.timeStamp, // 时间戳(单位:秒)
nonceStr: res.data.paynonceStr, // 随机字符串 nonceStr: res.data.nonceStr, // 随机字符串
package: res.data.payPackage, // 固定值 package: res.data.package, // 固定值
signType: res.data.paySignType, //固定值 signType: res.data.signType, //固定值
paySign: res.data.paySign, //签名 paySign: res.data.paySign, //签名
success: (res) => { success: (res) => {
uni.hideLoading() uni.hideLoading()

View File

@@ -172,7 +172,7 @@
以优惠¥{{emitorderfoodform.couponsPrice}} 以优惠¥{{emitorderfoodform.couponsPrice}}
</view> </view>
</view> </view>
<view class="fixedview_tow" @tap="$u.debounce(showpopupclick, 500)"> <view class="fixedview_tow" @tap="$u.debounce(showpopupclickdd, 500)">
立即付款 立即付款
</view> </view>
</view> </view>
@@ -257,11 +257,6 @@
this.radiovalue1 = n this.radiovalue1 = n
uni.cache.set('radiovalue1', n) uni.cache.set('radiovalue1', n)
}, },
// fangdouevent() {
// this.$u.debounce(() => {
// this.showpopupclick()
// }, 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,
@@ -297,7 +292,10 @@
console.log(msg, 'createOrder执行') console.log(msg, 'createOrder执行')
this.listinfoid = msg.data.id //下单需要的id this.listinfoid = msg.data.id //下单需要的id
this.orderInfo = msg.data this.orderInfo = msg.data
this.showpopupclickdd() if (this.radiovalue1 == 1) {
this.showpopupclickdds() //微信支付
}
} }
}, },
handlemessage() { handlemessage() {
@@ -354,35 +352,40 @@
}, },
// 去充值 // 去充值
goRecharge() { goRecharge() {
console.log(this.amountVIP.shopId, '调试11111')
uni.pro.navigateTo('/pages/member/index', { uni.pro.navigateTo('/pages/member/index', {
shopId: this.amountVIP.shopId shopId: this.amountVIP.shopId
}) })
}, },
showpopupclickdd(i) { showpopupclickdd() {
console.log(this.radiovalue1, 'radiovalue1的值') console.log(this.radiovalue1, 'radiovalue1的值')
if (this.radiovalue1 == 1) { if (this.radiovalue1 == 1) {
this.showpopupclickdds() this.showpopupclick() //生成订单
} else { } else {
// 判断是否有绑定支付密码 // 判断是否有绑定支付密码
// 先判断是否设置支付密码。0是没设置。没设置的情况下跳转到设置页面。有的话输入支付密码 // 先判断是否设置支付密码。0是没设置。没设置的情况下跳转到设置页面。有的话输入支付密码
let isVip = uni.cache.get('userInfo').isPwd if (uni.cache.get('userInfo').isPwd == 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')
}) })
} else { } else {
this.ispws = true if(this.amountVIP.amount > this.listinfo.amount){
this.$nextTick(() => { this.ispws = true
this.$refs.payPwd.onPayUp(); this.showpopupclick() //生成订单
}) this.$nextTick(() => {
this.$refs.payPwd.onPayUp();
})
}else{
uni.showToast({
title: "余额不足"
})
}
} }
} }
}, },
// 微信支付 // 微信支付
async showpopupclickdds() { async showpopupclickdds() {
let res = await this.api.payorderPay({ let res = await this.api.payorderPay({
orderId: this.listinfoid orderId: this.listinfoid
}) //判断是否支付成功 }) //判断是否支付成功
@@ -408,13 +411,17 @@
uni.cache.set('shopUser', '') //删除shopUser uni.cache.set('shopUser', '') //删除shopUser
this.paymodfiyOrderInfo() this.paymodfiyOrderInfo()
setTimeout(res => { setTimeout(res => {
// uni.redirectTo({
// url: '/pages/order/successful?orderId=' + this
// .listinfoid + '&orderInfo=' + JSON.stringify(
// this.orderInfo) + '&radiovalue1=' + this
// .radiovalue1
// });
uni.redirectTo({ uni.redirectTo({
url: '/pages/order/successful?orderId=' + this url: '/pages/order/order_detail?orderId=' + this
.listinfoid + '&orderInfo=' + JSON.stringify( .listinfoid
this.orderInfo) + '&radiovalue1=' + this
.radiovalue1
}); });
}, 1000) }, 500)
// uni.redirectTo({ // uni.redirectTo({
// url: "/pages/mall/order/ordersuccess?id=" + datareslane.data // url: "/pages/mall/order/ordersuccess?id=" + datareslane.data
// .order_id, // .order_id,
@@ -425,10 +432,18 @@
icon: 'none', icon: 'none',
title: '支付失败' title: '支付失败'
}) })
// uni.hideLoading() setTimeout(res => {
// uni.redirectTo({ // uni.redirectTo({
// url: '/pages/order/order_detail?orderId=' + this.listinfoid // url: '/pages/order/successful?orderId=' + this
// }); // .listinfoid + '&orderInfo=' + JSON.stringify(
// this.orderInfo) + '&radiovalue1=' + this
// .radiovalue1
// });
uni.redirectTo({
url: '/pages/order/order_detail?orderId=' + this
.listinfoid
});
}, 500)
}, },
complete: (data) => { complete: (data) => {
console.log(data, '成功与否') console.log(data, '成功与否')
@@ -451,13 +466,17 @@
title: '支付成功', title: '支付成功',
success: () => { success: () => {
setTimeout(res => { setTimeout(res => {
// uni.redirectTo({
// url: '/pages/order/successful?orderId=' + this
// .listinfoid + '&orderInfo=' + JSON.stringify(
// this.orderInfo) + '&radiovalue1=' + this
// .radiovalue1
// });
uni.redirectTo({ uni.redirectTo({
url: '/pages/order/successful?orderId=' + this url: '/pages/order/order_detail?orderId=' + this
.listinfoid + '&orderInfo=' + JSON.stringify( .listinfoid
this.orderInfo) + '&radiovalue1=' + this
.radiovalue1
}); });
}, 1000) }, 500)
} }