Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄庭坚
jinfa-platform
Commits
6214c8d3
Commit
6214c8d3
authored
Jul 17, 2020
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Plain Diff
merge:dev
parents
14f690d6
9743ea94
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
181 additions
and
98 deletions
+181
-98
.gitignore
.gitignore
+1
-0
base.config.json
config/base.config.json
+1
-1
config.ts
config/config.ts
+1
-1
demo.js
demo.js
+2
-1
package.json
package.json
+2
-0
gulpfile.js
scripts/gulpfile.js
+5
-2
index.js
scripts/services/index.js
+46
-0
app.tsx
src/app.tsx
+4
-1
index.tsx
src/components/TextLink/index.tsx
+1
-1
global.d.ts
src/global/config/global.d.ts
+39
-0
global.less
src/global/styles/global.less
+10
-11
addressForm.tsx
src/pages/logistics/list/components/addressForm.tsx
+0
-1
index.less
src/pages/user/index.less
+11
-1
index.less.d.ts
src/pages/user/index.less.d.ts
+0
-77
register.tsx
src/pages/user/register.tsx
+0
-0
index.ts
src/utils/hooks/index.ts
+57
-0
tsconfig.json
tsconfig.json
+1
-1
No files found.
.gitignore
View file @
6214c8d3
...
...
@@ -22,3 +22,4 @@
# mockStatic
/.idea
config/base.config.json
config/base.config.json
View file @
6214c8d3
{
"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"
:
"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"
}]}}
config/config.ts
View file @
6214c8d3
...
...
@@ -54,7 +54,7 @@ export default defineConfig({
},
// icon
// favicon: '',
hash
:
tru
e
,
hash
:
fals
e
,
/**
* 会自动添加到网页html的顶部
*/
...
...
demo.js
View file @
6214c8d3
...
...
@@ -34,7 +34,7 @@ const mockData = {
exports
.
fetchConfig
=
async
()
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
setTimeout
(()
=>
{
resolve
(
mockData
)
resolve
(
mockData
.
data
)
},
2
*
1000
)
})
}
\ No newline at end of file
package.json
View file @
6214c8d3
...
...
@@ -43,7 +43,9 @@
},
"devDependencies"
:
{
"
@types/qrcode
"
:
"^1.3.4"
,
"
axios
"
:
"^0.19.2"
,
"
chalk
"
:
"^4.1.0"
,
"
clone
"
:
"^2.1.2"
,
"
fs-extra
"
:
"^9.0.1"
,
"
gulp
"
:
"^4.0.2"
,
"
json2ts
"
:
"^0.0.7"
,
...
...
scripts/gulpfile.js
View file @
6214c8d3
...
...
@@ -2,7 +2,9 @@ const path = require('path')
const
Logs
=
require
(
'./utils/log'
)
const
fse
=
require
(
'fs-extra'
)
const
Type
=
require
(
'./utils/type'
)
const
fetchConfig
=
require
(
'../demo'
).
fetchConfig
const
runFile
=
'./services'
const
fetchConfig
=
require
(
runFile
).
fetchConfig
const
gulp
=
require
(
'gulp'
)
const
json2ts
=
require
(
'json2ts'
)
...
...
@@ -56,5 +58,5 @@ function genarateDtsFile(json, done) {
*/
async
function
getAsyncConfig
(
done
)
{
const
data
=
await
fetchConfig
()
genarateBaseJson
(
data
.
data
,
done
)
genarateBaseJson
(
data
,
done
)
}
\ No newline at end of file
scripts/services/index.js
0 → 100644
View file @
6214c8d3
/**
* 用于在项目开始前获取所有的配置
* 在项目开始前运行`yarn scripts:build`
* @todo 缺少异常处理清空
* @author xjm
*/
const
Axios
=
require
(
'axios'
).
default
;
const
deepClone
=
require
(
'clone'
)
const
demoFetch
=
require
(
'../../demo'
).
fetchConfig
const
isDemo
=
true
const
axios
=
Axios
.
create
({
baseURL
:
'http://10.0.0.25:8100'
,
responseType
:
'json'
,
})
const
serviceConfig
=
{
// 用于注册页
userRegister
:
{
useType
:
{
url
:
'/member/menu/register/type'
,
method
:
'get'
},
useDetail
:
{
url
:
'/member/menu/register/detail'
,
method
:
'get'
}
}
}
// 批量组装接口
async
function
batchAxiosHttps
()
{
const
asyncHttpQueue
=
deepClone
(
serviceConfig
)
for
(
const
item
in
serviceConfig
)
{
for
(
const
subItem
in
serviceConfig
[
item
])
{
const
data
=
await
axios
(
serviceConfig
[
item
][
subItem
])
asyncHttpQueue
[
item
][
subItem
]
=
data
.
data
.
data
}
}
return
isDemo
?
Object
.
assign
(
asyncHttpQueue
,
await
demoFetch
())
:
asyncHttpQueue
}
exports
.
fetchConfig
=
batchAxiosHttps
\ No newline at end of file
src/app.tsx
View file @
6214c8d3
...
...
@@ -5,7 +5,10 @@ import MobxProvider from './store'
import
'antd/es/form/style/index.less'
;
import
'@/global/styles/global.less'
;
// 导入全局样式
let
extraRoutes
:
never
[]
=
[]
// 默认引入所有的ant样式, 不引入css因为无法做到变量覆盖
import
'antd/dist/antd.less'
let
extraRoutes
=
[]
/**
* @description 配置函数,对已配置的路由做修改, 一般与render函数一起结合可根据接口动态配置路由
...
...
src/components/TextLink/index.tsx
View file @
6214c8d3
...
...
@@ -4,7 +4,7 @@ import styles from './index.less'
export
interface
TextLinkProps
{
url
:
string
,
}
const
TextLink
:
React
.
FC
=
(
props
)
=>
{
const
TextLink
:
React
.
FC
<
any
>
=
(
props
)
=>
{
return
(
<
span
className=
{
styles
.
link
}
>
{
props
.
children
}
...
...
src/global/config/global.d.ts
View file @
6214c8d3
export
interface
MemberType
{
id
:
number
;
typeName
:
string
;
}
export
interface
BusinessType
{
id
:
number
;
typeName
:
string
;
}
export
interface
UseType
{
memberType
:
MemberType
[];
businessType
:
BusinessType
[];
}
export
interface
Element
{
id
:
number
;
fieldName
:
string
;
fieldCNName
:
string
;
fieldType
?:
any
;
fieldLength
:
number
;
fieldEmpty
:
number
;
fieldOrder
:
number
;
fieldRemark
:
string
;
checkRules
:
any
[];
}
export
interface
UseDetail
{
groupName
:
string
;
elements
:
Element
[];
}
export
interface
UserRegister
{
useType
:
UseType
;
useDetail
:
UseDetail
[];
}
export
interface
CountryList
{
name
:
string
;
key
:
string
;
...
...
@@ -10,5 +47,6 @@ export interface Global {
}
export
interface
RootObject
{
userRegister
:
UserRegister
;
global
:
Global
;
}
\ No newline at end of file
src/global/styles/global.less
View file @
6214c8d3
...
...
@@ -86,18 +86,16 @@ h1, h2, h3, h4, h5, h6 {
background-color: @status-invalid; // 无效、未生成
}
.commonSearchBtn { //表格搜索按钮
border-left: none;
border-radius: 0 2px 2px 0;
background-color: #EBECF0FF;
&:hover, &:focus, &:active{
text-decoration: none;
color: rgba(0, 0, 0, 0.65);
background: #EBECF0FF;
border-color: #d9d9d9;
}
}
.mb-30{
margin-bottom: 30px;
}
.sc-fzpans {
display: block;
width: 100%;
}
.mr_t-40 {
margin-top: 40px;
}
\ No newline at end of file
src/pages/logistics/list/components/addressForm.tsx
View file @
6214c8d3
...
...
@@ -19,7 +19,6 @@ import { Row, Col, Card, Button, Popconfirm } from 'antd';
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
MegaLayout
,
Input
,
Switch
,
Select
,
FormMegaLayout
}
from
'@formily/antd-components'
import
ReutrnEle
from
'@/components/ReturnEle'
import
'antd/dist/antd.css'
let
selectList
:
any
=
[
{
label
:
'+86'
,
value
:
'1'
},
{
label
:
'Two'
,
value
:
'2'
},
...
...
src/pages/user/index.less
View file @
6214c8d3
...
...
@@ -107,6 +107,10 @@
margin-bottom: 0;
}
}
.registerForm {
max-width: 335px;
margin: 40px auto;
}
.registerBox {
width: 100%;
...
...
@@ -144,13 +148,14 @@
}
.continueButton{
.make-center(block);
width: 3
2
0px;
width: 3
4
0px;
height: 40px;
.make-center-space(margin, 8);
}
.identityRadio{
display: flex;
flex-direction: column;
margin: 0 auto;
.make-center(text);
& label{
width: 320px;
...
...
@@ -283,4 +288,8 @@
line-height:22px;
}
}
}
.mr_t-40 {
margin-top: 40px;
}
\ No newline at end of file
src/pages/user/index.less.d.ts
deleted
100644 → 0
View file @
14f690d6
// This file is automatically generated.
// Please do not change this file!
interface
CssExports
{
[
x
:
string
]:
string
|
undefined
;
'adBox'
:
string
;
'businessRadio'
:
string
;
'commonPanelTitle'
:
string
;
'continueButton'
:
string
;
'description'
:
string
;
'formBefore'
:
string
;
'formBoxStep1'
:
string
;
'formBoxStep2'
:
string
;
'formBoxStep3'
:
string
;
'guid'
:
string
;
'identityRadio'
:
string
;
'lingxi-business-content1024'
:
string
;
'lingxi-business-margin_content'
:
string
;
'lingxiBusinessContent1024'
:
string
;
'lingxiBusinessMarginContent'
:
string
;
'login-ctl'
:
string
;
'login-item'
:
string
;
'loginCtl'
:
string
;
'loginDesc'
:
string
;
'loginItem'
:
string
;
'loginMain'
:
string
;
'loginVerBtn'
:
string
;
'loginWrap'
:
string
;
'mb-10'
:
string
;
'mb-100'
:
string
;
'mb-20'
:
string
;
'mb-30'
:
string
;
'mb-50'
:
string
;
'mb10'
:
string
;
'mb100'
:
string
;
'mb20'
:
string
;
'mb30'
:
string
;
'mb50'
:
string
;
'ml-10'
:
string
;
'ml-100'
:
string
;
'ml-20'
:
string
;
'ml-30'
:
string
;
'ml-50'
:
string
;
'ml10'
:
string
;
'ml100'
:
string
;
'ml20'
:
string
;
'ml30'
:
string
;
'ml50'
:
string
;
'mr-10'
:
string
;
'mr-100'
:
string
;
'mr-20'
:
string
;
'mr-30'
:
string
;
'mr-50'
:
string
;
'mr10'
:
string
;
'mr100'
:
string
;
'mr20'
:
string
;
'mr30'
:
string
;
'mr50'
:
string
;
'mt-10'
:
string
;
'mt-100'
:
string
;
'mt-20'
:
string
;
'mt-30'
:
string
;
'mt-50'
:
string
;
'mt10'
:
string
;
'mt100'
:
string
;
'mt20'
:
string
;
'mt30'
:
string
;
'mt50'
:
string
;
'qrcodeLogin'
:
string
;
'register'
:
string
;
'registerBox'
:
string
;
'scanLoginWrap'
:
string
;
'scanTips'
:
string
;
'stepWrap'
:
string
;
'thirdLogin'
:
string
;
}
export
const
cssExports
:
CssExports
;
export
default
cssExports
;
src/pages/user/register.tsx
View file @
6214c8d3
This diff is collapsed.
Click to expand it.
src/utils/hooks/index.ts
View file @
6214c8d3
import
React
,
{
useState
,
useEffect
}
from
'react'
export
interface
UseCountDownProps
{
maxTime
:
number
,
minTime
:
number
,
initText
:
React
.
ReactNode
,
delay
:
number
,
onEnd
():
void
,
decayRate
:
number
}
export
interface
ReturnValue
{
start
():
void
,
text
:
React
.
ReactNode
,
isActive
:
boolean
}
const
useCountDown
=
(
options
:
UseCountDownProps
):
ReturnValue
=>
{
const
[
activeText
,
setActiveText
]
=
useState
(
options
.
initText
)
const
[
isOpen
,
setIsOpen
]
=
useState
(
false
)
useEffect
(()
=>
{
const
{
maxTime
=
60
,
minTime
=
0
,
initText
=
'获取验证码'
,
delay
=
1
*
1000
,
onEnd
=
()
=>
{},
decayRate
=
1
}
=
options
let
activeInterval
:
any
=
null
let
activeTime
=
maxTime
if
(
isOpen
)
{
activeInterval
=
setInterval
(()
=>
{
if
(
activeTime
===
minTime
)
{
setActiveText
(
initText
)
setIsOpen
(
false
)
clearInterval
(
activeInterval
)
onEnd
&&
onEnd
()
}
else
{
setActiveText
((
activeTime
-=
decayRate
)
+
's'
)
}
},
delay
)
}
return
()
=>
{
clearInterval
(
activeInterval
)
}
},
[
isOpen
])
function
start
()
{
if
(
isOpen
)
{
return
false
}
setIsOpen
(
true
)
setActiveText
(
options
.
maxTime
+
's'
)
}
return
{
start
,
text
:
activeText
,
isActive
:
isOpen
}
}
export
default
useCountDown
\ No newline at end of file
tsconfig.json
View file @
6214c8d3
...
...
@@ -7,9 +7,9 @@
"importHelpers"
:
true
,
"jsx"
:
"react"
,
"esModuleInterop"
:
true
,
"noImplicitAny"
:
false
,
"sourceMap"
:
true
,
"baseUrl"
:
"./"
,
"strict"
:
true
,
"paths"
:
{
"@/*"
:
[
"src/*"
],
"@mock/*"
:
[
"mockStatic/*"
],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment