Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-register-show-h5
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-register-show-h5
Commits
40899535
提交
40899535
authored
4月 25, 2022
作者:
lihuihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
上级
47cdbb03
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
48 行增加
和
12 行删除
+48
-12
MP_verify_HNvRVFt0FD3vltU7.txt
MP_verify_HNvRVFt0FD3vltU7.txt
+2
-0
api.js
src/modules/home/api.js
+4
-0
OrderConfirm.vue
src/modules/home/views/OrderConfirm.vue
+42
-12
没有找到文件。
MP_verify_HNvRVFt0FD3vltU7.txt
0 → 100644
浏览文件 @
40899535
HNvRVFt0FD3vltU7
\ No newline at end of file
src/modules/home/api.js
浏览文件 @
40899535
...
@@ -45,3 +45,7 @@ export function importPeople(data) {
...
@@ -45,3 +45,7 @@ export function importPeople(data) {
withCredentials
:
true
withCredentials
:
true
})
})
}
}
// 获取openid
export
function
getOpenid
(
data
)
{
return
httpRequest
.
post
(
'/api/register/v2/frontend/wechat/get-openid'
,
data
)
}
src/modules/home/views/OrderConfirm.vue
浏览文件 @
40899535
...
@@ -108,7 +108,7 @@
...
@@ -108,7 +108,7 @@
</template>
</template>
<
script
>
<
script
>
import
{
getPayInfo
}
from
'../api'
import
{
getPayInfo
,
getOpenid
}
from
'../api'
import
PayDetail
from
'./PayDetail.vue'
import
PayDetail
from
'./PayDetail.vue'
import
Commonheader
from
'../components/Commonheader.vue'
import
Commonheader
from
'../components/Commonheader.vue'
import
OfflinePay
from
'../components/OfflinePay.vue'
import
OfflinePay
from
'../components/OfflinePay.vue'
...
@@ -251,7 +251,23 @@ export default {
...
@@ -251,7 +251,23 @@ export default {
onSubmit
()
{
onSubmit
()
{
this
.
getPayDetail
()
this
.
getPayDetail
()
},
},
// 微信授权
wxAuthorize
(
call
)
{
if
(
!
this
.
$route
.
query
.
code
)
{
const
url
=
encodeURIComponent
(
window
.
location
.
href
)
console
.
log
(
url
,
'123'
,
window
.
location
.
href
)
window
.
location
.
href
=
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa41d0081d4889921&redirect_uri=
${
url
}
&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`
}
else
{
getOpenid
({
code
:
this
.
$route
.
query
.
code
,
identity
:
'road'
}).
then
(
res
=>
{
call
(
res
)
})
}
},
getPayDetail
()
{
getPayDetail
()
{
// 判断是否是支付宝
const
isAlipay
=
/AlipayClient/
.
test
(
window
.
navigator
.
userAgent
)
// 判断微信
const
isWx
=
/MicroMessenger/
.
test
(
window
.
navigator
.
userAgent
)
// let ua = window.navigator.userAgent.toLowerCase()
// let ua = window.navigator.userAgent.toLowerCase()
// 选择微信和支付宝支付走这
// 选择微信和支付宝支付走这
if
(
this
.
payMode
!==
'3'
)
{
if
(
this
.
payMode
!==
'3'
)
{
...
@@ -262,7 +278,8 @@ export default {
...
@@ -262,7 +278,8 @@ export default {
join_rand
:
this
.
data
.
payData
.
join_rand
,
join_rand
:
this
.
data
.
payData
.
join_rand
,
pay_type
:
this
.
payMode
===
'1'
?
'1'
:
'11'
pay_type
:
this
.
payMode
===
'1'
?
'1'
:
'11'
}
}
if
(
/AlipayClient/
.
test
(
window
.
navigator
.
userAgent
))
{
// 支付宝环境支付
if
(
isAlipay
)
{
params
.
pay_type
=
'12'
params
.
pay_type
=
'12'
const
url
=
const
url
=
window
.
location
.
href
.
indexOf
(
'?'
)
===
-
1
window
.
location
.
href
.
indexOf
(
'?'
)
===
-
1
...
@@ -271,6 +288,27 @@ export default {
...
@@ -271,6 +288,27 @@ export default {
params
.
redirect_url
=
params
.
redirect_url
=
window
.
location
.
href
.
indexOf
(
'qr'
)
!==
-
1
?
encodeURIComponent
(
window
.
location
.
href
)
:
url
window
.
location
.
href
.
indexOf
(
'qr'
)
!==
-
1
?
encodeURIComponent
(
window
.
location
.
href
)
:
url
}
}
// 微信环境支付
console
.
log
(
isWx
)
// if (isWx) {
// this.wxAuthorize((res) => {
// this.getPayInfo(params, isAlipay)
// })
// params.pay_type = '3'
// } else {
// this.getPayInfo(params, isAlipay)
// }
this
.
getPayInfo
(
params
,
isAlipay
)
}
else
{
// 线下支付
this
.
data
.
params
=
{
pay_record_ids
:
this
.
selctOrderData
.
map
(
item
=>
item
.
pay_record
.
id
).
toString
(),
join_rand
:
this
.
data
.
payData
.
join_rand
}
this
.
isQrPageShow
=
true
}
},
getPayInfo
(
params
,
isAlipay
)
{
// 获取支付二维码 订单id
// 获取支付二维码 订单id
getPayInfo
(
params
).
then
(
res
=>
{
getPayInfo
(
params
).
then
(
res
=>
{
this
.
data
.
payMode
=
this
.
payMode
this
.
data
.
payMode
=
this
.
payMode
...
@@ -278,8 +316,8 @@ export default {
...
@@ -278,8 +316,8 @@ export default {
this
.
payDetail
=
Object
.
assign
({
qrData
:
res
.
data
},
this
.
data
)
this
.
payDetail
=
Object
.
assign
({
qrData
:
res
.
data
},
this
.
data
)
this
.
payDetail
.
order_id
=
res
.
data
.
order_id
this
.
payDetail
.
order_id
=
res
.
data
.
order_id
window
.
localStorage
.
payDetail
=
JSON
.
stringify
(
this
.
payDetail
)
window
.
localStorage
.
payDetail
=
JSON
.
stringify
(
this
.
payDetail
)
if
(
/AlipayClient/
.
test
(
window
.
navigator
.
userAgent
))
{
// 支付宝
// window.localStorage.payUrl = res.data.url
if
(
isAlipay
)
{
window
.
location
.
href
=
res
.
data
.
url
window
.
location
.
href
=
res
.
data
.
url
}
}
this
.
isQrPageShow
=
true
this
.
isQrPageShow
=
true
...
@@ -296,14 +334,6 @@ export default {
...
@@ -296,14 +334,6 @@ export default {
this
.
stepList
.
length
===
this
.
data
.
num
?
this
.
$router
.
push
(
'/'
)
:
this
.
$emit
(
'next'
)
this
.
stepList
.
length
===
this
.
data
.
num
?
this
.
$router
.
push
(
'/'
)
:
this
.
$emit
(
'next'
)
}
}
})
})
}
else
{
// 线下支付
this
.
data
.
params
=
{
pay_record_ids
:
this
.
selctOrderData
.
map
(
item
=>
item
.
pay_record
.
id
).
toString
(),
join_rand
:
this
.
data
.
payData
.
join_rand
}
this
.
isQrPageShow
=
true
}
}
}
}
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论