Commit 058d90e2 by Caiyijun

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

parents ff06bda9 af1b30e2
......@@ -342,7 +342,7 @@
if (window["userData"]) {
this.userData = window["userData"];
} else {
let localUserData = localStorage.getItem("read_userData");
let localUserData = localStorage.getItem("walk_userData");
if (localUserData) {
window["userData"] = JSON.parse(localUserData);
this.userData = window["userData"];
......
......@@ -270,7 +270,7 @@
if (window["userData"]) {
this.userData = window["userData"];
} else {
let localUserData = localStorage.getItem("read_userData");
let localUserData = localStorage.getItem("walk_userData");
if (localUserData) {
window["userData"] = JSON.parse(localUserData);
this.userData = window["userData"];
......
......@@ -54,6 +54,7 @@
.title_container {
font-size: 0.36rem;
color: #ffffff;
z-index: 999;
}
.title_container > div {
......
......@@ -2,7 +2,7 @@ import axios from 'axios';//引入axios
export function fetch(options) {
// if (!window['userData']) {
// let user_data_str = localStorage.getItem('read_userData');
// let user_data_str = localStorage.getItem('walk_userData');
// if (user_data_str) {
// window['userData'] = JSON.parse(user_data_str);
// }
......@@ -34,7 +34,7 @@ export function fetch(options) {
// console.log(error);
// if (error.response.status == 401) {
// localStorage.setItem('last_url', location.hash.slice(1));
// localStorage.setItem('read_userData', '');
// localStorage.setItem('walk_userData', '');
// location.replace('#/Author');
// // this.$router.push({name:"Author"})
// } else {
......
......@@ -77,7 +77,7 @@ export default {
daka_records_detail: `${api}/api/v1/daka_records/detail`,
// 25 规则详情
daka_rule: `${api}/api/v1/daka_rule`,
// 26 红包 /api/v1/withdraw_img
// 26 红包 /api/v1/withdraw_img
withdraw_img: `${api}/api/v1/withdraw_img`,
// 27 提现明细 /api/v1/withdraw_log
withdraw_log: `${api}/api/v1/withdraw_log`,
......
......@@ -17,7 +17,7 @@ window.wx = wx;
router.beforeEach((to, from, next) => {
// document.title = to.meta.title //修改各个页面的title
var uid = localStorage.getItem('read_userData');
var uid = localStorage.getItem('walk_userData');
if (location.search.match(/inviter/)) {
let searchs = location.search.split('&');
let search_obj = {};
......
......@@ -7,6 +7,11 @@
// var url = getToUrl();
export default {
name: "Author",
data() {
return {
uid: ""
};
},
created() {
document.title = "微信授权中";
var code = this.GetUrlParame("code"); // 截取code
......@@ -14,24 +19,20 @@
if (!code) {
let local_hash = location.hash;
window.localStorage.setItem("local_hash", local_hash);
let redirect_uri = encodeURIComponent(
`${location.origin}${location.pathname}`
);
location.replace(
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx9af64967a0d40159&redirect_uri=${redirect_uri}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`
);
let redirect_uri = encodeURIComponent(`${location.origin}${location.pathname}`);
location.replace(`https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx9af64967a0d40159&redirect_uri=${redirect_uri}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`);
} else {
console.log("拿到code", code);
console.log("请求登录");
let inviter = localStorage.getItem("inviter");
var uid = localStorage.getItem('read_userData');
var uid = localStorage.getItem('walk_userData');
if (uid && inviter == JSON.parse(uid).id) {
inviter = "";
}
let from_type = localStorage.getItem("from_type");
// alert(inviter + "test2")
this.$http
.post("/game-bsdk/api/v1/auth_login", {
js_code: code,
......@@ -46,7 +47,7 @@
}
let result = res.data;
if (result.code == 0) {
localStorage.setItem("read_userData", JSON.stringify(result.data));
localStorage.setItem("walk_userData", JSON.stringify(result.data));
sessionStorage.setItem("new_user", result.data.new_user);
let last_url = localStorage.getItem("last_url") || "/";
let url = location.href.split("#")[0];
......@@ -65,11 +66,6 @@
});
}
},
data() {
return {
uid: ""
};
},
methods: {
// 截取code
GetUrlParame(parameName) {
......
<template>
<div class="partake-challenge-page">
<Title class="page-title" title=" " v-on:goback="goback" show_back="true"></Title>
<Title class="page-title" title=" " v-on:goback="goback" show_back="true" v-if="currentPage()==='PartakeChallenge'"></Title>
<div class="game-title">5000步七日耐力赛</div>
<div class="game-time">开赛时间:3月11日 00:00-3月17日24:00</div>
<div class="game-cost">本期运动契约金:<span>21.00元/人</span></div>
......@@ -30,8 +30,17 @@
<div class="content-text">次日结算前日比赛,达标者获得对应奖励金;总奖励金为用户每日达标奖金之和。</div>
</div>
</div>
<div class="game-introduce-join-container" v-if="currentPage()!=='PartakeChallenge'">
<div class="auth-container">
<img class="auth-checked" src="../images/PartakeChallenge/ic_choose.png" v-if="true">
<div class="auth-uncheck" v-else></div>
<div class="text1">我同意</div>
<div class="text2" @click="goOtherPage('Rule')">《步数打卡的挑战规则协议》</div>
</div>
<div class="partake-btn">立即报名</div>
</div>
</div>
<div class="footer-container">
<div class="footer-container" v-if="currentPage()==='PartakeChallenge'">
<div class="auth-container">
<img class="auth-checked" src="../images/PartakeChallenge/ic_choose.png" v-if="true">
<div class="auth-uncheck" v-else></div>
......@@ -63,6 +72,9 @@
goOtherPage(pageName) {
this.$router.push({name: pageName});
},
currentPage() {
return this.$router.history.current.name;
}
}
}
</script>
......@@ -111,7 +123,7 @@
.game-introduce-container {
width: 7.1rem;
border-radius: .08rem;
padding: .36rem .28rem .2rem;
padding: .36rem .28rem .3rem;
box-sizing: border-box;
background: #fff;
margin-top: .34rem;
......@@ -162,42 +174,29 @@
}
}
}
.game-introduce-join-container {
.auth-container {
background: transparent;
margin-top: .26rem;
}
.partake-btn {
width: 5.6rem;
height: .92rem;
border-radius: .92rem;
background: #FABD21;
font-size: .4rem;
line-height: .92rem;
color: #fff;
font-weight: bold;
text-align: center;
}
}
}
.footer-container {
width: 100%;
position: fixed;
left: 0;
bottom: 0;
.auth-container {
width: 100%;
height: .52rem;
background: #F2F2F2;
display: flex;
align-items: center;
justify-content: center;
.auth-checked {
width: .24rem;
height: .24rem;
}
.auth-uncheck {
width: .24rem;
height: .24rem;
border: .01rem solid #BFBFBF;
box-sizing: border-box;
border-radius: 50%;
}
.text1 {
font-size: .24rem;
line-height: 1;
color: #999;
margin: 0 .1rem;
}
.text2 {
font-size: .24rem;
line-height: 1;
color: #576B95;
}
}
.partake-btn {
width: 100%;
background: #FABD21;
......@@ -208,5 +207,35 @@
text-align: center;
}
}
.auth-container {
width: 100%;
height: .52rem;
background: #F2F2F2;
display: flex;
align-items: center;
justify-content: center;
.auth-checked {
width: .24rem;
height: .24rem;
}
.auth-uncheck {
width: .24rem;
height: .24rem;
border: .01rem solid #BFBFBF;
box-sizing: border-box;
border-radius: 50%;
}
.text1 {
font-size: .24rem;
line-height: 1;
color: #999;
margin: 0 .1rem;
}
.text2 {
font-size: .24rem;
line-height: 1;
color: #576B95;
}
}
}
</style>
......@@ -36,7 +36,7 @@
Title
},
created() {
let userData = localStorage.getItem("read_userData")
let userData = localStorage.getItem("walk_userData")
if (userData) {
this.userData = JSON.parse(userData)
}
......
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