提交 feb447a9 authored 作者: lihuihui's avatar lihuihui
......@@ -51,22 +51,45 @@ export default {
// 微信支付
wxPay() {
const options = this.order.options
wx.chooseWXPay({
timestamp: options.timeStamp, // 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符
WeixinJSBridge.invoke(
'getBrandWCPayRequest',
{
appId: options.appId, // 公众号名称,由商户传入
timeStamp: options.timeStamp, // 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符
nonceStr: options.nonceStr, // 支付签名随机串,不长于 32 位
package: `prepay_id=${this.order.prepay_id}`, // 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=\*\*\*)
signType: options.signType, // 签名方式,默认为'SHA1',使用新版支付需传入'MD5'
paySign: options.paySign, // 支付签名
success: res => {
paySign: options.paySign // 支付签名
},
function (res) {
if (res.err_msg === 'get_brand_wcpay_request:ok') {
// 使用以上方式判断前端返回,微信团队郑重提示:
// res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
this.$toast('支付成功')
// 支付成功后的回调函数
this.$emit('success', res)
},
fail: error => {
} else {
this.$toast('支付失败')
this.$emti('fail', error)
this.$emti('fail', res)
}
})
}
)
// wx.chooseWXPay({
// timestamp: options.timeStamp, // 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符
// nonceStr: options.nonceStr, // 支付签名随机串,不长于 32 位
// package: `prepay_id=${this.order.prepay_id}`, // 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=\*\*\*)
// signType: options.signType, // 签名方式,默认为'SHA1',使用新版支付需传入'MD5'
// paySign: options.paySign, // 支付签名
// success: res => {
// this.$toast('支付成功')
// // 支付成功后的回调函数
// this.$emit('success', res)
// },
// fail: error => {
// this.$toast('支付失败')
// this.$emti('fail', error)
// }
// })
},
pay() {
this.getOpenId()
......
<template>
<div class="main-container" v-show="loaded">
<ul v-if="list.length">
<li class="order-item" v-for="(item, index) in list" :key="index">
<ul v-if="dataList.length">
<li class="order-item" v-for="(item, index) in dataList" :key="index">
<div class="order-info">
<div class="no-c"></div>
<img :src="item.product_image" />
......@@ -28,8 +28,10 @@
<div class="close" @click="isPopShow = false">×</div>
<div class="tit">恭喜您,课程已购买成功!</div>
<div class="txt">请添加客服微信,有任何问题可随时沟通客服。</div>
<img src="../../assets/images/pay/pay-izq.png" alt="">
<a href="https://mp.weixin.qq.com/s/fwDqI1SFrk_bAyUrbLOvhg"><div class="btns">添加客服微信</div></a>
<img src="../../assets/images/pay/pay-izq.png" alt />
<a href="https://mp.weixin.qq.com/s/fwDqI1SFrk_bAyUrbLOvhg">
<div class="btns">添加客服微信</div>
</a>
<!-- <img @click="imagePreview" src="https://zws-imgs-pub.ezijing.com/static/public/dcef7bc62237a077b10d7e49c44a1e51.jpg" alt=""> -->
</div>
</div>
......@@ -50,14 +52,24 @@ export default {
goFlag: true
}
},
mounted() {
this.getMyOrder()
},
computed: {
isIos() {
return this.$store.state.isIos
},
isWeapp() {
return this.$store.state.isWeapp
},
// ios小程序里过滤未支付的订单
dataList() {
if (this.isIos && this.isWeapp) {
return this.list.filter(item => item.status !== '-1')
}
return this.list
}
},
mounted() {
this.getMyOrder()
},
filters: {
courseStatusText(status) {
return status === '1' ? '已付款' : '未付款'
......@@ -181,33 +193,33 @@ export default {
}
}
}
.succ-pop{
.succ-pop {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0,0,0,0.5);
.pop{
background: rgba(0, 0, 0, 0.5);
.pop {
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
width:5.9rem;
height:6.98rem;
background:rgba(255,255,255,1);
border-radius:.12rem;
.tit{
width: 5.9rem;
height: 6.98rem;
background: rgba(255, 255, 255, 1);
border-radius: 0.12rem;
.tit {
line-height: 1.1rem;
text-align: center;
font-size: .3rem;
font-size: 0.3rem;
color: #222;
font-weight: bold;
}
.txt{
width:5.1rem;
font-size: .3rem;
color:rgba(34,34,34,1);
.txt {
width: 5.1rem;
font-size: 0.3rem;
color: rgba(34, 34, 34, 1);
margin: 0 auto;
}
// img{
......@@ -216,28 +228,28 @@ export default {
// margin: 0.4rem auto;
// display: block;
// }
img{
img {
width: 3.16rem;
height: 3rem;
margin: 0.6rem auto 0.45rem auto;
display: block;
}
.btns{
.btns {
width: 4.5rem;
height: 0.7rem;
background: #C62245;
border-radius: .12rem;
background: #c62245;
border-radius: 0.12rem;
margin: 0 auto;
text-align: center;
line-height: 0.7rem;
font-size: .3rem;
font-size: 0.3rem;
color: #fff;
}
.close{
.close {
position: absolute;
top: -.8rem;
top: -0.8rem;
right: 0;
font-size: .6rem;
font-size: 0.6rem;
color: #fff;
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论