Commit fcbc7169 by 穆启卓

大改模式第一版

parent 2fb4489c
......@@ -307,7 +307,7 @@
},
// 立即报名
joinFree() {
let days = this.days || 0
// let days = this.days || 0
// this.queryPayImage();
// dakaPay(days, 1).then(response => {
// console.log("报名状态", response);
......
......@@ -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 year = now.getFullYear();
let month = now.getMonth() + 1;
......@@ -173,8 +173,7 @@ export function dakaPay(grade,days,use_contract) {
use_contract: use_contract || 0,
inviter_id: inviter || '',
from_type: from_type || '',
days: days || 0,
grade: grade || 0
days: days || 0
}
})
}
......@@ -382,12 +381,11 @@ export function withdraw_log(page) {
}
// 首页数据
export function daka_index(grade) {
export function daka_index() {
return fetch({
url: api.daka_index,
method: 'GET',
params: {
grade: grade
}
})
}
......@@ -403,13 +401,12 @@ export function select_user_signup() {
}
// 比赛详情
export function daka_status_detail(week, grade) {
export function daka_status_detail(week) {
return fetch({
url: api.daka_status_detail,
method: 'GET',
params: {
week: week,
grade: grade
week: week
}
})
}
......@@ -425,12 +422,11 @@ export function pop_up_windows() {
}
//参与挑战
export function daka_info(grade){
export function daka_info(){
return fetch({
url: api.daka_info,
method: 'GET',
params: {
grade: grade
}
})
}
......
......@@ -24,14 +24,15 @@
</div>
<div class="hr"></div>
<!-- <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">
<div class="item-title-status">
<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'"
>{{item.status===0?'未开始':item.status===1?'比赛中':item.status===2?'已结束':'已淘汰'}}
</div>
<div
: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>
</div>
<div class="item-income" v-if="item.status===2&&item.money>0">
<div class="item-amount">{{item.money|moneyFormatter}}</div>
......@@ -47,21 +48,27 @@
</div>
<div class="item-income" v-else style="visibility: hidden;">
<div class="item-amount">0.00</div>
<div class="item-text">(元) </div>
<div class="item-text">(元)</div>
</div>
<div class="item-progress-num">
<div class="item-num" v-if="item.status===0">还有{{item.format_tsp || '0秒'}}开始</div>
<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">
<!-- //已淘汰 1-->
<!-- 0: 未开始 1:比赛中 2:已结束 3:已淘汰-->
<!-- //已淘汰 1-->
<!-- 0: 未开始 1:比赛中 2:已结束 3:已淘汰-->
<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.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.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>
</template>
</div>
......@@ -70,10 +77,13 @@
<div class="swiper-pagination" slot="pagination" style="opacity: 0"></div>
</swiper>
<!-- </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="next-func-btn" v-if="next_signup" @click="joinNextGame()">报名下一期</div>
<!-- 报名成功弹框 -->
<div class="game-status-popup" v-if="userHavePaidGame">
<div class="game-status-container">
......@@ -87,8 +97,6 @@
<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">
......@@ -100,7 +108,9 @@
{{popupData.money|moneyFormatter}}
<span></span>
</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 class="popup-text6">{{popupData.target_steps}}步达标,今天走了{{popupData.step_num}}步</div>
<div class="popup-text7">契约金将于12点后返还至钱包中</div>
......@@ -119,7 +129,9 @@
{{popupData.money|moneyFormatter}}
<span></span>
</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 class="popup-text6">{{popupData.target_steps}}步达标,今天走了{{popupData.step_num}}步</div>
<div class="popup-text7">已达标{{popupData.days}}天,契约金已返还至你的钱包</div>
......@@ -127,21 +139,23 @@
<img class="close-btn" src="../images/common/pop_ic_close.png" @click="closePopup()">
</div>
</div>
<ShareModal
v-on:close="closeShareModal"
v-if="showShareModal"
></ShareModal>
<ShareModal v-on:close="closeShareModal" v-if="showShareModal"></ShareModal>
</div>
</template>
<script>
import Title from "@/components/Title.vue"
import {daka_status_detail, pop_up_windows, shareContent, track} 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 {
import Title from "@/components/Title.vue";
import {
daka_status_detail,
pop_up_windows,
shareContent,
track
} 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",
components: {
Title,
......@@ -159,7 +173,7 @@
loop: false,
autoplay: false,
pagination: {
el: '.swiper-pagination',
el: ".swiper-pagination",
clickable: false
}
},
......@@ -175,26 +189,26 @@
current_day: 0,
userHavePaidGame: false,
showShareModal: false,
userData: null,
}
userData: null
};
},
created() {
this.getPageData()
this.isPopup()
this.getPageData();
this.isPopup();
if (sessionStorage.getItem("userHavePaidGame") === "true") {
sessionStorage.setItem("userHavePaidGame", "false")
this.userHavePaidGame = true
sessionStorage.setItem("userHavePaidGame", "false");
this.userHavePaidGame = true;
}
},
computed: {
swiper() {
return this.$refs.mySwiper.swiper
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() {
......@@ -203,56 +217,49 @@
query: {
nextGame: true
}
})
});
},
goOtherPage (pageName) {
if(pageName == 'Rule'){
goOtherPage(pageName) {
if (pageName == "Rule") {
// console.log('规则')
let params = this.target_steps
let p = 0
console.log(params)
if(params == 3000){
p = 1
}else if(params == 5000){
p = 2
}else if(params == 8000){
p = 3
}
this.$router.push({name: pageName,params: {level:p}})
}else{
let params = this.target_steps;
let p = 0;
console.log(params);
if (params == 3000) {
p = 1;
} else if (params == 5000) {
p = 2;
} else if (params == 8000) {
p = 3;
}
this.$router.push({ name: pageName, params: { level: p } });
} else {
// console.log('提交步数')
this.$router.push({name: pageName})
this.$router.push({ name: pageName });
}
// let params = this.target_steps
// console.log('params',params)
// this.$router.push({name: pageName})
},
closePayPopup() {
this.userHavePaidGame = false
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})
// },
currentPage() {
return this.$router.history.current.name
return this.$router.history.current.name;
},
getPageData() {
let grade = 1
if (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).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) {
......@@ -260,7 +267,7 @@
"interval" + index,
parseInt((item.tsp * 1000 - Date.now()) / 1000),
index
)
);
}
// if(item.days < currentDay){
// if(item.step_num < item.target_steps){
......@@ -269,157 +276,158 @@
//
// }
// }
})
}
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;
}
})
});
},
inviteFriend() {
console.log("inviteFriend")
this.showShareModal = true
let id = this.userData.id
console.log("inviteFriend");
this.showShareModal = true;
let id = this.userData.id;
// let id = 'yijun';
track("free_contract_share")
track("free_contract_share");
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 => {
let result = res.data
console.log("分享内容", result, links)
let result = res.data;
console.log("分享内容", result, links);
let option1 = {
title: result.title, // 分享标题
desc: result.desc, // 分享描述
link: links, // 分享链接
imgUrl: result.img_url, // 分享图标
success: function (res) {
track("free_contract_share_act")
console.log("option1Success", res)
}
success: function(res) {
track("free_contract_share_act");
console.log("option1Success", res);
}
wx.updateAppMessageShareData(option1)
};
wx.updateAppMessageShareData(option1);
//微信分享菜单测试
let option2 = {
title: result.title, // 分享标题
desc: result.desc, // 分享描述
link: links, // 分享链接
imgUrl: result.img_url, // 分享图标
success: function (res) {
console.log("option2Success", res)
}
success: function(res) {
console.log("option2Success", res);
}
};
let option3 = {
title: result.title, // 分享标题
desc: result.desc, // 分享描述
link: links, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl: result.img_url, // 分享图标
success: function (res) {
success: function(res) {
// 用户点击了分享后执行的回调函数
track("free_contract_share_act")
console.log("option3Success", res)
track("free_contract_share_act");
console.log("option3Success", res);
},
fail: err => {
console.log("option3error", err)
}
console.log("option3error", err);
}
wx.onMenuShareAppMessage(option3)
};
wx.onMenuShareAppMessage(option3);
let option4 = {
title: result.title, // 分享标题
link: links, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl: result.img_url, // 分享图标
success: function (res) {
console.log("option4Success", res)
success: function(res) {
console.log("option4Success", res);
},
fail: err => {
console.log("option4error", err)
}
console.log("option4error", err);
}
};
// wx.onMenuShareTimeline(option4);
console.log("option", option1, option2, option3, option4)
})
console.log("option", option1, option2, option3, option4);
});
},
closeShareModal() {
this.showShareModal = false
this.showShareModal = false;
},
//倒计时
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
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
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
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 + 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);
......@@ -686,9 +694,9 @@
text-align: center;
margin-top: 0.3rem;
}
}
}
.game-status-popup {
.game-status-popup {
position: fixed;
left: 0;
top: 0;
......@@ -834,5 +842,5 @@
transform: translateX(-50%);
}
}
}
}
</style>
......@@ -120,7 +120,7 @@
if (this.$route.query.nextGame) {
nextGame = 2
}
dakaPay(sessionStorage.getItem("bushuType"), nextGame).then(response => {
dakaPay(nextGame).then(response => {
if (response.code == 1) {
this.showModal("温馨提示", response.msg)
return
......@@ -196,12 +196,7 @@
this.argeement = !this.argeement
},
getPageData(){
let grade = 1
if(sessionStorage.getItem('bushuType')){
grade = sessionStorage.getItem('bushuType')
}
console.log(grade)
daka_info(grade).then(res=>{
daka_info().then(res=>{
console.log('daka_info',res)
if(res.code == 0){
console.log('立即参与',res)
......
......@@ -23,7 +23,7 @@
</div>
</div>
<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-detail-container">
<div class="detail-item">
......@@ -85,8 +85,7 @@
sessionStorage.setItem("selectedRecord", JSON.stringify(item));
this.$router.push({name: "RecordDetail"})
},
goWhereDetail(week, grade) {
sessionStorage.setItem('bushuType', grade);
goWhereDetail(week) {
this.$router.push({
name: 'HaveJoinedGame',
query: {
......
<template>
<div class="rule-page">
<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="content1-container">
<div class="content1-item">• 为督促大家运动,每位用户报名均需提供契约金</div>
......@@ -25,49 +21,36 @@
<div class="content2-item">奖金派发时仅派发到小数点后两位,由此可能造成的奖金结余将在合并至本组下期比赛奖金中一并派发;</div>
<div class="content2-item">由于不可抗力因素导致当期比赛因故无法进行的,平台有权取消当期比赛’并将在指定时间内将运动契约金原路退还给报名成功用户;</div>
<div class="ps">注:Apple不是本赛事赞助者</div>
<br>
</div>
</template>
<script>
import Title from "@/components/Title.vue"
import Title from "@/components/Title.vue";
export default {
export default {
name: "Rule",
components: {
Title,
Title
},
data() {
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
}
}
return {};
},
mounted() {},
methods: {
goback() {
history.go(-1)
},
history.go(-1);
}
}
};
</script>
<style lang="less" scoped>
.rule-page {
.rule-page {
width: 100%;
background: #fff;
display: flex;
flex-direction: column;
align-items: center;
padding-top: .96rem;
padding-top: 0.96rem;
.page-title {
font-weight: bold;
......@@ -80,62 +63,55 @@
.section-title {
width: 6.72rem;
font-size: .3rem;
font-size: 0.3rem;
line-height: 1;
color: #333;
font-weight: bold;
text-align: left;
margin-top: .44rem;
}
.game-way-img {
width: 6.15rem;
height: 1.09rem;
margin-top: .3rem;
margin-bottom: .14rem;
margin-top: 0.44rem;
}
.content1-container {
width: 6.7rem;
margin-top: .2rem;
margin-top: 0.2rem;
.content1-item {
font-size: .26rem;
line-height: .44rem;
font-size: 0.26rem;
line-height: 0.44rem;
color: #5a5a5a;
}
}
.section2-title {
width: 6.72rem;
font-size: .26rem;
font-size: 0.26rem;
line-height: 1;
color: #333;
margin-top: .4rem;
margin-top: 0.4rem;
}
.content2-title {
width: 6.72rem;
font-size: .26rem;
line-height: .44rem;
font-size: 0.26rem;
line-height: 0.44rem;
color: #333;
margin-top: .2rem;
margin-top: 0.2rem;
}
.content2-item {
width: 6.72rem;
font-size: .26rem;
line-height: .44rem;
font-size: 0.26rem;
line-height: 0.44rem;
color: #5a5a5a;
margin-top: .14rem;
margin-top: 0.14rem;
}
.ps {
width: 6.72rem;
font-size: .26rem;
font-size: 0.26rem;
line-height: 1;
color: #A5A5A5;
margin: .4rem 0 .26rem;
}
color: #a5a5a5;
margin: 0.4rem 0 0.6rem;
}
}
</style>
\ No newline at end of file
<template>
<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"> -->
<!-- 信息广播 -->
......@@ -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_zmz.png" v-if="item.status===1">
<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-time">{{item.already_join===1?'已参赛':'未参赛'}} {{item.period_start}} - {{item.period_end}}
</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-info">
<div class="info-item" v-if="item.status===0||item.status===2">
<div class="item-title">达标人数</div>
......@@ -33,30 +28,44 @@
</div>
</div>
<!-- 0 比赛中 1 未开始 2 已结束-->
<div class="card-btn" v-if="item.status===1&&item.already_join===0" data-item="item"
@click="goOtherPage('PartakeChallenge')">
<div
class="card-btn"
v-if="item.status===1&&item.already_join===0"
data-item="item"
@click="goOtherPage('PartakeChallenge')"
>
<div class="btn-title">参与挑战</div>
</div>
<div class="card-btn" v-if="item.status===1&&item.already_join===1" data-item="item"
@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)
<div
class="card-btn"
v-if="item.status===1&&item.already_join===1"
data-item="item"
@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) ? '立即打卡': '查看详情' : '已淘汰'}}
<img src="../images/SignUp/detail_bg.png" alt="">
<img
src="../images/SignUp/detail_bg.png"
alt=""
>
</div>
</div>
</div>
</template>
<script>
import NoticeBonus from "@/components/NoticeBonus.vue"
import Free from "@/components/Free.vue"
import Modal from "@/components/Modal.vue"
import PayFailModal from "@/components/PayFailModal.vue"
import {dakaPay, track, userCards, daka_index} from "@/components/axios/api"
import NoticeBonus from "@/components/NoticeBonus.vue";
import Free from "@/components/Free.vue";
import Modal from "@/components/Modal.vue";
import PayFailModal from "@/components/PayFailModal.vue";
import { dakaPay, track, userCards, daka_index } from "@/components/axios/api";
export default {
export default {
name: "SignUp",
components: {
NoticeBonus,
......@@ -76,106 +85,88 @@
isFollow: false,
gameList: [],
choosedLevel: 2
}
};
},
created() {
let grade = Number(sessionStorage.getItem("bushuType"))
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)
}
this.getPageData();
},
methods: {
chooseGameLevel(level) {
sessionStorage.setItem("bushuType", level)
this.choosedLevel = level
this.getPageData(level)
},
goOtherPage(pageName) {
console.log('pageName', pageName)
this.$router.push({name: pageName})
console.log("pageName", pageName);
this.$router.push({ name: pageName });
},
goWhereDetail(item) {
if (item.status === 1 && item.already_join === 1) { // 已报名
if (item.status === 1 && item.already_join === 1) {
// 已报名
this.$router.push({
name: 'HaveJoinedGame',
name: "HaveJoinedGame",
query: {
week: item.week
}
})
} else { // 比赛中或者已结束
if (item.already_join === 1) { // 已报名
});
} else {
// 比赛中或者已结束
if (item.already_join === 1) {
// 已报名
this.$router.push({
name: 'HaveJoinedGame',
name: "HaveJoinedGame",
query: {
week: item.week
}
})
} else { // 未报名
sessionStorage.setItem('ChallengeDetailData', JSON.stringify(item))
this.$router.push({name: 'ChallengeDetail'})
});
} else {
// 未报名
sessionStorage.setItem("ChallengeDetailData", JSON.stringify(item));
this.$router.push({ name: "ChallengeDetail" });
}
}
},
getPageData(grade = 1) {
daka_index(grade).then(res => {
getPageData() {
daka_index().then(res => {
if (res.code === 0) {
res.data.forEach(item => {
item.action = item.week.substring(item.week.length - 4)
})
this.gameList = res.data
console.log('gameList', this.gameList)
item.action = item.week.substring(item.week.length - 4);
});
this.gameList = res.data;
console.log("gameList", this.gameList);
}
})
});
},
togglePayFail() {
this.isShowPayFail = !this.isShowPayFail
this.isShowPayFail = !this.isShowPayFail;
},
showSuccess() {
this.showModal("温馨提示", "报名成功", {
scb: () => {
if (this.isFollow == 1) {
this.$router.push({name: "Read"})
this.$router.push({ name: "Read" });
} else {
this.$router.push({name: "Success"})
this.$router.push({ name: "Success" });
}
}
})
});
},
confirmModal(scb) {
scb && scb()
this.modalShown = false
scb && scb();
this.modalShown = false;
},
showFree(e) {
e.stopPropagation()
track("free_contract_show")
e.stopPropagation();
track("free_contract_show");
if (localStorage.getItem("first_show_free") == 1) {
localStorage.setItem("first_show_free", 2)
this.canShowFree = false
localStorage.setItem("first_show_free", 2);
this.canShowFree = false;
} else {
this.canCheckShowFree = false
this.canShowFree = false
this.canCheckShowFree = false;
this.canShowFree = false;
}
userCards().then(res => {
console.log("获取免契约金数据", res)
console.log("获取免契约金数据", res);
let data = {
card: res.data.contract_card,
cnt: res.data.contract_cnt
}
this.current_date = new Date(res.date)
};
this.current_date = new Date(res.date);
// if (
// // 如果明天没报名,而且还有免契约金卡,则可以使用
// !this.date_status[1].user_status.daka_signup &&
......@@ -186,31 +177,31 @@
// } else {
// data.can_get = false;
// }
this.contract_data = JSON.parse(JSON.stringify(data))
this.showFreeModal = true
})
this.contract_data = JSON.parse(JSON.stringify(data));
this.showFreeModal = true;
});
},
closeFree() {
this.showFreeModal = false
this.showFreeModal = false;
},
showModal(title, desc, option) {
this.modalTitle = title || ""
this.modalDesc = desc || ""
this.modalOption = option || {}
this.modalShown = true
this.modalTitle = title || "";
this.modalDesc = desc || "";
this.modalOption = option || {};
this.modalShown = true;
},
closeModal() {
this.modalShown = false
this.modalShown = false;
},
payToSign() {
dakaPay().then(response => {
this.current_date = new Date(response.date)
this.current_date = new Date(response.date);
if (response.code == 1) {
this.showModal("温馨提示", response.msg)
return
this.showModal("温馨提示", response.msg);
return;
}
let result = response.data
console.log("请求打卡支付数据", result)
let result = response.data;
console.log("请求打卡支付数据", result);
if (result) {
WeixinJSBridge.invoke(
"getBrandWCPayRequest",
......@@ -224,44 +215,44 @@
},
// result,
res => {
console.log("支付调用结果", res)
console.log("支付调用结果", res);
if (res.err_msg == "get_brand_wcpay_request:ok") {
// 使用以上方式判断前端返回,微信团队郑重提示:
//res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
// 支付成功后的回调函数
console.log("支付成功")
console.log("支付成功");
this.showModal("温馨提示", "报名成功", {
scb: () => {
if (this.isFollow == 1) {
this.$router.push({name: "Read"})
this.$router.push({ name: "Read" });
} else {
this.$router.push({name: "Success"})
this.$router.push({ name: "Success" });
}
}
})
});
// this.dateSelect(2);
// localStorage.setItem("is_every", 0)
// location.replace("#/Success");
}
if (res.err_msg == "get_brand_wcpay_request:fail") {
// this.showModal("温馨提示", "支付服务繁忙,请稍后重试");
this.togglePayFail()
this.togglePayFail();
}
if (res.err_msg == "get_brand_wcpay_request:cancel") {
// console.log("支付取消");
this.togglePayFail()
this.togglePayFail();
}
}
)
}
})
);
}
});
}
}
};
</script>
<style lang="less" scoped>
.sign-up-page {
.sign-up-page {
width: 100%;
height: 100%;
overflow-y: scroll;
......@@ -276,52 +267,6 @@
flex-direction: column;
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 {
flex-shrink: 0;
width: 1.11rem;
......@@ -334,7 +279,7 @@
.notice-broadcast {
flex-shrink: 0;
margin: 3.68rem 0 0.18rem;
margin: 4.3rem 0 0.18rem;
}
.challenge-card {
......@@ -367,8 +312,8 @@
.card-time {
background: rgba(0, 0, 0, 0.1);
padding: 0 0.24rem;
border-radius: .24rem;
height: .46rem;
border-radius: 0.24rem;
height: 0.46rem;
display: flex;
align-items: center;
font-size: 0.26rem;
......@@ -417,7 +362,7 @@
}
.statusnormal {
position:absolute;
position: absolute;
bottom: 0.38rem;
display: flex;
justify-content: center;
......@@ -460,10 +405,10 @@
}
.btn-title {
font-size: .34rem;
font-size: 0.34rem;
font-weight: bold;
}
}
}
}
}
</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