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