Commit fcbc7169 by 穆启卓

大改模式第一版

parent 2fb4489c
...@@ -307,7 +307,7 @@ ...@@ -307,7 +307,7 @@
}, },
// 立即报名 // 立即报名
joinFree() { joinFree() {
let days = this.days || 0 // let days = this.days || 0
// this.queryPayImage(); // this.queryPayImage();
// dakaPay(days, 1).then(response => { // dakaPay(days, 1).then(response => {
// console.log("报名状态", response); // console.log("报名状态", response);
......
...@@ -151,7 +151,7 @@ export function ocFollow() { //lookOption是你要调用接口的名字,issuer ...@@ -151,7 +151,7 @@ export function ocFollow() { //lookOption是你要调用接口的名字,issuer
} }
// 报名支付 // 报名支付
export function dakaPay(grade,days,use_contract) { export function dakaPay(days,use_contract) {
let now = new Date(); let now = new Date();
let year = now.getFullYear(); let year = now.getFullYear();
let month = now.getMonth() + 1; let month = now.getMonth() + 1;
...@@ -173,8 +173,7 @@ export function dakaPay(grade,days,use_contract) { ...@@ -173,8 +173,7 @@ export function dakaPay(grade,days,use_contract) {
use_contract: use_contract || 0, use_contract: use_contract || 0,
inviter_id: inviter || '', inviter_id: inviter || '',
from_type: from_type || '', from_type: from_type || '',
days: days || 0, days: days || 0
grade: grade || 0
} }
}) })
} }
...@@ -382,12 +381,11 @@ export function withdraw_log(page) { ...@@ -382,12 +381,11 @@ export function withdraw_log(page) {
} }
// 首页数据 // 首页数据
export function daka_index(grade) { export function daka_index() {
return fetch({ return fetch({
url: api.daka_index, url: api.daka_index,
method: 'GET', method: 'GET',
params: { params: {
grade: grade
} }
}) })
} }
...@@ -403,13 +401,12 @@ export function select_user_signup() { ...@@ -403,13 +401,12 @@ export function select_user_signup() {
} }
// 比赛详情 // 比赛详情
export function daka_status_detail(week, grade) { export function daka_status_detail(week) {
return fetch({ return fetch({
url: api.daka_status_detail, url: api.daka_status_detail,
method: 'GET', method: 'GET',
params: { params: {
week: week, week: week
grade: grade
} }
}) })
} }
...@@ -425,12 +422,11 @@ export function pop_up_windows() { ...@@ -425,12 +422,11 @@ export function pop_up_windows() {
} }
//参与挑战 //参与挑战
export function daka_info(grade){ export function daka_info(){
return fetch({ return fetch({
url: api.daka_info, url: api.daka_info,
method: 'GET', method: 'GET',
params: { params: {
grade: grade
} }
}) })
} }
......
...@@ -24,14 +24,15 @@ ...@@ -24,14 +24,15 @@
</div> </div>
<div class="hr"></div> <div class="hr"></div>
<!-- <div style="height: 2.68rem;">v-if="showSwiper" --> <!-- <div style="height: 2.68rem;">v-if="showSwiper" -->
<swiper :options="swiperOption" ref="mySwiper" class="game-scroll-container" 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"> <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 :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" v-if="item.status===2&&item.money>0"> <div class="item-income" v-if="item.status===2&&item.money>0">
<div class="item-amount">{{item.money|moneyFormatter}}</div> <div class="item-amount">{{item.money|moneyFormatter}}</div>
...@@ -47,21 +48,27 @@ ...@@ -47,21 +48,27 @@
</div> </div>
<div class="item-income" v-else style="visibility: hidden;"> <div class="item-income" v-else style="visibility: hidden;">
<div class="item-amount">0.00</div> <div class="item-amount">0.00</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.format_tsp || '0秒'}}开始</div> <div class="item-num" v-if="item.status===0">还有{{item.format_tsp || '0秒'}}开始</div>
<template v-else> <template v-else>
<div class="item-progress" :style="'width: '+item.rate/100*2.46+'rem;'" v-if="index ==0 || (index > 0 && record_list[index-1].status != 3)"></div> <div
class="item-progress"
:style="'width: '+item.rate/100*2.46+'rem;'"
v-if="index ==0 || (index > 0 && record_list[index-1].status != 3)"
></div>
<div class="item-num"> <div class="item-num">
<!-- //已淘汰 1--> <!-- //已淘汰 1-->
<!-- 0: 未开始 1:比赛中 2:已结束 3:已淘汰--> <!-- 0: 未开始 1:比赛中 2:已结束 3:已淘汰-->
<span v-if="item.is_complete == 2">未达标({{item.step_num}}步)</span> <span v-if="item.is_complete == 2">未达标({{item.step_num}}步)</span>
<span v-else-if="item.status == 3 && item.is_complete != 2">已失去比赛资格</span> <span v-else-if="item.status == 3 && item.is_complete != 2">已失去比赛资格</span>
<span v-else-if="item.is_complete == 1 && item.status == 2">已达标({{item.step_num}}步)</span> <span v-else-if="item.is_complete == 1 && item.status == 2">已达标({{item.step_num}}步)</span>
<span v-else-if="item.status == 1 && item.is_complete == 1">今天达标了</span> <span v-else-if="item.status == 1 && item.is_complete == 1">今天达标了</span>
<!-- 今天进行中--> <!-- 今天进行中-->
<span v-else-if="item.is_complete == 0 && item.status == 1"> ({{item.step_num}}/{{target_steps}}步)</span> <span
v-else-if="item.is_complete == 0 && item.status == 1"
>({{item.step_num}}/{{target_steps}}步)</span>
</div> </div>
</template> </template>
</div> </div>
...@@ -70,10 +77,13 @@ ...@@ -70,10 +77,13 @@
<div class="swiper-pagination" slot="pagination" style="opacity: 0"></div> <div class="swiper-pagination" slot="pagination" style="opacity: 0"></div>
</swiper> </swiper>
<!-- </div>--> <!-- </div>-->
<div class="func-btn green-btn" @click="inviteFriend" v-if="record_list.length&&record_list[0].status === 0">邀请好友来参赛</div> <div
class="func-btn green-btn"
@click="inviteFriend"
v-if="record_list.length&&record_list[0].status === 0"
>邀请好友来参赛</div>
<div class="func-btn" @click="goOtherPage('GoXCX')" v-else>提交今日步数</div> <div class="func-btn" @click="goOtherPage('GoXCX')" v-else>提交今日步数</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>
<!-- 报名成功弹框 --> <!-- 报名成功弹框 -->
<div class="game-status-popup" v-if="userHavePaidGame"> <div class="game-status-popup" v-if="userHavePaidGame">
<div class="game-status-container"> <div class="game-status-container">
...@@ -87,8 +97,6 @@ ...@@ -87,8 +97,6 @@
<img class="close-btn" src="../images/common/pop_ic_close.png" @click="closePayPopup()"> <img class="close-btn" src="../images/common/pop_ic_close.png" @click="closePayPopup()">
</div> </div>
</div> </div>
<!-- 恭喜达标弹框 --> <!-- 恭喜达标弹框 -->
<div class="game-status-popup" v-if="popupData.window && popupData.daka_done"> <div class="game-status-popup" v-if="popupData.window && popupData.daka_done">
<div class="game-status-container"> <div class="game-status-container">
...@@ -100,7 +108,9 @@ ...@@ -100,7 +108,9 @@
{{popupData.money|moneyFormatter}} {{popupData.money|moneyFormatter}}
<span></span> <span></span>
</div> </div>
<div class="popup-text5">第{{String(popupData.week).substring(4,8)}}期{{popupData.target_steps}}步3日耐力赛</div> <div
class="popup-text5"
>第{{String(popupData.week).substring(4,8)}}期{{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>
<div class="popup-text7">契约金将于12点后返还至钱包中</div> <div class="popup-text7">契约金将于12点后返还至钱包中</div>
...@@ -119,7 +129,9 @@ ...@@ -119,7 +129,9 @@
{{popupData.money|moneyFormatter}} {{popupData.money|moneyFormatter}}
<span></span> <span></span>
</div> </div>
<div class="popup-text5">第{{String(popupData.week).substring(4,8)}}期{{popupData.target_steps}}步3日耐力赛</div> <div
class="popup-text5"
>第{{String(popupData.week).substring(4,8)}}期{{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>
<div class="popup-text7">已达标{{popupData.days}}天,契约金已返还至你的钱包</div> <div class="popup-text7">已达标{{popupData.days}}天,契约金已返还至你的钱包</div>
...@@ -127,21 +139,23 @@ ...@@ -127,21 +139,23 @@
<img class="close-btn" src="../images/common/pop_ic_close.png" @click="closePopup()"> <img class="close-btn" src="../images/common/pop_ic_close.png" @click="closePopup()">
</div> </div>
</div> </div>
<ShareModal <ShareModal v-on:close="closeShareModal" v-if="showShareModal"></ShareModal>
v-on:close="closeShareModal"
v-if="showShareModal"
></ShareModal>
</div> </div>
</template> </template>
<script> <script>
import Title from "@/components/Title.vue" import Title from "@/components/Title.vue";
import {daka_status_detail, pop_up_windows, shareContent, track} from "@/components/axios/api" import {
import ShareModal from "@/components/ShareModal.vue" daka_status_detail,
import {swiper, swiperSlide} from "vue-awesome-swiper" pop_up_windows,
import "swiper/dist/css/swiper.css" shareContent,
track
export default { } from "@/components/axios/api";
import ShareModal from "@/components/ShareModal.vue";
import { swiper, swiperSlide } from "vue-awesome-swiper";
import "swiper/dist/css/swiper.css";
export default {
name: "HaveJoinedGame", name: "HaveJoinedGame",
components: { components: {
Title, Title,
...@@ -159,7 +173,7 @@ ...@@ -159,7 +173,7 @@
loop: false, loop: false,
autoplay: false, autoplay: false,
pagination: { pagination: {
el: '.swiper-pagination', el: ".swiper-pagination",
clickable: false clickable: false
} }
}, },
...@@ -175,26 +189,26 @@ ...@@ -175,26 +189,26 @@
current_day: 0, current_day: 0,
userHavePaidGame: false, userHavePaidGame: false,
showShareModal: false, showShareModal: false,
userData: null, userData: null
} };
}, },
created() { created() {
this.getPageData() this.getPageData();
this.isPopup() this.isPopup();
if (sessionStorage.getItem("userHavePaidGame") === "true") { if (sessionStorage.getItem("userHavePaidGame") === "true") {
sessionStorage.setItem("userHavePaidGame", "false") sessionStorage.setItem("userHavePaidGame", "false");
this.userHavePaidGame = true this.userHavePaidGame = true;
} }
}, },
computed: { computed: {
swiper() { swiper() {
return this.$refs.mySwiper.swiper return this.$refs.mySwiper.swiper;
} }
}, },
mounted() { mounted() {
setTimeout(() => { setTimeout(() => {
this.swiper.slideTo(this.current_day, 1200, false) this.swiper.slideTo(this.current_day, 1200, false);
}, 800) }, 800);
}, },
methods: { methods: {
joinNextGame() { joinNextGame() {
...@@ -203,56 +217,49 @@ ...@@ -203,56 +217,49 @@
query: { query: {
nextGame: true nextGame: true
} }
}) });
}, },
goOtherPage (pageName) { goOtherPage(pageName) {
if(pageName == 'Rule'){ if (pageName == "Rule") {
// console.log('规则') // console.log('规则')
let params = this.target_steps let params = this.target_steps;
let p = 0 let p = 0;
console.log(params) console.log(params);
if(params == 3000){ if (params == 3000) {
p = 1 p = 1;
}else if(params == 5000){ } else if (params == 5000) {
p = 2 p = 2;
}else if(params == 8000){ } else if (params == 8000) {
p = 3 p = 3;
} }
this.$router.push({name: pageName,params: {level:p}}) this.$router.push({ name: pageName, params: { level: p } });
}else{ } else {
// console.log('提交步数') // console.log('提交步数')
this.$router.push({name: pageName}) this.$router.push({ name: pageName });
} }
// let params = this.target_steps // let params = this.target_steps
// console.log('params',params) // console.log('params',params)
// this.$router.push({name: pageName}) // this.$router.push({name: pageName})
}, },
closePayPopup() { closePayPopup() {
this.userHavePaidGame = false this.userHavePaidGame = false;
}, },
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 = 1 daka_status_detail(this.$route.query.week).then(res => {
if (sessionStorage.getItem("bushuType")) {
grade = sessionStorage.getItem("bushuType")
}
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) {
...@@ -260,7 +267,7 @@ ...@@ -260,7 +267,7 @@
"interval" + index, "interval" + index,
parseInt((item.tsp * 1000 - Date.now()) / 1000), parseInt((item.tsp * 1000 - Date.now()) / 1000),
index index
) );
} }
// if(item.days < currentDay){ // if(item.days < currentDay){
// if(item.step_num < item.target_steps){ // if(item.step_num < item.target_steps){
...@@ -269,157 +276,158 @@ ...@@ -269,157 +276,158 @@
// //
// } // }
// } // }
}) });
} }
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;
this.current_day = pageData.current_day - 1 this.current_day = pageData.current_day - 1;
this.showSwiper = true this.showSwiper = true;
} }
}) });
}, },
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;
} }
}) });
}, },
inviteFriend() { inviteFriend() {
console.log("inviteFriend") console.log("inviteFriend");
this.showShareModal = true this.showShareModal = true;
let id = this.userData.id let id = this.userData.id;
// let id = 'yijun'; // let id = 'yijun';
track("free_contract_share") track("free_contract_share");
let links = `${ let links = `${
location.href.split("#")[0].split("?")[0]}?inviter=${id}&from_type=free_contract&` location.href.split("#")[0].split("?")[0]
}?inviter=${id}&from_type=free_contract&`;
shareContent("free_contract").then(res => { shareContent("free_contract").then(res => {
let result = res.data let result = res.data;
console.log("分享内容", result, links) console.log("分享内容", result, links);
let option1 = { let option1 = {
title: result.title, // 分享标题 title: result.title, // 分享标题
desc: result.desc, // 分享描述 desc: result.desc, // 分享描述
link: links, // 分享链接 link: links, // 分享链接
imgUrl: result.img_url, // 分享图标 imgUrl: result.img_url, // 分享图标
success: function (res) { success: function(res) {
track("free_contract_share_act") track("free_contract_share_act");
console.log("option1Success", res) console.log("option1Success", res);
}
} }
wx.updateAppMessageShareData(option1) };
wx.updateAppMessageShareData(option1);
//微信分享菜单测试 //微信分享菜单测试
let option2 = { let option2 = {
title: result.title, // 分享标题 title: result.title, // 分享标题
desc: result.desc, // 分享描述 desc: result.desc, // 分享描述
link: links, // 分享链接 link: links, // 分享链接
imgUrl: result.img_url, // 分享图标 imgUrl: result.img_url, // 分享图标
success: function (res) { success: function(res) {
console.log("option2Success", res) console.log("option2Success", res);
}
} }
};
let option3 = { let option3 = {
title: result.title, // 分享标题 title: result.title, // 分享标题
desc: result.desc, // 分享描述 desc: result.desc, // 分享描述
link: links, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致 link: links, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl: result.img_url, // 分享图标 imgUrl: result.img_url, // 分享图标
success: function (res) { success: function(res) {
// 用户点击了分享后执行的回调函数 // 用户点击了分享后执行的回调函数
track("free_contract_share_act") track("free_contract_share_act");
console.log("option3Success", res) console.log("option3Success", res);
}, },
fail: err => { fail: err => {
console.log("option3error", err) console.log("option3error", err);
}
} }
wx.onMenuShareAppMessage(option3) };
wx.onMenuShareAppMessage(option3);
let option4 = { let option4 = {
title: result.title, // 分享标题 title: result.title, // 分享标题
link: links, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致 link: links, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl: result.img_url, // 分享图标 imgUrl: result.img_url, // 分享图标
success: function (res) { success: function(res) {
console.log("option4Success", res) console.log("option4Success", res);
}, },
fail: err => { fail: err => {
console.log("option4error", err) console.log("option4error", err);
}
} }
};
// wx.onMenuShareTimeline(option4); // wx.onMenuShareTimeline(option4);
console.log("option", option1, option2, option3, option4) console.log("option", option1, option2, option3, option4);
}) });
}, },
closeShareModal() { closeShareModal() {
this.showShareModal = false this.showShareModal = false;
}, },
//倒计时 //倒计时
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 = second =
Math.floor(times) - Math.floor(times) -
day * 24 * 60 * 60 - day * 24 * 60 * 60 -
hour * 60 * 60 - hour * 60 * 60 -
minute * 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 = this.record_list[index].format_tsp =
day + hour + "时" + minute + "分" + second + "秒" 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);
...@@ -686,9 +694,9 @@ ...@@ -686,9 +694,9 @@
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;
...@@ -834,5 +842,5 @@ ...@@ -834,5 +842,5 @@
transform: translateX(-50%); transform: translateX(-50%);
} }
} }
} }
</style> </style>
...@@ -120,7 +120,7 @@ ...@@ -120,7 +120,7 @@
if (this.$route.query.nextGame) { if (this.$route.query.nextGame) {
nextGame = 2 nextGame = 2
} }
dakaPay(sessionStorage.getItem("bushuType"), nextGame).then(response => { dakaPay(nextGame).then(response => {
if (response.code == 1) { if (response.code == 1) {
this.showModal("温馨提示", response.msg) this.showModal("温馨提示", response.msg)
return return
...@@ -196,12 +196,7 @@ ...@@ -196,12 +196,7 @@
this.argeement = !this.argeement this.argeement = !this.argeement
}, },
getPageData(){ getPageData(){
let grade = 1 daka_info().then(res=>{
if(sessionStorage.getItem('bushuType')){
grade = sessionStorage.getItem('bushuType')
}
console.log(grade)
daka_info(grade).then(res=>{
console.log('daka_info',res) console.log('daka_info',res)
if(res.code == 0){ if(res.code == 0){
console.log('立即参与',res) console.log('立即参与',res)
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
</div> </div>
</div> </div>
<div class="card-container-list" @scroll="onScroll"> <div class="card-container-list" @scroll="onScroll">
<div class="card-item" v-for="(item,index) in recordList.records" @click="goWhereDetail(item.week, item.grade)"> <div class="card-item" v-for="(item,index) in recordList.records" @click="goWhereDetail(item.week)">
<div class="card-title">{{item.week}}期-{{item.target_steps}}{{item.total_days}}日耐力赛<template v-if="item.days">(第{{item.days}}天)</template></div> <div class="card-title">{{item.week}}期-{{item.target_steps}}{{item.total_days}}日耐力赛<template v-if="item.days">(第{{item.days}}天)</template></div>
<div class="card-detail-container"> <div class="card-detail-container">
<div class="detail-item"> <div class="detail-item">
...@@ -85,8 +85,7 @@ ...@@ -85,8 +85,7 @@
sessionStorage.setItem("selectedRecord", JSON.stringify(item)); sessionStorage.setItem("selectedRecord", JSON.stringify(item));
this.$router.push({name: "RecordDetail"}) this.$router.push({name: "RecordDetail"})
}, },
goWhereDetail(week, grade) { goWhereDetail(week) {
sessionStorage.setItem('bushuType', grade);
this.$router.push({ this.$router.push({
name: 'HaveJoinedGame', name: 'HaveJoinedGame',
query: { query: {
......
<template> <template>
<div class="rule-page"> <div class="rule-page">
<Title class="page-title" title="活动规则与协议" titleColor="#000" @goback="goback" show_back="true" arrowColor="black"></Title> <Title class="page-title" title="活动规则与协议" titleColor="#000" @goback="goback" show_back="true" arrowColor="black"></Title>
<div class="section-title">挑战玩法:</div>
<img class="game-way-img" v-if="bushuType == 1" src="../images/Rule/img_rule_0.png">
<img class="game-way-img" v-if="bushuType == 2" src="../images/Rule/img_rule_1.png">
<img class="game-way-img" v-if="bushuType == 3" src="../images/Rule/img_rule_2.png">
<div class="section-title">参赛须知:</div> <div class="section-title">参赛须知:</div>
<div class="content1-container"> <div class="content1-container">
<div class="content1-item">• 为督促大家运动,每位用户报名均需提供契约金</div> <div class="content1-item">• 为督促大家运动,每位用户报名均需提供契约金</div>
...@@ -25,49 +21,36 @@ ...@@ -25,49 +21,36 @@
<div class="content2-item">奖金派发时仅派发到小数点后两位,由此可能造成的奖金结余将在合并至本组下期比赛奖金中一并派发;</div> <div class="content2-item">奖金派发时仅派发到小数点后两位,由此可能造成的奖金结余将在合并至本组下期比赛奖金中一并派发;</div>
<div class="content2-item">由于不可抗力因素导致当期比赛因故无法进行的,平台有权取消当期比赛’并将在指定时间内将运动契约金原路退还给报名成功用户;</div> <div class="content2-item">由于不可抗力因素导致当期比赛因故无法进行的,平台有权取消当期比赛’并将在指定时间内将运动契约金原路退还给报名成功用户;</div>
<div class="ps">注:Apple不是本赛事赞助者</div> <div class="ps">注:Apple不是本赛事赞助者</div>
<br>
</div> </div>
</template> </template>
<script> <script>
import Title from "@/components/Title.vue" import Title from "@/components/Title.vue";
export default { export default {
name: "Rule", name: "Rule",
components: { components: {
Title, Title
}, },
data() { data() {
return { return {};
bushuType: 0
}
},
mounted() {
if (this.$route.params.level) {
this.bushuType = this.$route.params.level
} else {
let LastLevel = Number(sessionStorage.getItem('bushuType'))
if (LastLevel) {
this.bushuType = LastLevel
}
}
}, },
mounted() {},
methods: { methods: {
goback() { goback() {
history.go(-1) history.go(-1);
},
} }
} }
};
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.rule-page { .rule-page {
width: 100%; width: 100%;
background: #fff; background: #fff;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
padding-top: .96rem; padding-top: 0.96rem;
.page-title { .page-title {
font-weight: bold; font-weight: bold;
...@@ -80,62 +63,55 @@ ...@@ -80,62 +63,55 @@
.section-title { .section-title {
width: 6.72rem; width: 6.72rem;
font-size: .3rem; font-size: 0.3rem;
line-height: 1; line-height: 1;
color: #333; color: #333;
font-weight: bold; font-weight: bold;
text-align: left; text-align: left;
margin-top: .44rem; margin-top: 0.44rem;
}
.game-way-img {
width: 6.15rem;
height: 1.09rem;
margin-top: .3rem;
margin-bottom: .14rem;
} }
.content1-container { .content1-container {
width: 6.7rem; width: 6.7rem;
margin-top: .2rem; margin-top: 0.2rem;
.content1-item { .content1-item {
font-size: .26rem; font-size: 0.26rem;
line-height: .44rem; line-height: 0.44rem;
color: #5a5a5a; color: #5a5a5a;
} }
} }
.section2-title { .section2-title {
width: 6.72rem; width: 6.72rem;
font-size: .26rem; font-size: 0.26rem;
line-height: 1; line-height: 1;
color: #333; color: #333;
margin-top: .4rem; margin-top: 0.4rem;
} }
.content2-title { .content2-title {
width: 6.72rem; width: 6.72rem;
font-size: .26rem; font-size: 0.26rem;
line-height: .44rem; line-height: 0.44rem;
color: #333; color: #333;
margin-top: .2rem; margin-top: 0.2rem;
} }
.content2-item { .content2-item {
width: 6.72rem; width: 6.72rem;
font-size: .26rem; font-size: 0.26rem;
line-height: .44rem; line-height: 0.44rem;
color: #5a5a5a; color: #5a5a5a;
margin-top: .14rem; margin-top: 0.14rem;
} }
.ps { .ps {
width: 6.72rem; width: 6.72rem;
font-size: .26rem; font-size: 0.26rem;
line-height: 1; line-height: 1;
color: #A5A5A5; color: #a5a5a5;
margin: .4rem 0 .26rem; margin: 0.4rem 0 0.6rem;
}
} }
}
</style> </style>
\ No newline at end of file
<template> <template>
<div class="sign-up-page"> <div class="sign-up-page">
<!-- 顶部步数级别选择 -->
<div class="top-nav-level">
<div :class="['level-item', choosedLevel===1?'active':'']" @click="chooseGameLevel(1)">3000步赛</div>
<div :class="['level-item', choosedLevel===2?'active':'']" @click="chooseGameLevel(2)">5000步赛</div>
<div :class="['level-item', choosedLevel===3?'active':'']" @click="chooseGameLevel(3)">8000步赛</div>
</div>
<!-- 左上角查看步数按钮 --> <!-- 左上角查看步数按钮 -->
<!-- <img class="view-steps-btn" src="../images/SignUp/sy_bushu.png"> --> <!-- <img class="view-steps-btn" src="../images/SignUp/sy_bushu.png"> -->
<!-- 信息广播 --> <!-- 信息广播 -->
...@@ -15,9 +9,10 @@ ...@@ -15,9 +9,10 @@
<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.action}}期 - {{item.target_step}}步3天耐力赛</div> <div class="card-title">{{item.action}}期 - 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>
...@@ -33,30 +28,44 @@ ...@@ -33,30 +28,44 @@
</div> </div>
</div> </div>
<!-- 0 比赛中 1 未开始 2 已结束--> <!-- 0 比赛中 1 未开始 2 已结束-->
<div class="card-btn" v-if="item.status===1&&item.already_join===0" data-item="item" <div
@click="goOtherPage('PartakeChallenge')"> class="card-btn"
v-if="item.status===1&&item.already_join===0"
data-item="item"
@click="goOtherPage('PartakeChallenge')"
>
<div class="btn-title">参与挑战</div> <div class="btn-title">参与挑战</div>
</div> </div>
<div class="card-btn" v-if="item.status===1&&item.already_join===1" data-item="item" <div
@click="goWhereDetail(item)">已报名 class="card-btn"
</div> v-if="item.status===1&&item.already_join===1"
<div class="statusnormal" v-if="item.status===2 || item.status===0 || item.status===3" data-item="item"
@click="goWhereDetail(item)">{{(item.status===2 || item.status===0) @click="goWhereDetail(item)"
>已报名</div>
<div
class="statusnormal"
v-if="item.status===2 || item.status===0 || item.status===3"
@click="goWhereDetail(item)"
>
{{(item.status===2 || item.status===0)
? (item.status===0&&item.already_join===1) ? '立即打卡': '查看详情' : '已淘汰'}} ? (item.status===0&&item.already_join===1) ? '立即打卡': '查看详情' : '已淘汰'}}
<img src="../images/SignUp/detail_bg.png" alt=""> <img
src="../images/SignUp/detail_bg.png"
alt=""
>
</div> </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",
components: { components: {
NoticeBonus, NoticeBonus,
...@@ -76,106 +85,88 @@ ...@@ -76,106 +85,88 @@
isFollow: false, isFollow: false,
gameList: [], gameList: [],
choosedLevel: 2 };
}
}, },
created() { created() {
let grade = Number(sessionStorage.getItem("bushuType")) this.getPageData();
if(grade){
// console.log('grade',grade)
this.getPageData(grade)
}else{
// console.log('grade 0',grade)
this.getPageData(this.choosedLevel)
}
},
mounted() {
//获取步数tab缓存
let LastLevel = Number(sessionStorage.getItem("bushuType"))
if (LastLevel) {
this.choosedLevel = LastLevel
} else {
sessionStorage.setItem("bushuType", this.choosedLevel)
}
}, },
methods: { methods: {
chooseGameLevel(level) {
sessionStorage.setItem("bushuType", level)
this.choosedLevel = 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)) // 未报名
this.$router.push({name: 'ChallengeDetail'}) sessionStorage.setItem("ChallengeDetailData", JSON.stringify(item));
this.$router.push({ name: "ChallengeDetail" });
} }
} }
}, },
getPageData(grade = 1) { getPageData() {
daka_index(grade).then(res => { daka_index().then(res => {
if (res.code === 0) { if (res.code === 0) {
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 &&
...@@ -186,31 +177,31 @@ ...@@ -186,31 +177,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",
...@@ -224,44 +215,44 @@ ...@@ -224,44 +215,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;
...@@ -276,52 +267,6 @@ ...@@ -276,52 +267,6 @@
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
.top-nav-level {
flex-shrink: 0;
margin-top: 0.3rem;
border: 0.02rem solid #fff;
border-radius: 0.1rem;
overflow: hidden;
background: #fff;
box-sizing: border-box;
display: flex;
.level-item {
width: 1.76rem;
font-size: 0.3rem;
line-height: 0.54rem;
color: #465895;
text-align: center;
position: relative;
&:after {
content: "";
height: 0.26rem;
width: 0.02rem;
background: #465895;
position: absolute;
left: -0.02rem;
top: 50%;
transform: translateY(-50%);
}
&:first-child:after {
display: none;
}
&.active {
background: #465895;
color: #fff;
border-radius: 0.1rem;
font-weight: bold;
}
&.active:after {
display: none;
}
}
}
.view-steps-btn { .view-steps-btn {
flex-shrink: 0; flex-shrink: 0;
width: 1.11rem; width: 1.11rem;
...@@ -334,7 +279,7 @@ ...@@ -334,7 +279,7 @@
.notice-broadcast { .notice-broadcast {
flex-shrink: 0; flex-shrink: 0;
margin: 3.68rem 0 0.18rem; margin: 4.3rem 0 0.18rem;
} }
.challenge-card { .challenge-card {
...@@ -367,8 +312,8 @@ ...@@ -367,8 +312,8 @@
.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: 0.24rem;
height: .46rem; height: 0.46rem;
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 0.26rem; font-size: 0.26rem;
...@@ -417,7 +362,7 @@ ...@@ -417,7 +362,7 @@
} }
.statusnormal { .statusnormal {
position:absolute; position: absolute;
bottom: 0.38rem; bottom: 0.38rem;
display: flex; display: flex;
justify-content: center; justify-content: center;
...@@ -460,10 +405,10 @@ ...@@ -460,10 +405,10 @@
} }
.btn-title { .btn-title {
font-size: .34rem; font-size: 0.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