Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
project-online-old
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
project-online-old
Commits
07733669
提交
07733669
authored
1月 27, 2025
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: update
上级
7415c3dc
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
54 行增加
和
82 行删除
+54
-82
pay.vue
src/pages/train/components/pay.vue
+35
-54
form.vue
src/pages/train/form.vue
+18
-27
httpRequest.js
src/utils/httpRequest.js
+1
-1
没有找到文件。
src/pages/train/components/pay.vue
浏览文件 @
07733669
<
template
>
<
template
>
<div
class=
"pay-pop-box"
>
<div
class=
"pay-pop-box"
>
<div
class=
"content-box"
v-if=
"!is
CodeShow
"
>
<div
class=
"content-box"
v-if=
"!is
ShowQrCode
"
>
<i
class=
"el-icon-close"
@
click=
"$emit('close')"
></i>
<i
class=
"el-icon-close"
@
click=
"$emit('close')"
></i>
<div
class=
"tips-cen"
>
<div
class=
"tips-cen"
>
<div
class=
"name"
>
活动名称:
</div>
<div
class=
"name"
>
活动名称:
</div>
...
@@ -13,25 +13,24 @@
...
@@ -13,25 +13,24 @@
<div
class=
"tips-top"
>
<div
class=
"tips-top"
>
<div
class=
"name"
>
支付方式:
</div>
<div
class=
"name"
>
支付方式:
</div>
<div
class=
"pay-method"
>
<div
class=
"pay-method"
>
<div
:class=
"payMethod == 2 ? 'li active' : 'li'"
@
click=
"changePayMethod(2)"
>
<div
v-for=
"item in payMethodList"
:key=
"item.value"
:class=
"
{ li: true, active: payMethod == item.value }"
@click="payMethod = item.value">
<div
class=
"select-icon"
></div>
<div
class=
"select-icon"
></div>
<div
class=
"icon"
></div>
<div
class=
"icon"
></div>
<div
class=
"pay-text"
>
支付宝支付
</div>
<div
class=
"pay-text"
>
{{
item
.
name
}}
</div>
</div>
<div
:class=
"payMethod == 1 ? 'li active' : 'li'"
@
click=
"changePayMethod(1)"
>
<div
class=
"select-icon"
></div>
<div
class=
"icon"
></div>
<div
class=
"pay-text"
>
微信支付
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"pay-btn"
@
click=
"createOrder"
>
去支付
</div>
<div
class=
"pay-btn"
@
click=
"createOrder"
>
去支付
</div>
<div
class=
"tips-text"
>
注:请核对报名表信息,支付后将不能修改报名信息。
</div>
<div
class=
"tips-text"
>
注:请核对报名表信息,支付后将不能修改报名信息。
</div>
</div>
</div>
<div
class=
"content-box
ewm-code"
v-if=
"isCodeShow
"
>
<div
class=
"content-box
qr-code"
v-if=
"isShowQrCode
"
>
<i
class=
"el-icon-close"
@
click=
"closeClear"
></i>
<i
class=
"el-icon-close"
@
click=
"closeClear"
></i>
<div
class=
"title"
>
{{
payMethod
==
1
?
'微信
支付'
:
'支付宝支付'
}}
</div>
<div
class=
"title"
>
{{
payMethod
==
1
?
'微信
'
:
'支付宝'
}}
支付
</div>
<div
class=
"
ewm
-box"
>
<div
class=
"
qr
-box"
>
<div
class=
"block"
>
<div
class=
"block"
>
<qrcode-vue
:value=
"payInfo.url"
size=
"200"
></qrcode-vue>
<qrcode-vue
:value=
"payInfo.url"
size=
"200"
></qrcode-vue>
</div>
</div>
...
@@ -52,15 +51,16 @@ export default {
...
@@ -52,15 +51,16 @@ export default {
data
()
{
data
()
{
return
{
return
{
payMethod
:
2
,
payMethod
:
2
,
isCodeShow
:
false
,
payMethodList
:
[
{
name
:
'支付宝支付'
,
value
:
2
},
{
name
:
'微信支付'
,
value
:
1
},
],
isShowQrCode
:
false
,
payInfo
:
{},
payInfo
:
{},
timer
:
null
,
timer
:
null
,
}
}
},
},
methods
:
{
methods
:
{
changePayMethod
(
n
)
{
this
.
payMethod
=
n
},
async
createOrder
()
{
async
createOrder
()
{
const
loading
=
this
.
$loading
({
const
loading
=
this
.
$loading
({
lock
:
true
,
lock
:
true
,
...
@@ -79,7 +79,7 @@ export default {
...
@@ -79,7 +79,7 @@ export default {
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
if
(
res
.
code
===
200
)
{
if
(
res
.
code
===
200
)
{
this
.
payInfo
=
res
.
data
this
.
payInfo
=
res
.
data
this
.
is
CodeShow
=
true
this
.
is
ShowQrCode
=
true
clearInterval
(
this
.
timer
)
clearInterval
(
this
.
timer
)
this
.
timer
=
setInterval
(()
=>
{
this
.
timer
=
setInterval
(()
=>
{
this
.
checkPay
(
res
.
data
.
pay_order_id
,
res
.
data
.
order_no
)
this
.
checkPay
(
res
.
data
.
pay_order_id
,
res
.
data
.
order_no
)
...
@@ -91,34 +91,27 @@ export default {
...
@@ -91,34 +91,27 @@ export default {
}
}
})
})
},
},
checkPay
(
id
,
order_no
)
{
async
checkPay
(
id
,
order_no
)
{
api
.
checkPay
(
id
).
then
((
res
)
=>
{
const
{
code
,
data
}
=
await
api
.
checkPay
(
id
)
if
(
res
.
code
===
0
)
{
if
(
code
===
0
)
{
const
[
order
=
{}]
=
res
.
data
const
[
order
=
{}]
=
data
if
(
order
.
status
===
1
)
{
if
(
order
.
status
===
1
)
{
this
.
$message
({
this
.
$message
({
message
:
'支付成功'
,
type
:
'success'
})
message
:
'支付成功'
,
await
this
.
payEnd
(
order_no
)
type
:
'success'
,
this
.
$emit
(
'success'
)
})
clearInterval
(
this
.
timer
)
this
.
payEnd
(
order_no
)
}
else
if
(
order
.
status
!==
0
)
{
this
.
$emit
(
'payStatus'
)
clearInterval
(
this
.
timer
)
clearInterval
(
this
.
timer
)
}
else
if
(
order
.
status
!==
0
)
{
clearInterval
(
this
.
timer
)
}
}
}
}
)
}
},
},
closeClear
()
{
closeClear
()
{
this
.
is
CodeShow
=
false
this
.
is
ShowQrCode
=
false
this
.
$emit
(
'close'
)
this
.
$emit
(
'close'
)
clearInterval
(
this
.
timer
)
},
},
payEnd
(
orderOn
)
{
async
payEnd
(
orderNo
)
{
const
param
=
{
await
api
.
payEnd
({
order_no
:
orderNo
,
form_id
:
this
.
form
.
id
})
order_no
:
orderOn
,
form_id
:
this
.
form
.
id
,
}
api
.
payEnd
(
param
)
},
},
},
},
beforeDestroy
()
{
beforeDestroy
()
{
...
@@ -131,14 +124,14 @@ export default {
...
@@ -131,14 +124,14 @@ export default {
width
:
100%
;
width
:
100%
;
height
:
100%
;
height
:
100%
;
.content-box
{
.content-box
{
&
.
ewm
-code
{
&
.
qr
-code
{
padding
:
21px
21px
88px
;
padding
:
21px
21px
88px
;
.title
{
.title
{
font-size
:
18px
;
font-size
:
18px
;
color
:
#333333
;
color
:
#333333
;
line-height
:
25px
;
line-height
:
25px
;
}
}
.
ewm
-box
{
.
qr
-box
{
width
:
220px
;
width
:
220px
;
margin
:
43px
auto
0
;
margin
:
43px
auto
0
;
text-align
:
center
;
text-align
:
center
;
...
@@ -160,7 +153,7 @@ export default {
...
@@ -160,7 +153,7 @@ export default {
position
:
absolute
;
position
:
absolute
;
top
:
50%
;
top
:
50%
;
left
:
50%
;
left
:
50%
;
-webkit-
transform
:
translate
(
-50%
,
-50%
);
transform
:
translate
(
-50%
,
-50%
);
width
:
735px
;
width
:
735px
;
height
:
426px
;
height
:
426px
;
background
:
#ffffff
;
background
:
#ffffff
;
...
@@ -231,12 +224,6 @@ export default {
...
@@ -231,12 +224,6 @@ export default {
background
:
url(https://zws-imgs-pub.ezijing.com/static/public/189526ea395b7a1a3b47ffea73d25b95.png)
;
background
:
url(https://zws-imgs-pub.ezijing.com/static/public/189526ea395b7a1a3b47ffea73d25b95.png)
;
background-size
:
100%
100%
;
background-size
:
100%
100%
;
}
}
&
.active
{
.icon
{
background
:
url(https://zws-imgs-pub.ezijing.com/static/public/189526ea395b7a1a3b47ffea73d25b95.png)
;
background-size
:
100%
100%
;
}
}
}
}
&
:nth-child
(
2
)
{
&
:nth-child
(
2
)
{
margin-top
:
15px
;
margin-top
:
15px
;
...
@@ -246,12 +233,6 @@ export default {
...
@@ -246,12 +233,6 @@ export default {
background
:
url(https://zws-imgs-pub.ezijing.com/static/public/e7db788a3194460535d6543cc358a5f5.png)
;
background
:
url(https://zws-imgs-pub.ezijing.com/static/public/e7db788a3194460535d6543cc358a5f5.png)
;
background-size
:
100%
100%
;
background-size
:
100%
100%
;
}
}
&
.active
{
.icon
{
background
:
url(https://zws-imgs-pub.ezijing.com/static/public/e7db788a3194460535d6543cc358a5f5.png)
;
background-size
:
100%
100%
;
}
}
}
}
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
...
...
src/pages/train/form.vue
浏览文件 @
07733669
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
<el-form-item
label=
"验证码"
prop=
"code"
v-if=
"!isLogin"
required
>
<el-form-item
label=
"验证码"
prop=
"code"
v-if=
"!isLogin"
required
>
<el-input
v-model=
"form.code"
>
<el-input
v-model=
"form.code"
>
<template
#
append
>
<template
#
append
>
<countdown
@
start=
"getCheckedCode
"
></countdown>
<countdown
size=
"small"
:disabled=
"disabledSend"
@
start=
"sendCodeRequest"
ref=
"countdown
"
></countdown>
</
template
>
</
template
>
</el-input>
</el-input>
</el-form-item>
</el-form-item>
...
@@ -191,6 +191,9 @@ export default {
...
@@ -191,6 +191,9 @@ export default {
train
()
{
train
()
{
return
datalist
.
find
((
item
)
=>
item
.
id
==
this
.
id
)
||
{}
return
datalist
.
find
((
item
)
=>
item
.
id
==
this
.
id
)
||
{}
},
},
disabledSend
()
{
return
!
MOBILE_REG
.
test
(
this
.
form
.
mobile
)
},
},
},
created
()
{
created
()
{
if
(
!
this
.
id
)
{
if
(
!
this
.
id
)
{
...
@@ -226,33 +229,21 @@ export default {
...
@@ -226,33 +229,21 @@ export default {
project_id
:
5009
,
project_id
:
5009
,
})
})
}
}
const
{
code
}
=
await
api
.
submitForm
({
...
this
.
form
,
periods
:
this
.
id
})
await
api
.
submitForm
({
...
this
.
form
,
periods
:
this
.
id
})
if
(
code
===
200
)
{
this
.
$message
.
success
(
'报名信息提交成功'
)
this
.
$message
.
success
(
'报名信息提交成功'
)
this
.
getDetail
()
this
.
getDetail
()
}
else
{
this
.
$message
.
error
(
'报名信息提交失败'
)
}
},
},
getCheckedCode
()
{
// 发送验证码
if
(
!
this
.
form
.
mobile
)
{
sendCodeRequest
()
{
this
.
$message
(
'请填写手机号'
)
api
.
sendCode
({
account
:
this
.
form
.
mobile
,
service
:
'eec.ezijing.com'
}).
then
((
res
)
=>
{
}
else
if
(
!
MOBILE_REG
.
test
(
this
.
form
.
mobile
))
{
if
(
res
.
code
===
0
)
{
this
.
$message
(
'手机号格式错误'
)
this
.
$message
({
message
:
'验证码发送成功'
,
type
:
'success'
})
}
else
{
}
else
{
api
// 停止计时
.
sendCode
({
this
.
$refs
.
countdown
.
stop
()
account
:
this
.
form
.
mobile
,
this
.
$message
({
message
:
res
.
msg
||
'发送验证码失败'
,
type
:
'error'
})
service
:
'sofia.ezijing.com'
,
}
})
})
.
then
((
res
)
=>
{
if
(
res
&&
res
.
code
===
0
)
{
this
.
$message
({
message
:
'验证码发送成功'
,
type
:
'success'
})
}
else
{
this
.
$message
({
message
:
res
.
msg
||
'发送验证码失败'
,
type
:
'error'
})
}
})
}
},
},
},
},
}
}
...
...
src/utils/httpRequest.js
浏览文件 @
07733669
...
@@ -61,7 +61,7 @@ httpRequest.interceptors.response.use(
...
@@ -61,7 +61,7 @@ httpRequest.interceptors.response.use(
function
(
response
)
{
function
(
response
)
{
const
{
config
,
data
}
=
response
const
{
config
,
data
}
=
response
if
(
config
.
url
.
includes
(
'/api/microservices'
)
&&
data
.
code
!==
200
)
{
if
(
config
.
url
.
includes
(
'/api/microservices'
)
&&
data
.
code
!==
200
)
{
Message
.
error
(
data
.
message
)
Message
.
error
(
data
.
message
||
data
.
msg
)
return
Promise
.
reject
(
data
)
return
Promise
.
reject
(
data
)
}
}
return
data
return
data
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论