Pārlūkot izejas kodu

记账页面大体完成

wly 7 gadi atpakaļ
vecāks
revīzija
e3618cb53d

+ 13 - 3
src/case/BillApp/src/App.js

@@ -15,6 +15,7 @@ import My from './components/My/My'
 import Bill from './components/Bill/Bill'
 import BillDetail from './components/BillDetail/BillDetail'
 import CreateAssets from './components/Create_assets/Create_assets'
+import Account from './components/Account/Account'
 
 
 import './components/App/App.css';
@@ -57,12 +58,12 @@ class BillApp extends Component{
   //获取数据
   getBills(){
     graphqls(BILL_BY_PROPS,{}).then((e)=>{
-        //console.log('1----',e.billbyprops)
+      //console.log('1----',e.billbyprops)
         this.setState({
             bills:e.billbyprops
         })
 
-        return e.billbyprops
+      return e
     })
   }
 
@@ -81,7 +82,7 @@ class BillApp extends Component{
           return(
             <div className="pageWrap">
               <div className="scrollPage">
-                <Assets changePage={this.changePage}/>
+                <Assets changePage={this.changePage} bills={this.state.bills} getBills={this.getBills}/>
               </div>
             </div>
           )
@@ -118,6 +119,15 @@ class BillApp extends Component{
             </div>
           </div>
         )
+
+      case('account'):
+        return(
+          <div className="pageWrap">
+            <div className="scrollPage">
+              <Account changePage={this.changePage} />
+            </div>
+          </div>
+        )
           
       default:
           return(

+ 0 - 610
src/case/BillApp/src/api/billsGraphql.txt

@@ -1,610 +0,0 @@
-query collectbyid($id: ID) {
-    collectbyid: collect_by_id(id: $id) {
-        updateAt
-        remark
-        account_id {
-            id
-
-            accountName
-            createdAt
-            updateAt
-        }
-        month
-        createdAt
-        allIncome
-        allPay
-        year
-        id
-        user_id {
-            id
-            openid
-            username
-            password
-            avatar
-            createdAt
-            updateAt
-        }
-    }
-}
-
-query userbyid($id: ID) {
-    userbyid: user_by_id(id: $id) {
-        id
-        openid
-        username
-        password
-        avatar
-        createdAt
-        updateAt
-    }
-}
-
-query accountbyid($id: ID) {
-    accountbyid: account_by_id(id: $id) {
-        id
-        user_id {
-            id
-            openid
-            username
-            password
-            avatar
-            createdAt
-            updateAt
-        }
-        accountName
-        createdAt
-        updateAt
-    }
-}
-
-query classbyid($id: ID) {
-    classbyid: class_by_id(id: $id) {
-        id
-        user_id {
-            id
-            openid
-            username
-            password
-            avatar
-            createdAt
-            updateAt
-        }
-        account_id {
-            id
-
-            accountName
-            createdAt
-            updateAt
-        }
-        name
-        createdAt
-        updateAt
-    }
-}
-
-query tagbyprops($user_id: ID, $account_id: ID, $name: String, $icon: String, $createdAt: String, $updateAt: String) {
-    tagbyprops: tag_by_props(user_id: $user_id account_id: $account_id name: $name icon: $icon createdAt: $createdAt updateAt: $updateAt) {
-        id
-        user_id {
-            id
-            openid
-            username
-            password
-            avatar
-            createdAt
-            updateAt
-        }
-        account_id {
-            id
-            accountName
-            createdAt
-            updateAt
-        }
-        name
-        icon
-        createdAt
-        updateAt
-    }
-}
-
-query billbyid($id: ID) {
-    billbyid: bill_by_id(id: $id) {
-        money
-        updateAt
-        remark
-        account_id {
-            id
-
-            accountName
-            createdAt
-            updateAt
-        }
-        time
-        createdAt
-        id
-        class
-        user_id {
-            id
-            openid
-            username
-            password
-            avatar
-            createdAt
-            updateAt
-        }
-        tag_id {
-            id
-
-
-            name
-            icon
-            createdAt
-            updateAt
-        }
-    }
-}
-
-query classbyprops($user_id: ID, $account_id: ID, $name: String, $createdAt: String, $updateAt: String) {
-    classbyprops: class_by_props(user_id: $user_id account_id: $account_id name: $name createdAt: $createdAt updateAt: $updateAt) {
-        id
-        user_id {
-            id
-            openid
-            username
-            password
-            avatar
-            createdAt
-            updateAt
-        }
-        account_id {
-            id
-
-            accountName
-            createdAt
-            updateAt
-        }
-        name
-        createdAt
-        updateAt
-    }
-}
-
-query accountbyprops($user_id: ID, $accountName: String, $createdAt: String, $updateAt: String) {
-    accountbyprops: account_by_props(user_id: $user_id accountName: $accountName createdAt: $createdAt updateAt: $updateAt) {
-        id
-        user_id {
-            id
-            openid
-            username
-            password
-            avatar
-            createdAt
-            updateAt
-        }
-        accountName
-        createdAt
-        updateAt
-    }
-}
-
-query tagbyid($id: ID) {
-    tagbyid: tag_by_id(id: $id) {
-        id
-        user_id {
-            id
-            openid
-            username
-            password
-            avatar
-            createdAt
-            updateAt
-        }
-        account_id {
-            id
-
-            accountName
-            createdAt
-            updateAt
-        }
-        name
-        icon
-        createdAt
-        updateAt
-    }
-}
-
-query collectbyprops($updateAt: String, $remark: String, $account_id: ID, $month: String, $createdAt: String, $allIncome: Float, $allPay: Float, $year: String, $user_id: ID) {
-    collectbyprops: collect_by_props(updateAt: $updateAt remark: $remark account_id: $account_id month: $month createdAt: $createdAt allIncome: $allIncome allPay: $allPay year: $year user_id: $user_id) {
-        updateAt
-        remark
-        account_id {
-            id
-
-            accountName
-            createdAt
-            updateAt
-        }
-        month
-        createdAt
-        allIncome
-        allPay
-        year
-        id
-        user_id {
-            id
-            openid
-            username
-            password
-            avatar
-            createdAt
-            updateAt
-        }
-    }
-}
-
-query billbyprops($money: Float, $updateAt: String, $remark: String, $account_id: ID, $time: String, $createdAt: String, $class: String, $user_id: ID, $tag_id: ID) {
-    billbyprops: bill_by_props(money: $money updateAt: $updateAt remark: $remark account_id: $account_id time: $time createdAt: $createdAt class: $class user_id: $user_id tag_id: $tag_id) {
-        money
-        updateAt
-        remark
-        account_id {
-            id
-
-            accountName
-            createdAt
-            updateAt
-        }
-        time
-        createdAt
-        id
-        class
-        user_id {
-            id
-            openid
-            username
-            password
-            avatar
-            createdAt
-            updateAt
-        }
-        tag_id {
-            id
-
-
-            name
-            icon
-            createdAt
-            updateAt
-        }
-    }
-}
-
-query userbyprops($openid: String, $username: String, $password: String, $avatar: String, $createdAt: String, $updateAt: String) {
-    userbyprops: user_by_props(openid: $openid username: $username password: $password avatar: $avatar createdAt: $createdAt updateAt: $updateAt) {
-        id
-        openid
-        username
-        password
-        avatar
-        createdAt
-        updateAt
-    }
-}
-
-mutation createuser($id: ID!, $openid: String, $username: String, $password: String, $avatar: String, $createdAt: String, $updateAt: String) {
-    createuser: create_user(id: $id openid: $openid username: $username password: $password avatar: $avatar createdAt: $createdAt updateAt: $updateAt) {
-        id
-        openid
-        username
-        password
-        avatar
-        createdAt
-        updateAt
-    }
-}
-
-mutation deleteaccount($id: ID, $user_id: ID, $accountName: String, $createdAt: String, $updateAt: String) {
-    deleteaccount: delete_account(id: $id user_id: $user_id accountName: $accountName createdAt: $createdAt updateAt: $updateAt)
-}
-
-mutation updatebill($money: Float, $updateAt: String, $remark: String, $account_id: ID, $time: String, $createdAt: String, $id: ID, $class: String, $user_id: ID, $tag_id: ID) {
-    updatebill: update_bill(money: $money updateAt: $updateAt remark: $remark account_id: $account_id time: $time createdAt: $createdAt id: $id class: $class user_id: $user_id tag_id: $tag_id) {
-        money
-        updateAt
-        remark
-        account_id {
-            id
-
-            accountName
-            createdAt
-            updateAt
-        }
-        time
-        createdAt
-        id
-        class
-        user_id {
-            id
-            openid
-            username
-            password
-            avatar
-            createdAt
-            updateAt
-        }
-        tag_id {
-            id
-
-
-            name
-            icon
-            createdAt
-            updateAt
-        }
-    }
-}
-
-mutation deletecollect($updateAt: String, $remark: String, $account_id: ID, $month: String, $createdAt: String, $allIncome: Float, $allPay: Float, $year: String, $id: ID, $user_id: ID) {
-    deletecollect: delete_collect(updateAt: $updateAt remark: $remark account_id: $account_id month: $month createdAt: $createdAt allIncome: $allIncome allPay: $allPay year: $year id: $id user_id: $user_id)
-}
-
-mutation updateuser($id: ID, $openid: String, $username: String, $password: String, $avatar: String, $createdAt: String, $updateAt: String) {
-    updateuser: update_user(id: $id openid: $openid username: $username password: $password avatar: $avatar createdAt: $createdAt updateAt: $updateAt) {
-        id
-        openid
-        username
-        password
-        avatar
-        createdAt
-        updateAt
-    }
-}
-
-mutation deleteclass($id: ID, $user_id: ID, $account_id: ID, $name: String, $createdAt: String, $updateAt: String) {
-    deleteclass: delete_class(id: $id user_id: $user_id account_id: $account_id name: $name createdAt: $createdAt updateAt: $updateAt)
-}
-
-mutation updateclass($id: ID, $user_id: ID, $account_id: ID, $name: String, $createdAt: String, $updateAt: String) {
-    updateclass: update_class(id: $id user_id: $user_id account_id: $account_id name: $name createdAt: $createdAt updateAt: $updateAt) {
-        id
-        user_id {
-            id
-            openid
-            username
-            password
-            avatar
-            createdAt
-            updateAt
-        }
-        account_id {
-            id
-
-            accountName
-            createdAt
-            updateAt
-        }
-        name
-        createdAt
-        updateAt
-    }
-}
-
-mutation updatetag($id: ID, $user_id: ID, $account_id: ID, $name: String, $icon: String, $createdAt: String, $updateAt: String) {
-    updatetag: update_tag(id: $id user_id: $user_id account_id: $account_id name: $name icon: $icon createdAt: $createdAt updateAt: $updateAt) {
-        id
-        user_id {
-            id
-            openid
-            username
-            password
-            avatar
-            createdAt
-            updateAt
-        }
-        account_id {
-            id
-
-            accountName
-            createdAt
-            updateAt
-        }
-        name
-        icon
-        createdAt
-        updateAt
-    }
-}
-
-mutation createcollect($updateAt: String, $remark: String, $account_id: ID, $month: String, $createdAt: String, $allIncome: Float, $allPay: Float, $year: String, $id: ID!, $user_id: ID) {
-    createcollect: create_collect(updateAt: $updateAt remark: $remark account_id: $account_id month: $month createdAt: $createdAt allIncome: $allIncome allPay: $allPay year: $year id: $id user_id: $user_id) {
-        updateAt
-        remark
-        account_id {
-            id
-
-            accountName
-            createdAt
-            updateAt
-        }
-        month
-        createdAt
-        allIncome
-        allPay
-        year
-        id
-        user_id {
-            id
-            openid
-            username
-            password
-            avatar
-            createdAt
-            updateAt
-        }
-    }
-}
-
-mutation createtag($id: ID!, $user_id: ID, $account_id: ID, $name: String, $icon: String, $createdAt: String, $updateAt: String) {
-    createtag: create_tag(id: $id user_id: $user_id account_id: $account_id name: $name icon: $icon createdAt: $createdAt updateAt: $updateAt) {
-        id
-        user_id {
-            id
-            openid
-            username
-            password
-            avatar
-            createdAt
-            updateAt
-        }
-        account_id {
-            id
-
-            accountName
-            createdAt
-            updateAt
-        }
-        name
-        icon
-        createdAt
-        updateAt
-    }
-}
-
-mutation deleteuser($id: ID, $openid: String, $username: String, $password: String, $avatar: String, $createdAt: String, $updateAt: String) {
-    deleteuser: delete_user(id: $id openid: $openid username: $username password: $password avatar: $avatar createdAt: $createdAt updateAt: $updateAt)
-}
-
-mutation updateaccount($id: ID, $user_id: ID, $accountName: String, $createdAt: String, $updateAt: String) {
-    updateaccount: update_account(id: $id user_id: $user_id accountName: $accountName createdAt: $createdAt updateAt: $updateAt) {
-        id
-        user_id {
-            id
-            openid
-            username
-            password
-            avatar
-            createdAt
-            updateAt
-        }
-        accountName
-        createdAt
-        updateAt
-    }
-}
-
-mutation createaccount($id: ID!, $user_id: ID, $accountName: String, $createdAt: String, $updateAt: String) {
-    createaccount: create_account(id: $id user_id: $user_id accountName: $accountName createdAt: $createdAt updateAt: $updateAt) {
-        id
-        user_id {
-            id
-            openid
-            username
-            password
-            avatar
-            createdAt
-            updateAt
-        }
-        accountName
-        createdAt
-        updateAt
-    }
-}
-
-mutation deletebill($money: Float, $updateAt: String, $remark: String, $account_id: ID, $time: String, $createdAt: String, $id: ID, $class: String, $user_id: ID, $tag_id: ID) {
-    deletebill: delete_bill(money: $money updateAt: $updateAt remark: $remark account_id: $account_id time: $time createdAt: $createdAt id: $id class: $class user_id: $user_id tag_id: $tag_id)
-}
-
-mutation deletetag($id: ID, $user_id: ID, $account_id: ID, $name: String, $icon: String, $createdAt: String, $updateAt: String) {
-    deletetag: delete_tag(id: $id user_id: $user_id account_id: $account_id name: $name icon: $icon createdAt: $createdAt updateAt: $updateAt)
-}
-
-mutation updatecollect($updateAt: String, $remark: String, $account_id: ID, $month: String, $createdAt: String, $allIncome: Float, $allPay: Float, $year: String, $id: ID, $user_id: ID) {
-    updatecollect: update_collect(updateAt: $updateAt remark: $remark account_id: $account_id month: $month createdAt: $createdAt allIncome: $allIncome allPay: $allPay year: $year id: $id user_id: $user_id) {
-        updateAt
-        remark
-        account_id {
-            id
-
-            accountName
-            createdAt
-            updateAt
-        }
-        month
-        createdAt
-        allIncome
-        allPay
-        year
-        id
-        user_id {
-            id
-            openid
-            username
-            password
-            avatar
-            createdAt
-            updateAt
-        }
-    }
-}
-
-mutation createclass($id: ID!, $user_id: ID, $account_id: ID, $name: String, $createdAt: String, $updateAt: String) {
-    createclass: create_class(id: $id user_id: $user_id account_id: $account_id name: $name createdAt: $createdAt updateAt: $updateAt) {
-        id
-        user_id {
-            id
-            openid
-            username
-            password
-            avatar
-            createdAt
-            updateAt
-        }
-        account_id {
-            id
-
-            accountName
-            createdAt
-            updateAt
-        }
-        name
-        createdAt
-        updateAt
-    }
-}
-
-mutation createbill($money: Float, $updateAt: String, $remark: String, $account_id: ID, $time: String, $createdAt: String, $id: ID!, $class: String, $user_id: ID, $tag_id: ID) {
-    createbill: create_bill(money: $money updateAt: $updateAt remark: $remark account_id: $account_id time: $time createdAt: $createdAt id: $id class: $class user_id: $user_id tag_id: $tag_id) {
-        money
-        updateAt
-        remark
-        account_id {
-            id
-
-            accountName
-            createdAt
-            updateAt
-        }
-        time
-        createdAt
-        id
-        class
-        user_id {
-            id
-            openid
-            username
-            password
-            avatar
-            createdAt
-            updateAt
-        }
-        tag_id {
-            id
-
-
-            name
-            icon
-            createdAt
-            updateAt
-        }
-    }
-}

+ 43 - 0
src/case/BillApp/src/api/graphql/assets.js

@@ -18,5 +18,48 @@ export const CREATE_ASSETS=`mutation createassets($id: ID!, $user_id: ID, $name:
   }
 }`
 
+export const DELETE_ASSETS=`mutation deleteassets($id: ID, $user_id: ID, $name: String, $money: Float, $createdAt: String, $updateAt: String) {
+    deleteassets: delete_assets(id: $id user_id: $user_id name: $name money: $money createdAt: $createdAt updateAt: $updateAt)
+}`
+
+export const ASSETS_BY_PROPS=`query assetsbyprops($user_id: ID, $name: String, $money: Float, $createdAt: String, $updateAt: String) {
+    assetsbyprops: assets_by_props(user_id: $user_id name: $name money: $money createdAt: $createdAt updateAt: $updateAt) {
+        id
+        user_id {
+            id
+            openid
+            username
+            password
+            avatar
+            createdAt
+            updateAt
+        }
+        name
+        money
+        createdAt
+        updateAt
+    }
+}`
+
+
+export const UPDATE_ASSETS=`mutation updateassets($id: ID, $user_id: ID, $name: String, $money: Float, $createdAt: String, $updateAt: String) {
+    updateassets: update_assets(id: $id user_id: $user_id name: $name money: $money createdAt: $createdAt updateAt: $updateAt) {
+        id
+        user_id {
+            id
+            openid
+            username
+            password
+            avatar
+            createdAt
+            updateAt
+        }
+        name
+        money
+        createdAt
+        updateAt
+    }
+}`
+
 
 

+ 86 - 0
src/case/BillApp/src/components/Account/Account.jsx

@@ -0,0 +1,86 @@
+import React, {Component} from 'react';
+
+
+import NavBars from '../common/NavBar'
+import Buttons from '../common/Button'
+
+import {graphqls} from '../../api/graphql_request'
+import {ACCOUNT_BY_PROPS,CREATE_ACCOUNT,DELETE_ACCOUNT,UPDATE_ACCOUNT} from '../../api/graphql/account'
+
+
+import config from '../../api/url_config'
+
+const user_id=config.APPID
+
+class Account extends Component {
+  constructor(props){
+    super(props)
+    this.state={
+      accountList:[]
+    }
+
+    this.deleteAccount=this.deleteAccount.bind(this)
+  }
+
+  componentDidMount() {
+    this.getAccount({user_id})
+  }
+
+  getAccount(data){
+    graphqls(ACCOUNT_BY_PROPS,data).then((e)=>{
+      console.log(e)
+      this.setState({accountList:e.accountbyprops})
+    })
+  }
+
+
+  createAccount(data){
+    graphqls(CREATE_ACCOUNT,data).then((e)=>{
+
+    })
+  }
+
+  deleteAccount(data){
+    graphqls(DELETE_ACCOUNT,data).then((e)=>{
+      this.getAccount({user_id})
+    })
+  }
+
+  updateAccount(data){
+    graphqls(UPDATE_ACCOUNT,data).then((e)=>{
+
+    })
+  }
+
+  createAccountPage(){
+
+  }
+
+  render() {
+    const accountList=this.state.accountList
+    return (
+      <div>
+        <NavBars changePage={this.props.changePage} page={"my"} navBarText={"账户"}/>
+        {
+          accountList.length===0?
+            <div>
+              <div>暂无账户</div>
+              <div style={{height:"20px"}}></div>
+              <Buttons buttonText={"新建账户"}  changePage={this.createAccountPage}/>
+            </div>
+            :
+            accountList.map((item)=>{
+              return(
+                <div key={item.id} style={{minHeight:"20px",background:"#fff",padding:"5px",margin:"10px"}}>
+                  <div style={{padding:"10px 0",fontWeight:"bold",display:"flex"}}><span style={{flexGrow:"1"}}>{item.accountName}</span><span onClick={()=>{this.deleteAccount({id:item.id})}} style={{flexBasis:"23px",height:"23px"}}>x</span></div>
+                  <div style={{padding:"10px 0",color:"#ccc"}}>收入:<span style={{color:"red"}}>10</span>支出:<span style={{color:"green"}}>20</span></div>
+                </div>
+              )
+            })
+        }
+      </div>
+    );
+  }
+}
+
+export default Account;

+ 8 - 0
src/case/BillApp/src/components/App/App.css

@@ -69,6 +69,7 @@
 
 
 
+
 .assetsWrap .collect{
     text-align: center;
     margin-top: 150px;
@@ -86,6 +87,13 @@
 }
 
 
+.xxx{
+    display: flex;
+flex-basis: 100px;
+    flex-grow: 1;
+}
+
+
 
 
 

+ 39 - 3
src/case/BillApp/src/components/Assets/Assets.jsx

@@ -2,25 +2,61 @@ import React, { Component } from 'react'
 
 import NavBars from '../common/NavBar'
 import Buttons from '../common/Button'
+import {getAllCollect} from '../../untils/collect'
+
+import {graphqls} from "../../api/graphql_request";
+import {CREATE_ASSETS,ASSETS_BY_PROPS,UPDATE_ASSETS} from '../../api/graphql/assets'
+import {BILL_BY_PROPS} from '../../api/graphql/bills'
+
+import config from '../../api/url_config'
+
+
+const user_id=config.APPID
 
 export default class Assets extends Component {
   constructor(props){
     super(props)
     this.state={
       navBarText:'资产统计',
-      collect:'0.00'
+      collect:0,
+      pay:0,
+      money:0,
+      bills:[]
     }
+
   }
   componentWillMount(){
-   
+
+
+    let collects= getAllCollect(this.state.bills)
+    this.setState({pay:collects.pay})
+
+    graphqls(ASSETS_BY_PROPS,{user_id}).then(e=>{
+      this.setState({money:e.assetsbyprops[0].money||0})
+    })
+
   }
 
+  getBills(){
+    graphqls(BILL_BY_PROPS,{}).then((e)=>{
+      //console.log('1----',e.billbyprops)
+      this.setState({
+        bills:e.billbyprops
+      })
+    })
+  }
+
+  // componentWillReceiveProps(props) {
+  //   console.log(props)
+  // }
+
   render() {
+    console.log(this.state)
     return (
       <div>
        <NavBars navBarText={this.state.navBarText} changePage={this.props.changePage}/>
        <div className="assetsWrap">
-        <div className="collect">¥<span>{this.state.collect}</span>元</div>
+        <div className="collect">¥<span>{this.state.money-this.state.collect}</span>元</div>
         <div className="buttonWrap"><Buttons  changePage={this.props.changePage} toPage='create_assets' buttonText='去统计资产'/></div>
         <div className="tips">tip:总资产使用统计自己每个月内的消费的情况</div>
        </div>

+ 64 - 8
src/case/BillApp/src/components/Create_assets/Create_assets.jsx

@@ -3,6 +3,14 @@ import {  WhiteSpace } from 'antd-mobile';
 
 import NavBars from '../common/NavBar'
 import Input from '../common/Input'
+import Buttons from '../common/Button'
+
+
+import {graphqls} from '../../api/graphql_request'
+import {CREATE_ASSETS,ASSETS_BY_PROPS,UPDATE_ASSETS} from '../../api/graphql/assets'
+import config from '../../api/url_config'
+
+const user_id=config.APPID
 
 
 
@@ -10,23 +18,71 @@ class CreateAssets extends Component {
   constructor(props){
     super(props)
     this.state={
-      navBarText:'统计资产'
+      navBarText:'统计资产',
+      assetsList:[],
+      name:'',
+      money:0
     }
+    this.save=this.save.bind(this)
+  }
+
+
+  componentDidMount() {
+    this.getAssets({user_id})
   }
+
+  getAssets(data){
+    graphqls(ASSETS_BY_PROPS,data).then((e)=>{
+      this.setState({
+        assetsList:e.assetsbyprops,
+        money:e.assetsbyprops[0].money||0
+      })
+    })
+
+    this.handleChange=this.handleChange.bind(this)
+  }
+
+  renderList(){
+
+
+  }
+
+  handleChange(e){
+    this.setState({money:e})
+  }
+
+  save(){
+    let that=this
+    console.log('money',this.state)
+    let data={
+      user_id:user_id,
+      money:this.state.money
+    }
+    this.updateAssets(data)
+  }
+
+
+  updateAssets(data){
+    graphqls(UPDATE_ASSETS,data).then((e)=>{
+      this.getAssets()
+    })
+  }
+
   render() {
     return (
       <div>
         <NavBars navBarText={this.state.navBarText} changePage={this.props.changePage} page={'assets'}/>
-        <div style={{fontSize:"10px",coloe:"#ccc"}}>我拥有:</div>
-        <Input title="金额" callback={this.setMoney} value={this.state.money} />
-        <WhiteSpace />
-        <Input title="金额" callback={this.setMoney} value={this.state.money} />
-        <WhiteSpace />
-        <Input title="金额" callback={this.setMoney} value={this.state.money} />
-        <WhiteSpace />
+        <div style={{display:"flex",justifyContent:"center",flexDirection: "column",alignItems: "center",height:"500px"}}>
+          <div style={{fontSize:"10px",coloe:"#ccc",padding:"10px"}}>我拥有:</div>
+          <WhiteSpace/>
+          <Input title="财富值" callback={this.handleChange} value={this.state.money} />
+          <WhiteSpace/>
+          <div style={{width:"300px"}}><Buttons buttonText={"确认修改"}  changePage={this.save}/></div>
+        </div>
       </div>
     );
   }
+
 }
 
 export default CreateAssets;

+ 6 - 4
src/case/BillApp/src/components/My/My.jsx

@@ -4,6 +4,8 @@ import React, { Component } from 'react'
 import NavBars from '../common/NavBar'
 import Head from '../common/Head'
 import Lists from '../common/List'
+import {successToast} from '../common/Toast'
+
 
 export default class My extends Component {
   constructor(props){
@@ -21,19 +23,19 @@ export default class My extends Component {
   }
 
   myAccount(){
-
+    this.props.changePage('account')
   }
 
   myAssets(){
-
+    successToast('待后续开发',1)
   }
 
     
   contactServer(){
-    
+    successToast('待后续开发',1)
   }
   feedback(){
-
+    successToast('待后续开发',1)
   }
 
   render() {

+ 2 - 1
src/case/BillApp/src/components/common/Input.jsx

@@ -14,9 +14,10 @@ export default class Input extends Component {
         <List>
             <InputItem
                 clear
+                data-name={this.props.name}
                 value={value}
                 placeholder={placeholder}
-                ref={el => this.autoFocusInst = el}
+                ref={(el) => {}}
                 extra={<span style={extra}></span>}
                 disabled={disabled}
                 onChange={(e)=>{callback(e)}}

+ 0 - 1
src/case/BillApp/src/components/common/NavBar.jsx

@@ -4,7 +4,6 @@ import { NavBar, Icon } from 'antd-mobile';
 import {PageContext} from '../context'
 
 
-
 export default class NavBars extends Component{
     render(){
         let page=this.props.page||'home'