Commit 0bf7d45b by Caiyijun

新增对应天数 卡片滚动

parent 06fe2041
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
.msg_container { .msg_container {
flex: 1; flex: 1;
height: .34rem; height: .44rem;
transform-style: preserve-3d; transform-style: preserve-3d;
overflow: hidden; overflow: hidden;
} }
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
.notice_msg { .notice_msg {
font-size: .24rem; font-size: .24rem;
color: #fff; color: #fff;
line-height: .32rem; line-height: .44rem;
text-align: center; text-align: center;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
} }
.msg1 { .msg1 {
transform: translate3d(0, 0.32rem, 0); transform: translate3d(0, 0.44rem, 0);
animation: rowUp 10s infinite; animation: rowUp 10s infinite;
/* transform: translateZ(35rpx); */ /* transform: translateZ(35rpx); */
} }
...@@ -76,8 +76,8 @@ ...@@ -76,8 +76,8 @@
@keyframes rowUp { @keyframes rowUp {
0% { 0% {
-webkit-transform: translate3d(0, 0.32rem, 0); -webkit-transform: translate3d(0, 0.44rem, 0);
transform: translate3d(0, 0.32rem, 0); transform: translate3d(0, 0.44rem, 0);
} }
10% { 10% {
-webkit-transform: translate3d(0, 0, 0); -webkit-transform: translate3d(0, 0, 0);
...@@ -88,12 +88,12 @@ ...@@ -88,12 +88,12 @@
transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0);
} }
50% { 50% {
-webkit-transform: translate3d(0, -0.32rem, 0); -webkit-transform: translate3d(0, -0.44rem, 0);
transform: translate3d(0, -0.32rem, 0); transform: translate3d(0, -0.44rem, 0);
} }
100% { 100% {
-webkit-transform: translate3d(0, -0.32rem, 0); -webkit-transform: translate3d(0, -0.44rem, 0);
transform: translate3d(0, -0.32rem, 0); transform: translate3d(0, -0.44rem, 0);
} }
} }
...@@ -107,12 +107,12 @@ ...@@ -107,12 +107,12 @@
transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0);
} }
60% { 60% {
-webkit-transform: translate3d(0, -0.32rem, 0); -webkit-transform: translate3d(0, -0.44rem, 0);
transform: translate3d(0, -0.32rem, 0); transform: translate3d(0, -0.44rem, 0);
} }
90% { 90% {
-webkit-transform: translate3d(0, -0.32rem, 0); -webkit-transform: translate3d(0, -0.32rem, 0);
transform: translate3d(0, -0.32rem, 0); transform: translate3d(0, -0.44rem, 0);
} }
100% { 100% {
-webkit-transform: translate3d(0, -0.96rem, 0); -webkit-transform: translate3d(0, -0.96rem, 0);
......
...@@ -30,7 +30,7 @@ export function fetch(options) { ...@@ -30,7 +30,7 @@ export function fetch(options) {
resolve(response.data);//把请求到的数据发到引用请求的地方 resolve(response.data);//把请求到的数据发到引用请求的地方
}) })
.catch(error => { .catch(error => {
console.log('请求异常信息:', error); // console.log('请求异常信息:', error);
// console.log(error); // console.log(error);
// if (error.response.status == 401) { // if (error.response.status == 401) {
// localStorage.setItem('last_url', location.hash.slice(1)); // localStorage.setItem('last_url', location.hash.slice(1));
......
...@@ -5,8 +5,6 @@ import store from './store' ...@@ -5,8 +5,6 @@ import store from './store'
import axios from 'axios' import axios from 'axios'
import wx from 'weixin-js-sdk' import wx from 'weixin-js-sdk'
import api from "@/components/axios/api" import api from "@/components/axios/api"
// import VConsole from 'vconsole/dist/vconsole.min.js' //import vconsole // import VConsole from 'vconsole/dist/vconsole.min.js' //import vconsole
// let vConsole = new VConsole() // 初始化 // let vConsole = new VConsole() // 初始化
......
...@@ -19,14 +19,16 @@ ...@@ -19,14 +19,16 @@
<div class="target-people-text">已有{{total_signup}}人参赛</div> <div class="target-people-text">已有{{total_signup}}人参赛</div>
</div> </div>
<div class="hr"></div> <div class="hr"></div>
<swiper :options="swiperOption" class="game-scroll-container" v-if="showSwiper"> <!-- <div style="height: 2.68rem;">-->
<swiper :options="swiperOption" ref="mySwiper" class="game-scroll-container" v-if="showSwiper">
<swiper-slide v-for="(item,index) in record_list" :key="index"> <swiper-slide v-for="(item,index) in record_list" :key="index">
<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 <div
:class="item.status===0?'item-status0':item.status===1?'item-status1':item.status===2?'item-status2':'item-status2'" :class="item.status===0?'item-status0':item.status===1?'item-status1':item.status===2?'item-status2':'item-status2'"
>{{item.status===0?'未开始':item.status===1?'比赛中':item.status===2?'已结束':'已淘汰'}}</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|moneyFormatter}}</div> <div class="item-amount">{{item.money|moneyFormatter}}</div>
...@@ -42,6 +44,7 @@ ...@@ -42,6 +44,7 @@
</div> </div>
</swiper-slide> </swiper-slide>
</swiper> </swiper>
<!-- </div>-->
<div class="func-btn" @click="goOtherPage('GoXCX')">提交今日步数</div> <div class="func-btn" @click="goOtherPage('GoXCX')">提交今日步数</div>
<div class="next-func-btn" v-if="next_signup" @click="joinNextGame()">报名下一期</div> <div class="next-func-btn" v-if="next_signup" @click="joinNextGame()">报名下一期</div>
<!-- 报名成功弹框 --> <!-- 报名成功弹框 -->
...@@ -98,12 +101,12 @@ ...@@ -98,12 +101,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, swiperSlide} from "vue-awesome-swiper"
import { swiper, swiperSlide } from "vue-awesome-swiper"; import "swiper/dist/css/swiper.css"
export default { export default {
name: "HaveJoinedGame", name: "HaveJoinedGame",
components: { components: {
Title, Title,
...@@ -115,7 +118,8 @@ export default { ...@@ -115,7 +118,8 @@ export default {
swiperOption: { swiperOption: {
slidesPerView: "auto", slidesPerView: "auto",
centeredSlides: true, centeredSlides: true,
spaceBetween: 10 spaceBetween: 10,
notNextTick: true
}, },
showSwiper: false, showSwiper: false,
bet_bonus: "0.00", bet_bonus: "0.00",
...@@ -125,12 +129,25 @@ export default { ...@@ -125,12 +129,25 @@ export default {
total_signup: 0, total_signup: 0,
target_steps: 0, target_steps: 0,
record_list: [], record_list: [],
popupData: {} popupData: {},
}; current_day: 0
}
}, },
created() { created() {
this.getPageData(); this.getPageData()
this.isPopup(); this.isPopup()
},
computed: {
swiper() {
// setTimeout(()=>{
return this.$refs.mySwiper.swiper
// },800)
}
},
mounted() {
setTimeout(() => {
this.swiper.slideTo(this.current_day, 1200, false)
}, 800)
}, },
methods: { methods: {
joinNextGame() { joinNextGame() {
...@@ -139,115 +156,114 @@ export default { ...@@ -139,115 +156,114 @@ export default {
query: { query: {
nextGame: true nextGame: true
} }
}); })
}, },
closePopup() { closePopup() {
this.popupData.window = false; this.popupData.window = false
}, },
goback() { goback() {
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 = 1
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, this.$route.query.week ? grade : '').then(res => {
if (res.code === 0) { if (res.code === 0) {
const pageData = res.data; const pageData = res.data
if (pageData.record_list && pageData.record_list.length) { if (pageData.record_list && pageData.record_list.length) {
pageData.record_list.forEach((item, index) => { pageData.record_list.forEach((item, index) => {
if (item.status === 0) { if (item.status === 0) {
item.format_tsp = this.countDown('interval'+index, parseInt((item.tsp * 1000 - Date.now()) / 1000), index); 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
this.period_start = pageData.period_start; this.period_start = pageData.period_start
this.total_signup = pageData.total_signup; this.total_signup = pageData.total_signup
this.target_steps = pageData.target_steps; this.target_steps = pageData.target_steps
this.record_list = pageData.record_list; this.record_list = pageData.record_list
setTimeout(()=>{ this.current_day = pageData.current_day - 1
this.showSwiper = true this.showSwiper = true
},500)
} }
}); })
}, },
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) { countDown(intervalName, times, index) {
clearInterval(this[intervalName]); clearInterval(this[intervalName])
this[intervalName] = null; this[intervalName] = null
this[intervalName] = setInterval(() => { this[intervalName] = setInterval(() => {
let day = 0, let day = 0,
hour = 0, hour = 0,
minute = 0, minute = 0,
second = 0; second = 0
if (times > 0) { if (times > 0) {
day = Math.floor(times / (60 * 60 * 24)); day = Math.floor(times / (60 * 60 * 24))
hour = Math.floor(times / (60 * 60)) - day * 24; hour = Math.floor(times / (60 * 60)) - day * 24
minute = Math.floor(times / 60) - day * 24 * 60 - hour * 60; minute = Math.floor(times / 60) - day * 24 * 60 - hour * 60
second = Math.floor(times) - day * 24 * 60 * 60 - hour * 60 * 60 - minute * 60; second = Math.floor(times) - day * 24 * 60 * 60 - hour * 60 * 60 - minute * 60
if (day < 1) day = ""; if (day < 1) day = ""
else day = day + "天"; else day = day + "天"
if (hour <= 9) hour = "0" + hour; if (hour <= 9) hour = "0" + hour
if (minute <= 9) minute = "0" + minute; if (minute <= 9) minute = "0" + minute
if (second <= 9) second = "0" + second; if (second <= 9) second = "0" + second
this.record_list[index].format_tsp = day + hour + "时" + minute + "分" + second + "秒"; this.record_list[index].format_tsp = day + hour + "时" + minute + "分" + second + "秒"
} else { } else {
this.getPageData(); this.getPageData()
clearInterval(this[intervalName]); clearInterval(this[intervalName])
} }
times--; times--
// console.log('gagagag',intervalName, day + hour + "时" + minute + "分" + second + "秒") // console.log('gagagag',intervalName, day + hour + "时" + minute + "分" + second + "秒")
// console.log('gagagag',times) // console.log('gagagag',times)
// console.log('gagagag',this.format_tsp) // console.log('gagagag',this.format_tsp)
}, 1000); }, 1000)
} }
}, },
filters: { filters: {
moneyFormatter(val) { moneyFormatter(val) {
if (val && !isNaN(val)) { if (val && !isNaN(val)) {
return Number(val).toFixed(2); return Number(val).toFixed(2)
} else { } else {
return "0.00"; return "0.00"
}
} }
} }
} }
};
</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);
...@@ -260,13 +276,15 @@ export default { ...@@ -260,13 +276,15 @@ export default {
align-items: center; align-items: center;
overflow: hidden; overflow: hidden;
position: relative; position: relative;
padding-bottom: 34px; padding-bottom: 50px;
.page-title { .page-title {
width: 100%; width: 100%;
position: fixed; position: fixed;
left: 0; left: 0;
top: 0; top: 0;
} }
.game-bonus-container { .game-bonus-container {
width: 6.4rem; width: 6.4rem;
padding: 0.3rem 0; padding: 0.3rem 0;
...@@ -278,12 +296,14 @@ export default { ...@@ -278,12 +296,14 @@ export default {
rgba(255, 255, 255, 0) rgba(255, 255, 255, 0)
); );
margin-top: 2.38rem; margin-top: 2.38rem;
.bonus-title { .bonus-title {
font-size: 0.3rem; font-size: 0.3rem;
line-height: 1; line-height: 1;
color: #fff; color: #fff;
text-align: center; text-align: center;
} }
.bonus-amount { .bonus-amount {
font-size: 0.64rem; font-size: 0.64rem;
line-height: 0.8; line-height: 0.8;
...@@ -292,6 +312,7 @@ export default { ...@@ -292,6 +312,7 @@ export default {
margin-top: 0.26rem; margin-top: 0.26rem;
} }
} }
.game-title { .game-title {
font-size: 0.36rem; font-size: 0.36rem;
line-height: 1; line-height: 1;
...@@ -299,6 +320,7 @@ export default { ...@@ -299,6 +320,7 @@ export default {
font-weight: bold; font-weight: bold;
margin-top: 0.4rem; margin-top: 0.4rem;
} }
.game-time { .game-time {
font-size: 0.24rem; font-size: 0.24rem;
line-height: 1; line-height: 1;
...@@ -308,18 +330,22 @@ export default { ...@@ -308,18 +330,22 @@ export default {
background: #556cb6; background: #556cb6;
margin-top: 0.14rem; margin-top: 0.14rem;
} }
.target-people-container { .target-people-container {
display: flex; display: flex;
margin-top: 0.34rem; margin-top: 0.34rem;
.target-img { .target-img {
width: 0.3rem; width: 0.3rem;
height: 0.26rem; height: 0.26rem;
} }
.people-img { .people-img {
width: 0.28rem; width: 0.28rem;
height: 0.24rem; height: 0.24rem;
margin-left: 0.5rem; margin-left: 0.5rem;
} }
.target-people-text { .target-people-text {
font-size: 0.26rem; font-size: 0.26rem;
line-height: 1; line-height: 1;
...@@ -327,12 +353,14 @@ export default { ...@@ -327,12 +353,14 @@ export default {
margin-left: 0.08rem; margin-left: 0.08rem;
} }
} }
.hr { .hr {
width: 3rem; width: 3rem;
height: 0.01rem; height: 0.01rem;
background: #6f82c3; background: #6f82c3;
margin-top: 0.5rem; margin-top: 0.5rem;
} }
.game-scroll-container { .game-scroll-container {
width: 100%; width: 100%;
height: 2.68rem; height: 2.68rem;
...@@ -341,9 +369,11 @@ export default { ...@@ -341,9 +369,11 @@ export default {
box-sizing: border-box; box-sizing: border-box;
overflow-x: scroll; overflow-x: scroll;
white-space: nowrap; white-space: nowrap;
&::-webkit-scrollbar { &::-webkit-scrollbar {
display: none; display: none;
} }
.game-scroll-item { .game-scroll-item {
width: 5.1rem; width: 5.1rem;
height: 2.68rem; height: 2.68rem;
...@@ -355,9 +385,11 @@ export default { ...@@ -355,9 +385,11 @@ export default {
margin-left: 0.2rem; margin-left: 0.2rem;
display: inline-block; display: inline-block;
vertical-align: top; vertical-align: top;
&:first-child { &:first-child {
margin-left: 0; margin-left: 0;
} }
.item-title-status { .item-title-status {
width: 100%; width: 100%;
padding: 0 0.24rem 0 0.3rem; padding: 0 0.24rem 0 0.3rem;
...@@ -365,11 +397,13 @@ export default { ...@@ -365,11 +397,13 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
.item-title { .item-title {
font-size: 0.3rem; font-size: 0.3rem;
line-height: 1; line-height: 1;
color: #fff; color: #fff;
} }
.item-status0 { .item-status0 {
padding: 0 0.16rem; padding: 0 0.16rem;
box-sizing: border-box; box-sizing: border-box;
...@@ -378,6 +412,7 @@ export default { ...@@ -378,6 +412,7 @@ export default {
line-height: 0.42rem; line-height: 0.42rem;
color: #fff; color: #fff;
} }
.item-status1 { .item-status1 {
padding: 0 0.16rem; padding: 0 0.16rem;
box-sizing: border-box; box-sizing: border-box;
...@@ -386,6 +421,7 @@ export default { ...@@ -386,6 +421,7 @@ export default {
line-height: 0.42rem; line-height: 0.42rem;
color: #703e0b; color: #703e0b;
} }
.item-status2 { .item-status2 {
padding: 0 0.16rem; padding: 0 0.16rem;
box-sizing: border-box; box-sizing: border-box;
...@@ -395,6 +431,7 @@ export default { ...@@ -395,6 +431,7 @@ export default {
color: #fff; color: #fff;
} }
} }
.item-income { .item-income {
width: 100%; width: 100%;
padding-left: 0.3rem; padding-left: 0.3rem;
...@@ -402,11 +439,13 @@ export default { ...@@ -402,11 +439,13 @@ export default {
margin-top: 0.4rem; margin-top: 0.4rem;
display: flex; display: flex;
align-items: flex-end; align-items: flex-end;
.item-amount { .item-amount {
font-size: 0.48rem; font-size: 0.48rem;
line-height: 0.8; line-height: 0.8;
color: #fcf776; color: #fcf776;
} }
.item-text { .item-text {
font-size: 0.26rem; font-size: 0.26rem;
line-height: 1; line-height: 1;
...@@ -414,6 +453,7 @@ export default { ...@@ -414,6 +453,7 @@ export default {
margin-left: 0.1rem; margin-left: 0.1rem;
} }
} }
.item-progress-num { .item-progress-num {
width: 100%; width: 100%;
padding: 0 0.3rem; padding: 0 0.3rem;
...@@ -422,10 +462,12 @@ export default { ...@@ -422,10 +462,12 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
.item-progress { .item-progress {
height: 0.06rem; height: 0.06rem;
background: #fff; background: #fff;
position: relative; position: relative;
&:after { &:after {
content: ""; content: "";
width: 2.46rem; width: 2.46rem;
...@@ -434,6 +476,7 @@ export default { ...@@ -434,6 +476,7 @@ export default {
position: absolute; position: absolute;
} }
} }
.item-num { .item-num {
font-size: 0.26rem; font-size: 0.26rem;
line-height: 1; line-height: 1;
...@@ -442,6 +485,7 @@ export default { ...@@ -442,6 +485,7 @@ export default {
} }
} }
} }
.func-btn { .func-btn {
width: 5.6rem; width: 5.6rem;
border-radius: 0.92rem; border-radius: 0.92rem;
...@@ -453,6 +497,7 @@ export default { ...@@ -453,6 +497,7 @@ export default {
text-align: center; text-align: center;
margin-top: 1.2rem; margin-top: 1.2rem;
} }
.next-func-btn { .next-func-btn {
width: 5.6rem; width: 5.6rem;
border-radius: 0.92rem; border-radius: 0.92rem;
...@@ -464,9 +509,9 @@ export default { ...@@ -464,9 +509,9 @@ export default {
text-align: center; text-align: center;
margin-top: 0.3rem; margin-top: 0.3rem;
} }
} }
.game-status-popup { .game-status-popup {
position: fixed; position: fixed;
left: 0; left: 0;
top: 0; top: 0;
...@@ -477,6 +522,7 @@ export default { ...@@ -477,6 +522,7 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
.game-status-container { .game-status-container {
width: 6rem; width: 6rem;
background: #fff; background: #fff;
...@@ -486,16 +532,19 @@ export default { ...@@ -486,16 +532,19 @@ export default {
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
position: relative; position: relative;
.status-icon { .status-icon {
width: 5.08rem; width: 5.08rem;
height: 2.58rem; height: 2.58rem;
margin-top: -1.29rem; margin-top: -1.29rem;
} }
.join-success-banner { .join-success-banner {
width: 5.44rem; width: 5.44rem;
height: 3.18rem; height: 3.18rem;
margin-top: 0.3rem; margin-top: 0.3rem;
} }
.status-date { .status-date {
font-size: 0.36rem; font-size: 0.36rem;
line-height: 1; line-height: 1;
...@@ -504,12 +553,14 @@ export default { ...@@ -504,12 +553,14 @@ export default {
text-align: center; text-align: center;
margin-top: 0.4rem; margin-top: 0.4rem;
} }
.status-money { .status-money {
width: 5.04rem; width: 5.04rem;
height: 2.84rem; height: 2.84rem;
background-image: url(../images/HaveJoinedGame/pop_gxdb_board.png); background-image: url(../images/HaveJoinedGame/pop_gxdb_board.png);
background-size: 100%; background-size: 100%;
margin-top: 0.42rem; margin-top: 0.42rem;
.popup-text3 { .popup-text3 {
font-size: 0.3rem; font-size: 0.3rem;
line-height: 1; line-height: 1;
...@@ -517,18 +568,21 @@ export default { ...@@ -517,18 +568,21 @@ export default {
text-align: center; text-align: center;
margin-top: 0.42rem; margin-top: 0.42rem;
} }
.popup-text4 { .popup-text4 {
font-size: 1.2rem; font-size: 1.2rem;
line-height: 0.8; line-height: 0.8;
color: #fabd21; color: #fabd21;
text-align: center; text-align: center;
margin-top: 0.24rem; margin-top: 0.24rem;
span { span {
font-size: 0.3rem; font-size: 0.3rem;
line-height: 1; line-height: 1;
vertical-align: bottom; vertical-align: bottom;
} }
} }
.popup-text5 { .popup-text5 {
font-size: 0.24rem; font-size: 0.24rem;
line-height: 1; line-height: 1;
...@@ -537,6 +591,7 @@ export default { ...@@ -537,6 +591,7 @@ export default {
margin-top: 0.42rem; margin-top: 0.42rem;
} }
} }
.popup-text1 { .popup-text1 {
width: 5.34rem; width: 5.34rem;
font-size: 0.26rem; font-size: 0.26rem;
...@@ -544,10 +599,12 @@ export default { ...@@ -544,10 +599,12 @@ export default {
color: #333; color: #333;
text-align: center; text-align: center;
margin-top: 0.16rem; margin-top: 0.16rem;
span { span {
color: #fabd21; color: #fabd21;
} }
} }
.popup-text2 { .popup-text2 {
font-size: 0.24rem; font-size: 0.24rem;
line-height: 1; line-height: 1;
...@@ -555,6 +612,7 @@ export default { ...@@ -555,6 +612,7 @@ export default {
text-align: center; text-align: center;
margin-top: 0.32rem; margin-top: 0.32rem;
} }
.popup-text6 { .popup-text6 {
font-size: 0.26rem; font-size: 0.26rem;
line-height: 1; line-height: 1;
...@@ -562,12 +620,14 @@ export default { ...@@ -562,12 +620,14 @@ export default {
text-align: center; text-align: center;
margin: 0.4rem 0 0.34rem; margin: 0.4rem 0 0.34rem;
} }
.popup-text7 { .popup-text7 {
font-size: 0.26rem; font-size: 0.26rem;
line-height: 1; line-height: 1;
color: #8e5b29; color: #8e5b29;
text-align: center; text-align: center;
} }
.popup-btn1 { .popup-btn1 {
width: 4.6rem; width: 4.6rem;
height: 0.8rem; height: 0.8rem;
...@@ -579,12 +639,15 @@ export default { ...@@ -579,12 +639,15 @@ export default {
text-align: center; text-align: center;
margin-top: 0.4rem; margin-top: 0.4rem;
} }
.green-btn { .green-btn {
background: #1fdbb1; background: #1fdbb1;
} }
.yellow-btn { .yellow-btn {
background: #fabd21; background: #fabd21;
} }
.close-btn { .close-btn {
width: 0.58rem; width: 0.58rem;
height: 0.58rem; height: 0.58rem;
...@@ -594,5 +657,5 @@ export default { ...@@ -594,5 +657,5 @@ export default {
transform: translateX(-50%); transform: translateX(-50%);
} }
} }
} }
</style> </style>
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</div> </div>
<div class="text2" @click="goOtherPage('Rule')">《步数打卡的挑战规则协议》</div> <div class="text2" @click="goOtherPage('Rule')">《步数打卡的挑战规则协议》</div>
</div> </div>
<div class="partake-btn">立即报名</div> <div class="partake-btn" @click="payToSign()">立即报名</div>
</div> </div>
</div> </div>
<div class="footer-container" v-if="currentPage()==='PartakeChallenge'"> <div class="footer-container" v-if="currentPage()==='PartakeChallenge'">
...@@ -199,10 +199,13 @@ ...@@ -199,10 +199,13 @@
} }
console.log(grade) console.log(grade)
daka_info(grade).then(res=>{ daka_info(grade).then(res=>{
console.log('daka_info',res)
if(res.code == 0){
console.log('立即参与',res) console.log('立即参与',res)
console.log(typeof res.data.daka_info) console.log(typeof res.data.daka_info)
this.daka_info = res.data.daka_info this.daka_info = res.data.daka_info
this.daka_faq = res.data.daka_faq this.daka_faq = res.data.daka_faq
}
}) })
} }
}, },
......
...@@ -15,8 +15,9 @@ ...@@ -15,8 +15,9 @@
<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">
<div class="card-title">{{item.target_step}}步3天耐力赛 第{{item.action}}</div> <div class="card-title">{{item.action}}期 - {{item.target_step}}步3天耐力赛</div>
<div class="card-time">{{item.already_join===1?'已参赛':'未参赛'}} {{item.period_start}} - {{item.period_end}}</div> <div class="card-time">{{item.already_join===1?'已参赛':'未参赛'}} {{item.period_start}} - {{item.period_end}}
</div>
<div class="card-info"> <div class="card-info">
<div class="info-item" v-if="item.status===0||item.status===2"> <div class="info-item" v-if="item.status===0||item.status===2">
<div class="item-title">达标人数</div> <div class="item-title">达标人数</div>
...@@ -31,27 +32,29 @@ ...@@ -31,27 +32,29 @@
<div class="item-money">{{item.total_money || '0.00'}}</div> <div class="item-money">{{item.total_money || '0.00'}}</div>
</div> </div>
</div> </div>
<!-- 0 比赛中 1 未开始 2 已结束-->
<div class="card-btn" v-if="item.status===1&&item.already_join===0" data-item="item" <div class="card-btn" v-if="item.status===1&&item.already_join===0" data-item="item"
@click="goOtherPage('PartakeChallenge')"> @click="goOtherPage('PartakeChallenge')">
<div class="btn-title">参与挑战</div> <div class="btn-title">参与挑战</div>
<!--<div class="card-btn-tip">(每日目标{{item.target_step}}步)</div>-->
</div> </div>
<div class="card-btn" :style="item.status!==1?'background:#32A1F6;':''" <div class="card-btn" v-if="item.status===1&&item.already_join===1" data-item="item"
v-if="item.status===1&&item.already_join===1" @click="goWhereDetail(item)">已报名
@click="goWhereDetail(item)">已报名</div> </div>
<div class="card-btn statusnormal" v-if="item.status===2 || item.status===3 || item.status===0" <div class="statusnormal" v-if="item.status===2 || item.status===0 || item.status===3"
@click="goWhereDetail(item)">{{(item.status===2 || item.status===0) @click="goWhereDetail(item)">{{(item.status===2 || item.status===0)
?'查看详情': '已淘汰'}}</div> ? (item.status===0&&item.already_join===1) ? '立即打卡': '查看详情' : '已淘汰'}}
<img src="../images/SignUp/detail_bg.png" alt="">
</div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import NoticeBonus from "@/components/NoticeBonus.vue"; import NoticeBonus from "@/components/NoticeBonus.vue"
import Free from "@/components/Free.vue"; import Free from "@/components/Free.vue"
import Modal from "@/components/Modal.vue"; import Modal from "@/components/Modal.vue"
import PayFailModal from "@/components/PayFailModal.vue"; import PayFailModal from "@/components/PayFailModal.vue"
import { dakaPay, track, userCards, daka_index } from "@/components/axios/api"; import {dakaPay, track, userCards, daka_index} from "@/components/axios/api"
export default { export default {
name: "SignUp", name: "SignUp",
...@@ -73,50 +76,57 @@ ...@@ -73,50 +76,57 @@
isFollow: false, isFollow: false,
gameList: [], gameList: [],
choosedLevel: 1 choosedLevel: 2
}; }
}, },
created() { created() {
this.getPageData(); let grade = Number(sessionStorage.getItem("bushuType"))
if(grade){
// console.log('grade',grade)
this.getPageData(grade)
}else{
// console.log('grade 0',grade)
this.getPageData()
}
}, },
mounted() { mounted() {
//获取步数tab缓存 //获取步数tab缓存
let LastLevel = Number(sessionStorage.getItem("bushuType")); let LastLevel = Number(sessionStorage.getItem("bushuType"))
if (LastLevel) { if (LastLevel) {
this.choosedLevel = LastLevel; this.choosedLevel = LastLevel
}else{ } else {
sessionStorage.setItem("bushuType", this.choosedLevel); sessionStorage.setItem("bushuType", this.choosedLevel)
} }
}, },
methods: { methods: {
chooseGameLevel(level) { chooseGameLevel(level) {
sessionStorage.setItem("bushuType", level); sessionStorage.setItem("bushuType", level)
this.choosedLevel = level; this.choosedLevel = level
this.getPageData(level); this.getPageData(level)
}, },
goOtherPage(pageName) { goOtherPage(pageName) {
console.log('pageName',pageName) console.log('pageName', pageName)
this.$router.push({ name: pageName }); this.$router.push({name: pageName})
}, },
goWhereDetail(item) { goWhereDetail(item) {
if (item.status===1&&item.already_join===1) { // 已报名 if (item.status === 1 && item.already_join === 1) { // 已报名
this.$router.push({ this.$router.push({
name: 'HaveJoinedGame', name: 'HaveJoinedGame',
query: { query: {
week: item.week week: item.week
} }
}); })
} else { // 比赛中或者已结束 } else { // 比赛中或者已结束
if (item.already_join===1) { // 已报名 if (item.already_join === 1) { // 已报名
this.$router.push({ this.$router.push({
name: 'HaveJoinedGame', name: 'HaveJoinedGame',
query: { query: {
week: item.week week: item.week
} }
}); })
} else { // 未报名 } else { // 未报名
sessionStorage.setItem('ChallengeDetailData', JSON.stringify(item)); sessionStorage.setItem('ChallengeDetailData', JSON.stringify(item))
this.$router.push({name: 'ChallengeDetail'}); this.$router.push({name: 'ChallengeDetail'})
} }
} }
}, },
...@@ -126,46 +136,46 @@ ...@@ -126,46 +136,46 @@
res.data.forEach(item => { res.data.forEach(item => {
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); console.log('gameList', this.gameList)
} }
}); })
}, },
togglePayFail() { togglePayFail() {
this.isShowPayFail = !this.isShowPayFail; this.isShowPayFail = !this.isShowPayFail
}, },
showSuccess() { showSuccess() {
this.showModal("温馨提示", "报名成功", { this.showModal("温馨提示", "报名成功", {
scb: () => { scb: () => {
if (this.isFollow == 1) { if (this.isFollow == 1) {
this.$router.push({ name: "Read" }); this.$router.push({name: "Read"})
} else { } else {
this.$router.push({ name: "Success" }); this.$router.push({name: "Success"})
} }
} }
}); })
}, },
confirmModal(scb) { confirmModal(scb) {
scb && scb(); scb && scb()
this.modalShown = false; this.modalShown = false
}, },
showFree(e) { showFree(e) {
e.stopPropagation(); e.stopPropagation()
track("free_contract_show"); track("free_contract_show")
if (localStorage.getItem("first_show_free") == 1) { if (localStorage.getItem("first_show_free") == 1) {
localStorage.setItem("first_show_free", 2); localStorage.setItem("first_show_free", 2)
this.canShowFree = false; this.canShowFree = false
} else { } else {
this.canCheckShowFree = false; this.canCheckShowFree = false
this.canShowFree = false; this.canShowFree = false
} }
userCards().then(res => { userCards().then(res => {
console.log("获取免契约金数据", res); console.log("获取免契约金数据", res)
let data = { let data = {
card: res.data.contract_card, card: res.data.contract_card,
cnt: res.data.contract_cnt cnt: res.data.contract_cnt
}; }
this.current_date = new Date(res.date); this.current_date = new Date(res.date)
// if ( // if (
// // 如果明天没报名,而且还有免契约金卡,则可以使用 // // 如果明天没报名,而且还有免契约金卡,则可以使用
// !this.date_status[1].user_status.daka_signup && // !this.date_status[1].user_status.daka_signup &&
...@@ -176,31 +186,31 @@ ...@@ -176,31 +186,31 @@
// } else { // } else {
// data.can_get = false; // data.can_get = false;
// } // }
this.contract_data = JSON.parse(JSON.stringify(data)); this.contract_data = JSON.parse(JSON.stringify(data))
this.showFreeModal = true; this.showFreeModal = true
}); })
}, },
closeFree() { closeFree() {
this.showFreeModal = false; this.showFreeModal = false
}, },
showModal(title, desc, option) { showModal(title, desc, option) {
this.modalTitle = title || ""; this.modalTitle = title || ""
this.modalDesc = desc || ""; this.modalDesc = desc || ""
this.modalOption = option || {}; this.modalOption = option || {}
this.modalShown = true; this.modalShown = true
}, },
closeModal() { closeModal() {
this.modalShown = false; this.modalShown = false
}, },
payToSign() { payToSign() {
dakaPay().then(response => { dakaPay().then(response => {
this.current_date = new Date(response.date); this.current_date = new Date(response.date)
if (response.code == 1) { if (response.code == 1) {
this.showModal("温馨提示", response.msg); this.showModal("温馨提示", response.msg)
return; return
} }
let result = response.data; let result = response.data
console.log("请求打卡支付数据", result); console.log("请求打卡支付数据", result)
if (result) { if (result) {
WeixinJSBridge.invoke( WeixinJSBridge.invoke(
"getBrandWCPayRequest", "getBrandWCPayRequest",
...@@ -214,44 +224,44 @@ ...@@ -214,44 +224,44 @@
}, },
// result, // result,
res => { res => {
console.log("支付调用结果", res); console.log("支付调用结果", res)
if (res.err_msg == "get_brand_wcpay_request:ok") { if (res.err_msg == "get_brand_wcpay_request:ok") {
// 使用以上方式判断前端返回,微信团队郑重提示: // 使用以上方式判断前端返回,微信团队郑重提示:
//res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。 //res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
// 支付成功后的回调函数 // 支付成功后的回调函数
console.log("支付成功"); console.log("支付成功")
this.showModal("温馨提示", "报名成功", { this.showModal("温馨提示", "报名成功", {
scb: () => { scb: () => {
if (this.isFollow == 1) { if (this.isFollow == 1) {
this.$router.push({ name: "Read" }); this.$router.push({name: "Read"})
} else { } else {
this.$router.push({ name: "Success" }); this.$router.push({name: "Success"})
} }
} }
}); })
// this.dateSelect(2); // this.dateSelect(2);
// localStorage.setItem("is_every", 0) // localStorage.setItem("is_every", 0)
// location.replace("#/Success"); // location.replace("#/Success");
} }
if (res.err_msg == "get_brand_wcpay_request:fail") { if (res.err_msg == "get_brand_wcpay_request:fail") {
// this.showModal("温馨提示", "支付服务繁忙,请稍后重试"); // this.showModal("温馨提示", "支付服务繁忙,请稍后重试");
this.togglePayFail(); this.togglePayFail()
} }
if (res.err_msg == "get_brand_wcpay_request:cancel") { if (res.err_msg == "get_brand_wcpay_request:cancel") {
// console.log("支付取消"); // console.log("支付取消");
this.togglePayFail(); this.togglePayFail()
} }
} }
); )
}
})
} }
});
} }
} }
};
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.sign-up-page { .sign-up-page {
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow-y: scroll; overflow-y: scroll;
...@@ -265,6 +275,7 @@ ...@@ -265,6 +275,7 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
.top-nav-level { .top-nav-level {
flex-shrink: 0; flex-shrink: 0;
margin-top: 0.3rem; margin-top: 0.3rem;
...@@ -274,6 +285,7 @@ ...@@ -274,6 +285,7 @@
background: #fff; background: #fff;
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
.level-item { .level-item {
width: 1.76rem; width: 1.76rem;
font-size: 0.3rem; font-size: 0.3rem;
...@@ -281,6 +293,7 @@ ...@@ -281,6 +293,7 @@
color: #465895; color: #465895;
text-align: center; text-align: center;
position: relative; position: relative;
&:after { &:after {
content: ""; content: "";
height: 0.26rem; height: 0.26rem;
...@@ -291,20 +304,24 @@ ...@@ -291,20 +304,24 @@
top: 50%; top: 50%;
transform: translateY(-50%); transform: translateY(-50%);
} }
&:first-child:after { &:first-child:after {
display: none; display: none;
} }
&.active { &.active {
background: #465895; background: #465895;
color: #fff; color: #fff;
border-radius: 0.1rem; border-radius: 0.1rem;
font-weight: bold; font-weight: bold;
} }
&.active:after { &.active:after {
display: none; display: none;
} }
} }
} }
.view-steps-btn { .view-steps-btn {
flex-shrink: 0; flex-shrink: 0;
width: 1.11rem; width: 1.11rem;
...@@ -314,10 +331,12 @@ ...@@ -314,10 +331,12 @@
left: 0; left: 0;
top: 1.22rem; top: 1.22rem;
} }
.notice-broadcast { .notice-broadcast {
flex-shrink: 0; flex-shrink: 0;
margin: 3.68rem 0 0.18rem; margin: 3.68rem 0 0.18rem;
} }
.challenge-card { .challenge-card {
flex-shrink: 0; flex-shrink: 0;
width: 6.9rem; width: 6.9rem;
...@@ -329,6 +348,7 @@ ...@@ -329,6 +348,7 @@
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
position: relative; position: relative;
.corner-marker { .corner-marker {
width: 1.39rem; width: 1.39rem;
height: 1.39rem; height: 1.39rem;
...@@ -336,22 +356,27 @@ ...@@ -336,22 +356,27 @@
top: -0.02rem; top: -0.02rem;
right: -0.02rem; right: -0.02rem;
} }
.card-title { .card-title {
font-size: 0.34rem; font-size: 0.34rem;
line-height: 1; line-height: 1;
color: #fff; color: #fff;
margin-top: 0.28rem; margin-top: 0.28rem;
} }
.card-time { .card-time {
background: rgba(0,0,0,0.1); background: rgba(0, 0, 0, 0.1);
padding:0 0.24rem; padding: 0 0.24rem;
border-radius: .24rem; border-radius: .24rem;
height: .46rem; height: .46rem;
display: flex;
align-items: center;
font-size: 0.26rem; font-size: 0.26rem;
line-height: .46rem; font-family: Helvetica;
color: #fff; color: #fff;
margin-top: 0.16rem; margin-top: 0.16rem;
} }
.card-info { .card-info {
width: 100%; width: 100%;
margin-top: 0.7rem; margin-top: 0.7rem;
...@@ -364,20 +389,24 @@ ...@@ -364,20 +389,24 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
&:first-child { &:first-child {
border-left: none; border-left: none;
} }
.item-title { .item-title {
font-size: 0.28rem; font-size: 0.28rem;
line-height: 0.8; line-height: 0.8;
color: #fff; color: #fff;
} }
.item-content { .item-content {
font-size: 0.48rem; font-size: 0.48rem;
line-height: 0.8; line-height: 0.8;
color: #fff; color: #fff;
margin-top: 0.12rem; margin-top: 0.12rem;
} }
.item-money { .item-money {
font-size: 0.48rem; font-size: 0.48rem;
line-height: 0.8; line-height: 0.8;
...@@ -386,13 +415,24 @@ ...@@ -386,13 +415,24 @@
} }
} }
} }
.statusnormal{
background: transparent !important; .statusnormal {
box-shadow: 0 0 0 0 !important; position:absolute;
background: url("../images/SignUp/detail_bg.png") no-repeat !important; bottom: 0.38rem;
background-position: 130px !important; display: flex;
background-size: 14px 14px !important; justify-content: center;
align-content: center;
color: #fff;
font-size: 0.34rem;
font-weight: 600;
img {
display: flex;
margin-left: 4px;
width: 15px;
height: 15px;
}
} }
.card-btn { .card-btn {
width: 4rem; width: 4rem;
height: 0.88rem; height: 0.88rem;
...@@ -412,16 +452,18 @@ ...@@ -412,16 +452,18 @@
bottom: 0.38rem; bottom: 0.38rem;
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
.card-btn-tip { .card-btn-tip {
font-size: 0.22rem; font-size: 0.22rem;
margin-top: 0.06rem; margin-top: 0.06rem;
font-weight: normal; font-weight: normal;
} }
.btn-title{
.btn-title {
font-size: .34rem; font-size: .34rem;
font-weight: bold; font-weight: bold;
} }
} }
} }
} }
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment