Commit a9a1ed0c authored by maple's avatar maple

[new]小区列表组件、未完成、(接口应该为数组非数字符串)

parent 78b644a4
import * as service from '../services/Init';
import { message } from 'antd';
import { routerRedux } from 'dva/router'
export default {
namespace: 'Init',
state: {
CommunityList: '',
},
reducers: {
returnCommunityList(state, { CommunityList }) {
return { ...state, CommunityList };
},
},
effects: {
//获取物业费列表
*tosCommunityget({ playload }, { call, put }) {
console.log(playload)
const resp = yield call(service.tosCommunityget, playload);
console.log(resp)
let CommunityList = resp.data.communityList;
yield put({ type: 'returnCommunityList', CommunityList, });
},
},
};
......@@ -13,7 +13,7 @@ import SelectOptions from '../../../components/SelectOptions/index';
const ServiceProviderManagement = (props: any) => {
const { formatMessage } = useIntl();
const { dispatch, location,Data } = props;
const { dispatch, location,Data,CommunityList} = props;
const get = (values:any) => {dispatch({type: 'ServiceProvider/get',playload:values})};
useEffect(() => {
get(null)
......@@ -67,10 +67,10 @@ const ServiceProviderManagement = (props: any) => {
return (
<div className={styles.base}>
{/* 头部组件 */}
<h1>CommunityList({CommunityList[0]}):{CommunityList}</h1>
<Form ref={formRef} name="basic" initialValues={{}} onFinish={onFinish} onFinishFailed={onFinishFailed}>
<div className={styles.box}><Form.Item name="providerName" ><Input style={{width:200}} placeholder="Service Provider" /></Form.Item></div>
<SelectOptions list={["美国","美丽的","美好","加拿大","加油","XO"].sort()} onSubmit={printContent}/>
<SelectOptions list={CommunityList} onSubmit={printContent}/>
<Form.Item><button className={styles.item3}>Search</button></Form.Item>
</Form>
{/* 内容组件 */}
......@@ -89,8 +89,10 @@ const ServiceProviderManagement = (props: any) => {
function mapStateToProps(state:any) {
const { Data } = state.ServiceProvider;
const { CommunityList } = state.Init;
return {
Data
Data,
CommunityList
};
}
......
CompanyName Sunshine Stab
FullName
\ No newline at end of file
......@@ -8,32 +8,21 @@ import Line from '../../components/Line/Line';
import BackButton from '../../components/BackButton/BackButton';
import TitleGet from '../../components/TitleGet/TitleGet';
const Guard = () => {
const Guard = (props:any) => {
const { dispatch, CommunityList } = props;
const tosCommunityget = (values:any) => {dispatch({type: 'Init/tosCommunityget',playload:values})};
useEffect(() => {
tosCommunityget(null)
}, []);
return (
<div className={styles.base}>
<div className={styles.item0}><TitleGet title={"Edit Security Guard Account"}/></div>
<div className={styles.item0_1}>Status:Normal</div>
<div className={styles.item0_1}>Registration Date:23-03-2020</div>
<div className={styles.item2}><BackButton/></div>
<div className={styles.clear0}></div>
<div className={styles.item1}>Company Name</div>
<div className={styles.item1_1} >123</div>
<div className={styles.clear1}></div>
<div className={styles.item1} >Full Name</div>
<div className={styles.item1_1} >123</div>
<div className={styles.clear1} ></div>
<div className={styles.item1} >Contact Details</div>
<div className={styles.item1_1} >12312</div>
<div className={styles.item1} style={{ marginLeft: 32,width:40}} >Email</div>
<div className={styles.item1_1} >123123213</div>
<div className={styles.clear1}></div>
<div className={styles.item0}><TitleGet title={"This is a test"}/></div>
<h1>{CommunityList}</h1>
<Line />
<Button>Cancellation</Button>
......@@ -43,5 +32,11 @@ const Guard = () => {
);
};
function mapStateToProps(state:any) {
const { CommunityList } = state.Init;
return {
CommunityList
};
}
export default Guard;
export default connect(mapStateToProps)(Guard);
import request from '@/utils/request';
export function tosCommunityget(values: any) {
console.log(values)
return request('/tos/tosCommunity/get',{method: 'POST',body: JSON.stringify(values),headers:{ 'Content-Type': 'application/json'}})
}
\ No newline at end of file
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