Commit 0675efd0 by 穆启卓

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

parents 324dc31c f504fa90
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
}, },
"dependencies": { "dependencies": {
"axios": "^0.18.0", "axios": "^0.18.0",
"console": "^0.7.2",
"vconsole": "^3.3.0",
"vue": "^2.6.6", "vue": "^2.6.6",
"vue-awesome-swiper": "^3.1.3", "vue-awesome-swiper": "^3.1.3",
"vue-calendar-component": "^2.8.2", "vue-calendar-component": "^2.8.2",
...@@ -18,6 +20,7 @@ ...@@ -18,6 +20,7 @@
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "^3.4.0", "@vue/cli-plugin-babel": "^3.4.0",
"@vue/cli-service": "^3.4.0", "@vue/cli-service": "^3.4.0",
"console": "^0.7.2",
"less": "^3.9.0", "less": "^3.9.0",
"less-loader": "^4.1.0", "less-loader": "^4.1.0",
"stylus": "^0.54.5", "stylus": "^0.54.5",
......
...@@ -434,6 +434,16 @@ export function daka_info(){ ...@@ -434,6 +434,16 @@ export function daka_info(){
}) })
} }
//检查用户是否关注过公众号,是否需要弹窗
export function select_follow(){
return fetch({
url: api.select_follow,
method: 'GET',
params: {
}
})
}
//有新接口的时候像上面那样再来一次 //有新接口的时候像上面那样再来一次
// //修改昵称接口 // //修改昵称接口
......
import axios from 'axios';//引入axios import axios from 'axios'//引入axios
export function fetch(options) { export function fetch(options) {
if (process.env.NODE_ENV === 'production') { if (process.env.NODE_ENV === 'production') {
if (!window['userData']) { if (!window['userData']) {
let user_data_str = localStorage.getItem('walk_userData'); let user_data_str = localStorage.getItem('walk_userData')
if (user_data_str) { if (user_data_str) {
window['userData'] = JSON.parse(user_data_str); window['userData'] = JSON.parse(user_data_str)
} }
} }
if (!window['userData']) { if (!window['userData']) {
localStorage.setItem('last_url', location.hash.slice(1)); localStorage.setItem('last_url', location.hash.slice(1))
location.replace('#/Author'); location.replace('#/Author')
} }
} }
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
...@@ -18,28 +18,28 @@ export function fetch(options) { ...@@ -18,28 +18,28 @@ export function fetch(options) {
//所有的请求都会带上这些配置,比如全局都要用的身份信息等。 //所有的请求都会带上这些配置,比如全局都要用的身份信息等。
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Authorization': process.env.NODE_ENV === 'production' ? (window['userData']?window['userData'].token:'') : "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAiLCJvcGVuX2lkIjoiMTExMTExMTExMTExMTExMTExMTExMTExMTExMSIsInVuaW9uX2lkIjoiMTExMTExMTExMTExMTExMTExMTExMTExMTExMSIsImV4cCI6MTU1NDU2MjA2Mn0.eHkAuqQpoZb34KbCAyVzNaunn4Knn77jfC0N5DG5JD0" 'Authorization': process.env.NODE_ENV === 'production' ? (window['userData'] ? window['userData'].token : '') : "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAiLCJvcGVuX2lkIjoiMTExMTExMTExMTExMTExMTExMTExMTExMTExMSIsInVuaW9uX2lkIjoiMTExMTExMTExMTExMTExMTExMTExMTExMTExMSIsImV4cCI6MTU1NDU2MjA2Mn0.eHkAuqQpoZb34KbCAyVzNaunn4Knn77jfC0N5DG5JD0"
// 'token_in_header': global_.token,//token从全局变量那里传过来 // 'token_in_header': global_.token,//token从全局变量那里传过来
}, },
timeout: 30 * 1000 // 30秒超时 timeout: 30 * 1000 // 30秒超时
}); })
instance(options) instance(options)
.then(response => { //then 请求成功之后进行什么操作 .then(response => { //then 请求成功之后进行什么操作
console.log('raw response',response); console.log('raw response', response)
response.data['date'] = response.headers.date; response.data['date'] = response.headers.date
resolve(response.data);//把请求到的数据发到引用请求的地方 resolve(response.data)//把请求到的数据发到引用请求的地方
}) })
.catch(error => { .catch(error => {
console.log('请求异常信息:', error); console.log('请求异常信息:', error)
if (process.env.NODE_ENV === 'production') { if (process.env.NODE_ENV === 'production') {
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))
localStorage.setItem('walk_userData', ''); localStorage.setItem('walk_userData', '')
location.replace('#/Author'); location.replace('#/Author')
} else { } else {
reject(error); reject(error)
} }
} }
}); })
}); })
} }
...@@ -77,4 +77,6 @@ export default { ...@@ -77,4 +77,6 @@ export default {
pop_up_windows: `${api}/api/v1/pop_up_windows`, pop_up_windows: `${api}/api/v1/pop_up_windows`,
//首页第一项立即报名 //首页第一项立即报名
daka_info: `${api}/api/v1/daka_info`, daka_info: `${api}/api/v1/daka_info`,
//检查用户是否关注过公众号,是否需要弹窗
select_follow: `${api}/api/v1/select_follow`,
} }
\ No newline at end of file
...@@ -5,8 +5,8 @@ import store from './store' ...@@ -5,8 +5,8 @@ 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() // 初始化
Vue.config.productionTip = false Vue.config.productionTip = false
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<div class="bonus-title" v-else>达标奖励金(元)</div> <div class="bonus-title" v-else>达标奖励金(元)</div>
<div class="bonus-amount">{{pageData.bet_bonus}}</div> <div class="bonus-amount">{{pageData.bet_bonus}}</div>
</div> </div>
<div class="game-title">{{pageData.target_step}}步3日耐力赛</div> <div class="game-title">{{pageData.action}}耐力赛</div>
<div class="game-time">开赛时间:{{pageData.start_format}}{{pageData.end_format}}</div> <div class="game-time">开赛时间:{{pageData.start_format}}{{pageData.end_format}}</div>
<div class="hr"></div> <div class="hr"></div>
<div class="game-info-container"> <div class="game-info-container">
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
} }
}, },
mounted () { mounted () {
console.log("this.pageType", this.page_type) console.log("this.pageType", this.pageData)
if (window["userData"]) { if (window["userData"]) {
this.userData = window["userData"] this.userData = window["userData"]
} else { } else {
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<div class="bonus-title">本期累计奖励金(元)</div> <div class="bonus-title">本期累计奖励金(元)</div>
<div class="bonus-amount">{{bet_bonus|moneyFormatter}}</div> <div class="bonus-amount">{{bet_bonus|moneyFormatter}}</div>
</div> </div>
<div class="game-title">{{target_steps}}3日耐力赛</div> <div class="game-title">{{target_steps}}{{record_list.length}}日耐力赛</div>
<div class="game-time">开赛时间:{{period_start}}{{period_end}}</div> <div class="game-time">开赛时间:{{period_start}}{{period_end}}</div>
<div class="target-people-container"> <div class="target-people-container">
<img class="target-img" src="../images/HaveJoinedGame/ic_shoes.png"> <img class="target-img" src="../images/HaveJoinedGame/ic_shoes.png">
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<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-show="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">
...@@ -209,6 +209,15 @@ export default { ...@@ -209,6 +209,15 @@ export default {
setTimeout(() => { setTimeout(() => {
this.swiper.slideTo(this.current_day, 1200, false); this.swiper.slideTo(this.current_day, 1200, false);
}, 800); }, 800);
if (window["userData"]) {
this.userData = window["userData"]
} else {
let localUserData = localStorage.getItem("walk_userData")
if (localUserData) {
window["userData"] = JSON.parse(localUserData)
this.userData = window["userData"]
}
}
}, },
methods: { methods: {
joinNextGame() { joinNextGame() {
...@@ -220,26 +229,7 @@ export default { ...@@ -220,26 +229,7 @@ export default {
}); });
}, },
goOtherPage(pageName) { goOtherPage(pageName) {
if (pageName == "Rule") { this.$router.push({ name: pageName});
// 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 {
// console.log('提交步数')
this.$router.push({ name: pageName });
}
// let params = this.target_steps
// console.log('params',params)
// this.$router.push({name: pageName})
}, },
closePayPopup() { closePayPopup() {
this.userHavePaidGame = false; this.userHavePaidGame = false;
...@@ -250,9 +240,6 @@ export default { ...@@ -250,9 +240,6 @@ export default {
goback() { goback() {
history.go(-1); history.go(-1);
}, },
// goOtherPage(pageName) {
// this.$router.push({name: pageName})
// },
currentPage() { currentPage() {
return this.$router.history.current.name; return this.$router.history.current.name;
}, },
...@@ -269,13 +256,6 @@ export default { ...@@ -269,13 +256,6 @@ export default {
index index
); );
} }
// if(item.days < currentDay){
// if(item.step_num < item.target_steps){
// console.log('未达标')
// }else{
//
// }
// }
}); });
} }
this.bet_bonus = pageData.bet_bonus; this.bet_bonus = pageData.bet_bonus;
...@@ -837,9 +817,8 @@ export default { ...@@ -837,9 +817,8 @@ export default {
width: 0.58rem; width: 0.58rem;
height: 0.58rem; height: 0.58rem;
position: absolute; position: absolute;
bottom: -1.08rem; bottom: -0.88rem;
left: 50%; right: 0;
transform: translateX(-50%);
} }
} }
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<router-view/> <router-view/>
<div class="bottom-bar"> <div class="bottom-bar">
<div class="bottom-tab" @click="selectTab('SignUp')"> <div class="bottom-tab" @click="selectTab('SignUp')">
<div :class="['text', currentPage()==='SignUp'?'active':'']">3天健步挑战赛</div> <div :class="['text', currentPage()==='SignUp'?'active':'']">健步挑战赛</div>
</div> </div>
<div class="bottom-tab" @click="selectTab('nowGame')"> <div class="bottom-tab" @click="selectTab('nowGame')">
<div :class="['text', (currentPage()==='MainPagePartakeChallenge'||currentPage()==='MainPageHaveJoinedGame')?'active':'']">当前比赛</div> <div :class="['text', (currentPage()==='MainPagePartakeChallenge'||currentPage()==='MainPageHaveJoinedGame')?'active':'']">当前比赛</div>
......
...@@ -9,10 +9,8 @@ ...@@ -9,10 +9,8 @@
<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}}期 - 3天耐力赛</div> <div class="card-title">{{item.action}}期耐力赛</div>
<div <div class="card-time">{{item.already_join===1?'已参赛':'未参赛'}} {{item.period_start}} - {{item.period_end}}</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>
...@@ -28,33 +26,29 @@ ...@@ -28,33 +26,29 @@
</div> </div>
</div> </div>
<!-- 0 比赛中 1 未开始 2 已结束--> <!-- 0 比赛中 1 未开始 2 已结束-->
<div <div class="card-btn" v-if="item.status===1&&item.already_join===0" data-item="item" @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 <div class="card-btn" v-if="item.status===1&&item.already_join===1" data-item="item" @click="goWhereDetail(item)">已报名</div>
class="card-btn" <div class="statusnormal" v-if="item.status===2 || item.status===0 || item.status===3" @click="goWhereDetail(item)">
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===2 || item.status===0)
? (item.status===0&&item.already_join===1) ? '立即打卡': '查看详情' : '已淘汰'}} ? (item.status===0&&item.already_join===1) ? '立即打卡': '查看详情' : '已淘汰'}}
<img <img src="../images/SignUp/detail_bg.png" alt="">
src="../images/SignUp/detail_bg.png"
alt=""
>
</div> </div>
</div> </div>
<!-- 没有关注公众号弹窗 -->
<div class="game-status-popup" v-if="needFollow">
<div class="game-status-container">
<div class="status-date">请关注公众号报名</div>
<img :src="followInfo.img_url" alt="" class="img_code">
<div class="follow-tip">
<p>由于在公众号内才能获取运动数据</p>
<p>请长按上方二维码关注公众号后报名</p>
</div>
<img class="close-btn" src="../images/common/pop_ic_close.png" @click="closePopup()">
</div>
</div>
<img :src="followInfo.img_url" alt="" style="display: none">
</div> </div>
</template> </template>
...@@ -63,7 +57,14 @@ import NoticeBonus from "@/components/NoticeBonus.vue"; ...@@ -63,7 +57,14 @@ 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,
select_follow
} from "@/components/axios/api";
import { constants } from "crypto";
export default { export default {
name: "SignUp", name: "SignUp",
...@@ -83,15 +84,22 @@ export default { ...@@ -83,15 +84,22 @@ export default {
current_date: {}, current_date: {},
isShowPayFail: false, isShowPayFail: false,
isFollow: false, isFollow: false,
gameList: [], gameList: [],
followInfo: {
},
needFollow: false
}; };
}, },
created() { created() {
this.getPageData(); this.getPageData();
this.getFollowInfo();
}, },
methods: { methods: {
goOtherPage(pageName) { goOtherPage(pageName) {
if(!this.followInfo.follow){
this.needFollow = true
return
}
console.log("pageName", pageName); console.log("pageName", pageName);
this.$router.push({ name: pageName }); this.$router.push({ name: pageName });
}, },
...@@ -115,12 +123,21 @@ export default { ...@@ -115,12 +123,21 @@ export default {
} }
}); });
} else { } else {
console.log("item", item);
// 未报名 // 未报名
sessionStorage.setItem("ChallengeDetailData", JSON.stringify(item)); sessionStorage.setItem("ChallengeDetailData", JSON.stringify(item));
this.$router.push({ name: "ChallengeDetail" }); this.$router.push({ name: "ChallengeDetail" });
} }
} }
}, },
getFollowInfo() {
select_follow().then(res => {
console.log(res);
if (res.code == 0) {
this.followInfo = res.data
}
});
},
getPageData() { getPageData() {
daka_index().then(res => { daka_index().then(res => {
if (res.code === 0) { if (res.code === 0) {
...@@ -246,7 +263,10 @@ export default { ...@@ -246,7 +263,10 @@ export default {
); );
} }
}); });
} },
closePopup() {
this.needFollow = false;
},
} }
}; };
</script> </script>
...@@ -411,4 +431,82 @@ export default { ...@@ -411,4 +431,82 @@ export default {
} }
} }
} }
.game-status-popup {
position: fixed;
left: 0;
top: 0;
right: 0;
bottom: 0;
z-index: 998;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
.game-status-container {
position: relative;
width: 6.4rem;
height: 7.08rem;
background: url(../images/SignUp/follow_modal.png) no-repeat center center;
background-size: cover;
border-radius: 0.08rem;
padding-bottom: 0.4rem;
display: flex;
flex-direction: column;
align-items: center;
position: relative;
.img_code{
position: absolute;
top:2.62rem;
width: 2.2rem;
height: 2.2rem;
}
.follow-tip{
position: absolute;
bottom: .7rem;
font-size: .3rem;
font-weight: bold;
line-height: .46rem;
text-align: center;
}
.status-icon {
width: 5.08rem;
height: 2.58rem;
margin-top: -1.29rem;
}
.join-success-banner {
width: 5.44rem;
height: 3.18rem;
margin-top: 0.3rem;
}
.status-date {
font-size: 0.36rem;
line-height: 1;
color: #fff;
font-weight: bold;
text-align: center;
margin-top: 0.7rem;
}
.status-money {
width: 5.04rem;
height: 2.84rem;
background-image: url(../images/HaveJoinedGame/pop_gxdb_board.png);
background-size: 100%;
margin-top: 0.42rem;
}
.green-btn {
background: #1fdbb1;
}
.yellow-btn {
background: #fabd21;
}
.close-btn {
width: 0.58rem;
height: 0.58rem;
position: absolute;
top: -.88rem;
right: 0
}
}
}
</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