Commit 27cc0691 authored by 前端-许佳敏's avatar 前端-许佳敏

merge

parents 1819e76f b8c29d42
{ {"userRegister":{"useType":{"memberType":[{"id":1,"typeName":"企业会员"},{"id":2,"typeName":"个人会员"},{"id":3,"typeName":"渠道企业会员"},{"id":4,"typeName":"渠道个人会员"}],"businessType":[{"id":1,"typeName":"商品销售"},{"id":2,"typeName":"加工服务"},{"id":3,"typeName":"物流服务"},{"id":4,"typeName":"金融服务"},{"id":5,"typeName":"保险服务"},{"id":6,"typeName":"采购"}]},"useDetail":[{"groupName":"联系信息","elements":[{"id":62,"fieldName":"contact","fieldCNName":"联系人","fieldType":null,"fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":63,"fieldName":"fixed_contact_number","fieldCNName":"固定联系电话","fieldType":null,"fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":64,"fieldName":"phone_number","fieldCNName":"手机号码","fieldType":null,"fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":65,"fieldName":"fax_number","fieldCNName":"传真号码","fieldType":null,"fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":66,"fieldName":"address","fieldCNName":"地址","fieldType":null,"fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":67,"fieldName":"zip_code","fieldCNName":"邮编","fieldType":null,"fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":68,"fieldName":"url","fieldCNName":"网址","fieldType":null,"fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":69,"fieldName":"email","fieldCNName":"邮箱","fieldType":null,"fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]}]},{"groupName":"营业执照信息","elements":[{"id":47,"fieldName":"enterprise_type","fieldCNName":"企业类型","fieldType":null,"fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":48,"fieldName":"residence","fieldCNName":"住所","fieldType":null,"fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":49,"fieldName":"legal_representative","fieldCNName":"法定代表人","fieldType":null,"fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":50,"fieldName":"register_capital","fieldCNName":"注册资本","fieldType":null,"fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":51,"fieldName":"establish_date","fieldCNName":"成立日期","fieldType":null,"fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":52,"fieldName":"business_term","fieldCNName":"营业期限","fieldType":null,"fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":53,"fieldName":"business_scope","fieldCNName":"经营范围","fieldType":null,"fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":54,"fieldName":"registration_authority","fieldCNName":"登记机关","fieldType":null,"fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":55,"fieldName":"registration_time","fieldCNName":"登记时间","fieldType":null,"fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":56,"fieldName":"unified_social_credit_code","fieldCNName":"统一社会信用代码","fieldType":null,"fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":57,"fieldName":"business_license","fieldCNName":"营业执照","fieldType":null,"fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]}]},{"groupName":"填写会员基本信息","elements":[{"id":38,"fieldName":"member_type","fieldCNName":"会员类型","fieldType":null,"fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":39,"fieldName":"MEMBER_ROLE","fieldCNName":"会员角色","fieldType":null,"fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":40,"fieldName":"member_level","fieldCNName":"会员等级","fieldType":null,"fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":41,"fieldName":"REGISTER_PHONE","fieldCNName":"注册手机号","fieldType":null,"fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":42,"fieldName":"register_email","fieldCNName":"注册邮箱","fieldType":null,"fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]}]},{"groupName":"法定代表人信息","elements":[{"id":60,"fieldName":"legal_id_card","fieldCNName":"法人身份证号","fieldType":null,"fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":61,"fieldName":"legal_id_card_information","fieldCNName":"法人身份证信息","fieldType":null,"fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":58,"fieldName":"legal_name","fieldCNName":"法人姓名","fieldType":null,"fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":59,"fieldName":"legal_phone","fieldCNName":"法人手机号","fieldType":null,"fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]}]},{"groupName":"企业信息","elements":[{"id":3,"fieldName":"company_name","fieldCNName":"公司名称","fieldType":null,"fieldLength":128,"fieldEmpty":1,"fieldOrder":1,"fieldRemark":"","checkRules":[]},{"id":4,"fieldName":"company_type","fieldCNName":"公司类型","fieldType":null,"fieldLength":128,"fieldEmpty":0,"fieldOrder":2,"fieldRemark":"","checkRules":[]}]},{"groupName":"填写渠道信息","elements":[{"id":43,"fieldName":"channel_level","fieldCNName":"渠道级别","fieldType":null,"fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":44,"fieldName":"channel_type","fieldCNName":"渠道类型","fieldType":null,"fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":45,"fieldName":"agent_city","fieldCNName":"代理地市","fieldType":null,"fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]},{"id":46,"fieldName":"channel_describe","fieldCNName":"渠道描述","fieldType":null,"fieldLength":100,"fieldEmpty":0,"fieldOrder":1,"fieldRemark":"test","checkRules":[]}]},{"groupName":"444","elements":[{"id":1,"fieldName":"444","fieldCNName":"44","fieldType":null,"fieldLength":44,"fieldEmpty":1,"fieldOrder":44,"fieldRemark":null,"checkRules":[]}]}]},"global":{"logo":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/logo.png","countryList":[{"name":"简体中文-ZH","key":"cn","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/china.png"},{"name":"English-EN","key":"en","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/us.png"},{"name":"日本語-JP","key":"jp","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/japen.png"},{"name":"한국어-KO","key":"ko","icon":"http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/koren.png"}]}}
"userRegister": {
"useType": {
"memberType": [
{
"id": 1,
"typeName": "企业会员"
},
{
"id": 2,
"typeName": "个人会员"
},
{
"id": 3,
"typeName": "渠道企业会员"
},
{
"id": 4,
"typeName": "渠道个人会员"
}
],
"businessType": [
{
"id": 1,
"typeName": "new11"
},
{
"id": 2,
"typeName": "王者农药"
}
]
},
"useDetail": [
{
"groupName": "企业组",
"elements": [
{
"id": 2,
"fieldName": "company",
"fieldCNName": "企业",
"fieldType": null,
"fieldLength": 10,
"fieldEmpty": 0,
"fieldOrder": 1,
"fieldRemark": "test",
"checkRules": []
}
]
},
{
"groupName": "企业信息",
"elements": [
{
"id": 3,
"fieldName": "company_name",
"fieldCNName": "公司名称",
"fieldType": null,
"fieldLength": 128,
"fieldEmpty": 1,
"fieldOrder": 1,
"fieldRemark": "",
"checkRules": []
},
{
"id": 4,
"fieldName": "company_type",
"fieldCNName": "公司类型",
"fieldType": null,
"fieldLength": 128,
"fieldEmpty": 0,
"fieldOrder": 2,
"fieldRemark": "",
"checkRules": []
}
]
},
{
"groupName": "444",
"elements": [
{
"id": 1,
"fieldName": "444",
"fieldCNName": "44",
"fieldType": null,
"fieldLength": 44,
"fieldEmpty": 1,
"fieldOrder": 44,
"fieldRemark": null,
"checkRules": []
}
]
}
]
},
"global": {
"logo": "http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/logo.png",
"countryList": [
{
"name": "简体中文-ZH",
"key": "zh-CN",
"icon": "http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/china.png"
},
{
"name": "English-EN",
"key": "en-US",
"icon": "http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/us.png"
}
]
}
}
\ No newline at end of file
...@@ -19,7 +19,7 @@ const config:any = { ...@@ -19,7 +19,7 @@ const config:any = {
}, },
routes, routes,
extraBabelPlugins: [ extraBabelPlugins: [
['import', { libraryName: 'antd', libraryDirectory: 'es', style: true }, 'antd'], // ['import', { libraryName: 'antd', libraryDirectory: 'es', style: true }, 'antd'],
['import', { libraryName: 'god', libraryDirectory: 'es', style: true }, 'god'] ['import', { libraryName: 'god', libraryDirectory: 'es', style: true }, 'god']
], ],
history: { history: {
......
{ {
"name": "god-template", "name": "god-template",
"scripts": { "scripts": {
"api": "god-ytt",
"scripts:build": "node scripts/run", "scripts:build": "node scripts/run",
"start:analyze": "ANALYZE=1 umi dev", "start:analyze": "ANALYZE=1 umi dev",
"clean": "rimraf node_modules", "clean": "rimraf node_modules",
"start": "umi dev", "start": "yarn scripts:build && umi dev",
"build": "umi build", "build": "umi build",
"build:analyze": "ANALYZE=1 umi build", "build:analyze": "ANALYZE=1 umi build",
"postinstall": "umi generate tmp", "postinstall": "umi generate tmp",
...@@ -49,6 +50,7 @@ ...@@ -49,6 +50,7 @@
"chalk": "^4.1.0", "chalk": "^4.1.0",
"clone": "^2.1.2", "clone": "^2.1.2",
"fs-extra": "^9.0.1", "fs-extra": "^9.0.1",
"god-yapi2ts": "^1.5.0",
"gulp": "^4.0.2", "gulp": "^4.0.2",
"json2ts": "^0.0.7", "json2ts": "^0.0.7",
"ora": "^4.0.4" "ora": "^4.0.4"
......
...@@ -2,7 +2,7 @@ import { IRoutes } from '.'; ...@@ -2,7 +2,7 @@ import { IRoutes } from '.';
import { history, RequestConfig } from 'umi'; import { history, RequestConfig } from 'umi';
import React from 'react' import React from 'react'
import MobxProvider from './store' import MobxProvider from './store'
import 'antd/es/form/style/index.less'; import '@/global/styles/reset.less'; // 重置antd样式
import '@/global/styles/global.less'; // 导入全局样式 import '@/global/styles/global.less'; // 导入全局样式
// 默认引入所有的ant样式, 不引入css因为无法做到变量覆盖 // 默认引入所有的ant样式, 不引入css因为无法做到变量覆盖
......
/**
* 正则表达式集合
*/
export const PATTERN_MAPS = {
// 8-20位, 大小写字幕 + 数字组合
password: /^(?=.*[a-z])(?=.*[A-Z])[a-zA-Z\d]{8,20}$/,
email: /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/,
phone: /^1[3|4|5|6|7|8|9][0-9]{9}$/,
smsCode: /^\d{6}$/
}
\ No newline at end of file
...@@ -129,4 +129,12 @@ h6 { ...@@ -129,4 +129,12 @@ h6 {
.mr_t-40 { .mr_t-40 {
margin-top: 40px; margin-top: 40px;
}
#registerForm {
.ant-input-group-addon {
padding: 0;
border: none;
background: none;
}
} }
\ No newline at end of file
@import './mixins/layout.less';
#root {
.identityRadio{
display: flex;
flex-direction: column;
margin: 0 auto;
.make-center(text);
& label{
width: 320px;
height: 48px;
.make-center-space(margin, 12);
vertical-align: middle;
line-height: 48px;
}
}
.businessRadio{
display: flex;
flex-wrap: wrap;
width: 320px;
.make-center(margin);
.make-center(text);
& label{
width: 148px;
height: 32px;
line-height: 32px;
margin: 8px 0;
}
& label:nth-child(odd) {
margin-right: 24px;
}
}
}
\ No newline at end of file
...@@ -40,7 +40,7 @@ const LoginWrap: React.FC = () => { ...@@ -40,7 +40,7 @@ const LoginWrap: React.FC = () => {
onFinish={finish} onFinish={finish}
> >
<Form.Item <Form.Item
name='username' name='account'
rules={ rules={
[ [
{ {
......
...@@ -176,39 +176,6 @@ ...@@ -176,39 +176,6 @@
.make-center-space(margin, 8); .make-center-space(margin, 8);
} }
.identityRadio {
display: flex;
flex-direction: column;
margin: 0 auto;
.make-center(text);
& label {
width: 320px;
height: 48px;
.make-center-space(margin, 12);
vertical-align: middle;
line-height: 48px;
}
}
.businessRadio {
display: flex;
flex-wrap: wrap;
width: 320px;
.make-center(margin);
.make-center(text);
& label {
width: 148px;
height: 32px;
line-height: 32px;
margin: 8px 0;
}
& label:nth-child(odd) {
margin-right: 24px;
}
}
.formBoxStep3 { .formBoxStep3 {
width: 704px; width: 704px;
......
...@@ -11,11 +11,13 @@ import { FormPage } from 'god' ...@@ -11,11 +11,13 @@ import { FormPage } from 'god'
import { IFormControllers, IFormButtonTypes } from 'god/dist/src/form-page' import { IFormControllers, IFormButtonTypes } from 'god/dist/src/form-page'
import { Link, history } from 'umi' import { Link, history } from 'umi'
import im_success from '../../../mockStatic/im_success.png' import im_success from '../../../mockStatic/im_success.png'
import { postMemberRegister, getRegisterTypeList, postMemberRegisterType } from '@/services/member'
import { FormStep, FormBlock, Input, Password, Checkbox } from '@formily/antd-components' import { FormStep, FormBlock, Input, Password, Checkbox } from '@formily/antd-components'
import SchemaForm, { Field, FormMegaLayout, FormButtonGroup, createFormActions, FormEffectHooks } from '@formily/antd'; import SchemaForm, { Field, FormMegaLayout, FormButtonGroup, createFormActions, FormEffectHooks } from '@formily/antd';
import useCountDown from '@/utils/hooks'; import useCountDown from '@/utils/hooks';
import { GlobalConfig } from '@/global/config'; import { GlobalConfig } from '@/global/config';
import { omit } from '@/utils';
import { PATTERN_MAPS } from '@/constants/regExp';
import { PublicApi } from '@/services/api';
const { TextArea } = Input; const { TextArea } = Input;
const Step = Steps.Step const Step = Steps.Step
...@@ -37,7 +39,7 @@ let formCache: any = {} ...@@ -37,7 +39,7 @@ let formCache: any = {}
const CustomCheckbox = props => { const CustomCheckbox = props => {
const { layout } = props const { layout } = props
return ( return (
<Radio.Group value={props.value} onChange={props.onChange} className={layout === 'column' ? styles.identityRadio : styles.businessRadio} name={props.name}> <Radio.Group value={props.value} onChange={props.onChange} className={layout === 'column' ? 'identityRadio' : 'businessRadio'} name={props.name}>
{ {
props.dataSource && props.dataSource.map((v, i) => <Radio.Button value={v.value} key={v.value + i}>{v.label}</Radio.Button>) props.dataSource && props.dataSource.map((v, i) => <Radio.Button value={v.value} key={v.value + i}>{v.label}</Radio.Button>)
} }
...@@ -46,11 +48,10 @@ const CustomCheckbox = props => { ...@@ -46,11 +48,10 @@ const CustomCheckbox = props => {
} }
const CustomInput = props => { const CustomInput = props => {
const { help } = props const { help, ...restProps } = props
return ( return (
<AntdInput <AntdInput
value={props.value} {...restProps}
onChange={props.onChange}
addonAfter={help ? <Tooltip title={help}><QuestionCircleOutlined style={{color: '#6B778C', marginLeft: 5}}/></Tooltip> : undefined} addonAfter={help ? <Tooltip title={help}><QuestionCircleOutlined style={{color: '#6B778C', marginLeft: 5}}/></Tooltip> : undefined}
/> />
) )
...@@ -103,19 +104,13 @@ const UserRegistry = () => { ...@@ -103,19 +104,13 @@ const UserRegistry = () => {
delete obj.readme delete obj.readme
delete obj.confirm delete obj.confirm
console.log(obj, 'values') console.log(obj, 'values')
postMemberRegister(obj).then(res => { PublicApi.postRegister(obj).then(res => {
console.log(res,'res') console.log(res,'res')
// if(res.data.id) setCurrent(1) // if(res.data.id) setCurrent(1)
}) })
if(values.phone) setCurrent(1) if(values.phone) setCurrent(1)
} }
const handleRegisterTypeList = () => {
getRegisterTypeList().then(res=>{
console.log(res, 'res')
})
}
const handleJumpLogin = () => { const handleJumpLogin = () => {
history.push('/user/login') history.push('/user/login')
} }
...@@ -139,18 +134,18 @@ const UserRegistry = () => { ...@@ -139,18 +134,18 @@ const UserRegistry = () => {
// clearInterval(timeChange) // clearInterval(timeChange)
// handleRegisterTypeList() // handleRegisterTypeList()
// }, []) // }, [])
// useEffect(() => { useEffect(() => {
// console.log(current) console.log(current)
// if(current === 2) runTimerJump() if(current === 3) runTimerJump()
// }, [current]) }, [current])
// useEffect(() => { useEffect(() => {
// if(time === 0){ if(time === 0){
// clearInterval(timeChange) clearInterval(timeChange)
// setTime(60) setTime(60)
// history.push('/user/login') history.push('/user/login')
// console.log('执行登录跳转!') console.log('执行登录跳转!')
// } }
// }, [time]) }, [time])
const runTimerJump = () => { const runTimerJump = () => {
timeChange = setInterval(() => setTime(t => --t), 1000) timeChange = setInterval(() => setTime(t => --t), 1000)
} }
...@@ -196,11 +191,11 @@ const UserRegistry = () => { ...@@ -196,11 +191,11 @@ const UserRegistry = () => {
}) })
const handleActionBtn = () => { const handleActionBtn = () => {
actions.dispatch('onFormStepNext', () => { // 校验后触发跳转
actions.validate('*').then(data => {
actions.dispatch('onFormStepNext', {})
setCurrent(current + 1) setCurrent(current + 1)
}) })
// FormStep
// FormStep.onStepNext$()
} }
const mapMemberType = GlobalConfig.userRegister.useType.memberType.map(v => { const mapMemberType = GlobalConfig.userRegister.useType.memberType.map(v => {
return { return {
...@@ -216,13 +211,18 @@ const UserRegistry = () => { ...@@ -216,13 +211,18 @@ const UserRegistry = () => {
} }
}) })
// @todo 注册成功后 交互功能未完成
const submitForm = () => { const submitForm = () => {
actions.submit().then(data => { actions.submit().then(data => {
const { values } = data const { values } = data
formCache = Object.assign(values, formCache) formCache = Object.assign(values, formCache)
// 写死传入的区号 // 写死传入的区号
formCache.countryCode = '+86' formCache.countryCode = '+86'
console.log(formCache) const params = omit(formCache, ['isRead', 'confirmPassword'])
PublicApi.postRegister(params).then(() => {
actions.dispatch('onFormStepNext', {})
setCurrent(current + 1)
})
}) })
} }
return ( return (
...@@ -231,6 +231,7 @@ const UserRegistry = () => { ...@@ -231,6 +231,7 @@ const UserRegistry = () => {
<div className={cx(styles.registerBox, globalStyles.lingxiBusinessMarginContent)}> <div className={cx(styles.registerBox, globalStyles.lingxiBusinessMarginContent)}>
<div> <div>
<SchemaForm <SchemaForm
name='registerForm'
actions={actions} actions={actions}
components={{ components={{
Input, Input,
...@@ -252,11 +253,11 @@ const UserRegistry = () => { ...@@ -252,11 +253,11 @@ const UserRegistry = () => {
> >
</FormStep> </FormStep>
<FormMegaLayout className={styles.registerForm} name='message'> <FormMegaLayout className={styles.registerForm} name='message'>
<Field name="phone" x-rules={{required: true, pattern: /^1[3|4|5|6|7|8|9][0-9]{9}$/}} x-component-props={{placeholder: '请输入你的手机号码', size: 'large'}} x-props={{addonBefore: <div className={styles.formBefore}>+86</div>}} x-component="Input" /> <Field name="phone" x-rules={{required: true, pattern: PATTERN_MAPS.phone}} x-component-props={{placeholder: '请输入你的手机号码', size: 'large'}} x-props={{addonBefore: <div className={styles.formBefore}>+86</div>}} x-component="Input" />
<Field name="smsCode" x-rules={{required: true, pattern: /^\d{6}$/}} x-component-props={{ size: 'large', style: {width: 220}}} x-props={{addonAfter: <Button disabled={isActive} style={{minWidth: 110, marginLeft: 8}} size='large' onClick={start}>{text}</Button>}} x-component="Input" /> <Field name="smsCode" x-rules={{required: true, pattern: PATTERN_MAPS.smsCode}} x-component-props={{ size: 'large', style: {width: 220}}} x-props={{addonAfter: <Button disabled={isActive} style={{minWidth: 110, marginLeft: 8}} size='large' onClick={start}>{text}</Button>}} x-component="Input" />
<Field name="password" x-rules={{required: true}} x-component-props={{ placeholder: '设置你的登录密码', size: 'large'}} x-component="Password" /> <Field name="password" x-rules={{required: true, pattern: PATTERN_MAPS.password}} x-component-props={{ placeholder: '设置你的登录密码', size: 'large'}} x-component="Password" />
<Field name="confirmPassword" x-rules={{required: true}} x-component-props={{ placeholder: '请再次输入你的登录密码',size: 'large'}} x-component="Password" /> <Field name="confirmPassword" x-rules={{required: true}} x-component-props={{ placeholder: '请再次输入你的登录密码',size: 'large'}} x-component="Password" />
<Field name="email" x-rules={{message: '请输入正确的邮箱', pattern: /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/}} x-component-props={{ placeholder: '请输入你的邮箱(选填)',size: 'large', type: 'email'}} x-component="Input" /> <Field name="email" x-rules={{message: '请输入正确的邮箱', pattern: PATTERN_MAPS.email}} x-component-props={{ placeholder: '请输入你的邮箱(选填)',size: 'large', type: 'email'}} x-component="Input" />
<Field name="isRead" x-rules={{message: '请勾选', required: true}} x-component-props={{ <Field name="isRead" x-rules={{message: '请勾选', required: true}} x-component-props={{
children:<span style={{fontSize: 12}}>阅读并同意<span className='commonPickColor'>《会员服务协议》《法律条款》《隐私政策》</span></span> children:<span style={{fontSize: 12}}>阅读并同意<span className='commonPickColor'>《会员服务协议》《法律条款》《隐私政策》</span></span>
}} x-component="CheckBoxSingle" /> }} x-component="CheckBoxSingle" />
...@@ -284,9 +285,36 @@ const UserRegistry = () => { ...@@ -284,9 +285,36 @@ const UserRegistry = () => {
{ {
v.elements.map(field => { v.elements.map(field => {
// 字段类型暂时为null, 所以固定为input // 字段类型暂时为null, 所以固定为input
return ( switch(field.fieldType) {
<Field x-mega-props={{span: 1}} name={field.fieldName} key={field.fieldName} x-component-props={{ help: field.fieldRemark}} x-component='CustomInput'></Field> case 'file': return (
) <Field
x-mega-props={{span: 1}}
name={field.fieldName}
key={field.fieldName}
title={field.fieldCNName}
x-component-props={{ listType: 'text'}}
x-component='Upload'
>
</Field>
)
default : return (
<Field
x-mega-props={{span: 1}}
name={field.fieldName}
key={field.fieldName}
required={field.fieldEmpty === 0}
x-rules={field.checkRules.map(v => {
return {
message: v.msg,
pattern: v.rulePattern
}
})}
x-component-props={{ help: field.fieldRemark, placeholder: `请输入${field.fieldCNName}`}}
x-component='CustomInput'
>
</Field>
)
}
}) })
} }
</FormMegaLayout> </FormMegaLayout>
...@@ -296,27 +324,44 @@ const UserRegistry = () => { ...@@ -296,27 +324,44 @@ const UserRegistry = () => {
} }
</Field> </Field>
</FormMegaLayout> </FormMegaLayout>
<FormButtonGroup className={styles.registerForm}>
{
current === 0 &&
<Button type='primary' className={styles.continueButton} onClick={handleActionBtn}>同意协议并注册</Button>
}
{
current === 1 &&
<Button type='primary' className={styles.continueButton} onClick={() => {
actions.submit().then(data => {
const { values } = data
formCache = values
setCurrent(current + 1)
})
}}>下一步:继续完善</Button>
}
{
current === 2 &&
<Button type='primary' className={styles.continueButton} onClick={submitForm}>提交注册资料</Button>
}
</FormButtonGroup>
</SchemaForm> </SchemaForm>
<div className={styles.registerForm}>
{
current === 0 &&
<Button type='primary' className={styles.continueButton} onClick={handleActionBtn}>同意协议并注册</Button>
}
{
current === 1 &&
<Button type='primary' className={styles.continueButton} onClick={() => {
actions.submit().then(data => {
const { values } = data
formCache = values
setCurrent(current + 1)
})
}}>下一步:继续完善</Button>
}
{
current === 2 &&
<Button type='primary' className={styles.continueButton} onClick={submitForm}>提交注册资料</Button>
}
</div>
{
current === 3 &&
<div className={styles.formBoxStep3}>
<img src={im_success} alt="待审核"/>
<h2>您的注册资料已经提交成功,请等待平台审核</h2>
<div className={styles.description}>
<p>审核结果会以短信通知您</p>
<p>您也可以登录平台查看审核结果</p>
</div>
<p className={styles.guid}>
<span>{time}s 后自动跳转至登录页</span>
<br />
<span><Link to="/user/login">立即跳转</Link></span>
</p>
</div>
}
<Row justify='center' align='middle'> <Row justify='center' align='middle'>
已有平台账号?<Button type='link' onClick={handleJumpLogin}>去登陆</Button> 已有平台账号?<Button type='link' onClick={handleJumpLogin}>去登陆</Button>
</Row> </Row>
...@@ -324,57 +369,6 @@ const UserRegistry = () => { ...@@ -324,57 +369,6 @@ const UserRegistry = () => {
</div> </div>
</div> </div>
) )
return (
<div className={cx(styles.register, globalStyles.lingxiBusinessContent1024)}>
<h3>欢迎您注册数商云账号</h3>
<div className={cx(styles.registerBox, globalStyles.lingxiBusinessMarginContent)}>
<Steps current={current} className={styles.stepWrap} size='small'>
{
stepList.map((v,i) => <Step title={v.title} key={v.key} onClick={() => {setCurrent(i)}}/>)
}
</Steps>
{
current === 1 && <div className={styles.formBoxStep2}>
<FormPage
renderFormLists={identityFormData}
onSubmit={handleSecondSubmit}
>
</FormPage>
</div>
}
{
current === 1.1 && <div className={styles.formBoxStep2}>
<FormPage
renderFormLists={licenseFormData}
onSubmit={handleLicenseSubmit}
formProps={{
...formItemLayout,
labelAlign: 'left',
colon: false
}}
>
</FormPage>
</div>
}
{
current === 2 && <div className={styles.formBoxStep3}>
<img src={im_success} alt="待审核"/>
<h2>您的注册资料已经提交成功,请等待平台审核</h2>
<div className={styles.description}>
<p>审核结果会以短信通知您</p>
<p>您也可以登录平台查看审核结果</p>
</div>
<p className={styles.guid}>
<span>{time}s 后自动跳转至登录页</span>
<br />
<span><Link to="/user/login">立即跳转</Link></span>
</p>
</div>
}
</div>
</div>
)
} }
export default UserRegistry export default UserRegistry
\ No newline at end of file
import * as Api from './index'
import request from '@/utils/request'
/**
* 可在这里写入自定义的接口
*/
export const CustomApi = {}
// 公共的接口,从yapi拉下
export const PublicApi = Api
// 用于表格数据时的模型定义
export interface ApiListData<T> {
data: T[],
totalCount: number
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
declare namespace LogisticsApi {
interface RegisterTypeDTO{
}
}
\ No newline at end of file
import request from '@/utils/request';
/**
* @description 物流公司
* @param
*/
export async function getCompanyList(params: LogisticsApi.RegisterTypeDTO) {
return request('', {
method: 'get',
data: params
})
}
\ No newline at end of file
declare namespace MemberApi {
interface RegisterBasicDTO {
phone: string;
smsCode: string;
password: string;
email: string;
}
interface RegisterBasicModel {
id: number;
}
interface RegisterTypeDTO {
id: number;
typeId: number;
businessTypeId: number;
}
interface MemberTypeItem {
id: number;
typeName: string;
}
interface BusinessTypeItem {
id: number;
businessTypeName: string;
}
interface RegisterTypeModel {
memberType: MemberTypeItem[];
businessType: BusinessTypeItem[];
}
interface CheckRulesItem {
id: number;
ruleName: string;
ruleType: string;
rulePattern: RegExp;
msg: string;
}
interface RegisterElementItem {
id: number;
fieldName: string;
fieldCNName: string;
fieldType: string;
fieldLength: number;
fieldEmpty: number;
fieldOrder: number;
fieldRemark: string;
checkRules: CheckRulesItem[];
}
interface RegisterDetailElementModel{
groupName: string;
elements: RegisterElementItem[];
}
}
\ No newline at end of file
import request from '@/utils/request';
const prefix = '/member/merchant'
/**
* @description 用户基础注册接口
* @param {MemberApi.RegisterBasicModel} params
*/
export async function postMemberRegister(params: MemberApi.RegisterBasicDTO) {
return request<MemberApi.RegisterBasicModel>('/member/register/basic', {
prefix,
method: 'post',
data: params
})
}
/**
* @description 用户会员注册 获取会员/业务类型
*
*/
export async function getRegisterTypeList() {
return request<MemberApi.RegisterTypeModel>('/menu/member/register/type', {
prefix
})
}
/**
* @description 用户会员注册 提交会员类型业务类型
* @param {MemberApi.RegisterTypeDTO}
*/
export async function postMemberRegisterType(params: MemberApi.RegisterTypeDTO) {
return request('/member/register/type', {
prefix,
method: 'post',
data: params
})
}
/**
* @description 获取注册详情页 element元素数据
*
*/
export async function getRegisterElementList() {
return request<MemberApi.RegisterDetailElementModel>('/menu/member/register/detail', {
prefix
})
}
/**
* @description 用户会员注册 提交注册详情
* @param {T}
*/
export async function postMemberRegisterDetail<T>(params: T) {
return request('/member/register/detail', {
prefix,
method: 'post',
data: params
})
}
\ No newline at end of file
declare namespace UpgradeRuleApi {
interface UpgradeRuleItem {
page: number;
rows: number;
}
}
\ No newline at end of file
import request from '@/utils/request';
const prefix = '/member/promotion'
/**
* @description 会员升级规则-列表
*
*/
export async function getUpgradeRuleList(params: any) {
return request('/rule/list', {
prefix,
params
})
}
\ No newline at end of file
import { Config } from 'god-yapi2ts'
const tokens = [
'b063a0a29fb1a570d9f00eaabbdd8ccfe8e6e10e24739441990cc1098e79b601', // 业务中台管理平台
'7c8f235d95f6224ceb97c4d832b09658f9a75fb8721a95699b230af0733d7fa4', // 仓库服务
'8d14d945507d1f8cd89afe139ca6d111bbad25f702fafe0aec59d3c9cd2e0ffe', // 物流服务
'3a46198c5b97ac7147e5b07ad2dff5ac5c93c1afed47e1911961db87149e6ebf', // 商户会员管理服务
'efe99e20ed1375dc0db3e809e4fc7692f42ecebaf60cd77e65c50ed65d6ba6c4', // 商品服务
]
const genMap = (tokens) => {
return tokens.map(v => {
return {
token: v,
categories: [
{
id: 0,
getRequestFunctionName(interfaceInfo, changeCase) {
return changeCase.camelCase(interfaceInfo.method + interfaceInfo.path)
},
},
]
}
})
}
const config: Config = [
{
serverUrl: 'http://10.0.0.25:4000/',
typesOnly: false,
reactHooks: {
enabled: false,
},
outputFilePath: 'src/services/index.ts',
requestFunctionFilePath: 'request.ts',
dataKey: 'data',
projects: genMap(tokens),
},
]
export default config
\ 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