Commit 9079fcbd authored by Bill's avatar Bill

Merge branch 'dev' of 10.0.0.22:lingxi/lingxi-business-paltform into dev

parents a18d32d0 1344f209
......@@ -34,7 +34,7 @@ export const productModalByMemberSchema: ISchema = {
"x-component-props": {
placeholder: '请选择品类',
className: 'fixed-ant-selected-down', // 该类强制将显示的下拉框出现在select下, 只有这里出现问题, ??
fetchSearch: PublicApi.getProductSelectGetSelectCustomerCategory,
fetchSearch: PublicApi.getProductSelectGetMemberCategory,
style: {
width: 160
}
......@@ -45,7 +45,7 @@ export const productModalByMemberSchema: ISchema = {
"x-component": 'SearchSelect',
"x-component-props": {
placeholder: '请选择品牌',
fetchSearch: PublicApi.getProductSelectGetSelectBrand,
fetchSearch: PublicApi.getProductSelectGetMemberBrand,
style: {
width: 160
}
......
......@@ -16,7 +16,7 @@ const { TabPane } = Tabs
const PayWaySetTemplate: React.FC<{}> = () => {
const [config, setconfig] = useState<any>([]);
const [payItem, setPayItem] = useState<any>([]);
const [step, setStep] = useState<Array<number>>([]);
// const [step, setStep] = useState<Array<number>>([]);
const [obj, setObj] = useState<any>({});
const payWayConfigInfo = () => {
// 支付配置信息
......@@ -29,76 +29,76 @@ const PayWaySetTemplate: React.FC<{}> = () => {
})
}
const initPayWayStart = (id: any) => {
return new Promise(resolve => {
PublicApi.getPayMemberQueryPlatformIsStart({ id }).then(res => {
if (res.code === 1000) {
if (res.data) {
resolve(res)
}
}
})
}).then((res: any) => {
const data = [...payItem];
if (data.length > 0) {
data.forEach((item: any) => {
if (item.id === res.data.id) {
item.id = res.data.id;
item.isPitchOn = res.data.isPitchOn;
item.payParametersList = res.data.payParametersList;
item.payParametersAddListRequests = res.data.payParametersListResponses;
item.payType = res.data.payType;
item.way = res.data.way;
}
})
setPayItem([...data])
}
})
}
// const initPayWayStart = (id: any) => {
// return new Promise(resolve => {
// PublicApi.getPayMemberQueryPlatformIsStart({ id }).then(res => {
// if (res.code === 1000) {
// if (res.data) {
// resolve(res)
// }
// }
// })
// }).then((res: any) => {
// const data = [...payItem];
// if (data.length > 0) {
// data.forEach((item: any) => {
// if (item.id === res.data.id) {
// item.id = res.data.id;
// item.isPitchOn = res.data.isPitchOn;
// item.payParametersList = res.data.payParametersList;
// item.payParametersAddListRequests = res.data.payParametersListResponses;
// item.payType = res.data.payType;
// item.way = res.data.way;
// }
// })
// setPayItem([...data])
// }
// })
// }
const handleTabClick = (key: any) => {
if (!step.includes(Number(key))) {
initPayWayStart(key);
}
const data = [...step, Number(key)];
let arr = [...new Set(data)]
setStep(arr);
}
// const handleTabClick = (key: any) => {
// if (!step.includes(Number(key))) {
// initPayWayStart(key);
// }
// const data = [...step, Number(key)];
// let arr = [...new Set(data)]
// setStep(arr);
// }
useEffect(() => {
// 支付配置信息
payWayConfigInfo().then((res: any) => {
const id = res[0].id;
const arr: any[] = [];
console.log(res)
res.forEach((item: any) => {
arr.push({
id: item.id,
way: item.way,
isPitchOn: item.isPitchOn ? item.isPitchOn : 0,
payType: item.payType,
payParametersList: [],
payParametersAddListRequests: []
payParametersList: item.payParametersList ? item.payParametersList : [],
payParametersAddListRequests: item.payParametersListResponses ? item.payParametersListResponses : []
})
})
setStep([...step, id])
setconfig(res);
/**第一次运行 */
PublicApi.getPayMemberQueryPlatformIsStart({ id }).then(res => {
arr.forEach((item: any, index: number) => {
if (res.data) {
if (item.id === id) {
item.id = res.data.id;
item.isPitchOn = res.data.isPitchOn;
item.payParametersList = res.data.payParametersList;
item.payParametersAddListRequests = res.data.payParametersListResponses;
item.payType = res.data.payType;
item.way = res.data.way;
}
}
})
console.log(arr)
// setStep([...step, id])
setconfig([...res]);
// /**第一次运行 */
// PublicApi.getPayMemberQueryPlatformIsStart({ id }).then(res => {
// arr.forEach((item: any, index: number) => {
// if (res.data) {
// if (item.id === id) {
// item.id = res.data.id;
// item.isPitchOn = res.data.isPitchOn;
// item.payParametersList = res.data.payParametersList;
// item.payParametersAddListRequests = res.data.payParametersListResponses;
// item.payType = res.data.payType;
// item.way = res.data.way;
// }
// }
// })
// console.log(arr)
setPayItem([...arr]);
})
// })
})
}, [])
......@@ -161,18 +161,24 @@ const PayWaySetTemplate: React.FC<{}> = () => {
/** */
const handleBlur = (e, name, idx) => {
const data = [...payItem];
const assginObj = {...obj, ...{[name]: e.target.value}}
setObj(assginObj)
const arr: any[] = []
arr.push(assginObj)
data[idx].payParametersAddListRequests = [...arr]
const payParametersAddListRequests = data[idx].payParametersAddListRequests;
payParametersAddListRequests.map(item => {
for(let key in item) {
if(key === name) {
item[key] = e.target.value
}
}
item.type = 6;
})
data[idx].payParametersAddListRequests = [...payParametersAddListRequests]
setPayItem(data)
}
return (
<PageHeaderWrapper
extra={<Button type='primary' onClick={onHnadleSubmit}>保存</Button>}
>
<Card>
<Tabs type="card" onTabClick={handleTabClick}>
<Tabs type="card">
{config.map((item: any, idx: number) =>
<TabPane tab={item.way} key={item.id} forceRender>
<>
......
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