Commit aa75caec authored by LeeJiancong's avatar LeeJiancong

对接会员支付配置,和无配置时效果

parent 4845a885
......@@ -98,9 +98,9 @@ export function render(oldRender: Function) {
export function onRouteChange({ routes, matchedRoutes, location, action }) {
console.log('onRouteChange')
// if (isDev) {
// return;
// }
if (isDev) {
return;
}
if (whiteLists.includes(location.pathname)) return;
......
.init-img {
width: 400px;
height: 300px;
}
.right {
padding: 64px 0 0 64px;
}
.right .title {
font-size: 32px;
font-weight: 600;
color: black;
}
.right .btn {
margin-top: 48px;
width: 80px;
height: 32px;
line-height: 32px;
}
.init-img{
width: 400px;
height: 300px;
}
.right{
padding: 64px 0 0 64px;
.title{
font-size: 32px;
font-weight: 600;
color: black;
}
.btn{
margin-top: 48px;
width: 80px;
height: 32px;
line-height: 32px;
}
}
\ No newline at end of file
import React, { Component } from 'react'
import {Card,Row,Col,Space,Button} from 'antd'
import style from './initBase.less'
const initBase :React.FC<{}> = (props:any) => {
const initImg = require('../../../../public/static/imgs/icon_initpayBase@2x.png')
return (
<Card>
<Row>
<Col pull={6} push={6}>
<Row>
<Col span={12}>
<img className={style['init-img']} src={initImg}/>
</Col>
<Col span={12} className={style['right']}>
<Space direction="vertical">
<div className={style['title']}>抱歉</div>
<div>平台还未配置您的支付方式,请联系平台客服</div>
<Button className={style['btn']} type="primary" size='small'>联系客服</Button>
</Space>
</Col>
</Row>
</Col>
</Row>
</Card>
)
}
export default initBase
\ No newline at end of file
/*
* @Author: LeeJiancong
* @Date: 2020-08-13 09:50:41
* @Date: 2020-08-19 15:25:54
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-08-20 16:04:56
* @Copyright: 1549414730@qq.com
* @LastEditTime: 2020-08-21 18:19:53
*/
import React, { useEffect, useState, useRef } from 'react'
import { Card, Button, Tabs, Radio, Space, Row, Col, Table,Popconfirm,Input } from 'antd'
......@@ -12,6 +13,7 @@ import EyePreview from '@/components/EyePreview'
import { createFormActions, FormEffectHooks, useFormEffects } from '@formily/antd'
import { GlobalConfig } from '@/global/config'
import { ColumnType } from 'antd/lib/table/interface'
import InitBase from '../components/initBase'
import SettingModal from '../components/settingModal'
import { PublicApi } from '@/services/api'
import { history } from 'umi'
......@@ -33,7 +35,13 @@ const PaySetting: React.FC<{}> = () => {
const [initialValues, setinitialValues] = useState({})
const [type, settype] = useState<any>(null)
const [hasEdit, sethasEdit] = useState<boolean>(false)
const [showInput, setshowInput] = useState(true)
/**
* @description: isSetting
* @param {type} 默认为已从pass平台为此账号配置好了策略
* @return {type}
*/
const [isSetting, setisSetting] = useState(true)
const [showInput, setshowInput] = useState(true) //是否显示授权
const [initParam, setinitParam] = useState({//授权参数
code:'',
value:'',
......@@ -50,7 +58,7 @@ const PaySetting: React.FC<{}> = () => {
})
const handleAddMemberBtn = (id: string | number, type: number) => {
console.log('id', id, 'type', type)
// console.log('id', id, 'type', type)
setmode(0)
settype(type)
setvisible(true)
......@@ -139,9 +147,6 @@ const PaySetting: React.FC<{}> = () => {
}
// const tableAddButton = <Button style={{ marginBottom: 16 }} block icon={<PlusOutlined />} onClick={() => handleAddMemberBtn(1)} type='dashed'>新增参数配置1</Button>
// const tableAddButton2 = <Button style={{ marginBottom: 16 }} block icon={<PlusOutlined />} onClick={() => handleAddMemberBtn(2)} type='dashed'>新增参数配置2</Button>
// const tableAddButton3 = <Button style={{ marginBottom: 16 }} block icon={<PlusOutlined />} onClick={() => handleAddMemberBtn(3)} type='dashed'>新增参数配置3</Button>
const tableColumns: ColumnType<any>[] = [
{ dataIndex: 'code', title: '参数代码', align: 'center' },
{ dataIndex: 'value', align: 'center', title: '参数值', render: (_, record) => <EyePreview url={`/memberCenter/memberAbility/manage/addMember?id=${record.memberId}&preview=1`}>{_}</EyePreview> },
......@@ -166,7 +171,8 @@ const PaySetting: React.FC<{}> = () => {
let { id, isPitchOn, payParametersList, payParametersListResponses } = res.data
setisPitchOn(isPitchOn)
if(id == 6){
let {id,code,value,describe} = payParametersListResponses[0] || {}
setinitParam({...initParam,code,value,describe})
}else{
payParametersList = payParametersList ? payParametersList : []
......@@ -187,23 +193,22 @@ const PaySetting: React.FC<{}> = () => {
settabid(ids[0])
initBase(ids[0])
}
}else{
setisSetting(false)
}
})
// let ids = TabList.map((v, i) => v.id)
// settabid(ids[0])
// const init = setTimeout(() => {
// tabid = tabid ? tabid : ids[0]
// initBase(tabid)
// }, 1000)
return () => {
// clearTimeout(init)
}
}, [])
const useTabEffects = () => {
}
//提交表单
/**
* @description: 提交表单 保存
* @param {type}
* @return {type}
*/
const handleSubmit = () => {
let list: any = []
if (tabid == 1) {
......@@ -213,6 +218,7 @@ const PaySetting: React.FC<{}> = () => {
} else if(tabid == 6){
list = [{
type: type,
code: initParam.code,
value: initParam.value,
describe: initParam.describe
......@@ -247,6 +253,9 @@ const PaySetting: React.FC<{}> = () => {
}
const changeTab = (tab) => {
settabid(tab)
if(tab == 6){//授信
settype(tab)
}
initBase(tab)
}
const changeRadio = (e) => {
......@@ -275,6 +284,8 @@ const PaySetting: React.FC<{}> = () => {
</Button>
}
>
{
isSetting &&
<Card>
<Tabs onTabClick={(e) => changeTab(e)} type="card">
......@@ -350,7 +361,14 @@ const PaySetting: React.FC<{}> = () => {
onOK={(list) => handleModalOK(list)}
/>
</Card>
}
{
isSetting === false &&
<InitBase/>
}
</PageHeaderWrapper>
)
}
export default PaySetting
\ 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