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
566e1e53
Commit
566e1e53
authored
Apr 02, 2019
by
Caiyijun
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'remotes/origin/mutou' into dev_yijun
parents
b0de9417
a40b97d8
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
90 additions
and
79 deletions
+90
-79
fetch.js
src/components/axios/fetch.js
+1
-1
ChallengeDetail.vue
src/views/ChallengeDetail.vue
+0
-39
HaveJoinedGame.vue
src/views/HaveJoinedGame.vue
+89
-39
No files found.
src/components/axios/fetch.js
View file @
566e1e53
...
@@ -18,7 +18,7 @@ export function fetch(options) {
...
@@ -18,7 +18,7 @@ export function fetch(options) {
headers
:
{
headers
:
{
'Content-Type'
:
'application/json'
,
'Content-Type'
:
'application/json'
,
// 'Authorization': window['userData']?window['userData'].token:''
// 'Authorization': window['userData']?window['userData'].token:''
'Authorization'
:
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAiLCJvcGVuX2lkIjoiMTExMTExMTExMTExMTExMTExMTExMTExMTExMSIsInVuaW9uX2lkIjoiMTExMTExMTExMTExMTExMTExMTExMTExMTExMSIsImV4cCI6MTU1NDMx
MTMzMH0.4UEG6I9K0JARU5KDMW-Xwx13DMniYelsmI-qWd97e_c
"
'Authorization'
:
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAiLCJvcGVuX2lkIjoiMTExMTExMTExMTExMTExMTExMTExMTExMTExMSIsInVuaW9uX2lkIjoiMTExMTExMTExMTExMTExMTExMTExMTExMTExMSIsImV4cCI6MTU1NDMx
NzM0NH0.3yWRj-qm-Rk1PcCc7KrifJiuExlzETSBznBxrtYA3dU
"
// 'token_in_header': global_.token,//token从全局变量那里传过来
// 'token_in_header': global_.token,//token从全局变量那里传过来
},
},
timeout
:
30
*
1000
// 30秒超时
timeout
:
30
*
1000
// 30秒超时
...
...
src/views/ChallengeDetail.vue
View file @
566e1e53
...
@@ -147,45 +147,6 @@
...
@@ -147,45 +147,6 @@
closeShareModal
()
{
closeShareModal
()
{
this
.
showShareModal
=
false
this
.
showShareModal
=
false
},
},
//倒计时
countDown
(
times
)
{
clearInterval
(
grabStartTimer
)
grabStartTimer
=
null
grabStartTimer
=
setInterval
(
function
()
{
let
day
=
0
,
hour
=
0
,
minute
=
0
,
second
=
0
//时间默认值
// console.log('times:' + times)
if
(
times
>
0
)
{
day
=
Math
.
floor
(
times
/
(
60
*
60
*
24
))
hour
=
Math
.
floor
(
times
/
(
60
*
60
))
-
(
day
*
24
)
minute
=
Math
.
floor
(
times
/
60
)
-
(
day
*
24
*
60
)
-
(
hour
*
60
)
second
=
Math
.
floor
(
times
)
-
(
day
*
24
*
60
*
60
)
-
(
hour
*
60
*
60
)
-
(
minute
*
60
)
if
(
day
<
1
)
day
=
''
else
day
=
day
+
'天'
if
(
hour
<=
9
)
hour
=
'0'
+
hour
if
(
minute
<=
9
)
minute
=
'0'
+
minute
if
(
second
<=
9
)
second
=
'0'
+
second
this
.
grabTimer
=
(
day
+
hour
+
'时'
+
minute
+
'分'
+
second
+
'秒'
)
}
else
{
clearInterval
(
grabStartTimer
)
// that.setData({
// redpack: {
// ...that.data.redpack,
// redpackStatus: 2
// }
// })
}
times
--
//
//console.log(day + "天:" + hour + "小时:" + minute + "分钟:" + second + "秒");
},
1000
)
}
}
}
}
}
</
script
>
</
script
>
...
...
src/views/HaveJoinedGame.vue
View file @
566e1e53
<
template
>
<
template
>
<div
class=
"have-joined-game-page"
>
<div
class=
"have-joined-game-page"
>
<Title
class=
"page-title"
@
goback=
"goback"
show_back=
"true"
v-if=
"currentPage()==='HaveJoinedGame'"
></Title>
<Title
class=
"page-title"
@
goback=
"goback"
show_back=
"true"
v-if=
"currentPage()==='HaveJoinedGame'"
></Title>
<div
class=
"game-bonus-container"
>
<div
class=
"game-bonus-container"
>
<div
class=
"bonus-title"
>
本期累计奖励金(元)
</div>
<div
class=
"bonus-title"
>
本期累计奖励金(元)
</div>
<div
class=
"bonus-amount"
>
{{
bet_bonus
}}
</div>
<div
class=
"bonus-amount"
>
{{
bet_bonus
}}
</div>
...
@@ -19,17 +24,16 @@
...
@@ -19,17 +24,16 @@
<div
class=
"game-scroll-item"
>
<div
class=
"game-scroll-item"
>
<div
class=
"item-title-status"
>
<div
class=
"item-title-status"
>
<div
class=
"item-title"
>
第
{{
item
.
days
}}
天
</div>
<div
class=
"item-title"
>
第
{{
item
.
days
}}
天
</div>
<div
:class=
"item.status===0?'item-status0':item.status===1?'item-status1':item.status===2?'item-status2':'item-status2'"
>
<div
{{
item
.
status
===
0
?
'未开始'
:
item
.
status
===
1
?
'比赛中'
:
item
.
status
===
2
?
'已结束'
:
'已淘汰'
}}
:class=
"item.status===0?'item-status0':item.status===1?'item-status1':item.status===2?'item-status2':'item-status2'"
</div>
>
{{
item
.
status
===
0
?
'未开始'
:
item
.
status
===
1
?
'比赛中'
:
item
.
status
===
2
?
'已结束'
:
'已淘汰'
}}
</div>
</div>
</div>
<div
class=
"item-income"
:style=
"item.status===1?'':'visibility: hidden;'"
>
<div
class=
"item-income"
:style=
"item.status===1?'':'visibility: hidden;'"
>
<div
class=
"item-amount"
>
{{
item
.
money
}}
</div>
<div
class=
"item-amount"
>
{{
item
.
money
}}
</div>
<div
class=
"item-text"
>
(元) 预计收益
</div>
<div
class=
"item-text"
>
(元) 预计收益
</div>
</div>
</div>
<div
class=
"item-progress-num"
>
<div
class=
"item-progress-num"
>
<div
class=
"item-num"
v-if=
"item.status===0"
>
还有
{{
item
.
tsp
}}
开始
</div>
<div
class=
"item-num"
v-if=
"item.status===0"
>
还有
{{
item
.
format_tsp
||
'0秒'
}}
开始
</div>
<!--
<div
class=
"item-num"
v-if=
"item.status===0"
>
还有01天03小时56秒开始
</div>
-->
<template
v-else
>
<template
v-else
>
<div
class=
"item-progress"
:style=
"'width: '+item.rate/100*2.46+'rem;'"
></div>
<div
class=
"item-progress"
:style=
"'width: '+item.rate/100*2.46+'rem;'"
></div>
<div
class=
"item-num"
>
{{
item
.
step_num
}}
/
{{
target_steps
}}
步
</div>
<div
class=
"item-num"
>
{{
item
.
step_num
}}
/
{{
target_steps
}}
步
</div>
...
@@ -45,7 +49,9 @@
...
@@ -45,7 +49,9 @@
<div
class=
"game-status-container"
>
<div
class=
"game-status-container"
>
<img
class=
"status-icon"
src=
"../images/HaveJoinedGame/pop_bmcg_title.png"
>
<img
class=
"status-icon"
src=
"../images/HaveJoinedGame/pop_bmcg_title.png"
>
<img
class=
"join-success-banner"
src=
"../images/HaveJoinedGame/pop_bmcg_img.png"
>
<img
class=
"join-success-banner"
src=
"../images/HaveJoinedGame/pop_bmcg_img.png"
>
<div
class=
"popup-text1"
><span>
每日24点前
</span>
打开「运动打卡」小程序,手动提交今日步数,否则可能导致无法分钱哦!
</div>
<div
class=
"popup-text1"
>
<span>
每日24点前
</span>
打开「运动打卡」小程序,手动提交今日步数,否则可能导致无法分钱哦!
</div>
<div
class=
"popup-text2"
>
注:微信暂不支持小程序实时更新步数
</div>
<div
class=
"popup-text2"
>
注:微信暂不支持小程序实时更新步数
</div>
<div
class=
"popup-btn1 green-btn"
>
邀请好友来参赛
</div>
<div
class=
"popup-btn1 green-btn"
>
邀请好友来参赛
</div>
<img
class=
"close-btn"
src=
"../images/common/pop_ic_close.png"
>
<img
class=
"close-btn"
src=
"../images/common/pop_ic_close.png"
>
...
@@ -58,7 +64,10 @@
...
@@ -58,7 +64,10 @@
<div
class=
"status-date"
>
第{{popupData.days}}日达标
</div>
<div
class=
"status-date"
>
第{{popupData.days}}日达标
</div>
<div
class=
"status-money"
>
<div
class=
"status-money"
>
<div
class=
"popup-text3"
>
返还契约金
</div>
<div
class=
"popup-text3"
>
返还契约金
</div>
<div
class=
"popup-text4"
>
{{popupData.money}}
<span>
元
</span></div>
<div
class=
"popup-text4"
>
{{popupData.money}}
<span>
元
</span>
</div>
<div
class=
"popup-text5"
>
第{{popupData.week}}期{{popupData.target_steps}}步3日耐力赛
</div>
<div
class=
"popup-text5"
>
第{{popupData.week}}期{{popupData.target_steps}}步3日耐力赛
</div>
</div>
</div>
<div
class=
"popup-text6"
>
{{popupData.target_steps}}步达标,今天走了{{popupData.step_num}}步
</div>
<div
class=
"popup-text6"
>
{{popupData.target_steps}}步达标,今天走了{{popupData.step_num}}步
</div>
...
@@ -73,7 +82,10 @@
...
@@ -73,7 +82,10 @@
<div
class=
"status-date"
>
第{{popupData.days}}日未达标
</div>
<div
class=
"status-date"
>
第{{popupData.days}}日未达标
</div>
<div
class=
"status-money"
>
<div
class=
"status-money"
>
<div
class=
"popup-text3"
>
扣除契约金
</div>
<div
class=
"popup-text3"
>
扣除契约金
</div>
<div
class=
"popup-text4"
>
{{popupData.money}}
<span>
元
</span></div>
<div
class=
"popup-text4"
>
{{popupData.money}}
<span>
元
</span>
</div>
<div
class=
"popup-text5"
>
第{{popupData.week}}期{{popupData.target_steps}}步3日耐力赛
</div>
<div
class=
"popup-text5"
>
第{{popupData.week}}期{{popupData.target_steps}}步3日耐力赛
</div>
</div>
</div>
<div
class=
"popup-text6"
>
{{popupData.target_steps}}步达标,今天走了{{popupData.step_num}}步
</div>
<div
class=
"popup-text6"
>
{{popupData.target_steps}}步达标,今天走了{{popupData.step_num}}步
</div>
...
@@ -86,12 +98,12 @@
...
@@ -86,12 +98,12 @@
</template>
</template>
<
script
>
<
script
>
import
Title
from
"@/components/Title.vue"
;
import
Title
from
"@/components/Title.vue"
;
import
{
daka_status_detail
,
pop_up_windows
}
from
"@/components/axios/api"
;
import
{
daka_status_detail
,
pop_up_windows
}
from
"@/components/axios/api"
;
import
"swiper/dist/css/swiper.css"
;
import
"swiper/dist/css/swiper.css"
;
import
{
swiper
,
swiperSlide
}
from
"vue-awesome-swiper"
;
import
{
swiper
,
swiperSlide
}
from
"vue-awesome-swiper"
;
export
default
{
export
default
{
name
:
"HaveJoinedGame"
,
name
:
"HaveJoinedGame"
,
components
:
{
components
:
{
Title
,
Title
,
...
@@ -101,19 +113,19 @@
...
@@ -101,19 +113,19 @@
data
()
{
data
()
{
return
{
return
{
swiperOption
:
{
swiperOption
:
{
slidesPerView
:
'auto'
,
slidesPerView
:
"auto"
,
centeredSlides
:
true
,
centeredSlides
:
true
,
spaceBetween
:
10
,
spaceBetween
:
10
},
},
bet_bonus
:
'0.00'
,
bet_bonus
:
"0.00"
,
next_signup
:
false
,
next_signup
:
false
,
period_end
:
''
,
period_end
:
""
,
period_start
:
''
,
period_start
:
""
,
total_signup
:
0
,
total_signup
:
0
,
target_steps
:
0
,
target_steps
:
0
,
record_list
:
[],
record_list
:
[],
popupData
:
{}
popupData
:
{}
}
};
},
},
created
()
{
created
()
{
this
.
getPageData
();
this
.
getPageData
();
...
@@ -122,7 +134,7 @@
...
@@ -122,7 +134,7 @@
methods
:
{
methods
:
{
joinNextGame
()
{
joinNextGame
()
{
this
.
$router
.
push
({
this
.
$router
.
push
({
name
:
'PartakeChallenge'
,
name
:
"PartakeChallenge"
,
query
:
{
query
:
{
nextGame
:
true
nextGame
:
true
}
}
...
@@ -135,19 +147,26 @@
...
@@ -135,19 +147,26 @@
history
.
go
(
-
1
);
history
.
go
(
-
1
);
},
},
goOtherPage
(
pageName
)
{
goOtherPage
(
pageName
)
{
this
.
$router
.
push
({
name
:
pageName
});
this
.
$router
.
push
({
name
:
pageName
});
},
},
currentPage
()
{
currentPage
()
{
return
this
.
$router
.
history
.
current
.
name
;
return
this
.
$router
.
history
.
current
.
name
;
},
},
getPageData
()
{
getPageData
()
{
let
grade
=
2
;
let
grade
=
2
;
if
(
sessionStorage
.
getItem
(
'bushuType'
))
{
if
(
sessionStorage
.
getItem
(
"bushuType"
))
{
grade
=
sessionStorage
.
getItem
(
'bushuType'
);
grade
=
sessionStorage
.
getItem
(
"bushuType"
);
}
}
daka_status_detail
(
this
.
$route
.
query
.
week
,
grade
).
then
(
res
=>
{
daka_status_detail
(
this
.
$route
.
query
.
week
=
20190401
,
grade
).
then
(
res
=>
{
const
pageData
=
res
.
data
;
if
(
res
.
code
===
0
)
{
if
(
res
.
code
===
0
)
{
const
pageData
=
res
.
data
;
if
(
pageData
.
record_list
&&
pageData
.
record_list
.
length
)
{
pageData
.
record_list
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
status
===
0
)
{
item
.
format_tsp
=
this
.
countDown
(
'interval'
+
index
,
parseInt
((
item
.
tsp
*
1000
-
Date
.
now
())
/
1000
),
index
);
}
});
}
this
.
bet_bonus
=
pageData
.
bet_bonus
;
this
.
bet_bonus
=
pageData
.
bet_bonus
;
this
.
next_signup
=
pageData
.
next_signup
;
this
.
next_signup
=
pageData
.
next_signup
;
this
.
period_end
=
pageData
.
period_end
;
this
.
period_end
=
pageData
.
period_end
;
...
@@ -156,35 +175,66 @@
...
@@ -156,35 +175,66 @@
this
.
target_steps
=
pageData
.
target_steps
;
this
.
target_steps
=
pageData
.
target_steps
;
this
.
record_list
=
pageData
.
record_list
;
this
.
record_list
=
pageData
.
record_list
;
}
}
})
});
},
},
isPopup
()
{
isPopup
()
{
pop_up_windows
().
then
(
res
=>
{
pop_up_windows
().
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
if
(
res
.
code
===
0
)
{
this
.
popupData
=
res
.
data
;
this
.
popupData
=
res
.
data
;
}
}
})
});
},
//倒计时
countDown
(
intervalName
,
times
,
index
)
{
clearInterval
(
this
[
intervalName
]);
this
[
intervalName
]
=
null
;
this
[
intervalName
]
=
setInterval
(()
=>
{
let
day
=
0
,
hour
=
0
,
minute
=
0
,
second
=
0
;
if
(
times
>
0
)
{
day
=
Math
.
floor
(
times
/
(
60
*
60
*
24
));
hour
=
Math
.
floor
(
times
/
(
60
*
60
))
-
day
*
24
;
minute
=
Math
.
floor
(
times
/
60
)
-
day
*
24
*
60
-
hour
*
60
;
second
=
Math
.
floor
(
times
)
-
day
*
24
*
60
*
60
-
hour
*
60
*
60
-
minute
*
60
;
if
(
day
<
1
)
day
=
""
;
else
day
=
day
+
"天"
;
if
(
hour
<=
9
)
hour
=
"0"
+
hour
;
if
(
minute
<=
9
)
minute
=
"0"
+
minute
;
if
(
second
<=
9
)
second
=
"0"
+
second
;
this
.
record_list
[
index
].
format_tsp
=
day
+
hour
+
"时"
+
minute
+
"分"
+
second
+
"秒"
;
}
else
{
this
.
getPageData
();
clearInterval
(
this
[
intervalName
]);
}
}
times
--
;
// console.log('gagagag',intervalName, day + hour + "时" + minute + "分" + second + "秒")
// console.log('gagagag',times)
// console.log('gagagag',this.format_tsp)
},
1000
);
}
}
}
}
};
</
script
>
</
script
>
<
style
lang=
"less"
scoped
>
<
style
lang=
"less"
scoped
>
.swiper-container
{
.swiper-container
{
/*margin-left: 0 !important;*/
/*margin-left: 0 !important;*/
}
}
.swiper-slide
{
.swiper-slide
{
width
:
5.1rem
;
width
:
5.1rem
;
height
:
2.68rem
;
height
:
2.68rem
;
}
}
.swiper-slide
img
{
.swiper-slide
img
{
width
:
5.1rem
;
width
:
5.1rem
;
height
:
2.68rem
;
height
:
2.68rem
;
}
}
.have-joined-game-page
{
.have-joined-game-page
{
//
width
:
100%
;
//
width
:
100%
;
min-height
:
100vh
;
min-height
:
100vh
;
background-color
:
rgb
(
70
,
88
,
149
);
background-color
:
rgb
(
70
,
88
,
149
);
...
@@ -399,11 +449,11 @@
...
@@ -399,11 +449,11 @@
color
:
#fff
;
color
:
#fff
;
font-weight
:
bold
;
font-weight
:
bold
;
text-align
:
center
;
text-align
:
center
;
margin-top
:
.3rem
;
margin-top
:
0.3rem
;
}
}
}
}
.game-status-popup
{
.game-status-popup
{
position
:
fixed
;
position
:
fixed
;
left
:
0
;
left
:
0
;
top
:
0
;
top
:
0
;
...
@@ -531,5 +581,5 @@
...
@@ -531,5 +581,5 @@
transform
:
translateX
(
-50%
);
transform
:
translateX
(
-50%
);
}
}
}
}
}
}
</
style
>
</
style
>
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