Commit c3e8149b by Caiyijun

Merge remote-tracking branch 'remotes/origin/mutou' into dev_yijun

parents 0bf7d45b b6d8d3c1
<template>
<div>
<div class="notice_bonus" v-if="isShowNotice">
<img class="icon_container" src="../images/components/NoticeBonus/sy_guangbo.png" alt="">
<div ref="container" class="msg_container">
......@@ -9,6 +10,7 @@
<div :class="['notice_msg', startAnimate?'msg2':'']">{{msg2}}</div>
</div>
</div>
</div>
</template>
<style>
......@@ -122,13 +124,13 @@
</style>
<script>
import {gameInfo} from "@/components/axios/api";
import {gameInfo} from "@/components/axios/api"
export default {
name: "NoticeBonus",
data() {
return {
isShowNotice:false,
isShowNotice: false,
notice_list: [],
gameInfo: {
"fly_top": [],
......@@ -140,7 +142,7 @@
msg1: "",
msg2: "",
};
}
},
// props: ["notice_list"],
// computed: {
......@@ -151,12 +153,12 @@
methods: {
stopScroll(e) {
console.log(e)
e.preventDefault();
e.preventDefault()
},
getGameInfo(nonRefresh) {
gameInfo().then(result => {
console.log("result", result)
if (result.code == 0) {
if (result.code == 0 && result.data.lenght > 0) {
let fly_bot = result.data.fly_bot
let fly_top = result.data.fly_top
let len = Math.max(fly_bot.length, fly_top.length)
......@@ -171,7 +173,7 @@
this.msg2 = this.notice_list[1]
console.log("this.notice_list", this.notice_list)
this.isShowNotice=true
this.isShowNotice = true
}
})
},
......@@ -204,5 +206,5 @@
mounted() {
this.msgAnimate()
}
};
}
</script>
......@@ -30,16 +30,16 @@ export function fetch(options) {
resolve(response.data);//把请求到的数据发到引用请求的地方
})
.catch(error => {
// console.log('请求异常信息:', error);
// console.log(error);
// if (error.response.status == 401) {
// localStorage.setItem('last_url', location.hash.slice(1));
// localStorage.setItem('walk_userData', '');
// location.replace('#/Author');
// // this.$router.push({name:"Author"})
// } else {
// reject(error);
// }
console.log('请求异常信息:', error);
console.log(error);
if (error.response.status == 401) {
localStorage.setItem('last_url', location.hash.slice(1));
localStorage.setItem('walk_userData', '');
location.replace('#/Author');
// this.$router.push({name:"Author"})
} else {
reject(error);
}
});
});
......
......@@ -189,12 +189,14 @@
width: 6.4rem;
padding: 0.3rem 0;
box-sizing: border-box;
background: linear-gradient(
90deg,
rgba(255, 255, 255, 0),
#1a285a,
rgba(255, 255, 255, 0)
);
background: url("../images/SignUp/shadow-bg.png") no-repeat center center;
background-size: contain;
/*background: linear-gradient(*/
/* 90deg,*/
/* rgba(255, 255, 255, 0),*/
/* #1a285a,*/
/* rgba(255, 255, 255, 0)*/
/*);*/
margin-top: 2.38rem;
.bonus-title {
font-size: 0.3rem;
......@@ -279,7 +281,7 @@
color: #fff;
font-weight: bold;
text-align: center;
margin-top: 2.24rem;
margin-top: 1.1rem;
}
}
</style>
......@@ -10,7 +10,7 @@
<div class="bonus-title">本期累计奖励金(元)</div>
<div class="bonus-amount">{{bet_bonus|moneyFormatter}}</div>
</div>
<div class="game-title">{{target_steps}}日耐力赛</div>
<div class="game-title">{{target_steps}}3日耐力赛</div>
<div class="game-time">开赛时间:{{period_start}}{{period_end}}</div>
<div class="target-people-container">
<img class="target-img" src="../images/HaveJoinedGame/ic_shoes.png">
......@@ -19,7 +19,7 @@
<div class="target-people-text">已有{{total_signup}}人参赛</div>
</div>
<div class="hr"></div>
<!-- <div style="height: 2.68rem;">-->
<!-- <div style="height: 2.68rem;">v-if="showSwiper" -->
<swiper :options="swiperOption" ref="mySwiper" class="game-scroll-container" v-if="showSwiper">
<swiper-slide v-for="(item,index) in record_list" :key="index">
<div class="game-scroll-item">
......@@ -47,19 +47,22 @@
<!-- </div>-->
<div class="func-btn" @click="goOtherPage('GoXCX')">提交今日步数</div>
<div class="next-func-btn" v-if="next_signup" @click="joinNextGame()">报名下一期</div>
<!-- 报名成功弹框 -->
<div class="game-status-popup" v-if="false">
<div class="game-status-popup" v-if="userHavePaidGame">
<div class="game-status-container">
<img class="status-icon" src="../images/HaveJoinedGame/pop_bmcg_title.png">
<img class="join-success-banner" src="../images/HaveJoinedGame/pop_bmcg_img.png">
<div class="popup-text1">
<span>每日24点前</span>打开「运动打卡」小程序,手动提交今日步数,否则可能导致无法分钱哦!
<span>每日24点前</span>打开「步步运动赚」小程序,手动提交今日步数,否则可能导致无法分钱哦!
</div>
<div class="popup-text2">注:微信暂不支持小程序实时更新步数</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" @click="closePayPopup()">
</div>
</div>
<!-- 恭喜达标弹框 -->
<div class="game-status-popup" v-if="popupData.window && popupData.daka_done">
<div class="game-status-container">
......@@ -74,7 +77,7 @@
<div class="popup-text5">第{{popupData.week}}期{{popupData.target_steps}}步3日耐力赛</div>
</div>
<div class="popup-text6">{{popupData.target_steps}}步达标,今天走了{{popupData.step_num}}步</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" @click="closePopup()">
</div>
</div>
......@@ -101,12 +104,12 @@
</template>
<script>
import Title from "@/components/Title.vue"
import {daka_status_detail, pop_up_windows} from "@/components/axios/api"
import {swiper, swiperSlide} from "vue-awesome-swiper"
import "swiper/dist/css/swiper.css"
import Title from "@/components/Title.vue";
import { daka_status_detail, pop_up_windows } from "@/components/axios/api";
import { swiper, swiperSlide } from "vue-awesome-swiper";
import "swiper/dist/css/swiper.css";
export default {
export default {
name: "HaveJoinedGame",
components: {
Title,
......@@ -119,7 +122,9 @@
slidesPerView: "auto",
centeredSlides: true,
spaceBetween: 10,
notNextTick: true
notNextTick: true,
loop: false,
autoplay: false
},
showSwiper: false,
bet_bonus: "0.00",
......@@ -130,24 +135,27 @@
target_steps: 0,
record_list: [],
popupData: {},
current_day: 0
}
current_day: 0,
userHavePaidGame: false
};
},
created() {
this.getPageData()
this.isPopup()
this.getPageData();
this.isPopup();
if (sessionStorage.getItem("userHavePaidGame") === "true") {
sessionStorage.setItem("userHavePaidGame", "false");
this.userHavePaidGame = true;
}
},
computed: {
swiper() {
// setTimeout(()=>{
return this.$refs.mySwiper.swiper
// },800)
return this.$refs.mySwiper.swiper;
}
},
mounted() {
setTimeout(() => {
this.swiper.slideTo(this.current_day, 1200, false)
}, 800)
this.swiper.slideTo(this.current_day, 1200, false);
}, 800);
},
methods: {
joinNextGame() {
......@@ -156,114 +164,129 @@
query: {
nextGame: true
}
})
});
},
closePayPopup() {
this.userHavePaidGame = false;
},
closePopup() {
this.popupData.window = false
this.popupData.window = false;
},
goback() {
history.go(-1)
history.go(-1);
},
goOtherPage(pageName) {
this.$router.push({name: pageName})
this.$router.push({ name: pageName });
},
currentPage() {
return this.$router.history.current.name
return this.$router.history.current.name;
},
getPageData() {
let grade = 1
let grade = 1;
if (sessionStorage.getItem("bushuType")) {
grade = sessionStorage.getItem("bushuType")
grade = sessionStorage.getItem("bushuType");
}
daka_status_detail(this.$route.query.week, 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) {
const pageData = res.data
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)
item.format_tsp = this.countDown(
"interval" + index,
parseInt((item.tsp * 1000 - Date.now()) / 1000),
index
);
}
})
});
}
this.bet_bonus = pageData.bet_bonus
this.next_signup = pageData.next_signup
this.period_end = pageData.period_end
this.period_start = pageData.period_start
this.total_signup = pageData.total_signup
this.target_steps = pageData.target_steps
this.record_list = pageData.record_list
this.current_day = pageData.current_day - 1
this.showSwiper = true
this.bet_bonus = pageData.bet_bonus;
this.next_signup = pageData.next_signup;
this.period_end = pageData.period_end;
this.period_start = pageData.period_start;
this.total_signup = pageData.total_signup;
this.target_steps = pageData.target_steps;
this.record_list = pageData.record_list;
this.current_day = pageData.current_day - 1;
this.showSwiper = true;
}
})
});
},
isPopup() {
pop_up_windows().then(res => {
if (res.code === 0) {
this.popupData = res.data
this.popupData = res.data;
}
})
});
},
//倒计时
countDown(intervalName, times, index) {
clearInterval(this[intervalName])
this[intervalName] = null
clearInterval(this[intervalName]);
this[intervalName] = null;
this[intervalName] = setInterval(() => {
let day = 0,
hour = 0,
minute = 0,
second = 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 + "秒"
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])
this.getPageData();
clearInterval(this[intervalName]);
}
times--
times--;
// console.log('gagagag',intervalName, day + hour + "时" + minute + "分" + second + "秒")
// console.log('gagagag',times)
// console.log('gagagag',this.format_tsp)
}, 1000)
}, 1000);
}
},
filters: {
moneyFormatter(val) {
if (val && !isNaN(val)) {
return Number(val).toFixed(2)
return Number(val).toFixed(2);
} else {
return "0.00"
}
return "0.00";
}
}
}
};
</script>
<style lang="less" scoped>
.swiper-container {
.swiper-container {
/*margin-left: 0 !important;*/
}
}
.swiper-slide {
.swiper-slide {
width: 5.1rem;
height: 2.68rem;
}
}
.swiper-slide img {
.swiper-slide img {
width: 5.1rem;
height: 2.68rem;
}
}
.have-joined-game-page {
.have-joined-game-page {
// width: 100%;
min-height: 100vh;
background-color: rgb(70, 88, 149);
......@@ -289,12 +312,14 @@
width: 6.4rem;
padding: 0.3rem 0;
box-sizing: border-box;
background: linear-gradient(
90deg,
rgba(255, 255, 255, 0),
#1a285a,
rgba(255, 255, 255, 0)
);
background: url("../images/SignUp/shadow-bg.png") no-repeat center center;
background-size: contain;
/*background: linear-gradient(*/
/* 90deg,*/
/* rgba(255, 255, 255, 0),*/
/* #1a285a,*/
/* rgba(255, 255, 255, 0)*/
/*);*/
margin-top: 2.38rem;
.bonus-title {
......@@ -509,9 +534,9 @@
text-align: center;
margin-top: 0.3rem;
}
}
}
.game-status-popup {
.game-status-popup {
position: fixed;
left: 0;
top: 0;
......@@ -657,5 +682,5 @@
transform: translateX(-50%);
}
}
}
}
</style>
......@@ -171,12 +171,15 @@
this.modalShown = true
},
showSuccess () {
this.showModal("温馨提示", "报名成功", {
scb: () => {
sessionStorage.setItem('userHaveJoinGame', 'true')
sessionStorage.setItem('userHavePaidGame', 'true');
this.$router.push({name: "HaveJoinedGame"})
}
})
// this.showModal("温馨提示", "报名成功", {
// scb: () => {
// sessionStorage.setItem('userHaveJoinGame', 'true')
// sessionStorage.setItem('userHavePaidGame', 'true');
// }
// })
},
closeFree () {
this.showFreeModal = false
......
......@@ -86,7 +86,7 @@
this.getPageData(grade)
}else{
// console.log('grade 0',grade)
this.getPageData()
this.getPageData(this.choosedLevel)
}
},
mounted() {
......
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