|
|
@ -200,20 +200,22 @@ |
|
|
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</wybPopup> |
|
|
|
</wybPopup> |
|
|
|
<wybPopup ref="popupTip" type="center" :maskClickClose="false" :height="popupHeight" :width="popupWidth" bgColor="" radius="20" :showCloseIcon="false"> |
|
|
|
<wybPopup ref="popupTip" type="center" :maskClickClose="false" :height="popupHeight" :width="popupWidth" |
|
|
|
|
|
|
|
bgColor="" radius="20" :showCloseIcon="false"> |
|
|
|
|
|
|
|
|
|
|
|
<view class="width100 height100 pr" > |
|
|
|
<view class="width100 height100 pr"> |
|
|
|
<image class="popImg" mode="aspectFit" src="/static/tipBg.png"></image> |
|
|
|
<image class="popImg" mode="aspectFit" src="/static/tipBg.png"></image> |
|
|
|
<view class="popContain width100 "> |
|
|
|
<view class="popContain width100 "> |
|
|
|
<view class="tip-top font20">恭喜!获得了到店优惠</view> |
|
|
|
<view class="tip-top font20">恭喜!获得了到店优惠</view> |
|
|
|
<view class="tip-price tip-color"> |
|
|
|
<view class="tip-price tip-color"> |
|
|
|
<text class="font45 " v-if="tradeDetail">{{tradeDetail.rebateActivityActualPrice}}</text><text class="">元</text> |
|
|
|
<text class="font45 " v-if="tradeDetail">{{tradeDetail.rebateActivityActualPrice}}</text><text |
|
|
|
|
|
|
|
class="">元</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="tip-color tip-desc"> |
|
|
|
<view class="tip-color tip-desc"> |
|
|
|
到店付款可当现金用 |
|
|
|
到店付款可当现金用 |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
<view class="btnPay " @tap.stop="tapToPay" >去支付</view> |
|
|
|
<view class="btnPay " @tap.stop="tapToPay">去支付</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</wybPopup> |
|
|
|
</wybPopup> |
|
|
@ -234,7 +236,8 @@ |
|
|
|
phone, |
|
|
|
phone, |
|
|
|
getUserAccount, |
|
|
|
getUserAccount, |
|
|
|
queryUserDiscountList, |
|
|
|
queryUserDiscountList, |
|
|
|
calculation |
|
|
|
calculation, |
|
|
|
|
|
|
|
cancelOrder |
|
|
|
} from '../../Utils/Api.js'; |
|
|
|
} from '../../Utils/Api.js'; |
|
|
|
// #ifdef H5 |
|
|
|
// #ifdef H5 |
|
|
|
var jweixin = require('jweixin-module'); |
|
|
|
var jweixin = require('jweixin-module'); |
|
|
@ -287,13 +290,13 @@ |
|
|
|
storediscountType: '', //门店优惠类型 |
|
|
|
storediscountType: '', //门店优惠类型 |
|
|
|
storediscountCondition: '', //门店优惠条件 |
|
|
|
storediscountCondition: '', //门店优惠条件 |
|
|
|
storediscountPrice: '', //门店优惠价格 |
|
|
|
storediscountPrice: '', //门店优惠价格 |
|
|
|
storeDiscountId: '' ,//门店活动id |
|
|
|
storeDiscountId: '', //门店活动id |
|
|
|
|
|
|
|
|
|
|
|
tradeDetail:null,//订单详情 |
|
|
|
tradeDetail: null, //订单详情 |
|
|
|
/* 弹窗 */ |
|
|
|
/* 弹窗 */ |
|
|
|
popupHeight:485, |
|
|
|
popupHeight: 485, |
|
|
|
popupWidth:330, |
|
|
|
popupWidth: 330, |
|
|
|
outTradeNo:'',//订单编号 |
|
|
|
outTradeNo: '', //订单编号 |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted() {}, |
|
|
|
mounted() {}, |
|
|
@ -736,14 +739,12 @@ |
|
|
|
createJSAPIOrder(datas).then(res => { |
|
|
|
createJSAPIOrder(datas).then(res => { |
|
|
|
uni.hideLoading(); |
|
|
|
uni.hideLoading(); |
|
|
|
if (res.return_code == '000000') { |
|
|
|
if (res.return_code == '000000') { |
|
|
|
|
|
|
|
|
|
|
|
if(res.return_data.tradeDetail&&res.return_data.tradeDetail.rebateActivityPart){ |
|
|
|
|
|
|
|
this.tradeDetail = res.return_data.tradeDetail; |
|
|
|
|
|
|
|
this.outTradeNo = res.return_data.outTradeNo; |
|
|
|
this.outTradeNo = res.return_data.outTradeNo; |
|
|
|
|
|
|
|
if (res.return_data.tradeDetail && res.return_data.tradeDetail.rebateActivityPart) { |
|
|
|
|
|
|
|
this.tradeDetail = res.return_data.tradeDetail; |
|
|
|
this.$refs.popupTip.show(); |
|
|
|
this.$refs.popupTip.show(); |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.jsapiPay(res.return_data.outTradeNo); |
|
|
|
this.jsapiPay(res.return_data.outTradeNo); |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -756,26 +757,24 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
tapToPay(){ |
|
|
|
tapToPay() { |
|
|
|
this.$refs.popupTip.hide(); |
|
|
|
this.$refs.popupTip.hide(); |
|
|
|
this.$nextTick(()=>{ |
|
|
|
this.$nextTick(() => { |
|
|
|
if(this.outTradeNo){ |
|
|
|
if (this.outTradeNo) { |
|
|
|
this.jsapiPay(this.outTradeNo); |
|
|
|
this.jsapiPay(this.outTradeNo); |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
//唤起支付参数 |
|
|
|
//唤起支付参数 |
|
|
|
jsapiPay(item) { |
|
|
|
jsapiPay(item) { |
|
|
|
uni.showLoading({ |
|
|
|
uni.showLoading({ |
|
|
|
title: '请求中', |
|
|
|
title: '请求中', |
|
|
|
mask:true, |
|
|
|
mask: true, |
|
|
|
}) |
|
|
|
}) |
|
|
|
let datas = { |
|
|
|
let datas = { |
|
|
|
outTradeNo: item |
|
|
|
outTradeNo: item |
|
|
|
} |
|
|
|
} |
|
|
|
this.outTradeNo = ""; |
|
|
|
|
|
|
|
jsapiPay(datas).then(res => { |
|
|
|
jsapiPay(datas).then(res => { |
|
|
|
uni.hideLoading(); |
|
|
|
uni.hideLoading(); |
|
|
|
if (res.return_code == '000000') { |
|
|
|
if (res.return_code == '000000') { |
|
|
@ -807,6 +806,29 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
//取消支付 |
|
|
|
|
|
|
|
cancelOrder(outTradeNo) { |
|
|
|
|
|
|
|
let params = { |
|
|
|
|
|
|
|
"outTradeNo": outTradeNo |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
cancelOrder(params).then(res => { |
|
|
|
|
|
|
|
app.globalData.isClick = true; |
|
|
|
|
|
|
|
this.outTradeNo = ""; |
|
|
|
|
|
|
|
if (res.return_code == '000000') { |
|
|
|
|
|
|
|
// uni.showToast({ |
|
|
|
|
|
|
|
// title: "已取消订单", |
|
|
|
|
|
|
|
// icon: 'none', |
|
|
|
|
|
|
|
// duration: 2000 |
|
|
|
|
|
|
|
// }) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
|
|
title: res.return_msg, |
|
|
|
|
|
|
|
icon: 'none', |
|
|
|
|
|
|
|
duration: 2000 |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
//删除金额 |
|
|
|
//删除金额 |
|
|
|
deleteVal() { |
|
|
|
deleteVal() { |
|
|
|
// this.plateNumberList.pop(); |
|
|
|
// this.plateNumberList.pop(); |
|
|
@ -932,10 +954,10 @@ |
|
|
|
jweixin.checkJsApi({ |
|
|
|
jweixin.checkJsApi({ |
|
|
|
jsApiList: ['chooseWXPay'], // 需要检测的JS接口列表,所有JS接口列表见附录2, |
|
|
|
jsApiList: ['chooseWXPay'], // 需要检测的JS接口列表,所有JS接口列表见附录2, |
|
|
|
success: function(res) { |
|
|
|
success: function(res) { |
|
|
|
app.globalData.isClick = true; |
|
|
|
// app.globalData.isClick = true; |
|
|
|
}, |
|
|
|
}, |
|
|
|
fail: function(res) { |
|
|
|
fail: function(res) { |
|
|
|
app.globalData.isClick = true; |
|
|
|
// app.globalData.isClick = true; |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
jweixin.chooseWXPay({ |
|
|
|
jweixin.chooseWXPay({ |
|
|
@ -955,15 +977,19 @@ |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
cancel: function(r) { |
|
|
|
cancel: function(r) { |
|
|
|
app.globalData.isClick = true; |
|
|
|
that.cancelOrder(that.outTradeNo); //取消订单 |
|
|
|
|
|
|
|
// app.globalData.isClick = true; |
|
|
|
}, |
|
|
|
}, |
|
|
|
fail: function(res) { |
|
|
|
fail: function(res) { |
|
|
|
app.globalData.isClick = true; |
|
|
|
that.cancelOrder(that.outTradeNo); //取消订单 |
|
|
|
|
|
|
|
// app.globalData.isClick = true; |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
// config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名 |
|
|
|
jweixin.error(function(res) { |
|
|
|
jweixin.error(function(res) { |
|
|
|
app.globalData.isClick = true; |
|
|
|
that.cancelOrder(that.outTradeNo); //取消订单 |
|
|
|
|
|
|
|
// app.globalData.isClick = true; |
|
|
|
uni.showToast({ |
|
|
|
uni.showToast({ |
|
|
|
icon: 'none', |
|
|
|
icon: 'none', |
|
|
|
title: '支付失败了', |
|
|
|
title: '支付失败了', |
|
|
@ -999,17 +1025,21 @@ |
|
|
|
uni.showToast({ |
|
|
|
uni.showToast({ |
|
|
|
title: '支付成功' |
|
|
|
title: '支付成功' |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
cancel: function(r) { |
|
|
|
cancel: function(r) { |
|
|
|
app.globalData.isClick = true; |
|
|
|
// app.globalData.isClick = true; |
|
|
|
|
|
|
|
that.cancelOrder(that.outTradeNo); //取消订单 |
|
|
|
}, |
|
|
|
}, |
|
|
|
fail: function(res) { |
|
|
|
fail: function(res) { |
|
|
|
app.globalData.isClick = true; |
|
|
|
// app.globalData.isClick = true; |
|
|
|
|
|
|
|
that.cancelOrder(that.outTradeNo); //取消订单 |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
jweixin.error(function(res) { |
|
|
|
jweixin.error(function(res) { |
|
|
|
app.globalData.isClick = true; |
|
|
|
// app.globalData.isClick = true; |
|
|
|
|
|
|
|
that.cancelOrder(that.outTradeNo); //取消订单 |
|
|
|
uni.showToast({ |
|
|
|
uni.showToast({ |
|
|
|
icon: 'none', |
|
|
|
icon: 'none', |
|
|
|
title: '支付失败了', |
|
|
|
title: '支付失败了', |
|
|
@ -1020,13 +1050,40 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
//支付宝支付 |
|
|
|
//支付宝支付 |
|
|
|
alipayRequest(item) { |
|
|
|
alipayRequest(item) { |
|
|
|
|
|
|
|
let that = this; |
|
|
|
alipayApi.tradePay({ |
|
|
|
alipayApi.tradePay({ |
|
|
|
tradeNO: item |
|
|
|
tradeNO: item, |
|
|
|
}, function(res) { |
|
|
|
success: function(res) { |
|
|
|
|
|
|
|
if(res.resultCode==9000){ |
|
|
|
|
|
|
|
app.globalData.isClick = true; |
|
|
|
|
|
|
|
// uni.showToast({ |
|
|
|
|
|
|
|
// title:"支付成功!", |
|
|
|
|
|
|
|
// icon:'none' |
|
|
|
|
|
|
|
// }) |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
// uni.showToast({ |
|
|
|
|
|
|
|
// title:"支付失败!", |
|
|
|
|
|
|
|
// icon:'none' |
|
|
|
|
|
|
|
// }) |
|
|
|
|
|
|
|
that.cancelOrder(that.outTradeNo); //取消订单 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
fail: function(res) { |
|
|
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
|
|
title:res, |
|
|
|
|
|
|
|
icon:'none' |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
that.cancelOrder(that.outTradeNo); //取消订单 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* function(res) { |
|
|
|
app.globalData.isClick = true; |
|
|
|
app.globalData.isClick = true; |
|
|
|
// alert(JSON.stringify(res)); |
|
|
|
// alert(JSON.stringify(res)); |
|
|
|
//支付完成的逻辑 |
|
|
|
//支付完成的逻辑 |
|
|
|
}); |
|
|
|
} */ |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
@ -1246,51 +1303,59 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* 活动金弹窗 */ |
|
|
|
/* 活动金弹窗 */ |
|
|
|
.pr{ |
|
|
|
.pr { |
|
|
|
position: relative; |
|
|
|
position: relative; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.popImg { |
|
|
|
.popImg { |
|
|
|
width: 100%; |
|
|
|
width: 100%; |
|
|
|
height: 100%; |
|
|
|
height: 100%; |
|
|
|
min-height: 430px; |
|
|
|
min-height: 430px; |
|
|
|
} |
|
|
|
} |
|
|
|
.popContain{ |
|
|
|
|
|
|
|
|
|
|
|
.popContain { |
|
|
|
position: absolute; |
|
|
|
position: absolute; |
|
|
|
top: 0; |
|
|
|
top: 0; |
|
|
|
// padding: 20px; |
|
|
|
// padding: 20px; |
|
|
|
box-sizing: border-box; |
|
|
|
box-sizing: border-box; |
|
|
|
text-align: center; |
|
|
|
text-align: center; |
|
|
|
font-size:28rpx; |
|
|
|
font-size: 28rpx; |
|
|
|
.tip-color{ |
|
|
|
|
|
|
|
color:#BF0E0F; |
|
|
|
.tip-color { |
|
|
|
|
|
|
|
color: #BF0E0F; |
|
|
|
} |
|
|
|
} |
|
|
|
.tip-top{ |
|
|
|
|
|
|
|
|
|
|
|
.tip-top { |
|
|
|
color: white; |
|
|
|
color: white; |
|
|
|
letter-spacing: 2px; |
|
|
|
letter-spacing: 2px; |
|
|
|
} |
|
|
|
} |
|
|
|
.tip-price{ |
|
|
|
|
|
|
|
margin-top:143px; |
|
|
|
.tip-price { |
|
|
|
|
|
|
|
margin-top: 143px; |
|
|
|
font-weight: bold; |
|
|
|
font-weight: bold; |
|
|
|
display: flex; |
|
|
|
display: flex; |
|
|
|
align-items: baseline; |
|
|
|
align-items: baseline; |
|
|
|
justify-content: center; |
|
|
|
justify-content: center; |
|
|
|
.font45{ |
|
|
|
|
|
|
|
|
|
|
|
.font45 { |
|
|
|
font-size: 45px; |
|
|
|
font-size: 45px; |
|
|
|
font-style: oblique; |
|
|
|
font-style: oblique; |
|
|
|
margin-right: 5px; |
|
|
|
margin-right: 5px; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.tip-desc{ |
|
|
|
|
|
|
|
|
|
|
|
.tip-desc { |
|
|
|
font-size: 18px; |
|
|
|
font-size: 18px; |
|
|
|
font-weight: bold; |
|
|
|
font-weight: bold; |
|
|
|
margin-top: 10px; |
|
|
|
margin-top: 10px; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.btnPay{ |
|
|
|
|
|
|
|
|
|
|
|
.btnPay { |
|
|
|
color: #FFFFFF; |
|
|
|
color: #FFFFFF; |
|
|
|
background: linear-gradient(to right, #F46538, #E8411A); |
|
|
|
background: linear-gradient(to right, #F46538, #E8411A); |
|
|
|
width: 60%; |
|
|
|
width: 60%; |
|
|
|
margin:22px auto 16px; |
|
|
|
margin: 22px auto 16px; |
|
|
|
height: 50px; |
|
|
|
height: 50px; |
|
|
|
display: flex; |
|
|
|
display: flex; |
|
|
|
justify-content: center; |
|
|
|
justify-content: center; |
|
|
|