提交 4101203e authored 作者: zhouhuan's avatar zhouhuan

个人中心,注销,权属

上级 d22a57c6
......@@ -132,9 +132,9 @@
"integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4="
},
"antd-mobile": {
"version": "2.0.1",
"resolved": "http://registry.npm.taobao.org/antd-mobile/download/antd-mobile-2.0.1.tgz",
"integrity": "sha1-MRvLOMwVwmsBVn77ftd9g5+xGJk=",
"version": "2.0.2",
"resolved": "http://registry.npm.taobao.org/antd-mobile/download/antd-mobile-2.0.2.tgz",
"integrity": "sha1-H/AYqApnWjmAz+JnRgZAgBbBedA=",
"requires": {
"array-tree-filter": "1.0.1",
"babel-runtime": "6.26.0",
......@@ -155,13 +155,13 @@
"rmc-date-picker": "6.0.5",
"rmc-dialog": "1.0.5",
"rmc-feedback": "1.0.2",
"rmc-input-number": "1.0.2",
"rmc-input-number": "1.0.3",
"rmc-list-view": "0.11.3",
"rmc-nuka-carousel": "3.0.0",
"rmc-picker": "5.0.3",
"rmc-pull-to-refresh": "1.0.4",
"rmc-pull-to-refresh": "1.0.5",
"rmc-steps": "1.0.0",
"rmc-tabs": "1.2.10",
"rmc-tabs": "1.2.16",
"rmc-tooltip": "1.0.1",
"rn-topview": "0.1.6"
}
......@@ -6687,7 +6687,7 @@
"requires": {
"dom-align": "1.6.5",
"prop-types": "15.6.0",
"rc-util": "4.1.1"
"rc-util": "4.2.0"
}
},
"rc-animate": {
......@@ -6708,7 +6708,7 @@
"babel-runtime": "6.26.0",
"classnames": "2.2.5",
"prop-types": "15.6.0",
"rc-util": "4.1.1"
"rc-util": "4.2.0"
}
},
"rc-collapse": {
......@@ -6770,7 +6770,7 @@
"classnames": "2.2.5",
"prop-types": "15.6.0",
"rc-animate": "2.4.1",
"rc-util": "4.1.1"
"rc-util": "4.2.0"
}
},
"rc-slider": {
......@@ -6781,8 +6781,8 @@
"babel-runtime": "6.26.0",
"classnames": "2.2.5",
"prop-types": "15.6.0",
"rc-tooltip": "3.6.0",
"rc-util": "4.1.1",
"rc-tooltip": "3.7.0",
"rc-util": "4.2.0",
"shallowequal": "1.0.2",
"warning": "3.0.0"
},
......@@ -6806,32 +6806,32 @@
}
},
"rc-tooltip": {
"version": "3.6.0",
"resolved": "http://registry.npm.taobao.org/rc-tooltip/download/rc-tooltip-3.6.0.tgz",
"integrity": "sha1-VgpQeIKwzRV5/1pc3SsyLhnd2R4=",
"version": "3.7.0",
"resolved": "http://registry.npm.taobao.org/rc-tooltip/download/rc-tooltip-3.7.0.tgz",
"integrity": "sha1-OvvxCYZffNz+Q3UvPz9QH3vjeqo=",
"requires": {
"babel-runtime": "6.26.0",
"prop-types": "15.6.0",
"rc-trigger": "2.1.0"
"rc-trigger": "2.2.2"
}
},
"rc-trigger": {
"version": "2.1.0",
"resolved": "http://registry.npm.taobao.org/rc-trigger/download/rc-trigger-2.1.0.tgz",
"integrity": "sha1-EnAnyROssG380Zpv8CvrRERfTLg=",
"version": "2.2.2",
"resolved": "http://registry.npm.taobao.org/rc-trigger/download/rc-trigger-2.2.2.tgz",
"integrity": "sha1-sMZms3zOTtJzAKfnENZ790RNEq0=",
"requires": {
"babel-runtime": "6.26.0",
"create-react-class": "15.6.2",
"prop-types": "15.6.0",
"rc-align": "2.3.4",
"rc-animate": "2.4.1",
"rc-util": "4.1.1"
"rc-util": "4.2.0"
}
},
"rc-util": {
"version": "4.1.1",
"resolved": "http://registry.npm.taobao.org/rc-util/download/rc-util-4.1.1.tgz",
"integrity": "sha1-k1DpwANotQzY+9kXdcwc+eLKcrI=",
"version": "4.2.0",
"resolved": "http://registry.npm.taobao.org/rc-util/download/rc-util-4.2.0.tgz",
"integrity": "sha1-2s7FBzVnWiEfHJRXEwapDouXJI8=",
"requires": {
"add-dom-event-listener": "1.0.2",
"babel-runtime": "6.26.0",
......@@ -7188,9 +7188,9 @@
}
},
"react-navigation": {
"version": "1.0.0-beta.16",
"resolved": "http://registry.npm.taobao.org/react-navigation/download/react-navigation-1.0.0-beta.16.tgz",
"integrity": "sha1-IOLzQf4XTpvxva+64c0YjG+Y8P8=",
"version": "1.0.0-beta.19",
"resolved": "http://registry.npm.taobao.org/react-navigation/download/react-navigation-1.0.0-beta.19.tgz",
"integrity": "sha1-luFZxLZ2D1H8ktXBw2kHkM/0288=",
"requires": {
"babel-plugin-transform-define": "1.3.0",
"clamp": "1.0.1",
......@@ -7556,7 +7556,7 @@
"requires": {
"babel-runtime": "6.26.0",
"dom-align": "1.6.5",
"rc-util": "4.1.1"
"rc-util": "4.2.0"
}
},
"rmc-calendar": {
......@@ -7607,9 +7607,9 @@
}
},
"rmc-input-number": {
"version": "1.0.2",
"resolved": "http://registry.npm.taobao.org/rmc-input-number/download/rmc-input-number-1.0.2.tgz",
"integrity": "sha1-DaST9i77zcH2j3yJ/GeY4fixSts=",
"version": "1.0.3",
"resolved": "http://registry.npm.taobao.org/rmc-input-number/download/rmc-input-number-1.0.3.tgz",
"integrity": "sha1-fmKgdnNtNi2Ai/zbTSSvX4ncxBc=",
"requires": {
"babel-runtime": "6.26.0",
"classnames": "2.2.5",
......@@ -7650,9 +7650,9 @@
}
},
"rmc-pull-to-refresh": {
"version": "1.0.4",
"resolved": "http://registry.npm.taobao.org/rmc-pull-to-refresh/download/rmc-pull-to-refresh-1.0.4.tgz",
"integrity": "sha1-/lf1BBiNfBqIY+yxy5CckpZZxPc=",
"version": "1.0.5",
"resolved": "http://registry.npm.taobao.org/rmc-pull-to-refresh/download/rmc-pull-to-refresh-1.0.5.tgz",
"integrity": "sha1-hGJqnGpqtXgdONplGYoBnC4Cles=",
"requires": {
"babel-runtime": "6.26.0",
"classnames": "2.2.5"
......@@ -7668,9 +7668,9 @@
}
},
"rmc-tabs": {
"version": "1.2.10",
"resolved": "http://registry.npm.taobao.org/rmc-tabs/download/rmc-tabs-1.2.10.tgz",
"integrity": "sha1-K6/hd0w9mvZlslkHm7jYJZFcfoU=",
"version": "1.2.16",
"resolved": "http://registry.npm.taobao.org/rmc-tabs/download/rmc-tabs-1.2.16.tgz",
"integrity": "sha1-TDonUj70ZMxLBJyRz6wx7ke2yws=",
"requires": {
"babel-runtime": "6.26.0",
"rc-gesture": "0.0.15"
......@@ -7692,7 +7692,7 @@
"requires": {
"babel-runtime": "6.26.0",
"rc-animate": "2.4.1",
"rc-util": "4.1.1",
"rc-util": "4.2.0",
"rmc-align": "1.0.0"
}
},
......
......@@ -32,7 +32,7 @@
"preset": "jest-expo"
},
"dependencies": {
"antd-mobile": "^2.0.1",
"antd-mobile": "^2.0.2",
"dva-core": "^1.1.0",
"dva-loading": "^1.0.3",
"fastjson_ref_resolver": "0.0.3",
......@@ -44,7 +44,7 @@
"react-native-device-info": "^0.12.1",
"react-native-splash-screen": "^3.0.6",
"react-native-vector-icons": "^4.4.2",
"react-navigation": "^1.0.0-beta.14",
"react-navigation": "^1.0.0-beta.19",
"react-redux": "^5.0.6",
"redux-persist": "^4.10.1"
}
......
/* eslint-disable prefer-destructuring,guard-for-in */
import { NavigationActions } from 'react-navigation';
import { fetchDomains, switchDomain, currentDomain } from '../services/domain';
import { getDomain, setDomain } from '../utils/auth';
import { delToken, getDomain, setDomain, delDomain, getUser, delUser } from '../utils/auth';
import { logout } from '../services/login';
const findTarget = (list, dmpath) => {
// 循环 list,元素el
......@@ -59,6 +61,7 @@ export default {
listChildren: [],
arrayPath: [],
cols: '',
userInfo: '',
},
subscriptions: {
......@@ -105,9 +108,29 @@ export default {
yield call(setDomain, name, path);
yield put({ type: 'queryInit', payload: path });
},
*logout(ignored, { put, call }) {
yield call(logout);
yield call(delToken);
yield call(delUser);
yield call(delDomain);
yield put(NavigationActions.navigate({
routeName: 'Login',
}));
},
*getUserInfo(ignored, { put, call }) {
const userInfo = yield call(getUser);
// console.log(userInfo);
yield put({ type: 'queryUserInfo', payload: userInfo });
},
},
reducers: {
queryUserInfo(state, { payload: userInfo }) {
return {
...state,
userInfo,
};
},
queryInit(state, { payload: init }) {
return {
...state,
......
import { getData } from '../../utils/DataTemplate';
import { Toast } from 'antd-mobile';
import { NavigationActions } from 'react-navigation';
import { getData, getMeta } from '../../utils/DataTemplate';
import { datasourceApi } from '../../services/datasource';
export default {
......@@ -6,17 +8,29 @@ export default {
state: {
singularData: {},
enableEdit: false,
metas: [],
},
reducers: {
setList(state, { payload }) {
console.info({ ...state, singularData: payload.singularData });
return { ...state, singularData: payload.singularData };
},
setMeta(state, { payload }) {
return {
...state,
metas: payload,
};
},
setEnable(state, { payload: enableEdit }) {
return { ...state, enableEdit };
},
},
effects: {
*jumpPage({ payload: id }, { put }) {
yield put(NavigationActions.navigate({
routeName: 'HouseDetailEditInfo',
params: { id },
}));
},
*getHouseDetail({ payload }, { call, put }) {
const coordinate = {
containerType: 'module',
......@@ -26,8 +40,10 @@ export default {
const result = yield call(getData, coordinate, { pst: 0, psz: 10, params: { pID: payload } });
const singularData = result[0];
yield put({ type: 'setList', payload: { singularData: { ...singularData } } });
const metas = yield call(getMeta, coordinate);
yield put({ type: 'setMeta', payload: metas });
},
*updateHouseDetail({ payload }, { call }) {
*updateHouseDetail({ payload }, { call, put }) {
const coordinate = {
containerType: 'module',
containerName: 'query-DSRFWInfo',
......@@ -37,6 +53,10 @@ export default {
console.info({ key: payload.id, params: payload.singularData });
const result = yield call(api.update, coordinate, { key: payload.id, params: payload.singularData });
console.info(result);
Toast.success('修改成功!', 0.5);
yield put(NavigationActions.navigate({
routeName: 'HouseList',
}));
},
},
};
......@@ -4,7 +4,7 @@
import React from 'react';
import { createForm } from 'rc-form';
import { View, ScrollView } from 'react-native';
import { List, InputItem, Toast, WhiteSpace } from 'antd-mobile';
import { List, InputItem, Toast, WhiteSpace, WingBlank } from 'antd-mobile';
import Icon from 'react-native-vector-icons/FontAwesome';
import { connect } from 'react-redux';
import { createAction } from '../../../utils';
......@@ -117,19 +117,21 @@ class DSRInfoDetailScreen extends React.Component {
return (
<ScrollView>
<WhiteSpace />
<View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
<Icon.Button
name="edit"
backgroundColor="#08BBF9"
onPress={this.onEdit}
>
编辑
</Icon.Button>
</View>
<WhiteSpace />
<List>
{
metas.map((m) => {
<WingBlank>
<View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
{/* <Icon.Button
name="edit"
backgroundColor="#08BBF9"
onPress={this.onEdit}
>
编辑
</Icon.Button> */}
</View>
<WhiteSpace />
<List>
{
metas.map((m) => {
return (
<List.Item
key={m.key}
......@@ -138,9 +140,10 @@ class DSRInfoDetailScreen extends React.Component {
{m.label}
</List.Item>
);
})
}
</List>
})
}
</List>
</WingBlank>
</ScrollView>
);
}
......
......@@ -10,21 +10,13 @@ import SearchComponent from '../../../components/searchComponent';
class DSRInfoScreeen extends Component {
componentDidMount() {
const { dispatch } = this.props;
console.info('界面加载完成是,输出的searchValue');
console.info(this.props.DSRInfo);
dispatch(createAction('DSRInfo/getDSRList')({ clear: '', pName: this.props.DSRInfo.searchValue }));
}
onSearchSubmit = (pName) => {
console.info('点击搜索时,输出的searchValue前');
console.info(this.props.DSRInfo);
this.props.dispatch(createAction('DSRInfo/getDSRList')({ clear: 'clear', pName }));
console.info('点击搜索时,输出的searchValue后');
console.info(this.props.DSRInfo);
};
onSearchChange = (pName) => {
this.props.dispatch(createAction('DSRInfo/setSearchValue')(pName));
console.info('每次改变的值searchValue');
console.info(this.props.DSRInfo);
};
// 上拉加载更多
onEndReached = () => {
......
import React, { Component } from 'react';
import { View, ScrollView } from 'react-native';
import { List, InputItem, Button, Toast } from 'antd-mobile';
import { View, ScrollView, Text } from 'react-native';
import { List, InputItem, Button, Toast, WhiteSpace, WingBlank } from 'antd-mobile';
import Icon from 'react-native-vector-icons/FontAwesome';
import { createForm } from 'rc-form';
import { connect } from 'react-redux';
import { createAction } from '../../../utils/index';
......@@ -11,157 +12,43 @@ class HouseDetail extends Component {
const { dispatch, ListHouse } = this.props;
dispatch(createAction('HouseDetail/getHouseDetail')(ListHouse.houseID));
}
onSubmit = () => {
this.props.form.validateFields({ force: true }, (error, value) => {
if (!error) {
// 校验成功执行这里的代码
this.props.dispatch(createAction('HouseDetail/updateHouseDetail')({ id: this.props.ListHouse.houseID, singularData: value }));
} else {
// 执行出现错误,弹出错处理
Toast.show('Validation failed');
}
});
};
onReset = () => {
this.props.form.resetFields();
};
validateFWBianMa = (rule, value, callback) => {
if (value) {
callback();
} else {
callback(new Error('At least four charactors for account'));
}
};
modifyInfo = () => {
this.props.dispatch(createAction({ type: 'setEnable', payload: { enableEdit: true } }));
const { ListHouse } = this.props;
this.props.dispatch(createAction('HouseDetail/jumpPage')(ListHouse.houseID));
};
render() {
const { getFieldProps } = this.props.form;
const { fwLouCeng } = this.props.HouseDetail.singularData;
if (this.props.HouseDetail.enableEdit === true) {
return (
<View>
<List>
<InputItem
{...getFieldProps('fwBiaMa', {
initialValue: this.props.HouseDetail.singularData.fwBiaMa,
rules: [
{ required: true, message: '房屋编码不允许为空' },
{ validator: this.validateFWBianMa },
],
})}
clear
placeholder="请输入房屋编码"
ref={(el) => { this.customFocusInst = el; }}
>
房屋编码
</InputItem>
<InputItem
{...getFieldProps('fwDiZhi')}
clear
placeholder="请输入"
ref={(el) => { this.customFocusInst = el; }}
>
房屋地址
</InputItem>
<InputItem
{...getFieldProps('fwLouDongHao')}
clear
placeholder="请输入"
ref={(el) => { this.customFocusInst = el; }}
>
楼栋号
</InputItem>
<InputItem
{...getFieldProps('fwLouCeng')}
clear
placeholder="请输入"
ref={(el) => { this.customFocusInst = el; }}
>
楼层
</InputItem>
<InputItem
{...getFieldProps('fwFangHao')}
clear
placeholder="请输入"
ref={(el) => { this.customFocusInst = el; }}
>
房号
</InputItem>
<InputItem
{...getFieldProps('WangGeBianHao')}
clear
placeholder="请输入房屋编码"
ref={(el) => { this.customFocusInst = el; }}
>
网格
</InputItem>
<InputItem
{...getFieldProps('fwSuoShuJieDao')}
clear
placeholder="请输入"
ref={(el) => { this.customFocusInst = el; }}
>
街道
</InputItem>
<InputItem
{...getFieldProps('fwShenBaoMianJi')}
clear
placeholder="请输入"
ref={(el) => { this.customFocusInst = el; }}
>
申报面积
</InputItem>
<List.Item>
<View style={{ flexDirection: 'row' }}>
<Button type="primary" size="large" onClick={this.onSubmit}>Submit</Button>
<Button size="large" onClick={this.onReset}>Reset</Button>
</View>
</List.Item>
</List>
</View>
);
} else {
// console.log(this.props.HouseDetail);
const { singularData, metas } = this.props.HouseDetail;
const list = metas.map(({ key, label }) => {
const data = singularData[key];
return (
<View>
<Button type="primary" size="small" onClick={this.modifyInfo} >编辑</Button>
<ScrollView showsVerticalScrollIndicator={true}>
<List renderHeader={() => 'Basic Style'} className="my-list">
<List.Item
key={(this.props.HouseDetail.singularData.fwBiaMa)}
extra={(this.props.HouseDetail.singularData.fwBiaMa)}
>
房屋编码
</List.Item>
<List.Item
key={(this.props.HouseDetail.singularData.fwDiZhi)}
extra={(this.props.HouseDetail.singularData.fwDiZhi)}
>
房屋地址
</List.Item>
<List.Item
key={(this.props.HouseDetail.singularData.fwLouDongHao)}
extra={(this.props.HouseDetail.singularData.fwLouDongHao)}
>
楼栋号
</List.Item>
<List.Item key={(fwLouCeng)} extra={(fwLouCeng)}>楼层</List.Item>
<List.Item key={(this.props.HouseDetail.singularData.fwFangHao)} extra={(this.props.HouseDetail.singularData.fwFangHao)}>房号</List.Item>
<List.Item key={(this.props.HouseDetail.singularData.WangGeBianHao)} extra={(this.props.HouseDetail.singularData.WangGeBianHao)}>网格</List.Item>
<List.Item key={(this.props.HouseDetail.singularData.fwSuoShuJieDao)} extra={(this.props.HouseDetail.singularData.fwSuoShuJieDao)}>街道</List.Item>
<List.Item key={(this.props.HouseDetail.singularData.fwSuoShuSheQu)} extra={(this.props.HouseDetail.singularData.fwSuoShuSheQu)}>社区</List.Item>
<List.Item key={(this.props.HouseDetail.singularData.fwShenBaoMianJi)} extra={(this.props.HouseDetail.singularData.fwShenBaoMianJi)}>申报面积</List.Item>
<List.Item key={(this.props.HouseDetail.singularData.fwShenBaoMianJi)} extra={(this.props.HouseDetail.singularData.fwShenBaoMianJi)}>申报面积</List.Item>
<List.Item key={(this.props.HouseDetail.singularData.fwShenBaoMianJi)} extra={(this.props.HouseDetail.singularData.fwShenBaoMianJi)}>申报面积</List.Item>
<List.Item key={(this.props.HouseDetail.singularData.fwShenBaoMianJi)} extra={(this.props.HouseDetail.singularData.fwShenBaoMianJi)}>申报面积</List.Item>
<List.Item key={(this.props.HouseDetail.singularData.fwShenBaoMianJi)} extra={(this.props.HouseDetail.singularData.fwShenBaoMianJi)}>申报面积</List.Item>
<List.Item key={(this.props.HouseDetail.singularData.fwShenBaoMianJi)} extra={(this.props.HouseDetail.singularData.fwShenBaoMianJi)}>申报面积</List.Item>
</List>
</ScrollView>
</View>
<List.Item
key={key}
extra={data}
>
{label}
</List.Item>
);
}
});
return (
<View>
<ScrollView>
<View style={{ flex: 1, flexDirection: 'column' }}>
<WhiteSpace />
<View style={{ width: 80, height: 40 }}>
<Button type="primary" onClick={this.modifyInfo}>编辑</Button>
</View>
<WhiteSpace />
<View>
<List className="my-list">
{list}
</List>
</View>
</View>
</ScrollView>
<WhiteSpace />
</View>
);
}
}
export default createForm()(HouseDetail);
......
/**
* Created by zhouhuan on 2017/11/9.
*/
import { StackNavigator } from 'react-navigation';
import HouseDetail from './HouseDetail';
import EditHouseDetail from './editHouseDetail';
const HouseScreen = StackNavigator(
{
HouseDetailInfo: {
screen: HouseDetail,
},
HouseDetailEditInfo: {
screen: EditHouseDetail,
},
},
{
headerMode: 'none',
navigationOptions: {
gesturesEnabled: false,
},
},
);
export default HouseScreen;
......@@ -70,7 +70,7 @@ class ObligeeInfo extends React.Component {
};
render() {
const { sourceData, isDetail, detailData, editable, disabled } = this.props.obligeeInfo;
console.log(this.props.obligeeInfo);
// console.log(this.props.obligeeInfo);
const data = [sourceData];
// console.log(data);
const { getFieldProps } = this.props.form;
......
/**
* Created by zhouhuan on 2017/11/9.
*/
import React from 'react';
import { View, ScrollView, Text } from 'react-native';
import { List, InputItem, Button, Toast, WhiteSpace } from 'antd-mobile';
import { createForm } from 'rc-form';
import { connect } from 'react-redux';
import { createAction } from '../../../utils/index';
@connect(({ HouseDetail, ListHouse }) => ({ HouseDetail, ListHouse }))
class EditHouseDetail extends React.Component {
componentDidMount() {
const { dispatch, ListHouse } = this.props;
dispatch(createAction('HouseDetail/getHouseDetail')(ListHouse.houseID));
}
onSubmit = () => {
this.props.form.validateFields({ force: true }, (error, value) => {
if (!error) {
this.props.dispatch(createAction('HouseDetail/updateHouseDetail')({ id: this.props.ListHouse.houseID, singularData: value }));
} else {
Toast.show('Validation failed');
}
});
};
onReset = () => {
this.props.form.resetFields();
};
render() {
console.log(this.props.HouseDetail);
const { singularData, metas } = this.props.HouseDetail;
const { getFieldProps } = this.props.form;
const list = metas.map(({ key, label }) => {
const data = singularData[key];
return (
<InputItem
{...getFieldProps(key, {
initialValue: data,
})}
clear
ref={(el) => { this.customFocusInst = el; }}
>
{label}
</InputItem>
);
});
return (
<View>
<ScrollView>
<List>
{list}
<List.Item>
<View style={{ flexDirection: 'row' }}>
<Button type="primary"onClick={this.onSubmit}>保存</Button>
</View>
</List.Item>
</List>
</ScrollView>
</View>
);
}
}
export default createForm()(EditHouseDetail);
import { TabNavigator } from 'react-navigation';
import Empty from '../../empty';
import HouseDetail from './HouseDetail';
import HouseScreen from './HouseScreen';
import ObligeeInfo from './ObligeeInfo';
const ErJiScreen = TabNavigator(
{
HouseDetail: {
screen: HouseDetail,
screen: HouseScreen,
navigationOptions: {
lazy: true,
tabBarLabel: '详细信息',
......
import React, { Component } from 'react';
import { View, Text, Image, StyleSheet } from 'react-native';
import { TabNavigator } from 'react-navigation';
import { View, Text, Image, StyleSheet, ToolbarAndroid, Dimensions } from 'react-native';
import { TabNavigator, StackNavigator } from 'react-navigation';
import Icon from 'react-native-vector-icons/MaterialIcons';
import userInfoPageScreen from './userinfo/index';
import fwInfo from './fwInfo';
......@@ -8,6 +8,7 @@ import peopleInfoErJiScreen from './peopleInfo/index';
import chatsIcon from '../../../image/chats-icon.png';
import Empty from '../empty';
import DSRErJiScreen from './dangshireninfo/index';
import quanshuInfoErJiScreen from './quanshuInfo/index';
import TabBarComponent from '../../components/tabBarComponent';
const Content = TabNavigator({
......@@ -18,7 +19,7 @@ const Content = TabNavigator({
tabBarLabel: '房屋信息',
// Note: By default the icon is only shown on iOS. Search the showIcon option below.
tabBarIcon: () => (
<Icon name="home" size={28} color="#3b5998" />
<Icon name="home" size={28} color="#FFFFFF" />
),
},
},
......@@ -29,21 +30,18 @@ const Content = TabNavigator({
tabBarLabel: '权利人信息',
// Note: By default the icon is only shown on iOS. Search the showIcon option below.
tabBarIcon: () => (
<Icon name="person" size={28} />
<Icon name="person" size={28} color="#FFFFFF" />
),
},
},
QSInfo: {
screen: Empty('权属信息的新增,修改,还可以勾选房子', 'DSRInfoScreen'),
screen: quanshuInfoErJiScreen,
navigationOptions: {
lazy: true,
tabBarLabel: '权属信息',
// Note: By default the icon is only shown on iOS. Search the showIcon option below.
tabBarIcon: () => (
<Image
source={chatsIcon}
style={[styles.icon]}
/>
<Icon name="library-books" size={28} color="#FFFFFF" />
),
},
},
......@@ -54,27 +52,24 @@ const Content = TabNavigator({
tabBarLabel: '人口信息',
// Note: By default the icon is only shown on iOS. Search the showIcon option below.
tabBarIcon: () => (
<Image
source={chatsIcon}
style={[styles.icon]}
/>
),
},
},
UserInfoPageScreen: {
screen: userInfoPageScreen,
navigationOptions: {
lazy: true,
tabBarLabel: '个人中心',
// Note: By default the icon is only shown on iOS. Search the showIcon option below.
tabBarIcon: () => (
<Image
source={chatsIcon}
style={[styles.icon]}
/>
<Icon name="group-add" size={28} color="#FFFFFF" />
),
},
},
// UserInfoPageScreen: {
// screen: userInfoPageScreen,
// navigationOptions: {
// lazy: true,
// tabBarLabel: '个人中心',
// // Note: By default the icon is only shown on iOS. Search the showIcon option below.
// tabBarIcon: () => (
// <Image
// source={chatsIcon}
// style={[styles.icon]}
// />
// ),
// },
// },
}, {
lazy: true,
tabBarPosition: 'bottom',
......@@ -82,31 +77,62 @@ const Content = TabNavigator({
animationEnabled: true,
tabBarOptions: {
activeTintColor: '#e91e63',
inactiveTintColor: 'gray',
inactiveTintColor: '#FFFFFF',
labelStyle: {
fontSize: 12,
},
showIcon: true,
},
});
const MainWindow = StackNavigator(
{
Content: {
screen: Content,
},
personCenter: {
screen: userInfoPageScreen,
},
},
{
headerMode: 'none',
navigationOptions: {
gesturesEnabled: false,
},
},
);
class MainPage extends Component {
onActionSelected = () => {
this.props.navigation.navigate('personCenter');
}
render() {
return (
<View style={{ flex: 1 }}>
<View style={{ height: 36, backgroundColor: '#08BBF9', flexDirection: 'row' }}>
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<View style={{ height: 46, backgroundColor: '#08BBF9', flexDirection: 'row' }}>
{/* <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Text style={{ fontSize: 18, color: 'white', alignSelf: 'center' }}>深圳房屋普查</Text>
</View>
</View> */}
<ToolbarAndroid
title="深圳房屋普查"
style={styles.toolbar}
actions={[{ title: '个人中心', show: 'never' }]}
onActionSelected={this.onActionSelected}
titleColor="#FFFFFF"
/>
</View>
<Content navigation={this.props.navigation} />
<MainWindow navigation={this.props.navigation} />
</View>
);
}
}
MainPage.router = Content.router;
MainPage.router = MainWindow.router;
const styles = StyleSheet.create({
toolbar: {
backgroundColor: '#2196F3',
height: 40,
width: Dimensions.get('window').width,
alignSelf: 'center',
},
icon: {
width: 26,
height: 26,
......
......@@ -2,20 +2,12 @@
* Created by zhouhuan on 2017/11/9.
*/
import { StackNavigator } from 'react-navigation';
import PeopleInfo from './peopelInfo';
import PeopleDetailInfo from './peopleDetailInfo';
import AddPeopleInfo from './addPeopleInfo';
import QuanshuList from './quanshuList';
const quanshuInfoErJiScreen = StackNavigator(
{
peopleInfoList: {
screen: PeopleInfo,
},
peopleInfoDetail: {
screen: PeopleDetailInfo,
},
addPeoppleInfo: {
screen: AddPeopleInfo,
quanshuInfoList: {
screen: QuanshuList,
},
},
{
......
/**
* Created by zhouhuan on 2017/11/13.
*/
/**
* Created by zhouhuan on 2017/11/13.
*/
import React, { Component } from 'react';
import { Text, FlatList, View } from 'react-native';
import { WingBlank, WhiteSpace } from 'antd-mobile';
import { connect } from 'react-redux';
import { createAction } from '../../../utils/index';
import FlatListItem from '../../../components/FlatListItem';
import SearchComponent from '../../../components/searchComponent';
@connect(({ DSRInfo }) => ({ DSRInfo/* , loading: !!loading.effects['obligeeInfo/getObligeeInfo'] */ }))
class QuanshuList extends Component {
componentDidMount() {
const { dispatch } = this.props;
dispatch(createAction('DSRInfo/getDSRList')({ clear: '', pName: this.props.DSRInfo.searchValue }));
}
onSearchSubmit = (pName) => {
this.props.dispatch(createAction('DSRInfo/getDSRList')({ clear: 'clear', pName }));
};
onSearchChange = (pName) => {
this.props.dispatch(createAction('DSRInfo/setSearchValue')(pName));
};
// 上拉加载更多
onEndReached = () => {
// 以下是制造新数据
if (!this.props.loading) {
// console.info('执行了上啦加载');
this.props.dispatch(createAction('DSRInfo/getDSRList')({ clear: '', pName: this.props.DSRInfo.searchValue }));
}
};
onPressItem = (id) => {
this.props.dispatch(createAction('DSRInfo/jumpPage')(id));
};
getItemLayout = (data, index) => (
{ length: 120, offset: (120 + 1) * index, index }
);
/**
* 此函数用于为给定的item生成一个不重复的Key。
* Key的作用是使React能够区分同类元素的不同个体,以便在刷新时能够确定其变化的位置,减少重新渲染的开销。
* 若不指定此函数,则默认抽取item.key作为key值。
* 若item.key也不存在,则使用数组下标
*
* @param item
* @private
*/
// 这里指定使用数组下标作为唯一索引
keyExtractor = item => `${item.id}`;
// Footer布局
renderFooter = () => (
<WingBlank size="lg">
<WhiteSpace size="lg" />
<Text>到底了!!!</Text>
<WhiteSpace size="lg" />
</WingBlank>
);
// 空布局
renderEmptyView = () => (
<WingBlank size="lg">
<WhiteSpace size="lg" />
<Text>当前无内容</Text>
<WhiteSpace size="lg" />
</WingBlank>
);
// 下拉刷新
renderRefresh = () => {
if (!this.props.loading) {
this.props.dispatch(createAction('DSRInfo/getDSRList')({ clear: 'clear', pName: this.props.DSRInfo.searchValue }));
}
};
/**
* 使用箭头函数防止不必要的re-render;
* 如果使用bind方式来绑定onPressItem,每次都会生成一个新的函数,导致props在===比较时返回false,
* 从而触发自身的一次不必要的重新render,也就是FlatListItem组件每次都会重新渲染。
*
* @param id
* @private
*/
renderItem = ({ item }) => {
return (
<FlatListItem
title={item.dangShiRenXingMing}
meta={this.props.DSRInfo.metas}
item={item}
onPressItem={this.onPressItem}
/>
);
};
render() {
return (
<View>
<SearchComponent onSearchSubmit={this.onSearchSubmit} onSearchChange={this.onSearchChange} />
<FlatList
data={this.props.DSRInfo.sourceData}
keyExtractor={this.keyExtractor}
renderItem={this.renderItem}
// 决定当距离内容最底部还有多远时触发onEndReached回调;数值范围0~1,例如:0.5表示可见布局的最底端距离content最底端等于可见布局一半高度的时候调用该回调
onEndReachedThreshold={0.3}
// 当列表被滚动到距离内容最底部不足onEndReacchedThreshold设置的距离时调用
onEndReached={this.onEndReached}
ListFooterComponent={this.renderFooter}
ListEmptyComponent={this.renderEmptyView}
refreshing={this.props.loading || false}
onRefresh={this.renderRefresh}
// 是一个可选的优化,用于避免动态测量内容,+1是加上分割线的高度
/>
</View>
);
}
}
export default QuanshuList;
/* eslint-disable prefer-destructuring */
import React, { PureComponent } from 'react';
import { View, StyleSheet, Dimensions, ScrollView, Text } from 'react-native';
import { View, StyleSheet, Dimensions, ScrollView, Image, Text } from 'react-native';
import { WingBlank, Card, WhiteSpace, List, Button, Toast } from 'antd-mobile';
import { connect } from 'react-redux';
import PickerComponent from '../../../components/pickerComponent';
import { createAction } from '../../../utils/index';
......@@ -10,17 +11,27 @@ const height = Dimensions.get('window').height;
// create a component
@connect(({ userInfo, domain }) => ({ userInfo, domain }))
class UserInfoHomeScreen extends PureComponent {
componentDidMount() {
this.props.dispatch(createAction('domain/getUserInfo')());
}
onClick = () => {
console.log('666');
this.props.dispatch(createAction('domain/fetch')());
};
onPickerChange =(path) => {
// console.log(path);
this.props.dispatch(createAction('domain/fetchParam')(path));
};
onLogout = () => {
console.log('注销');
this.props.dispatch(createAction('domain/logout')());
};
onModify =() => {
Toast.offline('功能正在完善中...', 2);
};
render() {
const { list, listChildren, arrayPath, cols } = this.props.domain;
console.log(arrayPath);
const { list, listChildren, arrayPath, cols, userInfo } = this.props.domain;
// console.log(arrayPath);
console.log(userInfo);
let datas = [];
if (listChildren.length === 0) {
datas = list;
......@@ -28,23 +39,40 @@ class UserInfoHomeScreen extends PureComponent {
datas = listChildren;
}
return (
<View style={{ flex: 1, backgroundColor: '#06C1AE' }}>
<View style={{ position: 'absolute', width, height, backgroundColor: '#06C1AE' }} />
<ScrollView>
<View style={styles.header}>
<View style={styles.userContainer}>
<Text style={styles.avatar} />
<View>
<View style={{ flexDirection: 'row' }}>
<Text style={{ color: 'white' }}>素敌</Text>
<Text style={{ marginLeft: 4 }} />
</View>
<Text style={{ color: 'white', marginTop: 4 }}>个人信息</Text>
</View>
</View>
<View style={{ flex: 1 }}>
{/* <View style={{ position: 'absolute', width, height, backgroundColor: '#06C1AE' }} /> */}
<View style={styles.header}>
<View style={styles.userContainer}>
<Image style={styles.avatar} source={require('./touxiang.png')} />
</View>
</View>
<View style={styles.card}>
<WhiteSpace />
<Card>
<Card.Body>
<List>
<List.Item extra={userInfo.name}>姓名</List.Item>
</List>
<List >
<List.Item extra={userInfo.id}>电话号码</List.Item>
</List>
</Card.Body>
</Card>
<WhiteSpace />
</View>
<View>
<WhiteSpace />
<WingBlank>
<Button type="ghost" onClick={this.onModify}>修改密码</Button><WhiteSpace />
<Button type="ghost" onClick={this.onLogout}>注销</Button><WhiteSpace />
</WingBlank>
<WhiteSpace />
</View>
<WingBlank>
<View style={styles.pickerCom}>
<PickerComponent onClick={this.onClick} onPickerChange={this.onPickerChange} data={datas} pathVal={arrayPath} cols={cols} />
</View>
</ScrollView>
</WingBlank>
</View>
);
}
......@@ -61,15 +89,26 @@ const styles = StyleSheet.create({
userContainer: {
flexDirection: 'row',
alignItems: 'center',
margin: 10,
justifyContent: 'center',
marginTop: 20,
},
avatar: {
width: 50,
height: 50,
width: 80,
height: 80,
marginRight: 10,
borderRadius: 25,
borderRadius: 40,
borderWidth: 2,
borderColor: '#51D3C6',
borderColor: '#ffffff',
},
pickerCom: {
// marginTop: 100,
},
card: {
// height: Dimensions.get('window').height / 2,
marginBottom: 30,
},
cardText: {
textAlign: 'right',
},
});
export default UserInfoHomeScreen;
......@@ -30,3 +30,6 @@ export async function login(payload) {
export async function userInfo() {
return request(`${config.apiContextPath}/api/user/info`);
}
export async function logout() {
return post(`${config.apiContextPath}/api/auth/logout`);
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论