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