diff --git a/pages/index/index.vue b/pages/index/index.vue
index ef6b408..4984d6c 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -60,7 +60,7 @@
-
+
@@ -490,14 +490,12 @@
async viewHistory(item, index) {
this.viewHistoryindex = index
if (item.dictName == 'allCity') {
- console.log(item, 111)
let res = await this.api.locationdistrict({
keywords: uni.cache.get('getLocationstorage').address
})
this.clickhometoplistmenulist.detail = res.data
this.clickhometoplistmenulist.quilt = '1'
} else {
- console.log(item, 222)
this.clickhometoplistmenulist.detail = item.detail
this.clickhometoplistmenulist.quilt = ''
}
@@ -506,9 +504,10 @@
duration: 300
});
if (item.isChild) {
+ this.form.type = '' //先清空后赋值
this.showproductlist = true
} 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.size = 10
this.form.status = 'loadmore'
diff --git a/pages/order/order_detail.vue b/pages/order/order_detail.vue
index 3276ab8..ff4bebb 100644
--- a/pages/order/order_detail.vue
+++ b/pages/order/order_detail.vue
@@ -175,11 +175,11 @@
// #ifdef MP-WEIXIN
uni.requestPayment({
provider: 'wxpay', //支付类型-固定值
- partnerid: res.data.payAppId, // 微信支付商户号
- timeStamp: res.data.payTimeStamp, // 时间戳(单位:秒)
- nonceStr: res.data.paynonceStr, // 随机字符串
- package: res.data.payPackage, // 固定值
- signType: res.data.paySignType, //固定值
+ partnerid: res.data.appId, // 微信支付商户号
+ timeStamp: res.data.timeStamp, // 时间戳(单位:秒)
+ nonceStr: res.data.nonceStr, // 随机字符串
+ package: res.data.package, // 固定值
+ signType: res.data.signType, //固定值
paySign: res.data.paySign, //签名
success: (res) => {
uni.hideLoading()
diff --git a/pages/order_detail/order_detail.vue b/pages/order_detail/order_detail.vue
index 172c0c9..5d98c91 100644
--- a/pages/order_detail/order_detail.vue
+++ b/pages/order_detail/order_detail.vue
@@ -172,7 +172,7 @@
以优惠¥{{emitorderfoodform.couponsPrice}}
-
+
立即付款
@@ -257,11 +257,6 @@
this.radiovalue1 = n
uni.cache.set('radiovalue1', n)
},
- // fangdouevent() {
- // this.$u.debounce(() => {
- // this.showpopupclick()
- // }, 1000)
- // },
async getcoupon() {
let res = await this.api.userCoupon({
"orderNum": this.listinfo.amount,
@@ -297,7 +292,10 @@
console.log(msg, 'createOrder执行')
this.listinfoid = msg.data.id //下单需要的id
this.orderInfo = msg.data
- this.showpopupclickdd()
+ if (this.radiovalue1 == 1) {
+ this.showpopupclickdds() //微信支付
+ }
+
}
},
handlemessage() {
@@ -354,35 +352,40 @@
},
// 去充值
goRecharge() {
- console.log(this.amountVIP.shopId, '调试11111')
uni.pro.navigateTo('/pages/member/index', {
shopId: this.amountVIP.shopId
})
},
- showpopupclickdd(i) {
+ showpopupclickdd() {
console.log(this.radiovalue1, 'radiovalue1的值')
if (this.radiovalue1 == 1) {
- this.showpopupclickdds()
+ this.showpopupclick() //生成订单
} else {
// 判断是否有绑定支付密码
// 先判断是否设置支付密码。0是没设置。没设置的情况下跳转到设置页面。有的话输入支付密码
- let isVip = uni.cache.get('userInfo').isPwd
- if (isVip == 0) {
+ if (uni.cache.get('userInfo').isPwd == 0) {
uni.pro.navigateTo('/pages/user/repairpassword', {
shopId_id: uni.cache.get('shopUser')
})
} else {
- this.ispws = true
- this.$nextTick(() => {
- this.$refs.payPwd.onPayUp();
- })
+ if(this.amountVIP.amount > this.listinfo.amount){
+ this.ispws = true
+ this.showpopupclick() //生成订单
+ this.$nextTick(() => {
+ this.$refs.payPwd.onPayUp();
+ })
+ }else{
+ uni.showToast({
+ title: "余额不足"
+ })
+ }
+
}
}
},
// 微信支付
async showpopupclickdds() {
-
let res = await this.api.payorderPay({
orderId: this.listinfoid
}) //判断是否支付成功
@@ -408,13 +411,17 @@
uni.cache.set('shopUser', '') //删除shopUser
this.paymodfiyOrderInfo()
setTimeout(res => {
+ // uni.redirectTo({
+ // url: '/pages/order/successful?orderId=' + this
+ // .listinfoid + '&orderInfo=' + JSON.stringify(
+ // this.orderInfo) + '&radiovalue1=' + this
+ // .radiovalue1
+ // });
uni.redirectTo({
- url: '/pages/order/successful?orderId=' + this
- .listinfoid + '&orderInfo=' + JSON.stringify(
- this.orderInfo) + '&radiovalue1=' + this
- .radiovalue1
+ url: '/pages/order/order_detail?orderId=' + this
+ .listinfoid
});
- }, 1000)
+ }, 500)
// uni.redirectTo({
// url: "/pages/mall/order/ordersuccess?id=" + datareslane.data
// .order_id,
@@ -425,10 +432,18 @@
icon: 'none',
title: '支付失败'
})
- // uni.hideLoading()
- // uni.redirectTo({
- // url: '/pages/order/order_detail?orderId=' + this.listinfoid
- // });
+ setTimeout(res => {
+ // uni.redirectTo({
+ // 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) => {
console.log(data, '成功与否')
@@ -451,13 +466,17 @@
title: '支付成功',
success: () => {
setTimeout(res => {
+ // uni.redirectTo({
+ // url: '/pages/order/successful?orderId=' + this
+ // .listinfoid + '&orderInfo=' + JSON.stringify(
+ // this.orderInfo) + '&radiovalue1=' + this
+ // .radiovalue1
+ // });
uni.redirectTo({
- url: '/pages/order/successful?orderId=' + this
- .listinfoid + '&orderInfo=' + JSON.stringify(
- this.orderInfo) + '&radiovalue1=' + this
- .radiovalue1
+ url: '/pages/order/order_detail?orderId=' + this
+ .listinfoid
});
- }, 1000)
+ }, 500)
}