Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
T
transport-show-h5
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
transport-show-h5
Commits
feb447a9
提交
feb447a9
authored
9月 11, 2020
作者:
lihuihui
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
https://gitlab.ezijing.com/ezijing/transport-weapp-h5
上级
3d91241f
d961ead5
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
77 行增加
和
42 行删除
+77
-42
h5Pay.vue
src/pages/buy/components/h5Pay.vue
+37
-14
buyCourses.vue
src/pages/my/buyCourses.vue
+40
-28
没有找到文件。
src/pages/buy/components/h5Pay.vue
浏览文件 @
feb447a9
...
...
@@ -51,22 +51,45 @@ export default {
// 微信支付
wxPay
()
{
const
options
=
this
.
order
.
options
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
)
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
// 支付签名
},
fail
:
error
=>
{
this
.
$toast
(
'支付失败'
)
this
.
$emti
(
'fail'
,
error
)
function
(
res
)
{
if
(
res
.
err_msg
===
'get_brand_wcpay_request:ok'
)
{
// 使用以上方式判断前端返回,微信团队郑重提示:
// res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
this
.
$toast
(
'支付成功'
)
// 支付成功后的回调函数
this
.
$emit
(
'success'
,
res
)
}
else
{
this
.
$toast
(
'支付失败'
)
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
()
...
...
src/pages/my/buyCourses.vue
浏览文件 @
feb447a9
<
template
>
<div
class=
"main-container"
v-show=
"loaded"
>
<ul
v-if=
"
l
ist.length"
>
<li
class=
"order-item"
v-for=
"(item, index) in
l
ist"
:key=
"index"
>
<ul
v-if=
"
dataL
ist.length"
>
<li
class=
"order-item"
v-for=
"(item, index) in
dataL
ist"
: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
:
#
C
62245
;
border-radius
:
.12rem
;
background
:
#
c
62245
;
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
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论