Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
walk_daka_h5
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
穆启卓
walk_daka_h5
Commits
86ef6c33
Commit
86ef6c33
authored
Apr 18, 2019
by
穆启卓
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页改成整个卡片点击 + 首页代码整理
parent
2d127bd3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
142 deletions
+21
-142
SignUp.vue
src/views/SignUp.vue
+21
-142
No files found.
src/views/SignUp.vue
View file @
86ef6c33
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
<!-- 信息广播 -->
<!-- 信息广播 -->
<NoticeBonus
class=
"notice-broadcast"
></NoticeBonus>
<NoticeBonus
class=
"notice-broadcast"
></NoticeBonus>
<!-- 挑战赛卡片 -->
<!-- 挑战赛卡片 -->
<div
class=
"challenge-card"
v-for=
"item in gameList"
>
<div
class=
"challenge-card"
v-for=
"item in gameList"
@
click=
"clickCard(item)"
>
<img
class=
"corner-marker"
src=
"../images/SignUp/home_tag_bsz.png"
v-if=
"item.status===0"
>
<img
class=
"corner-marker"
src=
"../images/SignUp/home_tag_bsz.png"
v-if=
"item.status===0"
>
<img
class=
"corner-marker"
src=
"../images/SignUp/home_tag_zmz.png"
v-if=
"item.status===1"
>
<img
class=
"corner-marker"
src=
"../images/SignUp/home_tag_zmz.png"
v-if=
"item.status===1"
>
<img
class=
"corner-marker"
src=
"../images/SignUp/home_tag_yjs.png"
v-if=
"item.status===2"
>
<img
class=
"corner-marker"
src=
"../images/SignUp/home_tag_yjs.png"
v-if=
"item.status===2"
>
...
@@ -50,38 +50,20 @@
...
@@ -50,38 +50,20 @@
<
script
>
<
script
>
import
NoticeBonus
from
"@/components/NoticeBonus.vue"
;
import
NoticeBonus
from
"@/components/NoticeBonus.vue"
;
import
Free
from
"@/components/Free.vue"
;
import
Modal
from
"@/components/Modal.vue"
;
import
PayFailModal
from
"@/components/PayFailModal.vue"
;
import
Reborn
from
"@/components/Reborn.vue"
;
import
Reborn
from
"@/components/Reborn.vue"
;
import
{
import
{
dakaPay
,
track
,
userCards
,
daka_index
,
daka_index
,
select_follow
select_follow
}
from
"@/components/axios/api"
;
}
from
"@/components/axios/api"
;
import
{
constants
}
from
"crypto"
;
export
default
{
export
default
{
name
:
"SignUp"
,
name
:
"SignUp"
,
components
:
{
components
:
{
NoticeBonus
,
NoticeBonus
,
Modal
,
Reborn
Free
,
Reborn
,
PayFailModal
},
},
data
()
{
data
()
{
return
{
return
{
contract_data
:
{},
showFreeModal
:
false
,
modalTitle
:
""
,
modalDesc
:
""
,
modalShown
:
false
,
current_date
:
{},
isShowPayFail
:
false
,
isFollow
:
false
,
gameList
:
[],
gameList
:
[],
followInfo
:
{},
followInfo
:
{},
needFollow
:
false
needFollow
:
false
...
@@ -92,12 +74,19 @@ export default {
...
@@ -92,12 +74,19 @@ export default {
this
.
getFollowInfo
();
this
.
getFollowInfo
();
},
},
methods
:
{
methods
:
{
// 点击卡片整块的跳转
clickCard
(
item
)
{
if
(
item
.
status
===
1
&&
item
.
already_join
===
0
)
{
this
.
goOtherPage
(
'PartakeChallenge'
);
}
else
{
this
.
goWhereDetail
(
item
);
}
},
goOtherPage
(
pageName
)
{
goOtherPage
(
pageName
)
{
if
(
!
this
.
followInfo
.
follow
)
{
if
(
!
this
.
followInfo
.
follow
)
{
this
.
needFollow
=
true
;
this
.
needFollow
=
true
;
return
;
return
;
}
}
console
.
log
(
"pageName"
,
pageName
);
this
.
$router
.
push
({
name
:
pageName
});
this
.
$router
.
push
({
name
:
pageName
});
},
},
goWhereDetail
(
item
)
{
goWhereDetail
(
item
)
{
...
@@ -120,22 +109,31 @@ export default {
...
@@ -120,22 +109,31 @@ export default {
}
}
});
});
}
else
{
}
else
{
console
.
log
(
"item"
,
item
);
// 未报名
// 未报名
if
(
sessionStorage
.
getItem
(
'userHaveJoinGame'
)
===
'true'
)
{
item
.
daka_signup
=
true
;
}
else
{
item
.
daka_signup
=
false
;
item
.
newGameWeek
=
this
.
gameList
[
0
].
week
.
slice
(
4
,
8
);
}
sessionStorage
.
setItem
(
"ChallengeDetailData"
,
JSON
.
stringify
(
item
));
sessionStorage
.
setItem
(
"ChallengeDetailData"
,
JSON
.
stringify
(
item
));
this
.
$router
.
push
({
name
:
"ChallengeDetail"
});
this
.
$router
.
push
({
name
:
"ChallengeDetail"
});
}
}
}
}
},
},
// 关注公众号
getFollowInfo
()
{
getFollowInfo
()
{
select_follow
().
then
(
res
=>
{
select_follow
().
then
(
res
=>
{
console
.
log
(
res
);
if
(
res
.
code
==
0
)
{
if
(
res
.
code
==
0
)
{
this
.
followInfo
=
res
.
data
;
this
.
followInfo
=
res
.
data
;
sessionStorage
.
setItem
(
"followInfo"
,
JSON
.
stringify
(
res
.
data
));
sessionStorage
.
setItem
(
"followInfo"
,
JSON
.
stringify
(
res
.
data
));
}
}
});
});
},
},
// 关注公众号弹框
closePopup
()
{
this
.
needFollow
=
false
;
},
getPageData
()
{
getPageData
()
{
daka_index
().
then
(
res
=>
{
daka_index
().
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
if
(
res
.
code
===
0
)
{
...
@@ -143,127 +141,8 @@ export default {
...
@@ -143,127 +141,8 @@ export default {
item
.
action
=
item
.
week
.
substring
(
item
.
week
.
length
-
4
);
item
.
action
=
item
.
week
.
substring
(
item
.
week
.
length
-
4
);
});
});
this
.
gameList
=
res
.
data
;
this
.
gameList
=
res
.
data
;
console
.
log
(
"gameList"
,
this
.
gameList
);
}
});
},
togglePayFail
()
{
this
.
isShowPayFail
=
!
this
.
isShowPayFail
;
},
showSuccess
()
{
this
.
showModal
(
"温馨提示"
,
"报名成功"
,
{
scb
:
()
=>
{
if
(
this
.
isFollow
==
1
)
{
this
.
$router
.
push
({
name
:
"Read"
});
}
else
{
this
.
$router
.
push
({
name
:
"Success"
});
}
}
}
});
},
confirmModal
(
scb
)
{
scb
&&
scb
();
this
.
modalShown
=
false
;
},
showFree
(
e
)
{
e
.
stopPropagation
();
track
(
"free_contract_show"
);
if
(
localStorage
.
getItem
(
"first_show_free"
)
==
1
)
{
localStorage
.
setItem
(
"first_show_free"
,
2
);
this
.
canShowFree
=
false
;
}
else
{
this
.
canCheckShowFree
=
false
;
this
.
canShowFree
=
false
;
}
userCards
().
then
(
res
=>
{
console
.
log
(
"获取免契约金数据"
,
res
);
let
data
=
{
card
:
res
.
data
.
contract_card
,
cnt
:
res
.
data
.
contract_cnt
};
this
.
current_date
=
new
Date
(
res
.
date
);
// if (
// // 如果明天没报名,而且还有免契约金卡,则可以使用
// !this.date_status[1].user_status.daka_signup &&
// res.data.contract_card > 0
// ) {
// data.can_get = true;
// // 其他情况,显示报名下期比赛
// } else {
// data.can_get = false;
// }
this
.
contract_data
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
this
.
showFreeModal
=
true
;
});
});
},
closeFree
()
{
this
.
showFreeModal
=
false
;
},
showModal
(
title
,
desc
,
option
)
{
this
.
modalTitle
=
title
||
""
;
this
.
modalDesc
=
desc
||
""
;
this
.
modalOption
=
option
||
{};
this
.
modalShown
=
true
;
},
closeModal
()
{
this
.
modalShown
=
false
;
},
payToSign
()
{
dakaPay
().
then
(
response
=>
{
this
.
current_date
=
new
Date
(
response
.
date
);
if
(
response
.
code
==
1
)
{
this
.
showModal
(
"温馨提示"
,
response
.
msg
);
return
;
}
let
result
=
response
.
data
;
console
.
log
(
"请求打卡支付数据"
,
result
);
if
(
result
)
{
WeixinJSBridge
.
invoke
(
"getBrandWCPayRequest"
,
{
appId
:
result
.
appId
,
//公众号名称,由商户传入
timeStamp
:
`
${
result
.
timeStamp
}
`
,
//时间戳,自1970年以来的秒数
nonceStr
:
result
.
nonceStr
,
//随机串
package
:
result
.
package
,
signType
:
result
.
signType
,
//微信签名方式:
paySign
:
result
.
paySign
//微信签名
},
// result,
res
=>
{
console
.
log
(
"支付调用结果"
,
res
);
if
(
res
.
err_msg
==
"get_brand_wcpay_request:ok"
)
{
// 使用以上方式判断前端返回,微信团队郑重提示:
//res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
// 支付成功后的回调函数
console
.
log
(
"支付成功"
);
this
.
showModal
(
"温馨提示"
,
"报名成功"
,
{
scb
:
()
=>
{
if
(
this
.
isFollow
==
1
)
{
this
.
$router
.
push
({
name
:
"Read"
});
}
else
{
this
.
$router
.
push
({
name
:
"Success"
});
}
}
});
// this.dateSelect(2);
// localStorage.setItem("is_every", 0)
// location.replace("#/Success");
}
if
(
res
.
err_msg
==
"get_brand_wcpay_request:fail"
)
{
// this.showModal("温馨提示", "支付服务繁忙,请稍后重试");
this
.
togglePayFail
();
}
if
(
res
.
err_msg
==
"get_brand_wcpay_request:cancel"
)
{
// console.log("支付取消");
this
.
togglePayFail
();
}
}
);
}
});
},
closePopup
()
{
this
.
needFollow
=
false
;
}
}
}
}
};
};
...
...
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