Commit 162f6fdd authored by wildfirecode13's avatar wildfirecode13

1

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