Commit 162f6fdd authored by wildfirecode13's avatar wildfirecode13

1

parent a84ab89c
export const homeInfo = {
"code": null,
"data": {
"canUpdateNickName": false,
"canUpdateNickName": null,
"figures": [
{
"figureId": "4"
},
{
"figureId": "5"
},
{
"figureId": "7"
}
{ "figureId": "1" }, { "figureId": "2" }, { "figureId": "3" }
],
"newUser": true,
"userInfo": {
"figureId": "1",
"joyBeans": 10000,
"nickName": "霞霞"
}
"userInfo": null
},
"message": null,
"success": true
}
export const updateUinfo = {
"code": null,
"data": true,
......@@ -39,7 +28,7 @@ export const signInfo = {
"code": null,
"data": {
"continuousDays": 0,
"needPopup": true,
"needPopup": 1,
"signLists": [
{
"awardName": "欢趣豆",
......
......@@ -5,7 +5,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<title>React App</title>
<title>e趣小镇</title>
<script src="getTokenKey" id="scriptkey"></script>
<script id="scriptjs" src="//yun.duiba.com.cn/js-libs/px-token/0.0.4/px-token.min.js"></script>
<script src="//yun.duiba.com.cn/js-libs/rem/1.1.0/rem.min.js"></script>
......
......@@ -25,6 +25,10 @@ class App extends Component {
// }, 1000);
// }
eventHandler=()=>{
console.log('eventHandler')
}
navigateTo = (page, pagedata) => {
this.setState({ page, pagedata })
}
......@@ -36,7 +40,7 @@ class App extends Component {
{page == 'loading' && <Loading data={pagedata} navigateTo={this.navigateTo}></Loading>}
{page == 'mainpage' && <Main3 data={pagedata} navigateTo={this.navigateTo}></Main3>}
{page == 'detail' && <Detail2 data={pagedata} navigateTo={this.navigateTo}></Detail2>}
<AUPOP AUPopState={AUP_MBX_STATE} ></AUPOP>
<AUPOP eventHandler={this.eventHandler} AUPopState={AUP_MBX_STATE} ></AUPOP>
</>
);
}
......
......@@ -2,15 +2,18 @@
import React, { Component } from 'react';
import resList from '../../resconfig/resList'; //import API from '../../api';
import './sign.less';
import { Toast, Loading, Badge, CountDownButton, InputNumber } from '@spark/ui';
import API from '../../api';
class Sign extends Component {
constructor(props) {
super(props);
const { todaySigned } = props.data;
this.state = {
resList: resList,
todaySigned
};
}
......@@ -20,7 +23,14 @@ class Sign extends Component {
}, 1000);
}
doSign = () => {
API.dosign().then((res) => {
this.props.ctx.updateMoney();
})
}
render() {
const { todaySigned } = this.state;
return (
<div className="sign " uuid="14a66aed-4e41-4fea-9d16-6aa02c1bad5a">
<img
......@@ -272,16 +282,17 @@ class Sign extends Component {
+100
</span>
</div>
<img
{todaySigned && <img
className="sign_signed_btn "
uuid="d8ca8cb8-92f1-4512-aead-d674cac5a46c"
src={this.state.resList['534772d2-3e5a-487d-8236-8913de270cb0'].url}
/>
<img
/>}
{!todaySigned && <img
onClick={this.doSign}
className="sign_btn "
uuid="4dfe2b82-10bd-4442-a01e-65c18869a18e"
src={this.state.resList['13b618c4-cd2a-4037-9664-b77381fbfade'].url}
/>
/>}
<div className="signed_7 " uuid="7b91c31c-0de4-4148-9887-6ab24e963258">
<img
className="signed_7_bg "
......
......@@ -86,21 +86,18 @@ class Loading extends Component {
}
oncomplete() {
this.props.navigateTo('mainpage');
let isnewUser;
let homeinfo = dataCenter.getData(Store.homeinfo);
if(homeinfo){
const {newUser} = homeinfo;
if(newUser){//新用户,走选择,然后再走引导,引导结束后,走签到
Aup.show('Select', {}, this);
}else {
API.signInfo().then((res)=>{
const {needPopup} =res.data;
if(needPopup)
Aup.show('Sign', res.data, this);
})
isnewUser=1;
}
}
this.props.navigateTo('mainpage',{isnewUser});
}
render() {
......
......@@ -23,6 +23,10 @@ class Main3 extends Component {
};
}
updateMoney(){
console.log('update money')
}
onClick_userinfo = () => {
Aup.show('Userinfo', {}, this);
// console.log('onClick_signBtn')
......@@ -32,7 +36,6 @@ class Main3 extends Component {
API.signInfo().then((res)=>{
Aup.show('Sign', res.data, this);
})
// console.log('onClick_signBtn')
}
onClick_shareBtn = () => {
......@@ -50,6 +53,13 @@ class Main3 extends Component {
componentDidMount() {
this.initEvent();
if(!this.props.data.isnewUser) {
API.signInfo().then((res)=>{
const {needPopup} =res.data;
if(needPopup)
Aup.show('Sign', res.data, this);
})
}
}
initEvent() {
GDispatcher.addEventListener(Store.homeinfo, this.freshHomeInfo, this);
......
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