Commit 81c7bcb7 authored by cellee's avatar cellee

预约设施全部已检查bug修复

Signed-off-by: cellee's avatarcellee <893264950@qq.com>
parent b883be92
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import styles from './index.less'; import styles from './index.less';
import { Upload, Modal, Row, Col, Input, List, Card, Button } from 'antd';
import { Upload, Modal,Row,Col,Input,List,Card, Button } from 'antd'; import { PlusOutlined, PictureFilled } from '@ant-design/icons';
import { PlusOutlined,PictureFilled } from '@ant-design/icons';
import Picture from './Picture'; import Picture from './Picture';
import { getUrlPicName } from '../../utils/string'; import { getUrlPicName } from '../../utils/string';
const PictureOptions = (props:any) => { const PictureOptions = (props: any) => {
const { value, onChange } = props;
const { value, onChange } = props const [rowkey, setRoKey] = useState(0);
const [rowkey,setRoKey]=useState(0) const [fileList, setFileList] = useState([]);
const [fileList, setFileList] = useState([]) const [fileListLen, setFileListLen] = useState(0);
const [fileListLen, setFileListLen] = useState(0)
const add = () => { const add = () => {
setFileListLen(fileListLen + 1) setFileListLen(fileListLen + 1);
setFileList(fileList => ([...fileList, { uid:fileListLen + 1 ,index: fileListLen + 1, name: null, pic: null }])) setFileList((fileList) => [
} ...fileList,
{ uid: fileListLen + 1, index: fileListLen + 1, name: null, pic: null },
]);
};
useEffect(() => { useEffect(() => {
var tmp = value var tmp = value;
if (tmp != null&&tmp.length>0&&(typeof tmp[0])=="object") { console.log(value);
console.log("图片集合使用默认值") if (tmp != null && tmp.length > 0 && typeof tmp[0] == 'object') {
console.log(tmp) console.log('图片集合使用默认值');
var initArray = new Array() console.log(tmp);
var initArray = new Array();
tmp.map((item: any, index: any) => { tmp.map((item: any, index: any) => {
if (item.pic == null) { if (item.pic == null) {
item.pic = getUrlPicName(item.url) item.pic = getUrlPicName(item.url);
} }
initArray.push({ initArray.push({
index: index, index: index,
...@@ -35,99 +35,108 @@ const PictureOptions = (props:any) => { ...@@ -35,99 +35,108 @@ const PictureOptions = (props:any) => {
pic: item.pic, pic: item.pic,
url: item.url, url: item.url,
uid: index, uid: index,
status:"Done"}) status: 'Done',
}) });
console.log(initArray) });
setFileList(initArray) console.log(initArray);
setFileListLen(initArray.length + 1) setFileList(initArray);
onChange( CheckParm(initArray)) setFileListLen(initArray.length + 1);
onChange(CheckParm(initArray));
} }
}, [value]) }, [value]);
const Delete = (index: any, e: any) => {
var tmp = fileList const Delete = (index: any, e: any) => {
var tmp = fileList;
tmp.splice(index, 1); tmp.splice(index, 1);
setFileList(fileList => ([...tmp])) setFileList((fileList) => [...tmp]);
onChange( CheckParm(tmp)) onChange(CheckParm(tmp));
} };
const CheckParm = (values: Array<any>) => { const CheckParm = (values: Array<any>) => {
var tmp = new Array() var tmp = new Array();
values.map((item, index) => { values.map((item, index) => {
if (item.name != null && item.pic != null) { if (item.name != null && item.pic != null) {
tmp.push(item.name+"&"+item.pic) tmp.push(item.name + '&' + item.pic);
} else { } else {
tmp=[] tmp = [];
} }
}) });
return tmp return tmp;
} };
const DeletePictureName = (index: any, values: any) => { const DeletePictureName = (index: any, values: any) => {
var tmp = fileList var tmp = fileList;
tmp[index].pic = null tmp[index].pic = null;
console.log(tmp);
setFileList((fileList) => [...tmp]);
console.log(CheckParm(tmp));
console.log(tmp) onChange(CheckParm(tmp));
setFileList(fileList => ([...tmp])) };
console.log( CheckParm(tmp)); const PictureName = (index: any, values: any) => {
var tmp = fileList;
onChange( CheckParm(tmp)) console.log(fileList);
} tmp[index].pic = values;
const PictureName=(index: any,values:any) => { tmp[index].url = null;
var tmp = fileList console.log('图片文件发生改变');
console.log(fileList) console.log(CheckParm(tmp));
tmp[index].pic = values onChange(CheckParm(tmp));
tmp[index].url = null };
console.log("图片文件发生改变") const InputGet = (index: any, e: any) => {
console.log(CheckParm(tmp)) var tmp = fileList;
onChange( CheckParm(tmp)) if (e.target.value.length == 0) {
} tmp[index].name = null;
const InputGet = (index: any, e: any) => {
var tmp = fileList
if ((e.target.value).length == 0) {
tmp[index].name = null
} else { } else {
tmp[index].name = e.target.value tmp[index].name = e.target.value;
} }
console.log(tmp) console.log(tmp);
console.log(CheckParm(tmp)); console.log(CheckParm(tmp));
onChange(CheckParm(tmp)) onChange(CheckParm(tmp));
} };
return ( return (
<div> <div>
{fileList.map((item, index) => {
{ return (
fileList.map((item, index) => { <Row key={item.index}>
return ( <Col>
<Row key={item.index}> <Picture
<Col><Picture onSubmit={PictureName.bind(this, index)} onDelete={DeletePictureName.bind(this, index)} data={props.data} defaultValue={item.url!=null? [item]:null} disabled={props.disabled} /></Col> onSubmit={PictureName.bind(this, index)}
{/* defaultValue={[item]} */} onDelete={DeletePictureName.bind(this, index)}
<Col> data={props.data}
<Row><Input placeholder={"Facility Name"} onChange={InputGet.bind(this, index)} defaultValue={item.name} disabled={props.disabled}/></Row> defaultValue={item.url != null ? [item] : null}
{ disabled={props.disabled}
props.disabled ? null : />
<Row style={{ marginTop: 20 }}><a onClick={Delete.bind(this, index)}>delete</a></Row> </Col>
} {/* defaultValue={[item]} */}
</Col> <Col>
</Row> <Row>
) <Input
}) placeholder={'Facility Name'}
} onChange={InputGet.bind(this, index)}
defaultValue={item.name}
disabled={props.disabled}
/>
</Row>
{props.disabled ? null : (
<Row style={{ marginTop: 20 }}>
<a onClick={Delete.bind(this, index)}>delete</a>
</Row>
)}
</Col>
</Row>
);
})}
<div> <div>
{ {props.disabled ? null : (
props.disabled?null: <Button type="primary" onClick={add}>
<Button type="primary" onClick={add}>Add New</Button> Add New
} </Button>
)}
</div> </div>
</div> </div>
); );
}; };
export default PictureOptions; export default PictureOptions;
...@@ -22,7 +22,7 @@ const uploadButton = ( ...@@ -22,7 +22,7 @@ const uploadButton = (
import { getUrlPicName } from '../../utils/string'; import { getUrlPicName } from '../../utils/string';
const PictureOptionsRow = (props: any) => { const PictureOptionsRow = (props: any) => {
const { value, onChange, limitNums, over } = props; const { value, onChange, limitNums, over } = props;
const [fileList, setFileList] = useState([]); const [fileList, setFileList] = useState([] as any);
const [previewVisible, setPreviewVisible] = useState(false); const [previewVisible, setPreviewVisible] = useState(false);
const [previewImage, setPreviewImage] = useState(''); const [previewImage, setPreviewImage] = useState('');
const [limitNum, setLimitNum] = useState(5); const [limitNum, setLimitNum] = useState(5);
...@@ -50,8 +50,6 @@ const PictureOptionsRow = (props: any) => { ...@@ -50,8 +50,6 @@ const PictureOptionsRow = (props: any) => {
resultToInside.push(item.name); resultToInside.push(item.name);
}); });
setFileList(result); setFileList(result);
console.log('图片集最初组件');
console.log(resultToInside);
onChange(resultToInside); onChange(resultToInside);
} }
} }
...@@ -63,8 +61,6 @@ const PictureOptionsRow = (props: any) => { ...@@ -63,8 +61,6 @@ const PictureOptionsRow = (props: any) => {
var tmp = props.defaultValue; var tmp = props.defaultValue;
var result = new Array(); var result = new Array();
var resultToInside = new Array(); var resultToInside = new Array();
// console.log('组件');
// console.log(tmp);
tmp.map((item: any, index: any) => { tmp.map((item: any, index: any) => {
if (item.name == null) { if (item.name == null) {
...@@ -113,15 +109,12 @@ const PictureOptionsRow = (props: any) => { ...@@ -113,15 +109,12 @@ const PictureOptionsRow = (props: any) => {
const handleChange = ({ file, fileList }) => { const handleChange = ({ file, fileList }) => {
// 给传递的附加名字 // 给传递的附加名字
// props.data.fileName = fileList[0].name; // props.data.fileName = fileList[0].name;
console.log(props.data);
console.log(fileList);
let tmp = fileList; let tmp = fileList;
setFileList(tmp.filter((file) => !!file.status || file.status == null)); setFileList(tmp.filter((file) => !!file.status || file.status == null));
var result = new Array(); var result = new Array();
fileList.map((item, index) => { fileList.map((item, index) => {
result.push(item.name); result.push(item.name);
}); });
console.log('该过程图片发生改变');
onChange(result); onChange(result);
}; };
......
import { Select,Empty } from 'antd'; import { Select, Empty } from 'antd';
import { SearchOutlined } from '@ant-design/icons'; import { SearchOutlined } from '@ant-design/icons';
const { Option } = Select; const { Option } = Select;
class SearchOptions extends React.Component { class SearchOptions extends React.Purecomponent {
state = {}; state = {};
constructor(props) { constructor(props) {
super(props); super(props);
const {list,defaultValue,disabled} = this.props; const { list, defaultValue, disabled } = this.props;
console.log(props) console.log(props);
// console.log("重要的") // console.log("重要的")
this.state={ this.state = {
data: [], data: [],
value: defaultValue, value: defaultValue,
initflag:false, initflag: false,
list:list list: list,
} };
} }
componentDidUpdate(){ componentDidUpdate(defaultValue) {
if(this.props.defaultValue!=null&&this.props.defaultValue!=this.state.value) if (this.props.defaultValue != null && this.props.defaultValue != this.state.value) {
{ this.setState({ value: this.props.defaultValue });
this.setState({value:this.props.defaultValue})
} }
} }
handleSearch = value => { handleSearch = (value) => {
if (value&&value.length>0) { if (value && value.length > 0) {
// console.log(value) // console.log(value)
// console.log(this.state.list) // console.log(this.state.list)
if(this.state.list!=null){ if (this.state.list != null) {
var tmp=new Array() var tmp = new Array();
var rest=new Array() var rest = new Array();
this.state.list.map((item,index)=>{ this.state.list.map((item, index) => {
if((item.toLowerCase()).indexOf(value.toLowerCase())>-1){ if (item.toLowerCase().indexOf(value.toLowerCase()) > -1) {
if(item[0]==value[0]){ if (item[0] == value[0]) {
tmp.push(item) tmp.push(item);
}else{ } else {
rest.push(item) rest.push(item);
} }
if(this.props.titleSearch){ if (this.props.titleSearch) {
if(item.toLowerCase()===value.toLowerCase()){ if (item.toLowerCase() === value.toLowerCase()) {
this.props.onSubmit(value) this.props.onSubmit(value);
} }
} }
} }
this.setState({ data: tmp.concat(rest.sort()) }); this.setState({ data: tmp.concat(rest.sort()) });
}) });
} }
} else { } else {
this.setState({ data: [] }); this.setState({ data: [] });
} }
}; };
handleChange = value => { handleChange = (value) => {
this.setState({ value }); this.setState({ value });
// console.log(value) // console.log(value)
this.props.onSubmit(value) this.props.onSubmit(value);
}; };
nocontent=()=>{ nocontent = () => {
return( return (
<div> <div>
<div>404</div> <div>404</div>
</div> </div>
) );
} };
render() { render() {
const options = this.state.data.map(d => <Option key={d}>{d}</Option>); const options = this.state.data.map((d) => <Option key={d}>{d}</Option>);
return ( return (
<Select <Select
showSearch showSearch
value={this.state.value} value={this.state.value}
placeholder={"Community Name"} placeholder={'Community Name'}
optionFilterProp="children" optionFilterProp="children"
filterOption={(input, option) => filterOption={(input, option) =>
option.children.toLowerCase().indexOf(input.toLowerCase()) >= 0 option.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
...@@ -79,8 +77,13 @@ class SearchOptions extends React.Component { ...@@ -79,8 +77,13 @@ class SearchOptions extends React.Component {
showArrow={true} showArrow={true}
// filterOption={false} // filterOption={false}
onSearch={this.handleSearch} onSearch={this.handleSearch}
onChange={this.handleChange} onChange={this.handleChange}
notFoundContent={<div><Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />Please enter the correct Community Name!</div>} notFoundContent={
<div>
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
Please enter the correct Community Name!
</div>
}
style={{ width: 200 }} style={{ width: 200 }}
disabled={this.props.disabled} disabled={this.props.disabled}
allowClear allowClear
...@@ -93,7 +96,8 @@ class SearchOptions extends React.Component { ...@@ -93,7 +96,8 @@ class SearchOptions extends React.Component {
export default SearchOptions; export default SearchOptions;
// ReactDOM.render(<SearchInput placeholder="input search text" style={{ width: 200 }} />, mountNode); // ReactDOM.render(<SearchInput placeholder="input search text" style={{ width: 200 }} />, mountNode);
{/* <Select {
/* <Select
showSearch showSearch
style={{ width: 200 }} style={{ width: 200 }}
placeholder="Select a person" placeholder="Select a person"
...@@ -109,5 +113,5 @@ filterOption={(input, option) => ...@@ -109,5 +113,5 @@ filterOption={(input, option) =>
<Option value="jack">Jack</Option> <Option value="jack">Jack</Option>
<Option value="lucy">Lucy</Option> <Option value="lucy">Lucy</Option>
<Option value="tom">Tom</Option> <Option value="tom">Tom</Option>
</Select>, */} </Select>, */
}
...@@ -97,7 +97,7 @@ class SecurityLayout extends React.Component<SecurityLayoutProps, SecurityLayout ...@@ -97,7 +97,7 @@ class SecurityLayout extends React.Component<SecurityLayoutProps, SecurityLayout
// 权限判断 // 权限判断
let auth = false; let auth = false;
if (getCookie('token').length != 0) { if (getCookie('token').length != 0) {
console.log('是否有权限'); // console.log('是否有权限');
isLogin = true; isLogin = true;
// console.log(currentUser?.permission); // console.log(currentUser?.permission);
......
...@@ -4,7 +4,7 @@ import { Link, useIntl, connect, Dispatch, history } from 'umi'; ...@@ -4,7 +4,7 @@ import { Link, useIntl, connect, Dispatch, history } from 'umi';
import { routerRedux } from 'dva/router' import { routerRedux } from 'dva/router'
import {Fromate} from '@/utils/method' import {Fromate,Fromate3} from '@/utils/method'
import { timeToMoment } from '@/utils/time'; import { timeToMoment } from '@/utils/time';
export default { export default {
namespace: 'FacilityBookings', namespace: 'FacilityBookings',
...@@ -185,7 +185,7 @@ export default { ...@@ -185,7 +185,7 @@ export default {
periodType: tmp.periodType, periodType: tmp.periodType,
reservationQuantumTime: tmp.reservationQuantumTime, reservationQuantumTime: tmp.reservationQuantumTime,
categoriesName: Fromate(tmp.categoriesList, reg), categoriesName: Fromate(tmp.categoriesList, reg),
categoriesDetailsImageName:Fromate(tmp.facilitiesImageList,reg2) categoriesDetailsImageName:Fromate3(tmp.facilitiesImageList)
} }
console.log(sourceData) console.log(sourceData)
......
import { Effect, Reducer } from 'umi'; import { Effect, Reducer } from 'umi';
import { queryCurrent, query as queryUsers} from '@/services/user'; import { queryCurrent, query as queryUsers } from '@/services/user';
export interface CurrentUser { export interface CurrentUser {
avatar?: string; avatar?: string;
...@@ -10,7 +10,6 @@ export interface CurrentUser { ...@@ -10,7 +10,6 @@ export interface CurrentUser {
permission?: []; permission?: [];
} }
export interface UserModelState { export interface UserModelState {
currentUser?: CurrentUser; currentUser?: CurrentUser;
} }
...@@ -25,7 +24,7 @@ export interface UserModelType { ...@@ -25,7 +24,7 @@ export interface UserModelType {
}; };
reducers: { reducers: {
saveCurrentUser: Reducer<UserModelState>; saveCurrentUser: Reducer<UserModelState>;
deleteCurrentUser:Reducer<UserModelState>; deleteCurrentUser: Reducer<UserModelState>;
changeNotifyCount: Reducer<UserModelState>; changeNotifyCount: Reducer<UserModelState>;
}; };
} }
...@@ -38,11 +37,8 @@ const UserModel: UserModelType = { ...@@ -38,11 +37,8 @@ const UserModel: UserModelType = {
}, },
effects: { effects: {
*fetch(_, { call, put }) { *fetch(_, { call, put }) {
console.log(call);
console.log(call)
// const response = yield call(queryUsers); // const response = yield call(queryUsers);
// console.error(response) // console.error(response)
// yield put({ // yield put({
...@@ -51,15 +47,15 @@ const UserModel: UserModelType = { ...@@ -51,15 +47,15 @@ const UserModel: UserModelType = {
// }); // });
}, },
*fetchCurrent({ playload }, { call, put }) { *fetchCurrent({ playload }, { call, put }) {
console.log("response") // console.log("response")
const response = yield call(queryCurrent,playload); const response = yield call(queryCurrent, playload);
console.log(response) // console.log(response)
yield put({ yield put({
type: 'saveCurrentUser', type: 'saveCurrentUser',
payload: response, payload: response,
}); });
}, },
*deleteCurrent({playload}, { call, put }) { *deleteCurrent({ playload }, { call, put }) {
yield put({ yield put({
type: 'deleteCurrentUser', type: 'deleteCurrentUser',
}); });
......
...@@ -29,12 +29,14 @@ import { merge } from 'lodash'; ...@@ -29,12 +29,14 @@ import { merge } from 'lodash';
const BookingDetail = (props: any) => { const BookingDetail = (props: any) => {
const { dispatch, location, DataSave, DataSaveDetail, token, load } = props; const { dispatch, location, DataSave, DataSaveDetail, token, load } = props;
console.log(DataSave);
const RA = (index: any, values: any) => { const RA = (index: any, values: any) => {
dispatch({ type: 'FacilityBookings/RA', playload: { index: index, body: values } }); dispatch({ type: 'FacilityBookings/RA', playload: { index: index, body: values } });
}; };
useEffect(() => { useEffect(() => {
if (DataSave != null) { if (DataSave != null && DataSave.managerFeeStatus != 0) {
RA(2, { accountCategoriesId: DataSave.id }); RA(2, { accountCategoriesId: DataSave.id });
} }
}, [DataSave]); }, [DataSave]);
...@@ -57,6 +59,8 @@ const BookingDetail = (props: any) => { ...@@ -57,6 +59,8 @@ const BookingDetail = (props: any) => {
const radioStyle = { display: 'block', height: '50px', lineHeight: '50px' }; const radioStyle = { display: 'block', height: '50px', lineHeight: '50px' };
const formRef = useRef(null); const formRef = useRef(null);
// 切换全额还是部分退款
const backFee = (e: any) => { const backFee = (e: any) => {
if (e.target.value == 1) { if (e.target.value == 1) {
setBackFeeFlag(false); setBackFeeFlag(false);
...@@ -66,12 +70,10 @@ const BookingDetail = (props: any) => { ...@@ -66,12 +70,10 @@ const BookingDetail = (props: any) => {
} }
}; };
// 点击退款
const onFinish = (values: any) => { const onFinish = (values: any) => {
var val = values; var val = values;
// 如果选择了 部分退款 则 需要填写 理由 且不为全额退款的默认值 if (backFeeFlag && val.backMarginFeeReason == null) {
if (curbackFee == DataSaveDetail.marginFee) {
message.error('Please Fill In The Refund Amount Less Than The Full Amount!', 3);
} else if (backFeeFlag && val.backMarginFeeReason == null) {
message.error('Back MarginFee Reason Is Empty!', 3); message.error('Back MarginFee Reason Is Empty!', 3);
} else { } else {
var RAVAL = { var RAVAL = {
...@@ -95,6 +97,7 @@ const BookingDetail = (props: any) => { ...@@ -95,6 +97,7 @@ const BookingDetail = (props: any) => {
const getBackMarginFee = (e: any) => { const getBackMarginFee = (e: any) => {
setCurBackFee(e); setCurBackFee(e);
}; };
// 设置弹窗内容 退押金还是 取消预订
const makeFee = () => { const makeFee = () => {
setModalIteme({ title: 'Deposit And Fee', tab: 2 }); setModalIteme({ title: 'Deposit And Fee', tab: 2 });
setModalVisible(true); setModalVisible(true);
...@@ -103,6 +106,8 @@ const BookingDetail = (props: any) => { ...@@ -103,6 +106,8 @@ const BookingDetail = (props: any) => {
setModalIteme({ title: 'Cancel Reservation', tab: 1 }); setModalIteme({ title: 'Cancel Reservation', tab: 1 });
setModalVisible(true); setModalVisible(true);
}; };
// 弹窗确认
const handleOk = (e: any) => { const handleOk = (e: any) => {
setModalVisible(false); setModalVisible(false);
if (modalItem.tab == 1) { if (modalItem.tab == 1) {
...@@ -115,12 +120,13 @@ const BookingDetail = (props: any) => { ...@@ -115,12 +120,13 @@ const BookingDetail = (props: any) => {
var RAVAL2 = { var RAVAL2 = {
accountCategoriesId: DataSave.id, accountCategoriesId: DataSave.id,
accountName: DataSave.accountName, accountName: DataSave.accountName,
managerFee: DataSaveDetail.managerFee.toString(), managerFee: DataSave.communityManagerFee.toString(),
marginFee: DataSaveDetail.marginFee.toString(), marginFee: DataSave.communityMargin.toString(),
}; };
RA(4, RAVAL2); RA(4, RAVAL2);
} }
}; };
// 隐藏弹窗
const handleCancel = (e: any) => { const handleCancel = (e: any) => {
setModalVisible(false); setModalVisible(false);
}; };
...@@ -164,27 +170,10 @@ const BookingDetail = (props: any) => { ...@@ -164,27 +170,10 @@ const BookingDetail = (props: any) => {
<hr /> <hr />
{DataSaveDetail != null && DataSave.status == 1 && DataSaveDetail.managerFee > 0 ? ( {/* 已交押金且未产生退费 */}
<> {DataSave != null &&
<Row gutter={8} style={{ marginTop: 16 }}> DataSave.managerFeeStatus == 1 &&
<Col>Management Fee Required</Col> DataSave.communityManagerFee > 0 ? (
<Col span={2}>{DataSaveDetail.managerFee}</Col>
</Row>
<Row gutter={8} style={{ marginTop: 16 }}>
<Col>Deposit Required</Col>
<Col span={2}>{DataSaveDetail.marginFee}</Col>
</Row>
<div style={{ marginTop: 16 }}>
<Button type="primary" onClick={makeFee}>
Pay
</Button>
</div>
<Line />
</>
) : null}
{DataSaveDetail != null &&
DataSave.marginFeeStatus == 1 &&
DataSaveDetail.managerFee > 0 ? (
<> <>
<Form <Form
ref={formRef} ref={formRef}
...@@ -194,10 +183,10 @@ const BookingDetail = (props: any) => { ...@@ -194,10 +183,10 @@ const BookingDetail = (props: any) => {
> >
<Descriptions> <Descriptions>
<Descriptions.Item label="Management Expense"> <Descriptions.Item label="Management Expense">
$ {parseInt(DataSaveDetail.managerFee).toFixed(2)} $ {parseInt(DataSave.communityManagerFee).toFixed(2)}
</Descriptions.Item> </Descriptions.Item>
<Descriptions.Item label="Deposit"> <Descriptions.Item label="Deposit">
$ {parseInt(DataSaveDetail.marginFee).toFixed(2)} $ {parseInt(DataSave.communityMargin).toFixed(2)}
</Descriptions.Item> </Descriptions.Item>
</Descriptions> </Descriptions>
...@@ -212,7 +201,7 @@ const BookingDetail = (props: any) => { ...@@ -212,7 +201,7 @@ const BookingDetail = (props: any) => {
<InputNumber <InputNumber
placeholder="00.00" placeholder="00.00"
min={0} min={0}
max={parseInt(DataSaveDetail.marginFee).toFixed(2)} max={parseInt(DataSave.communityMargin).toFixed(2)}
maxLength={6} maxLength={6}
step={0.01} step={0.01}
prefix="$" prefix="$"
...@@ -242,15 +231,40 @@ const BookingDetail = (props: any) => { ...@@ -242,15 +231,40 @@ const BookingDetail = (props: any) => {
</Button> </Button>
</Form.Item> </Form.Item>
</div> </div>
<Line /> <hr />
</Form> </Form>
</> </>
) : null} ) : null}
{/* 未交押金 */}
{DataSave != null && DataSave.status == 1 && DataSave.managerFeeStatus == 0 ? (
<>
<div style={{ paddingBottom: 16 }}>
<Descriptions column={{ xs: 2, sm: 3, md: 4 }} style={{ marginBottom: 6 }}>
<Descriptions.Item label="Management fee required">
$ {parseInt(DataSave.communityManagerFee).toFixed(2)}
</Descriptions.Item>
<Descriptions.Item label="Deposit is required">
$ {parseInt(DataSave.communityMargin).toFixed(2)}
</Descriptions.Item>
</Descriptions>
<Button className="pay" loading={load} onClick={makeFee}>
Go Pay
</Button>
</div>
<hr />
</>
) : null}
{/* 取消预订按钮 */}
{DataSave.status == 1 || DataSave.status == 2 ? ( {DataSave.status == 1 || DataSave.status == 2 ? (
<Button onClick={showModal} loading={load}> <Button onClick={showModal} loading={load}>
Cancel Reservation Cancel Reservation
</Button> </Button>
) : null} ) : null}
{/* 弹窗 */}
<Modal <Modal
okText="Yes" okText="Yes"
cancelText="No" cancelText="No"
...@@ -266,8 +280,10 @@ const BookingDetail = (props: any) => { ...@@ -266,8 +280,10 @@ const BookingDetail = (props: any) => {
</p> </p>
) : ( ) : (
<p> <p>
Are you sure you confirm the payment of {DataSave.subscribeDate}{' '} Confirm receipt of all usage amount of the facility ?
{DataSave.subscribeTime} {DataSave.facilityTitle} <div>
{DataSave.subscribeDate} {DataSave.subscribeTime} {DataSave.facilityTitle}
</div>
</p> </p>
)} )}
</Modal> </Modal>
...@@ -294,36 +310,3 @@ function mapStateToProps(state: any) { ...@@ -294,36 +310,3 @@ function mapStateToProps(state: any) {
} }
export default connect(mapStateToProps)(BookingDetail); export default connect(mapStateToProps)(BookingDetail);
// accountId: ""
// accountName: "小文"
// accountPhone: "15917568033"
// baseQuery: null
// categoriesId: "868871abe5294075863a572d9ed4d533"
// categoriesImageUrl: ""
// categoriesName: ""
// communityId: "2df3a85e28b942edaf03f0ed765ff897"
// communityName: "A7"
// count: 0
// createTime: {date: 20, day: 4, hours: 17, minutes: 20, month: 7, …}
// deleted: 0
// description: ""
// extend: ""
// facilitiesId: "868871abe5294075863a572d9ed4d511"
// facilityTitle: ""
// id: "7b664a44a2a34add819f391dcb23675b"
// managerFeeStatus: 1
// marginFeeStatus: 1
// pageNum: 0
// status: 4
// subscribeDate: "2020-09-12"
// subscribeTime: "09:00,10:00"
// 预订状态
// 下单时间
// 服务小区
// 预订设施
// 预订时间
// 用户姓名
// 联系电话
// 单元
...@@ -63,6 +63,8 @@ const Bookings = (props: any) => { ...@@ -63,6 +63,8 @@ const Bookings = (props: any) => {
const [result, setResultTime] = useState(resultTime); // 已预约时间段 const [result, setResultTime] = useState(resultTime); // 已预约时间段
const [soltTime, setSoltTime] = useState(['', '']); // 已选时间 const [soltTime, setSoltTime] = useState(['', '']); // 已选时间
const [bookTime, setBookTime] = useState(1); // 默认延后预订时间
useEffect(() => { useEffect(() => {
if (DataSave != null) { if (DataSave != null) {
console.log('页面进入参数'); console.log('页面进入参数');
...@@ -177,6 +179,7 @@ const Bookings = (props: any) => { ...@@ -177,6 +179,7 @@ const Bookings = (props: any) => {
// console.log(comminityValues) // console.log(comminityValues)
// console.log(tmp) // console.log(tmp)
}; };
// 选择
const RadioChoose = (e: any) => { const RadioChoose = (e: any) => {
Data3.map((item: any, index: any) => { Data3.map((item: any, index: any) => {
item.categorieList.map((thing: any, i: any) => { item.categorieList.map((thing: any, i: any) => {
...@@ -192,7 +195,8 @@ const Bookings = (props: any) => { ...@@ -192,7 +195,8 @@ const Bookings = (props: any) => {
// 选择后取消输入框禁止 // 选择后取消输入框禁止
setProhibit(false); setProhibit(false);
// 赋值给延后天数
setBookTime(-thing.pageSize);
// console.log(item.communityManagerFee) // console.log(item.communityManagerFee)
// console.log(item.communityMargin) // console.log(item.communityMargin)
} }
...@@ -217,7 +221,7 @@ const Bookings = (props: any) => { ...@@ -217,7 +221,7 @@ const Bookings = (props: any) => {
// 设置之前时间不能选择 // 设置之前时间不能选择
function disabledDate(current: any) { function disabledDate(current: any) {
return current && current <= moment().subtract(1, 'days').endOf('day'); return current && current <= moment().subtract(bookTime, 'days').endOf('day');
} }
// 确认日期 // 确认日期
...@@ -282,6 +286,7 @@ const Bookings = (props: any) => { ...@@ -282,6 +286,7 @@ const Bookings = (props: any) => {
</Radio>, </Radio>,
); );
}); });
return tmp; return tmp;
})} })}
</Radio.Group> </Radio.Group>
......
...@@ -67,7 +67,7 @@ const Facility = (props: any) => { ...@@ -67,7 +67,7 @@ const Facility = (props: any) => {
const [facilityDetail, setFacilityDetail] = useState(false); const [facilityDetail, setFacilityDetail] = useState(false);
const [PATHNAME, setPATHNAME] = useState(''); const [PATHNAME, setPATHNAME] = useState('');
const formRef = useRef(null); const formRef = useRef(null as any);
// 监听是否选择了小区 // 监听是否选择了小区
const [imgOpen, setImgOpen] = useState(true); const [imgOpen, setImgOpen] = useState(true);
...@@ -96,9 +96,6 @@ const Facility = (props: any) => { ...@@ -96,9 +96,6 @@ const Facility = (props: any) => {
}; };
useEffect(() => { useEffect(() => {
if (sourceData != null) { if (sourceData != null) {
console.log(sourceData);
console.log(DataSave);
setExtend(DataSave.communityName); setExtend(DataSave.communityName);
setSoltTime(sourceData.reservationQuantumTime); // 设置时间 setSoltTime(sourceData.reservationQuantumTime); // 设置时间
...@@ -473,9 +470,13 @@ const Facility = (props: any) => { ...@@ -473,9 +470,13 @@ const Facility = (props: any) => {
</Row> */} </Row> */}
{facilityDetail ? ( {facilityDetail ? (
<> <>
<Button type="primary" onClick={Subscribe} loading={load} disabled={imgOpen}> {imgOpen ? (
Subscribe <Button type="primary" onClick={Subscribe} loading={load} disabled={imgOpen}>
</Button> Subscribe
</Button>
) : (
''
)}
</> </>
) : ( ) : (
<> <>
...@@ -508,19 +509,3 @@ function mapStateToProps(state: any) { ...@@ -508,19 +509,3 @@ function mapStateToProps(state: any) {
}; };
} }
export default connect(mapStateToProps)(Facility); export default connect(mapStateToProps)(Facility);
// ["10:00-12:00","13:00-14:00"]
// defultValue={[{ url: "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png", name: "篮球场A"},{ url: "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png", name: "篮球场B" }]}
// defultValue={[{ url: "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png" }]}
// const Data = {
// canReservationDay: "5",
// canReservationNum: "6",
// cancelReservationDay: "3",
// categoriesOpenTime: "09:00-20:00",
// communityManagerFee: "18",
// communityMargin: "20",
// communityName: "A9",
// facilityName: "篮球场",
// nomarginCancelReservationDay: "4",
// periodType: "2",
// }
...@@ -31,7 +31,6 @@ const FacilityBookings = (props: any) => { ...@@ -31,7 +31,6 @@ const FacilityBookings = (props: any) => {
const { dispatch, location, Data, Data2, token, DataSave, curString, Result, loading } = props; const { dispatch, location, Data, Data2, token, DataSave, curString, Result, loading } = props;
const RA = (index: any, values: any) => { const RA = (index: any, values: any) => {
console.log(values);
dispatch({ dispatch({
type: 'FacilityBookings/RA', type: 'FacilityBookings/RA',
playload: { index: index, body: values }, playload: { index: index, body: values },
...@@ -54,7 +53,6 @@ const FacilityBookings = (props: any) => { ...@@ -54,7 +53,6 @@ const FacilityBookings = (props: any) => {
const [columns2, setColumns2] = useState([]); const [columns2, setColumns2] = useState([]);
const goToFunction = () => { const goToFunction = () => {
console.log(curString.tab);
if (curString.tab == 2) { if (curString.tab == 2) {
CA(); CA();
// 先清空上传图片列表 // 先清空上传图片列表
...@@ -144,9 +142,6 @@ const FacilityBookings = (props: any) => { ...@@ -144,9 +142,6 @@ const FacilityBookings = (props: any) => {
]; ];
setColumns(objectColumns(key)); setColumns(objectColumns(key));
setColumns2(objectColumns(key2)); setColumns2(objectColumns(key2));
console.log('页面刷新');
console.log(DataSave);
console.log(curString);
if (curString.tab == 1) { if (curString.tab == 1) {
RA(9, { RA(9, {
userToken: token, userToken: token,
...@@ -161,8 +156,6 @@ const FacilityBookings = (props: any) => { ...@@ -161,8 +156,6 @@ const FacilityBookings = (props: any) => {
}, []); }, []);
const CallBackTitleSearch = (comment: any) => { const CallBackTitleSearch = (comment: any) => {
console.log(comment);
if (curString.tab == 1) { if (curString.tab == 1) {
if (comment.communityName != null || comment.key != null || comment.status != null) { if (comment.communityName != null || comment.key != null || comment.status != null) {
var tmp = curString; var tmp = curString;
...@@ -175,7 +168,6 @@ const FacilityBookings = (props: any) => { ...@@ -175,7 +168,6 @@ const FacilityBookings = (props: any) => {
tmp.communityNameList = comment.communityName; tmp.communityNameList = comment.communityName;
tmp.curPage = 1; tmp.curPage = 1;
QA(tmp); QA(tmp);
console.log(tmp);
//中断 //中断
RA(9, { RA(9, {
userToken: token, userToken: token,
...@@ -315,8 +307,8 @@ const FacilityBookings = (props: any) => { ...@@ -315,8 +307,8 @@ const FacilityBookings = (props: any) => {
</Button>, </Button>,
]} ]}
options={{ options={{
density: true, density: false,
fullScreen: true, fullScreen: false,
reload: () => { reload: () => {
// onReset(); // onReset();
}, },
...@@ -362,8 +354,8 @@ const FacilityBookings = (props: any) => { ...@@ -362,8 +354,8 @@ const FacilityBookings = (props: any) => {
</Button>, </Button>,
]} ]}
options={{ options={{
density: true, density: false,
fullScreen: true, fullScreen: false,
reload: () => { reload: () => {
// onReset(); // onReset();
}, },
......
...@@ -361,3 +361,17 @@ hr { ...@@ -361,3 +361,17 @@ hr {
text-align: right; text-align: right;
padding: 20px 10px 10px; padding: 20px 10px 10px;
} }
//缴费按钮
.pay {
color: #fff;
background: #f47920;
border-color: #faa755;
&:hover,
&:visited,
&:active,
&:focus {
color: #fff;
border-color: #faa755;
background: #faa755;
}
}
...@@ -98,11 +98,11 @@ function requestAuto(url: string, values: any) { ...@@ -98,11 +98,11 @@ function requestAuto(url: string, values: any) {
} }
export function RA(playload: any) { export function RA(playload: any) {
console.log('playload参数===========================================', playload); // console.log('playload参数===========================================', playload);
var url = requestList[playload.index][0].toString(); var url = requestList[playload.index][0].toString();
console.log(playload.index + '》【发送请求】' + url + ' ' + requestList[playload.index][1]); // console.log(playload.index + '》【发送请求】' + url + ' ' + requestList[playload.index][1]);
console.log('参数如下:'); // console.log('参数如下:');
console.log(playload.body); // console.log(playload.body);
// console.log(JSON.stringify(playload.body)) // console.log(JSON.stringify(playload.body))
return requestAuto(url, playload.body); return requestAuto(url, playload.body);
} }
......
...@@ -5,7 +5,7 @@ export async function query(): Promise<any> { ...@@ -5,7 +5,7 @@ export async function query(): Promise<any> {
} }
export async function queryCurrent(values: any): Promise<any> { export async function queryCurrent(values: any): Promise<any> {
console.log('登录数据=================', values); // console.log('登录数据=================', values);
return request('/tos/user/newCurrentUser', { return request('/tos/user/newCurrentUser', {
method: 'POST', method: 'POST',
body: JSON.stringify(values), body: JSON.stringify(values),
......
...@@ -115,6 +115,23 @@ export const Fromate2 = (values: any, reg: string) => { ...@@ -115,6 +115,23 @@ export const Fromate2 = (values: any, reg: string) => {
return result; return result;
}; };
// 更改返回值
export const Fromate3 = (values: any) => {
if (values != null) {
let arr = [];
for (var i in values) {
let a = {
uid: i,
name: values[i].facilitiesImageName,
url: values[i].facilitiesImageUrl,
status: 'done',
};
arr.push(a);
}
return arr;
}
};
// 获取对象信息 // 获取对象信息
export const getObjectInfo = (test: any) => { export const getObjectInfo = (test: any) => {
console.log(JSON.stringify(test, null, '\t')); console.log(JSON.stringify(test, null, '\t'));
......
// 方法名不能大写 // 方法名不能大写
export const stringSplit = (string: any, rex: any) => { export const stringSplit = (string: any, rex: any) => {
var index = string.lastIndexOf(rex);
var index=string.lastIndexOf(rex); string = string.substring(index + 1, string.length);
string=string.substring(index+1,string.length);
return string; return string;
};
}
// 构建对象 // 构建对象
export const objectColumns=(key:any) => { export const objectColumns = (key: any) => {
const name = ["title", "dataIndex", "render"] const name = ['title', 'dataIndex', 'render'];
var temp = new Array() var temp = new Array();
key.map((items:any) => { key.map((items: any) => {
var values: any = {}; items.map((thing:any, i:any) => { values[name[i]] = thing }); temp.push(values) var values: any = {};
}) items.map((thing: any, i: any) => {
return temp values[name[i]] = thing;
} });
temp.push(values);
});
return temp;
};
//取url中图片名字 //取url中图片名字
export const getUrlPicName=(str:string)=>{ export const getUrlPicName = (str: any) => {
var tmp=str.split("?") if (str.facilitiesImageName) {
var tmp2=tmp[0].split("/") return str.facilitiesImageName;
return(tmp2[tmp2.length-1]) } else {
} var tmp = str.split('?');
var tmp2 = tmp[0].split('/');
return tmp2[tmp2.length - 1];
}
};
//取url中取url最后的参数路径 //取url中取url最后的参数路径
export const getUrlLast = (str: string) => { export const getUrlLast = (str: string) => {
var index = str.lastIndexOf("/") var index = str.lastIndexOf('/');
var tmp =str.substring(0,index) var tmp = str.substring(0, index);
return tmp return tmp;
} };
//取url中取url最后的参数 //取url中取url最后的参数
export const getUrlLastParams = (str: string) => { export const getUrlLastParams = (str: string) => {
var index = str.lastIndexOf("?") var index = str.lastIndexOf('?');
var tmp =str.substring(0,index) var tmp = str.substring(0, index);
return tmp return tmp;
} };
//保留小数点后面的两位数 //保留小数点后面的两位数
export const getNumber = (str: string) => { export const getNumber = (str: string) => {
var index = str.lastIndexOf(".") var index = str.lastIndexOf('.');
var tmp =str var tmp = str;
if (index > -1) { if (index > -1) {
tmp = str.substring(0, index + 3) tmp = str.substring(0, index + 3);
// console.log(tmp) // console.log(tmp)
var k = 0; var k = 0;
for (var i = 0; i < tmp.length; i++) { for (var i = 0; i < tmp.length; i++) {
if (tmp[i] == '.') { k++ }; if (tmp[i] == '.') {
k++;
}
} }
if (k > 1) { if (k > 1) {
tmp = tmp.substring(0, tmp.length-1) tmp = tmp.substring(0, tmp.length - 1);
} }
} }
return tmp return tmp;
} };
//小数转字符串保留两位小数 //小数转字符串保留两位小数
export const numberToString = (values: any)=>{ export const numberToString = (values: any) => {
var a=""+values var a = '' + values;
var b="" var b = '';
if(a.indexOf('.')>-1){ if (a.indexOf('.') > -1) {
b=a b = a;
}else{ } else {
b=a+(".00") b = a + '.00';
} }
return b return b;
} };
//内容缩进 //内容缩进
export const stringTab = (string:any) => { export const stringTab = (string: any) => {
if (string.length > 20) { if (string.length > 20) {
return string.slice(0, 20) + "..." return string.slice(0, 20) + '...';
} }
return string return string;
} };
// if (/[\u4E00-\u9FA5]/g.test(value)||/^[0-9]+.?[0-9]*$/g.test(value)) { // if (/[\u4E00-\u9FA5]/g.test(value)||/^[0-9]+.?[0-9]*$/g.test(value)) {
// callback(new Error('只可输入字母、不能输入汉字!')); // callback(new Error('只可输入字母、不能输入汉字!'));
// } else { // } else {
// callback(); // callback();
// } // }
// const checkInput = (e: any) => { // const checkInput = (e: any) => {
// console.log(e) // console.log(e)
// if (e.target.value.length == 1) { // if (e.target.value.length == 1) {
// message.error("Ower Name Should be limit 2~30!",3) // message.error("Ower Name Should be limit 2~30!",3)
// } // }
// } // }
\ 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