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
4f89b536
提交
4f89b536
authored
3月 24, 2022
作者:
lihuihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
上级
455a498e
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
279 行增加
和
373 行删除
+279
-373
.eslintrc.js
.eslintrc.js
+1
-0
ImgShow.vue
src/modules/home/components/ImgShow.vue
+10
-14
SignForm.vue
src/modules/home/components/SignForm.vue
+43
-163
MyOrder.vue
src/modules/home/views/MyOrder.vue
+2
-5
OrderConfirm.vue
src/modules/home/views/OrderConfirm.vue
+66
-76
PayDetail.vue
src/modules/home/views/PayDetail.vue
+29
-39
SignMainPage.vue
src/modules/home/views/SignMainPage.vue
+127
-75
vite.config.js
vite.config.js
+1
-1
没有找到文件。
.eslintrc.js
浏览文件 @
4f89b536
...
...
@@ -4,6 +4,7 @@ module.exports = {
},
extends
:
[
'plugin:vue/essential'
,
'standard'
],
rules
:
{
'vue/no-mutating-props'
:
'off'
,
// 暂时关闭
'vue/comment-directive'
:
'off'
,
'space-before-function-paren'
:
'off'
}
...
...
src/modules/home/components/ImgShow.vue
浏览文件 @
4f89b536
<
template
>
<div
class=
"main"
>
<commonheader
@
back=
"handlePrev"
:callBack=
"true"
/>
<!-- 展示页面 -->
<div
class=
"show_content"
>
<div
class=
"show_content_img"
v-html=
"data.desc"
></div>
...
...
@@ -9,26 +10,21 @@
</
template
>
<
script
>
import
Commonheader
from
'../components/Commonheader.vue'
export
default
{
components
:
{
Commonheader
},
props
:
{
stepList
:
{
type
:
Array
},
data
:
{
type
:
Object
},
// eslint-disable-next-line vue/require-prop-type-constructor
stepIndex
:
0
data
:
{
type
:
Object
}
},
mounted
()
{
},
methods
:
{
handlePrev
()
{
this
.
$emit
(
'prev'
)
},
handleSubmit
()
{
const
lastorder
=
this
.
stepList
[
this
.
stepList
.
length
-
1
].
order
if
(
lastorder
===
this
.
data
.
order
)
{
this
.
$router
.
push
(
'/'
)
}
else
{
this
.
$emit
(
'next'
)
}
this
.
$emit
(
'next'
)
}
},
mounted
()
{
window
.
localStorage
.
setItem
(
'stepForm'
,
this
.
formList
)
}
}
</
script
>
...
...
src/modules/home/components/SignForm.vue
浏览文件 @
4f89b536
...
...
@@ -4,12 +4,12 @@
<div
class=
"main_content_banner"
v-html=
"data.desc"
></div>
<div
class=
"main_content_form"
>
<van-form>
<div
v-for=
"(listIt, formIndex) in
formList
"
:key=
"formIndex"
class=
"main_content_form_list"
>
<div
v-for=
"(listIt, formIndex) in
data.user_fields
"
:key=
"formIndex"
class=
"main_content_form_list"
>
<img
src=
"https://webapp-pub.ezijing.com/highway/h5/form_minus.png"
class=
"btn_minus"
@
click=
"handleMinus(formIndex)"
v-if=
"form
List.length > 1 && form
Index !== 0"
v-if=
"formIndex !== 0"
/>
<div
class=
"formItemList_item"
v-for=
"(item, index) in listIt"
:key=
"index"
>
<!-- 输入框 -->
...
...
@@ -77,16 +77,11 @@
</van-popup>
</div>
</div>
<div
class=
"btn_operate"
>
<img
src=
"https://webapp-pub.ezijing.com/highway/h5/form_add.png"
class=
"btn_add"
@
click=
"handleAdd"
v-if=
"formIndex === formList.length - 1"
/>
</div>
</div>
</van-form>
<div
class=
"btn_operate"
>
<img
src=
"https://webapp-pub.ezijing.com/highway/h5/form_add.png"
class=
"btn_add"
@
click=
"handleAdd"
/>
</div>
</div>
<div
class=
"main_content_footer"
>
<
template
v-if=
"data.can_skip_pay === 1"
>
...
...
@@ -109,193 +104,78 @@
<
script
>
import
{
saveStepInfo
}
from
'../api'
import
allFormList
from
'@/utils/formList'
export
default
{
props
:
{
stepList
:
{
type
:
Array
},
data
:
{
type
:
Object
},
stepIndex
:
{
type
:
Number
},
isShowSkip
:
{
type
:
String
},
personalInfo
:
{
type
:
Object
},
detailList
:
{
type
:
Object
},
myInfoList
:
{
type
:
Array
},
order_join_rand
:
{
type
:
String
}
}
},
data
()
{
return
{
checkedPay
:
false
,
checkedPay
:
false
,
// 勾选是否跳过按钮
index
:
0
,
cIndex
:
0
,
showPicker
:
false
,
showPickerTime
:
false
,
formList
:
[],
form
:
{},
stepOrderInfo
:
{},
join_rand
:
''
showPickerTime
:
false
}
},
mounted
()
{
console
.
log
(
this
.
stepList
,
'stepList'
)
console
.
log
(
this
.
data
,
'data'
)
const
orderInfoList
=
this
.
$route
.
query
.
activity_detail_list
// 点击我的订单也去支付,返回来拿到的表单数据
console
.
log
(
orderInfoList
,
'orderInfoList'
)
const
userFields
=
JSON
.
parse
(
this
.
stepList
[
this
.
stepIndex
].
user_fields
)
console
.
log
(
this
.
$route
.
query
.
activity_detail_id
,
'0000'
)
if
(
this
.
$route
.
query
.
activity_detail_id
)
{
if
(
orderInfoList
!==
undefined
)
{
this
.
handleAdd
()
}
// eslint-disable-next-line vue/no-mutating-props
// 订单拿回的数据回显
this
.
formList
=
orderInfoList
.
sort
((
a
,
b
)
=>
{
return
a
.
num
-
b
.
num
})
.
reduce
((
a
,
b
)
=>
{
const
arr
=
[]
userFields
.
forEach
(
item
=>
{
const
find
=
Object
.
assign
(
{},
allFormList
.
find
(
d
=>
d
.
key
===
item
.
key
)
)
find
.
value
=
b
[
item
.
key
]
arr
.
push
(
find
)
})
a
.
push
(
arr
)
return
a
},
[])
}
else
{
console
.
log
(
this
.
myInfoList
,
'this.myInfoList'
)
// 详情拿回的数据回显
if
(
!
this
.
myInfoList
.
length
)
{
this
.
handleAdd
()
return
}
this
.
myInfoList
.
map
((
item
,
index
)
=>
{
if
(
item
.
mobile
===
this
.
detailList
.
info
.
mobile
)
{
item
.
num
=
0
}
else
{
item
.
num
=
index
+
1
}
return
item
})
// eslint-disable-next-line vue/no-mutating-props
this
.
formList
=
this
.
myInfoList
.
sort
((
a
,
b
)
=>
{
return
a
.
num
-
b
.
num
})
.
reduce
((
a
,
b
)
=>
{
const
arr
=
[]
userFields
.
forEach
(
item
=>
{
const
find
=
Object
.
assign
(
{},
allFormList
.
find
(
d
=>
d
.
key
===
item
.
key
)
)
find
.
value
=
b
[
item
.
key
]
arr
.
push
(
find
)
})
a
.
push
(
arr
)
return
a
},
[])
}
console
.
log
(
this
.
formList
,
'1111'
)
},
mounted
()
{},
methods
:
{
// 提交
onSubmit
()
{
const
result
=
[]
console
.
log
(
this
.
formList
,
'this.formList'
)
this
.
formList
.
forEach
(
item
=>
{
const
resultObj
=
{}
item
.
forEach
(
obj
=>
{
resultObj
[
obj
.
key
]
=
obj
.
value
})
result
.
push
(
resultObj
)
})
console
.
log
(
this
.
detailList
.
self_fill_in
.
list
[
0
])
if
(
this
.
data
.
id
===
this
.
detailList
.
other_fill_in
.
list
[
0
]?.
pay_records
.
activity_detail_id
)
{
this
.
join_rand
=
this
.
detailList
.
other_fill_in
.
list
[
0
]?.
pay_records
.
join_rand
}
else
if
(
this
.
data
.
id
===
this
.
detailList
.
self_fill_in
.
list
[
0
]?.
pay_records
.
activity_detail_id
)
{
this
.
join_rand
=
this
.
detailList
.
self_fill_in
.
list
[
0
]?.
pay_records
.
join_rand
}
else
{
this
.
join_rand
=
this
.
order_join_rand
||
''
}
console
.
log
(
this
.
data
,
'123'
)
const
params
=
{
activity_id
:
this
.
data
.
activity
_
id
,
activity_id
:
this
.
data
.
activity
Info
.
id
,
activity_detail_id
:
this
.
data
.
id
,
need_skip
:
this
.
checkedPay
?
'1'
:
'0'
,
users_info
:
result
,
company_id
:
''
,
join_rand
:
this
.
join_rand
need_skip
:
this
.
checkedPay
?
1
:
0
}
console
.
log
(
this
.
data
.
order
,
'this.data.order'
)
if
(
this
.
data
.
join_rand
)
{
params
.
join_rand
=
this
.
data
.
join_rand
}
params
.
users_info
=
this
.
data
.
user_fields
.
reduce
((
a
,
b
)
=>
{
const
infos
=
{}
b
.
forEach
(
item
=>
{
infos
[
item
.
key
]
=
item
.
value
})
a
.
push
(
infos
)
return
a
},
[])
saveStepInfo
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
this
.
stepOrderInfo
=
res
.
data
console
.
log
(
this
.
stepOrderInfo
)
window
.
localStorage
.
setItem
(
'stepOrderInfo'
,
JSON
.
stringify
(
this
.
stepOrderInfo
.
list
))
this
.
data
.
join_rand
=
res
.
data
.
join_rand
if
(
this
.
checkedPay
)
{
const
lastorder
=
this
.
stepList
[
this
.
stepList
.
length
-
1
].
order
if
(
lastorder
===
this
.
data
.
order
)
{
this
.
$router
.
push
(
'/'
)
this
.
stepList
.
splice
(
this
.
data
.
num
,
1
)
if
(
this
.
stepList
[
this
.
stepList
.
length
-
1
].
num
===
this
.
data
.
num
)
{
// 完成步骤跳转
this
.
$router
.
push
({
path
:
'/'
})
}
else
{
this
.
$emit
(
'next'
)
this
.
$emit
(
'next'
,
res
.
data
)
}
}
else
{
console
.
log
(
this
.
join_rand
,
'this.join_rand'
)
this
.
$router
.
push
({
path
:
'/OrderConfirm'
,
query
:
{
// stepOrderInfo: JSON.stringify(this.stepOrderInfo),
detailListName
:
JSON
.
stringify
(
this
.
detailList
.
activity
.
name
),
activityId
:
JSON
.
stringify
(
this
.
data
.
activity_id
),
join_rand
:
this
.
stepOrderInfo
.
list
[
0
].
pay_record
.
join_rand
,
stepIndex
:
JSON
.
stringify
(
this
.
stepIndex
),
activity_detail_id
:
this
.
data
.
id
,
pay_price
:
JSON
.
stringify
(
this
.
stepOrderInfo
.
pay_price
)
}
})
this
.
$emit
(
'next'
,
res
.
data
)
}
}
})
},
// 表单项减少
handleMinus
(
index
)
{
this
.
formList
.
splice
(
index
,
1
)
this
.
data
.
user_fields
.
splice
(
index
,
1
)
},
// 表单项增加
handleAdd
()
{
console
.
log
(
'000'
,
'0000'
)
const
userFields
=
JSON
.
parse
(
this
.
data
.
user_fields
).
concat
()
const
allUserFields
=
userFields
.
reduce
((
a
,
b
)
=>
{
const
data
=
allFormList
.
find
(
item
=>
item
.
key
===
b
.
key
)
if
(
data
)
{
a
.
push
(
Object
.
assign
({},
data
))
}
return
a
},
[])
this
.
formList
.
push
(
allUserFields
)
if
(
this
.
formList
.
length
===
1
)
{
this
.
formList
[
0
].
forEach
(
item
=>
{
if
(
item
.
key
===
'name'
)
{
return
(
item
.
value
=
this
.
personalInfo
.
name
)
}
else
if
(
item
.
key
===
'mobile'
)
{
return
(
item
.
value
=
this
.
personalInfo
.
mobile
)
}
})
}
const
baseUserFields
=
this
.
data
.
user_fields
[
0
].
map
(
item
=>
{
const
copyItem
=
Object
.
assign
({},
item
)
copyItem
.
value
=
''
return
copyItem
})
this
.
data
.
user_fields
.
push
(
baseUserFields
)
},
onConfirmTime
(
time
)
{
this
.
formList
[
this
.
index
][
this
.
cIndex
].
value
=
this
.
bgDate
(
time
)
this
.
formList
[
this
.
index
][
this
.
cIndex
].
showPicker
=
false
this
.
data
.
user_fields
[
this
.
index
][
this
.
cIndex
].
value
=
this
.
bgDate
(
time
)
this
.
data
.
user_fields
[
this
.
index
][
this
.
cIndex
].
showPicker
=
false
},
bgDate
(
val
)
{
const
d
=
new
Date
(
val
)
...
...
@@ -308,18 +188,18 @@ export default {
return
n
<
10
?
`0
${
n
}
`
:
n
},
showTime
(
index
,
cIndex
)
{
this
.
formList
[
index
][
cIndex
].
showPicker
=
true
this
.
data
.
user_fields
[
index
][
cIndex
].
showPicker
=
true
this
.
index
=
index
this
.
cIndex
=
cIndex
},
showSelectPicker
(
index
,
cIndex
)
{
this
.
formList
[
index
][
cIndex
].
showPicker
=
true
this
.
data
.
user_fields
[
index
][
cIndex
].
showPicker
=
true
this
.
index
=
index
this
.
cIndex
=
cIndex
},
onConfirm
(
value
)
{
this
.
formList
[
this
.
index
][
this
.
cIndex
].
value
=
value
this
.
formList
[
this
.
index
][
this
.
cIndex
].
showPicker
=
false
this
.
data
.
user_fields
[
this
.
index
][
this
.
cIndex
].
value
=
value
this
.
data
.
user_fields
[
this
.
index
][
this
.
cIndex
].
showPicker
=
false
}
}
}
...
...
src/modules/home/views/MyOrder.vue
浏览文件 @
4f89b536
...
...
@@ -94,12 +94,9 @@ export default {
handlePay
(
item
)
{
console
.
log
(
item
,
'item'
)
this
.
$router
.
push
({
path
:
'/
s
ignMainPage'
,
path
:
'/
S
ignMainPage'
,
query
:
{
activityId
:
item
.
list
[
0
].
activity_id
,
activity_detail_id
:
item
.
list
[
0
].
pay_record
.
activity_detail_id
,
activity_detail_list
:
item
.
list
,
join_rand
:
item
.
join_rand
id
:
item
.
activity
.
id
}
})
}
...
...
src/modules/home/views/OrderConfirm.vue
浏览文件 @
4f89b536
<
template
>
<div
class=
"main"
>
<!-- 头部标题 -->
<commonheader
@
back=
"handlePrev"
:callBack=
"true"
:title=
"title"
/>
<div
class=
"main_content"
>
<div
class=
"main_content_list"
>
<van-checkbox-group
v-model=
"selctOrderData"
ref=
"checkboxGroup"
@
change=
"checkItem"
>
<div
class=
"main_content_list_card"
v-for=
"(item, index) in stepOrderInfo"
:key=
"index"
>
<div
class=
"card_header"
>
<van-checkbox
:name=
"item"
:disabled=
"item.pay_record.pay_status === '1'"
></van-checkbox>
<span
class=
"card_header_title"
>
{{
JSON
.
parse
(
$route
.
query
.
detailListName
)
}}
</span>
</div>
<div
class=
"card_con"
>
<p>
{{
item
.
name
}}
{{
item
.
mobile
}}
</p>
</div>
<div
class=
"card_fotter"
>
<div
class=
"card_fotter_left"
>
<span
class=
"price"
>
¥
</span>
<span
class=
"price_num"
>
{{
payPrice
}}
<span
class=
"price_num"
></span></span>
<div
class=
"order-confirm"
v-if=
"!isQrPageShow"
>
<!-- 头部标题 -->
<commonheader
@
back=
"handlePrev"
:callBack=
"true"
:title=
"title"
/>
<div
class=
"main_content"
>
<div
class=
"main_content_list"
>
<van-checkbox-group
v-model=
"selctOrderData"
ref=
"checkboxGroup"
@
change=
"checkItem"
>
<div
class=
"main_content_list_card"
v-for=
"(item, index) in stepOrderInfo"
:key=
"index"
>
<div
class=
"card_header"
>
<van-checkbox
:name=
"item"
:disabled=
"item.pay_record.pay_status === '1'"
></van-checkbox>
<!--
<span
class=
"card_header_title"
>
{{
JSON
.
parse
(
$route
.
query
.
detailListName
)
}}
</span>
-->
</div>
<div
class=
"card_con"
>
<p>
{{
item
.
name
}}
{{
item
.
mobile
}}
</p>
</div>
<div
class=
"card_fotter_left card_fotter_right"
>
<span
class=
"price"
>
单位已优惠
</span>
<span
class=
"price"
>
¥
</span>
<span
class=
"price_num"
>
{{
(
Number
(
payPrice
).
toFixed
(
2
)
-
Number
(
item
.
pay_record
.
pay_amount
).
toFixed
(
2
)).
toFixed
(
2
)
}}
</span>
<div
class=
"card_fotter"
>
<div
class=
"card_fotter_left"
>
<span
class=
"price"
>
¥
</span>
<span
class=
"price_num"
>
{{
payPrice
}}
<span
class=
"price_num"
></span></span>
</div>
<div
class=
"card_fotter_left card_fotter_right"
>
<span
class=
"price"
>
单位已优惠
</span>
<span
class=
"price"
>
¥
</span>
<span
class=
"price_num"
>
{{
(
Number
(
payPrice
).
toFixed
(
2
)
-
Number
(
item
.
pay_record
.
pay_amount
).
toFixed
(
2
)).
toFixed
(
2
)
}}
</span>
</div>
</div>
</div>
</div>
</van-checkbox-group>
</div>
</div>
<div
class=
"main_footer"
>
<van-checkbox
v-model=
"isAll"
@
click=
"checkAll"
>
全选
</van-checkbox>
<div
class=
"main_footer_total"
>
<div
class=
"main_footer_total_top"
></div>
<div
class=
"main_footer_total_top"
>
<div
class=
"total_text"
>
合计:
</div>
<div
class=
"total_sign"
>
¥
</div>
<div
class=
"price"
>
{{
totalPrice
}}
</div>
</van-checkbox-group>
</div>
<div
class=
"main_footer_total_bottom"
>
<div
class=
"company_yh"
>
单位已优惠
</div>
<div
class=
"company_sign"
>
¥
</div>
<div
class=
"company_yh"
>
{{
totalCompanyPrice
.
toFixed
(
2
)
}}
</div>
</div>
<div
class=
"main_footer"
>
<van-checkbox
v-model=
"isAll"
@
click=
"checkAll"
>
全选
</van-checkbox>
<div
class=
"main_footer_total"
>
<div
class=
"main_footer_total_top"
></div>
<div
class=
"main_footer_total_top"
>
<div
class=
"total_text"
>
合计:
</div>
<div
class=
"total_sign"
>
¥
</div>
<div
class=
"price"
>
{{
totalPrice
}}
</div>
</div>
<div
class=
"main_footer_total_bottom"
>
<div
class=
"company_yh"
>
单位已优惠
</div>
<div
class=
"company_sign"
>
¥
</div>
<div
class=
"company_yh"
>
{{
totalCompanyPrice
.
toFixed
(
2
)
}}
</div>
</div>
</div>
<van-button
round
@
click=
"handlePrev"
class=
"prev_btn"
>
上一页
</van-button>
<van-button
round
:disabled=
"!selctOrderData.length"
@
click=
"onSubmit"
class=
"pay_btn"
>
去支付
</van-button>
</div>
<van-button
round
@
click=
"handlePrev"
class=
"prev_btn"
>
上一页
</van-button>
<van-button
round
:disabled=
"!selctOrderData.length"
@
click=
"onSubmit"
class=
"pay_btn"
>
去支付
</van-button>
</div>
<pay-detail
@
next=
"$emit('next')"
:stepList=
"stepList"
v-else
:data=
"payDetail"
></pay-detail>
</div>
</
template
>
<
script
>
import
{
getPayInfo
}
from
'../api'
import
PayDetail
from
'./PayDetail.vue'
import
Commonheader
from
'../components/Commonheader.vue'
export
default
{
components
:
{
Commonheader
},
components
:
{
Commonheader
,
PayDetail
},
props
:
{
stepList
:
{
type
:
Array
},
data
:
{
type
:
Object
}
},
data
()
{
return
{
isQrPageShow
:
false
,
title
:
'订单确认'
,
isAll
:
false
,
numVsible
:
true
,
...
...
@@ -73,20 +85,16 @@ export default {
return
this
.
selctOrderData
.
map
(
item
=>
Number
(
item
.
pay_record
.
pay_amount
)).
reduce
((
pre
,
nex
)
=>
(
pre
+=
nex
),
0
)
},
payPrice
()
{
return
JSON
.
parse
(
this
.
$route
.
query
.
pay_price
)
return
this
.
data
.
payData
.
pay_price
},
totalCompanyPrice
()
{
return
this
.
selctOrderData
.
map
(
item
=>
Number
(
this
.
payPrice
)
-
Number
(
item
.
pay_record
.
pay_amount
))
.
reduce
((
pre
,
nex
)
=>
(
pre
+=
nex
),
0
)
},
stepIndex
()
{
return
JSON
.
parse
(
this
.
$route
.
query
.
stepIndex
)
}
},
mounted
()
{
this
.
stepOrderInfo
=
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'stepOrderInfo'
))
this
.
stepOrderInfo
=
this
.
data
.
payData
.
list
},
methods
:
{
checkItem
()
{
...
...
@@ -97,53 +105,35 @@ export default {
}
},
handlePrev
()
{
console
.
log
(
this
.
stepIndex
,
'kkk'
)
this
.
$router
.
push
({
path
:
'/SignMainPage'
,
query
:
{
isShowSkip
:
'1'
,
activityId
:
JSON
.
parse
(
this
.
$route
.
query
.
activityId
),
stepIndex
:
this
.
stepIndex
}
})
this
.
$emit
(
'prev'
)
},
checkAll
()
{
this
.
$refs
.
checkboxGroup
.
toggleAll
(
this
.
isAll
)
},
onSubmit
()
{
// if (this.selctOrderData.length && this.totalPrice === 0) {
// this.$router.push('/')
// } else {
this
.
getPayDetail
()
// }
},
getPayDetail
()
{
console
.
log
(
this
.
stepOrderInfo
,
'orderifno'
)
if
(
this
.
stepOrderInfo
.
length
)
{
this
.
stepOrderInfo
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
pay_record
.
pay_status
===
'1'
)
{
const
findIndex
=
this
.
selctOrderData
.
findIndex
(
id
=>
id
.
id
===
item
.
id
)
this
.
selctOrderData
.
splice
(
findIndex
,
1
)
if
(
findIndex
!==
-
1
)
{
this
.
selctOrderData
.
splice
(
findIndex
,
1
)
}
}
})
}
const
params
=
{
pay_record_ids
:
this
.
selctOrderData
.
map
(
item
=>
item
.
pay_record
.
id
).
toString
(),
join_rand
:
this
.
$route
.
query
.
join_rand
join_rand
:
this
.
data
.
payData
.
join_rand
}
console
.
log
(
this
.
$route
.
query
.
activity_detail_id
,
'selecer'
)
console
.
log
(
this
.
data
,
'selecer'
)
getPayInfo
(
params
).
then
(
res
=>
{
this
.
payDetail
=
res
.
data
this
.
payDetail
=
Object
.
assign
({
qrData
:
res
.
data
},
this
.
data
)
this
.
payDetail
.
order_id
=
res
.
data
.
order_id
this
.
$router
.
push
({
path
:
'/PayDetail'
,
query
:
{
pay_record_ids
:
this
.
payDetail
.
order_id
,
payDetail
:
res
.
data
,
stepIndex
:
this
.
stepIndex
,
activityId
:
JSON
.
parse
(
this
.
$route
.
query
.
activityId
),
activity_detail_id
:
this
.
$route
.
query
.
activity_detail_id
}
})
this
.
isQrPageShow
=
true
})
}
}
...
...
src/modules/home/views/PayDetail.vue
浏览文件 @
4f89b536
<
template
>
<div
class=
"main"
>
<
commonheader
:title=
"title"
/
>
<
!--
<commonheader
:title=
"title"
/>
--
>
<div
class=
"main_content"
>
<div
class=
"main_content_desc"
>
1.打开支付宝扫码二维码支付,或长按保存二维码打开支付宝支付。
</div>
<div
class=
"main_content_qdCode"
>
...
...
@@ -27,14 +27,14 @@
class=
"main_btn_home"
round
@
click=
"$router.push('/')"
v-if=
"
lastStepId === parseInt(this.activity_detail_id)
"
v-if=
"
isLastStep && status == 1
"
>
首页
</van-button
>
<van-button
round
class=
"main_btn_home"
@
click=
"
continueSign
"
v-if=
"
lastStepId !== parseInt(this.activity_detail_id) && this.status =
== 1"
@
click=
"
$router.go(0)
"
v-if=
"
!isLastStep && status
== 1"
>
继续报名
</van-button
>
<van-button
round
class=
"main_btn_order"
@
click=
"$router.push('/MyOrder')"
>
我的订单
</van-button>
...
...
@@ -49,16 +49,24 @@
import
QrcodeVue
from
'qrcode.vue'
import
Clipboard
from
'clipboard'
import
{
Toast
}
from
'vant'
import
{
get
ActivityDetail
,
get
PayStatus
}
from
'../api'
import
{
getPayStatus
}
from
'../api'
import
commonheader
from
'../components/Commonheader.vue'
//
import commonheader from '../components/Commonheader.vue'
export
default
{
props
:
{
data
:
{
type
:
Object
},
stepList
:
{
type
:
Array
}
},
components
:
{
QrcodeVue
,
commonheader
QrcodeVue
},
data
()
{
return
{
isLastStep
:
false
,
// 判断是不是最后一个步骤 显示不同的按钮
title
:
'订单支付'
,
qrcodeUrl
:
''
,
clipboard
:
null
,
...
...
@@ -71,10 +79,10 @@ export default {
},
computed
:
{
payDetail
()
{
return
this
.
$route
.
query
.
payDetail
return
this
.
data
.
qrData
},
pay_record_ids
()
{
return
this
.
$route
.
query
.
pay_record_ids
return
this
.
data
.
activity_detail_id
}
},
methods
:
{
...
...
@@ -99,48 +107,30 @@ export default {
})
},
getPayStatus
()
{
this
.
getActivityDetail
()
const
params
=
{
order_id
:
this
.
pay_record_ids
order_id
:
this
.
data
.
order_id
}
getPayStatus
(
params
).
then
(
res
=>
{
console
.
log
(
this
.
data
,
'pddata'
)
if
(
res
.
code
===
0
)
{
this
.
status
=
res
.
data
.
status
if
(
res
.
data
.
status
===
1
)
{
clearInterval
(
this
.
time
)
if
(
this
.
$route
.
query
.
activityId
)
{
this
.
getActivityDetail
()
if
(
this
.
data
.
jump_url
)
{
window
.
location
.
href
=
this
.
data
.
jump_url
return
false
}
this
.
getActivityDetail
()
}
}
})
},
getActivityDetail
()
{
this
.
activity_detail_id
=
this
.
$route
.
query
.
activity_detail_id
console
.
log
(
this
.
$route
.
query
.
activityId
,
'activityId'
)
const
params
=
{
id
:
this
.
$route
.
query
.
activityId
}
getActivityDetail
(
params
).
then
(
res
=>
{
this
.
detailList
=
res
.
data
this
.
lastStepId
=
this
.
detailList
.
activity
.
details
.
slice
(
-
1
).
id
const
currentStep
=
this
.
detailList
.
activity
.
details
.
find
(
item
=>
item
.
id
===
this
.
activity_detail_id
)
console
.
log
(
currentStep
,
'currentStep'
)
if
(
res
.
data
.
status
===
1
&&
currentStep
.
can_jump
===
1
)
{
window
.
open
(
currentStep
.
jump_url
)
}
// if (res.data.status === 1 || item) {
// if (parseInt(this.detailList.activity.details.slice(-1).id) === parseInt(this.activity_detail_id)) {
// console.log('1111tohome')
// this.$router.push('/')
// } else {
// console.log(this.$route.query.activityId, 'this.$route.query.activityId', '来了')
// this.$router.push({
// path: 'SignMainPage',
// query: {
// activityId: this.$route.query.activityId
// }
// })
// }
// }
})
console
.
log
(
this
.
stepList
.
length
,
this
.
data
.
num
)
if
(
this
.
stepList
.
length
===
this
.
data
.
num
)
{
this
.
isLastStep
=
true
}
},
continueSign
()
{
this
.
$router
.
push
({
...
...
src/modules/home/views/SignMainPage.vue
浏览文件 @
4f89b536
<
template
>
<div
class=
"main"
>
<
commonheader
@
back=
"handlePrev"
:callBack=
"true"
:title=
"title"
/
>
<
!--
<commonheader
@
back=
"handlePrev"
:callBack=
"true"
/>
--
>
<!-- 展示 -->
<template
v-if=
"Object.keys(stepList).length"
>
<img-show
:stepList=
"stepList"
:data=
"setpItem"
@
prev=
"handlePrev"
@
next=
"handleNext"
v-if=
"setpItem.type === 1"
/>
<img-show
:data=
"setpItem"
@
prev=
"handlePrev"
@
next=
"handleNext"
v-if=
"setpItem.type === 1"
/>
<!-- 表单 -->
<sign-form
:myInfoList=
"myInfoList"
:personalInfo=
"detailList.info"
:data=
"setpItem"
:stepList=
"stepList"
:stepIndex=
"stepIndex"
@
prev=
"handlePrev"
@
next=
"handleNext"
v-if=
"setpItem.type === 2"
:isShowSkip=
"isShowSkip"
:detailList=
"detailList"
:order_join_rand=
"$route.query.join_rand"
/>
<!-- 支付页面 -->
<order-confirm
@
prev=
"handlePrev"
@
next=
"handleNext"
:stepList=
"stepList"
:data=
"setpItem"
v-if=
"setpItem.type === 3"
></order-confirm>
</
template
>
</div>
</template>
<
script
>
import
allFormList
from
'@/utils/formList'
import
SignForm
from
'../components/SignForm.vue'
import
ImgShow
from
'../components/ImgShow.vue'
import
Commonheader
from
'../components/Commonheader.vue'
import
OrderConfirm
from
'./OrderConfirm.vue'
// import Commonheader from '../components/Commonheader.vue'
import
{
getActivityDetail
}
from
'../api'
export
default
{
components
:
{
SignForm
,
ImgShow
,
Commonheader
},
components
:
{
SignForm
,
ImgShow
,
OrderConfirm
},
data
()
{
return
{
title
:
'报名主页面'
,
...
...
@@ -49,11 +48,8 @@ export default {
},
computed
:
{
setpItem
()
{
if
(
this
.
$route
.
query
.
stepIndex
)
{
return
this
.
stepList
[
this
.
$route
.
query
.
stepIndex
]
}
else
{
return
this
.
stepList
[
this
.
stepIndex
]
}
// return this.stepList[2]
return
this
.
stepList
[
this
.
stepIndex
]
}
},
mounted
()
{
...
...
@@ -65,60 +61,111 @@ export default {
getActivityDetail
()
{
getActivityDetail
({
id
:
this
.
$route
.
query
.
id
}).
then
(
res
=>
{
const
data
=
res
.
data
if
(
data
.
other_fill_in
.
need_fill_in_status
===
false
&&
data
.
self_fill_in
.
need_fill_in_status
===
false
)
{
// 重新报名
let
sliceData
=
[]
if
(
data
.
other_fill_in
.
need_fill_in_status
)
{
initInfo
(
'other_fill_in'
)
}
else
if
(
data
.
self_fill_in
.
need_fill_in_status
)
{
initInfo
(
'self_fill_in'
)
}
else
{
// if (data.other_fill_in.need_fill_in_status) {
// }
initInfo
()
}
// this.detailList = res.data
// this.myInfoList = res.data.other_fill_in.list
// // console.log(this.detailList.activity.details.slice(-1), '0000')
// if (this.detailList.other_fill_in.need_fill_in_status) {
// this.detailList.activity.details.forEach(item => {
// if (item.id === this.detailList.other_fill_in.need_fill_in_id) {
// const details = this.detailList.activity.details.indexOf(item)
// console.log(details, '111')
// if (details === 0) {
// this.stepList = res.data.activity.details
// console.log(this.stepList, '1')
// } else if (details > 0) {
// console.log(details, 'details')
// this.stepList = this.detailList.activity.details.splice(details)
// console.log(this.stepList, '2')
// }
// }
// })
// } else {
// if (this.detailList.self_fill_in.need_fill_in_status) {
// this.detailList.activity.details.forEach(item => {
// if (item.id === this.detailList.self_fill_in.need_fill_in_id) {
// const details = this.detailList.activity.details.indexOf(item)
// console.log(details, '222')
// if (details === 0) {
// this.stepList = res.data.activity.details
// console.log(this.stepList, '3')
// } else if (details > 0) {
// console.log(details, 'details1')
// this.stepList = this.detailList.activity.details.splice(details)
// console.log(this.stepList, '4')
// }
// }
// })
// } else {
// this.stepList = res.data.activity.details
// console.log(this.stepList, '5')
// }
// }
// const newIndex = this.stepList.findIndex(item => {
// return item.id === this.$route.query.activity_detail_id
// })
// if (this.$route.query.stepIndex) {
// this.stepIndex = parseInt(this.$route.query.stepIndex)
// } else {
// this.stepIndex = newIndex
<
0
?
0
:
newIndex
// }
// 初始化拿到数据做的第一步处理:取到需要展示出来的所有页面
function
initInfo
(
fields
)
{
if
(
fields
)
{
// *** 继续报名数 || 第一次进报名,据初始化
const
index
=
data
.
activity
.
details
.
findIndex
(
item
=>
item
.
id
===
data
[
fields
].
need_fill_in_id
)
sliceData
=
data
.
activity
.
details
.
slice
(
index
,
data
.
activity
.
details
.
length
)
// list 人员信息
sliceData
.
map
(
item
=>
{
item
.
activityInfo
=
data
.
activity
// 判断有没有返回人员 没返回吧自己的信息push进去
if
(
data
[
fields
].
list
.
length
)
{
// list有可能不会返回自己的信息,不返回push进去
const
findOwn
=
data
[
fields
].
list
.
find
(
info
=>
info
.
mobile
===
data
.
info
.
mobile
)
if
(
!
findOwn
)
{
data
[
fields
].
list
.
push
(
data
.
info
)
}
// 添加index用于用户排序
item
.
list
=
data
[
fields
].
list
.
map
((
item
,
index
)
=>
{
item
.
mobile
===
data
.
info
.
mobile
?
(
item
.
index
=
0
)
:
(
item
.
index
=
index
+
1
)
return
item
})
item
.
join_rand
=
item
.
list
[
0
]
?
item
.
list
[
0
].
pay_records
[
0
].
join_rand
:
''
return
item
}
else
{
item
.
list
=
[]
item
.
list
.
push
(
data
.
info
)
}
return
item
})
}
else
{
// 重新报名初始化数据
sliceData
=
data
.
activity
.
details
sliceData
.
map
(
item
=>
{
item
.
list
=
[]
item
.
activityInfo
=
data
.
activity
item
.
list
.
push
(
data
.
info
)
return
item
})
}
}
// 第二步数据处理:字段细节处理
this
.
setData
(
sliceData
)
})
},
setData
(
data
)
{
// console.log(data, 'datas')
// 处理数据
this
.
stepList
=
data
.
reduce
((
a
,
b
)
=>
{
// type: 1 是展示不用处理
if
(
b
.
type
===
1
)
{
a
.
push
(
b
)
}
else
{
// 表单类型的数据处理
// 处理需要填写的字段表单
const
userFields
=
JSON
.
parse
(
b
.
user_fields
)
const
userFieldsStore
=
[]
// 人员信息转换成表单需要的数据(因为第1个永远是自己所以加了排序)
b
.
list
.
sort
((
a
,
b
)
=>
{
return
a
.
index
-
b
.
index
})
.
forEach
(
d
=>
{
const
fields
=
[]
userFields
.
forEach
(
dd
=>
{
const
fData
=
Object
.
assign
(
{},
allFormList
.
find
(
f
=>
f
.
key
===
dd
.
key
)
)
fData
.
value
=
d
[
dd
.
key
]
fields
.
push
(
fData
)
})
userFieldsStore
.
push
(
fields
)
})
b
.
user_fields
=
userFieldsStore
a
.
push
(
b
)
// 处理“开启支付功能” 自定义type3支付页
if
(
b
.
can_pay
===
1
)
{
const
payPage
=
{
type
:
3
,
user_fields
:
b
.
user_fields
,
activity_detail_id
:
b
.
id
,
id
:
b
.
activity_id
,
num
:
b
.
num
}
// 开启支付成功跳转的功能
if
(
b
.
can_jump
)
{
payPage
.
jump_url
=
b
.
jump_url
}
a
.
push
(
payPage
)
}
}
return
a
},
[])
console
.
log
(
this
.
stepList
)
this
.
stepList
.
map
((
item
,
index
)
=>
{
item
.
num
=
index
+
1
return
item
})
},
handlePrev
()
{
...
...
@@ -128,8 +175,13 @@ export default {
this
.
stepIndex
--
}
},
handleNext
()
{
this
.
stepIndex
++
handleNext
(
data
)
{
if
(
this
.
setpItem
.
num
!==
this
.
stepList
)
{
this
.
stepIndex
++
if
(
data
)
{
this
.
setpItem
.
payData
=
data
}
}
}
}
}
...
...
vite.config.js
浏览文件 @
4f89b536
...
...
@@ -16,7 +16,7 @@ export default defineConfig({
proxy
:
{
'/api/highway'
:
{
// target: 'http://localhost-activity-frontend.ezijing.com',
target
:
'http
s://activity-frontend-api
.ezijing.com'
,
target
:
'http
://localhost-activity-frontend
.ezijing.com'
,
changeOrigin
:
true
,
rewrite
:
path
=>
path
.
replace
(
/^
\/
api
\/
highway/
,
''
)
},
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论