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
18b01cd9
提交
18b01cd9
authored
4月 25, 2022
作者:
lihuihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
上级
40899535
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
89 行增加
和
49 行删除
+89
-49
main.js
src/main.js
+6
-0
api.js
src/modules/home/api.js
+1
-1
OrderConfirm.vue
src/modules/home/views/OrderConfirm.vue
+47
-32
SignMainPage.vue
src/modules/home/views/SignMainPage.vue
+35
-16
没有找到文件。
src/main.js
浏览文件 @
18b01cd9
...
@@ -24,6 +24,12 @@ modules({ router, store })
...
@@ -24,6 +24,12 @@ modules({ router, store })
router
.
beforeEach
(
beforeEnter
)
router
.
beforeEach
(
beforeEnter
)
// const originalPush = Router.prototype.push
// Router.prototype.push = function push(location) {
// return originalPush.call(this, location).catch(err => err)
// }
new
Vue
({
new
Vue
({
store
,
store
,
router
,
router
,
...
...
src/modules/home/api.js
浏览文件 @
18b01cd9
...
@@ -47,5 +47,5 @@ export function importPeople(data) {
...
@@ -47,5 +47,5 @@ export function importPeople(data) {
}
}
// 获取openid
// 获取openid
export
function
getOpenid
(
data
)
{
export
function
getOpenid
(
data
)
{
return
httpRequest
.
post
(
'/api/
regis
ter/v2/frontend/wechat/get-openid'
,
data
)
return
httpRequest
.
post
(
'/api/
usercen
ter/v2/frontend/wechat/get-openid'
,
data
)
}
}
src/modules/home/views/OrderConfirm.vue
浏览文件 @
18b01cd9
...
@@ -132,7 +132,11 @@ export default {
...
@@ -132,7 +132,11 @@ export default {
payDetail
:
{},
payDetail
:
{},
selctOrderData
:
[],
// 选中的数据
selctOrderData
:
[],
// 选中的数据
stepOrderInfo
:
[],
stepOrderInfo
:
[],
payType
:
[]
payType
:
[],
// 判断是否是支付宝
isAlipay
:
/AlipayClient/
.
test
(
window
.
navigator
.
userAgent
),
// 判断微信
isWx
:
/MicroMessenger/
.
test
(
window
.
navigator
.
userAgent
)
}
}
},
},
...
@@ -161,15 +165,14 @@ export default {
...
@@ -161,15 +165,14 @@ export default {
}
}
},
},
created
()
{
created
()
{
if
(
this
.
$route
.
query
.
qr
!==
undefined
)
{
//
if (this.$route.query.qr !== undefined) {
this
.
payDetail
=
JSON
.
parse
(
window
.
localStorage
.
payDetail
)
//
this.payDetail = JSON.parse(window.localStorage.payDetail)
}
//
}
},
},
mounted
()
{
mounted
()
{
if
(
this
.
isPc
())
{
if
(
this
.
isPc
())
{
document
.
getElementById
(
'main_footer'
).
style
.
width
=
'400px'
document
.
getElementById
(
'main_footer'
).
style
.
width
=
'400px'
}
}
// console.log(JSON.parse(window.localStorage.stepData), 'data')
this
.
payMode
=
this
.
data
.
pay_type
[
0
]
this
.
payMode
=
this
.
data
.
pay_type
[
0
]
},
},
methods
:
{
methods
:
{
...
@@ -255,7 +258,7 @@ export default {
...
@@ -255,7 +258,7 @@ export default {
wxAuthorize
(
call
)
{
wxAuthorize
(
call
)
{
if
(
!
this
.
$route
.
query
.
code
)
{
if
(
!
this
.
$route
.
query
.
code
)
{
const
url
=
encodeURIComponent
(
window
.
location
.
href
)
const
url
=
encodeURIComponent
(
window
.
location
.
href
)
console
.
log
(
url
,
'123'
,
window
.
location
.
href
)
console
.
log
(
url
)
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`
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
{
}
else
{
getOpenid
({
code
:
this
.
$route
.
query
.
code
,
identity
:
'road'
}).
then
(
res
=>
{
getOpenid
({
code
:
this
.
$route
.
query
.
code
,
identity
:
'road'
}).
then
(
res
=>
{
...
@@ -264,11 +267,6 @@ export default {
...
@@ -264,11 +267,6 @@ export default {
}
}
},
},
getPayDetail
()
{
getPayDetail
()
{
// 判断是否是支付宝
const
isAlipay
=
/AlipayClient/
.
test
(
window
.
navigator
.
userAgent
)
// 判断微信
const
isWx
=
/MicroMessenger/
.
test
(
window
.
navigator
.
userAgent
)
// let ua = window.navigator.userAgent.toLowerCase()
// 选择微信和支付宝支付走这
// 选择微信和支付宝支付走这
if
(
this
.
payMode
!==
'3'
)
{
if
(
this
.
payMode
!==
'3'
)
{
// const ua = window.navigator.userAgent.toLowerCase()
// const ua = window.navigator.userAgent.toLowerCase()
...
@@ -279,26 +277,32 @@ export default {
...
@@ -279,26 +277,32 @@ export default {
pay_type
:
this
.
payMode
===
'1'
?
'1'
:
'11'
pay_type
:
this
.
payMode
===
'1'
?
'1'
:
'11'
}
}
// 支付宝环境支付
// 支付宝环境支付
if
(
isAlipay
)
{
// if (this.isAlipay) {
params
.
pay_type
=
'12'
// params.pay_type = '12'
const
url
=
// const url =
window
.
location
.
href
.
indexOf
(
'?'
)
===
-
1
// window.location.href.indexOf('?') === -1
?
`
${
encodeURIComponent
(
window
.
location
.
href
)}
?qr=1`
// ? `${encodeURIComponent(window.location.href)}?qr=1`
:
`
${
encodeURIComponent
(
window
.
location
.
href
)}
&qr=1`
// : `${encodeURIComponent(window.location.href)}&qr=1`
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
)
// 微信环境支付
if
(
this
.
isWx
)
{
params
.
pay_type
=
'3'
// 没有openid去授权获取
if
(
!
window
.
localStorage
.
openId
)
{
this
.
wxAuthorize
(
res
=>
{
params
.
openid
=
res
.
openid
window
.
localStorage
.
openId
=
res
.
openid
this
.
getPayInfo
(
params
)
})
}
else
{
params
.
openid
=
window
.
localStorage
.
openId
this
.
getPayInfo
(
params
)
}
}
else
{
this
.
getPayInfo
(
params
)
}
}
else
{
}
else
{
// 线下支付
// 线下支付
this
.
data
.
params
=
{
this
.
data
.
params
=
{
...
@@ -308,7 +312,7 @@ export default {
...
@@ -308,7 +312,7 @@ export default {
this
.
isQrPageShow
=
true
this
.
isQrPageShow
=
true
}
}
},
},
getPayInfo
(
params
,
isAlipay
)
{
getPayInfo
(
params
)
{
// 获取支付二维码 订单id
// 获取支付二维码 订单id
getPayInfo
(
params
).
then
(
res
=>
{
getPayInfo
(
params
).
then
(
res
=>
{
this
.
data
.
payMode
=
this
.
payMode
this
.
data
.
payMode
=
this
.
payMode
...
@@ -317,9 +321,20 @@ export default {
...
@@ -317,9 +321,20 @@ export default {
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
(
isAlipay
)
{
if
(
this
.
isAlipay
)
{
window
.
location
.
href
=
res
.
data
.
url
window
.
location
.
href
=
res
.
data
.
url
}
}
if
(
this
.
isWx
)
{
// 拉起微信支付
window
.
WeixinJSBridge
.
invoke
(
'getBrandWCPayRequest'
,
JSON
.
parse
(
res
.
data
.
more_info
),
res
=>
{
// if (res.err_msg === 'get_brand_wcpay_request:ok') {
// console.log(res, 'zhifu')
// } else {
// console.log(res, 'zhifu2')
// }
})
}
window
.
sessionStorage
.
isCodePage
=
true
this
.
isQrPageShow
=
true
this
.
isQrPageShow
=
true
}
}
if
(
res
.
code
===
100
)
{
if
(
res
.
code
===
100
)
{
...
...
src/modules/home/views/SignMainPage.vue
浏览文件 @
18b01cd9
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
:stepList=
"stepList"
:stepList=
"stepList"
@
prev=
"handlePrev"
@
prev=
"handlePrev"
@
next=
"handleNext"
@
next=
"handleNext"
v-if=
"setpItem.type === 2"
v-if=
"setpItem.type === 2
&& stepList.length
"
/>
/>
<!-- 支付页面 -->
<!-- 支付页面 -->
<order-confirm
<order-confirm
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
@
next=
"handleNext"
@
next=
"handleNext"
:stepList=
"stepList"
:stepList=
"stepList"
:data=
"setpItem"
:data=
"setpItem"
v-if=
"setpItem.type === 3"
v-if=
"setpItem.type === 3
&& stepList.length
"
></order-confirm>
></order-confirm>
</
template
>
</
template
>
</div>
</div>
...
@@ -55,22 +55,18 @@ export default {
...
@@ -55,22 +55,18 @@ export default {
},
},
computed
:
{
computed
:
{
setpItem
()
{
setpItem
()
{
// return this.stepList[2]
// console.log(this.stepList, this.$route.query.index)
return
this
.
stepList
[
this
.
stepIndex
]
let
item
=
{}
// return this.stepList[this.$route.query.id ? this.stepIndex : this.stepIndex + 1]
const
queryIndex
=
parseInt
(
this
.
$route
.
query
.
index
)
if
(
queryIndex
&&
queryIndex
!==
0
)
{
item
=
JSON
.
parse
(
window
.
localStorage
.
stepData
).
stepList
[
queryIndex
]
}
else
{
item
=
this
.
stepList
[
this
.
stepIndex
]
}
// return this.stepList[this.$route.query.index !== undefined ? parseInt(this.$route.query.index) : this.stepIndex]
return
item
}
}
},
},
// watch: {
// '$route.query': {
// immediate: true,
// handler(query) {
// console.log(query)
// if (query.stepIndex) {
// this.stepIndex = query.stepIndex
// }
// }
// }
// },
mounted
()
{
mounted
()
{
if
(
this
.
$route
.
query
.
qr
===
undefined
)
{
if
(
this
.
$route
.
query
.
qr
===
undefined
)
{
if
(
this
.
$route
.
query
.
id
)
{
if
(
this
.
$route
.
query
.
id
)
{
...
@@ -244,6 +240,7 @@ export default {
...
@@ -244,6 +240,7 @@ export default {
if
(
this
.
$route
.
query
.
stepIndex
!==
undefined
)
{
if
(
this
.
$route
.
query
.
stepIndex
!==
undefined
)
{
this
.
stepIndex
=
this
.
$route
.
query
.
stepIndex
this
.
stepIndex
=
this
.
$route
.
query
.
stepIndex
}
}
console
.
log
(
this
.
stepList
,
'12331'
)
},
},
handlePrev
()
{
handlePrev
()
{
if
(
this
.
stepIndex
<=
0
)
{
if
(
this
.
stepIndex
<=
0
)
{
...
@@ -251,6 +248,7 @@ export default {
...
@@ -251,6 +248,7 @@ export default {
}
else
{
}
else
{
this
.
stepIndex
--
this
.
stepIndex
--
}
}
this
.
setQuery
()
},
},
handleNext
(
data
)
{
handleNext
(
data
)
{
if
(
this
.
setpItem
.
num
!==
this
.
stepList
[
this
.
stepList
.
length
-
1
].
num
)
{
if
(
this
.
setpItem
.
num
!==
this
.
stepList
[
this
.
stepList
.
length
-
1
].
num
)
{
...
@@ -262,7 +260,28 @@ export default {
...
@@ -262,7 +260,28 @@ export default {
index
:
this
.
stepIndex
,
index
:
this
.
stepIndex
,
stepList
:
this
.
stepList
stepList
:
this
.
stepList
}
}
this
.
setQuery
()
window
.
localStorage
.
stepData
=
JSON
.
stringify
(
stringData
)
window
.
localStorage
.
stepData
=
JSON
.
stringify
(
stringData
)
this
.
$route
.
query
.
index
=
this
.
stepIndex
}
},
setQuery
()
{
const
query
=
{
id
:
this
.
$route
.
query
.
id
,
index
:
this
.
stepIndex
}
if
(
this
.
$route
.
query
.
index
)
{
if
(
this
.
stepIndex
!==
parseInt
(
this
.
$route
.
query
.
index
))
{
this
.
$router
.
push
({
path
:
window
.
location
.
pathname
,
query
:
query
})
}
}
else
{
this
.
$router
.
push
({
path
:
window
.
location
.
pathname
,
query
:
query
})
}
}
}
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论