Commit 1973c2b2 by xuzhenghua

登录问题

parent 58085a3d
......@@ -18,7 +18,7 @@
text-align: center;
#to-square {
position: relative;
position: fixed;
width: 100%;
height: 30px;
background: #FF2121;
......@@ -26,7 +26,7 @@
font-size: 14px;
line-height: 30px;
text-align: center;
z-index: 10;
z-index: 21;
}
.box-container {
......@@ -35,7 +35,7 @@
.snow-deco {
position: absolute;
top: 0;
top: 30px;
left: 0;
display: block;
width: 100%;
......
......@@ -327,11 +327,11 @@ class YearCourse extends Component {
isFollow = (id, key) => {
const _this = this
http.get(`${API.home}/m/live/isFollow`).then(res => {
http.get(`${API.home}/sys/user/isFollowWeChat`).then(res => {
const {code, data, msg} = res.data
if (code === 200) {
_this.setState({
isshowFollow: data.status == 0 ? true : false
isshowFollow: !data.is_follow
})
if (!_this.state.isshowFollow) {
......
......@@ -10,11 +10,14 @@ import {setCurrentUser, startFetchUser} from "@/store/userAction"
import {SendMessageToApp, getParam, http} from '@/utils'
import {addDays} from "date-fns"
import {connect} from "react-redux"
import { Toast } from 'antd-mobile';
import {Toast} from 'antd-mobile'
import {compose} from "redux"
@connect(state => ({
user: state.user
}))
user: state.user
}),
{setCurrentUser, startFetchUser}
)
export default class index extends Component {
state = {
......@@ -35,8 +38,7 @@ export default class index extends Component {
window['loginInfo'] = result => {
_this.loginInfo(result)
}
_this.getStage();
_this.getStage()
}
// 获取app登录数据
......@@ -107,10 +109,10 @@ export default class index extends Component {
// 跳转到我的宝箱列表页
toBoxList = () => {
const isLogin = !this.props.user.hasError
const {currentOpenId} = this.state;
let search = '';
if(currentOpenId) {
search = `?id=${currentOpenId}`;
const {currentOpenId} = this.state
let search = ''
if (currentOpenId) {
search = `?id=${currentOpenId}`
}
if (isLogin) {
this.props.history.push(`/year/yearTreasure${search}`)
......@@ -126,16 +128,16 @@ export default class index extends Component {
// 获取活动以及宝箱的阶段
getStage = () => {
http.get(`${API.home}/activity/stage`).then(res => {
const { code, data, msg } = res.data;
if(code === 200) {
// treasure_stage,宝箱阶段,0-不在活动时间,1-活动时间内
this.setState({
treasure_stage: data.treasure_stage
})
}else{
Toast.info(msg, 2);
const {code, data, msg} = res.data
if (code === 200) {
// treasure_stage,宝箱阶段,0-不在活动时间,1-活动时间内
this.setState({
treasure_stage: data.treasure_stage
})
} else {
Toast.info(msg, 2)
}
});
})
}
toYearWish = () => {
......@@ -152,9 +154,9 @@ export default class index extends Component {
}
sonToPar(e){
sonToPar(e) {
this.setState({
txt1:e
txt1: e
})
}
......@@ -192,7 +194,7 @@ export default class index extends Component {
{/* 组队开宝箱 */}
{
treasure_stage === 1 && <TreasureBox getRemovable={this.getRemovable} />
treasure_stage === 1 && <TreasureBox getRemovable={this.getRemovable}/>
}
{/*课程*/}
......
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