Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
activities
/
web-vote
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
bcba9699
authored
Dec 23, 2024
by
陆志强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 投票结束自动跳转
parent
2b7f76eb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
1 deletions
+22
-1
src/store/modules/vote.js
+22
-1
No files found.
src/store/modules/vote.js
View file @
bcba9699
...
@@ -45,6 +45,7 @@ export const state = () => ({
...
@@ -45,6 +45,7 @@ export const state = () => ({
voteRankState
:
false
,
// 排行开启开关 1开启 0关闭
voteRankState
:
false
,
// 排行开启开关 1开启 0关闭
isShowInvite
:
false
,
// 是否显示马上拉票
isShowInvite
:
false
,
// 是否显示马上拉票
shareTitle
:
''
,
// 分享标题
shareTitle
:
''
,
// 分享标题
referUrl
:
''
,
// 回跳地址
bind_service
:
''
,
// 绑定服务
bind_service
:
''
,
// 绑定服务
bind_service_force_open
:
0
,
// 绑定服务强制开启
bind_service_force_open
:
0
,
// 绑定服务强制开启
bind_service_id
:
0
// 绑定服务id
bind_service_id
:
0
// 绑定服务id
...
@@ -120,6 +121,10 @@ export const actions = {
...
@@ -120,6 +121,10 @@ export const actions = {
is_invite
,
is_invite
,
shareTitle
,
shareTitle
,
share_img
,
share_img
,
refer_url
,
bind_service
,
bind_service_force_open
,
bind_service_id
}
=
data
}
=
data
const
voteRankState
=
parseInt
(
is_rank
,
10
)
===
1
const
voteRankState
=
parseInt
(
is_rank
,
10
)
===
1
const
obj
=
{
const
obj
=
{
...
@@ -137,7 +142,11 @@ export const actions = {
...
@@ -137,7 +142,11 @@ export const actions = {
voteRankState
,
voteRankState
,
isShowInvite
:
Number
(
is_invite
)
===
1
,
isShowInvite
:
Number
(
is_invite
)
===
1
,
shareTitle
,
shareTitle
,
shareImg
:
share_img
shareImg
:
share_img
,
referUrl
,
bindService
,
bindServiceForceOpen
,
bindServiceId
}
}
// 设置网页标题
// 设置网页标题
document
.
title
=
topic
||
'投票'
document
.
title
=
topic
||
'投票'
...
@@ -216,6 +225,18 @@ export const actions = {
...
@@ -216,6 +225,18 @@ export const actions = {
setVote
(
params
).
then
(
res
=>
{
setVote
(
params
).
then
(
res
=>
{
const
{
code
,
errorCode
,
errorMessage
,
data
}
=
res
const
{
code
,
errorCode
,
errorMessage
,
data
}
=
res
if
(
code
===
200
&&
errorCode
===
0
)
{
if
(
code
===
200
&&
errorCode
===
0
)
{
const
referUrl
=
voteInfo
.
referUrl
if
(
referUrl
)
{
Toast
.
success
({
message
:
'投票成功,正在跳转'
,
onClose
:
()
=>
{
if
(
referUrl
)
{
window
.
location
.
href
=
state
.
questionnaireInfo
.
referUrl
}
},
})
return
}
Toast
.
success
(
'投票成功'
)
Toast
.
success
(
'投票成功'
)
const
updateData
=
{
id
,
newData
:
{
vote_num
:
data
.
row_total
||
vote_num
+
1
}
}
const
updateData
=
{
id
,
newData
:
{
vote_num
:
data
.
row_total
||
vote_num
+
1
}
}
Bus
.
$emit
(
'VoteSuccessCallback'
,
updateData
)
Bus
.
$emit
(
'VoteSuccessCallback'
,
updateData
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment