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
linweijiong
jinfa-platform
Commits
606abbfe
Commit
606abbfe
authored
Oct 09, 2020
by
前端-许佳敏
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://10.0.0.22:3000/lingxi/lingxi-business-paltform
into dev
parents
31500768
d08d47c9
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
86 additions
and
58 deletions
+86
-58
regExp.ts
src/constants/regExp.ts
+2
-1
index.less
src/pages/accountSetting/components/SliderVerify/index.less
+15
-1
index.tsx
src/pages/accountSetting/components/SliderVerify/index.tsx
+15
-7
addressForm.tsx
src/pages/logistics/list/components/addressForm.tsx
+6
-10
template.tsx
src/pages/logistics/list/template.tsx
+47
-27
toOrderSumitList.tsx
src/pages/logistics/logisticsSubmit/toOrderSumitList.tsx
+1
-12
No files found.
src/constants/regExp.ts
View file @
606abbfe
...
...
@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Date: 2020-07-22 09:54:50
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-
07-30 19:28
:23
* @LastEditTime: 2020-
10-09 10:54
:23
*/
/**
* 正则表达式集合
...
...
@@ -13,6 +13,7 @@ export const PATTERN_MAPS = {
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}
$/
,
tel
:
/^
(
0
\d{2,3}
-
\d{7,8})(
-
\d{1,4})?
$/
,
//座机
smsCode
:
/^
\d{6}
$/
,
money
:
/^
\d
*
(?:\.\d{0,2})?
$/
,
weight
:
/^
\d
*
(?:\.\d{0,3})?
$/
,
...
...
src/pages/accountSetting/components/SliderVerify/index.less
View file @
606abbfe
...
...
@@ -43,6 +43,20 @@
left: 175px;
top: 45px;
}
.status {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #fff;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
color: red;
}
}
...
...
@@ -95,7 +109,7 @@
bottom: 0;
border-top-left-radius: 45px;
border-bottom-left-radius: 45px ;
background-color: #91d5ff;
//
background-color: #91d5ff;
}
}
...
...
src/pages/accountSetting/components/SliderVerify/index.tsx
View file @
606abbfe
...
...
@@ -96,8 +96,11 @@ const SliderVerify: React.FC<SliderVerifyProps> = (props) => {
const
onError
=
()
=>
{
console
.
log
(
"error"
)
setStatus
(
ERROR
);
setTimeout
(()
=>
{
reRender
()
},
500
)
// setOffset({x: 0, y: 0})
reRender
()
}
const
onReset
=
()
=>
{
...
...
@@ -106,12 +109,8 @@ const SliderVerify: React.FC<SliderVerifyProps> = (props) => {
const
reRender
=
()
=>
{
setLoading
(
true
);
setStatus
(
READY
);
setOffset
({
x
:
0
,
y
:
0
})
const
objImage
=
new
Image
()
console
.
log
(
imageUrl
)
objImage
.
addEventListener
(
"load"
,
()
=>
{
console
.
log
(
objImage
.
width
);
// 先获取两个ctx
const
ctxShadow
=
shadowCanvas
.
current
.
getContext
(
"2d"
)
const
ctxFragment
=
fragmentCanvas
.
current
.
getContext
(
"2d"
)
...
...
@@ -147,6 +146,9 @@ const SliderVerify: React.FC<SliderVerifyProps> = (props) => {
// 修改状态
setLoading
(
false
);
setStatus
(
READY
);
setOffset
({
x
:
0
,
y
:
0
})
})
objImage
.
src
=
imageUrl
}
...
...
@@ -161,11 +163,11 @@ const SliderVerify: React.FC<SliderVerifyProps> = (props) => {
?
null
:
(
<
div
>
{
{
/* {
loading
? <div className={styles.loading}><Spin /></div>
: null
}
}
*/
}
<
div
className=
{
styles
.
sliderContainer
}
style=
{
{
visibility
:
!
loading
?
'visible'
:
'hidden'
}
}
>
<
div
className=
{
styles
.
container
}
>
...
...
@@ -184,6 +186,12 @@ const SliderVerify: React.FC<SliderVerifyProps> = (props) => {
ref=
{
fragmentCanvas
}
style=
{
{
left
:
offset
.
x
+
"px"
,
top
:
clipImagePosition
.
y
+
"px"
}
}
></
canvas
>
{
status
===
ERROR
?
<
div
className=
{
styles
.
status
}
>
验证失败
</
div
>
:
null
}
</
div
>
<
div
className=
{
styles
.
slider
}
onMouseMove=
{
mouseMove
}
onMouseLeave=
{
mouseUp
}
>
<
div
className=
{
styles
.
sliderHandle
}
onMouseDown=
{
mouseDown
}
onMouseUp=
{
mouseUp
}
style=
{
sliderHandleStyle
}
><
DoubleRightOutlined
/></
div
>
...
...
src/pages/logistics/list/components/addressForm.tsx
View file @
606abbfe
...
...
@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Date: 2020-07-15 10:31:55
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-
09-17 17:41:05
* @LastEditTime: 2020-
10-09 11:00:43
*/
import
React
,
{
Component
,
useState
,
useEffect
}
from
'react'
;
import
ReactDOM
from
'react-dom'
...
...
@@ -440,20 +440,16 @@ const diaLogForm: React.FC<ListProps> = (props) => {
/>
</
FormMegaLayout
>
<
FormMegaLayout
label=
'电话号码'
grid
full
>
{
/* <Field
x-mega-props={{ span: 1 }}
name="phoneHead"
x-component="Input"
x-component-props={{
placeholder: '区号'
}}
/> */
}
<
Field
x
-
mega
-
props=
{
{
span
:
5
}
}
name=
"tel"
x
-
component=
"Input"
x
-
component
-
props=
{
{
placeholder
:
''
placeholder
:
'输入你的电话号码'
}
}
x
-
rules
=
{{
message
:
'输入正确电话号码',
pattern
:
PATTERN_MAPS
.
tel
}}
/>
</
FormMegaLayout
>
...
...
src/pages/logistics/list/template.tsx
View file @
606abbfe
...
...
@@ -6,7 +6,7 @@ EyePreview/*
*/
import
React
,
{
Component
,
ReactNode
,
useRef
,
useState
}
from
'react'
import
{
history
}
from
'umi'
import
{
Modal
,
Card
,
Button
,
Form
,
InputNumber
,
Radio
,
Popconfirm
,
Switch
,
Input
}
from
'antd'
;
import
{
Modal
,
Card
,
Row
,
Col
,
Button
,
Form
,
InputNumber
,
Radio
,
Popconfirm
,
Switch
,
Input
}
from
'antd'
;
import
{
PlayCircleOutlined
,
PauseCircleOutlined
,
...
...
@@ -20,7 +20,7 @@ import { ColumnType } from 'antd/lib/table/interface'
import
{
IFormFilter
,
IButtonFilter
}
from
'god/dist/src/standard-table/TableController'
import
StatusSwitch
from
'@/components/StatusSwitch'
import
EyePreview
from
'@/components/EyePreview'
import
{
PublicApi
}
from
'@/services/api'
import
{
PublicApi
}
from
'@/services/api'
const
data
=
[
{
...
...
@@ -47,7 +47,7 @@ const data = [
// 模拟请求
const
fetchData
=
(
params
:
any
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
PublicApi
.
getLogisticsFreightTemplatePage
({
...
params
}).
then
(
res
=>
{
PublicApi
.
getLogisticsFreightTemplatePage
({
...
params
}).
then
(
res
=>
{
resolve
(
res
.
data
)
})
})
...
...
@@ -114,6 +114,9 @@ const EditableCell: React.FC<EditableCellProps> = ({
const
Template
:
React
.
FC
<
ListProps
>
=
(
props
)
=>
{
console
.
log
(
props
)
const
ref
=
useRef
<
any
>
({})
const
[
searchForm
,
setSearchForm
]
=
useState
({
name
:
''
})
const
[
form
]
=
Form
.
useForm
();
const
[
table
,
setTable
]
=
useState
([])
const
[
editingKey
,
setEditingKey
]
=
useState
(
''
);
...
...
@@ -128,8 +131,8 @@ const Template: React.FC<ListProps> = (props) => {
dataIndex
:
'name'
,
align
:
'left'
,
key
:
'name'
,
render
:
(
text
:
any
,
record
:
any
)
=>
(
<
EyePreview
url=
{
`/memberCenter/logisticsAbility/logistics/templateForm?id=${record.id}&isSee=${true}`
}
>
{
text
}
</
EyePreview
>
render
:
(
text
:
any
,
record
:
any
)
=>
(
<
EyePreview
url=
{
`/memberCenter/logisticsAbility/logistics/templateForm?id=${record.id}&isSee=${true}`
}
>
{
text
}
</
EyePreview
>
)
},
{
...
...
@@ -137,9 +140,9 @@ const Template: React.FC<ListProps> = (props) => {
align
:
'center'
,
dataIndex
:
'pricingMode'
,
key
:
'pricingMode'
,
render
:
(
_
:
any
,
record
:
any
)
=>
{
render
:
(
_
:
any
,
record
:
any
)
=>
{
return
(
<>
{
record
.
transportMode
===
1
?
'按重量'
:
''
}
</>
<>
{
record
.
transportMode
===
1
?
'按重量'
:
''
}
</>
)
}
},
...
...
@@ -148,9 +151,9 @@ const Template: React.FC<ListProps> = (props) => {
dataIndex
:
'transportMode'
,
align
:
'center'
,
key
:
'transportMode'
,
render
:
(
_
:
any
,
record
:
any
)
=>
{
render
:
(
_
:
any
,
record
:
any
)
=>
{
return
(
<>
{
record
.
transportMode
===
1
?
'快递'
:
''
}
</>
<>
{
record
.
transportMode
===
1
?
'快递'
:
''
}
</>
)
}
},
...
...
@@ -166,7 +169,7 @@ const Template: React.FC<ListProps> = (props) => {
dataIndex
:
'status'
,
key
:
'status'
,
render
:
(
text
:
any
,
record
:
any
)
=>
(
<
StatusSwitch
fieldNames=
"status"
handleConfirm=
{
()
=>
handleChangeStatus
(
record
.
id
,
record
.
status
)
}
record=
{
record
}
/>
<
StatusSwitch
fieldNames=
"status"
handleConfirm=
{
()
=>
handleChangeStatus
(
record
.
id
,
record
.
status
)
}
record=
{
record
}
/>
)
},
{
...
...
@@ -180,7 +183,7 @@ const Template: React.FC<ListProps> = (props) => {
record
.
status
===
0
?
<>
<
Button
type=
'link'
onClick=
{
()
=>
history
.
push
(
`/memberCenter/logisticsAbility/logistics/templateForm?id=${record.id}`
)
}
>
编辑
</
Button
>
<
Popconfirm
title=
"确定要删除吗?"
okText=
"是"
cancelText=
"否"
onConfirm=
{
()
=>
handleDelete
(
record
.
id
)
}
>
<
Popconfirm
title=
"确定要删除吗?"
okText=
"是"
cancelText=
"否"
onConfirm=
{
()
=>
handleDelete
(
record
.
id
)
}
>
<
Button
type=
'link'
>
删除
</
Button
>
...
...
@@ -206,18 +209,18 @@ const Template: React.FC<ListProps> = (props) => {
columns
.
forEach
((
v
,
index
)
=>
{
})
}
const
handleChangeStatus
=
(
id
:
any
,
status
:
any
)
=>
{
let
_status
=
status
==
0
?
1
:
0
PublicApi
.
postLogisticsFreightTemplateEnable
({
id
:
id
,
status
:
_status
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
const
handleChangeStatus
=
(
id
:
any
,
status
:
any
)
=>
{
let
_status
=
status
==
0
?
1
:
0
PublicApi
.
postLogisticsFreightTemplateEnable
({
id
:
id
,
status
:
_status
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
console
.
log
(
ref
)
ref
.
current
.
reload
()
}
})
}
const
handleDelete
=
(
id
:
number
)
=>
{
PublicApi
.
postLogisticsFreightTemplateDelete
({
id
:
id
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
const
handleDelete
=
(
id
:
number
)
=>
{
PublicApi
.
postLogisticsFreightTemplateDelete
({
id
:
id
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
ref
.
current
.
reload
()
}
})
...
...
@@ -247,6 +250,16 @@ const Template: React.FC<ListProps> = (props) => {
console
.
log
(
'执行状态修改'
,
record
)
}
const
handleChange
=
(
key
:
any
,
val
:
any
)
=>
{
let
obj
:
any
=
{}
switch
(
key
)
{
case
'name'
:
obj
=
{
...
searchForm
,
name
:
val
}
break
;
}
setSearchForm
(
obj
)
ref
.
current
.
reload
(
obj
)
}
return
(
<
PageHeaderWrapper
>
<
Card
>
...
...
@@ -255,15 +268,22 @@ const Template: React.FC<ListProps> = (props) => {
currentRef=
{
ref
}
fetchTableData=
{
(
params
:
any
)
=>
fetchData
(
params
)
}
rowClassName=
"editable-row"
formilyChilds=
{
{
children
:
(
<>
<
Button
type=
"primary"
icon=
{
<
PlusOutlined
/>
}
onClick=
{
()
=>
history
.
push
(
`/memberCenter/logisticsAbility/logistics/templateForm?id=0`
)
}
>
新建
</
Button
>
</>
)
}
}
controlRender=
{
<
Row
style=
{
{
marginBottom
:
'32px'
}
}
>
<
Col
span=
{
6
}
>
<
Button
type=
"primary"
icon=
{
<
PlusOutlined
/>
}
onClick=
{
()
=>
history
.
push
(
`/memberCenter/logisticsAbility/logistics/templateForm?id=0`
)
}
>
新建
</
Button
>
</
Col
>
<
Col
span=
{
10
}
offset=
{
8
}
style=
{
{
textAlign
:
'right'
}
}
>
<
Input
.
Search
style=
{
{
width
:
'232px'
}
}
value=
{
searchForm
.
name
}
placeholder=
'输入模板名称进行搜索'
onChange=
{
(
e
)
=>
setSearchForm
({
...
searchForm
,
name
:
e
.
target
.
value
})
}
onSearch=
{
(
val
)
=>
handleChange
(
'name'
,
val
)
}
/>
</
Col
>
</
Row
>
}
/>
</
Card
>
</
PageHeaderWrapper
>
...
...
src/pages/logistics/logisticsSubmit/toOrderSumitList.tsx
View file @
606abbfe
...
...
@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Date: 2020-07-14 15:07:34
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-
09-22 14:26:1
6
* @LastEditTime: 2020-
10-09 11:29:3
6
*/
import
React
,
{
Component
,
ReactNode
,
useRef
,
useState
,
useEffect
}
from
'react'
import
{
history
}
from
'umi'
...
...
@@ -408,17 +408,6 @@ const OrderList: React.FC<ListProps> = (props) => {
})
}
</
Select
>
<
Select
className=
{
style
.
select
}
value=
{
searchForm
.
status
}
onChange=
{
(
val
)
=>
setSearchForm
({
...
searchForm
,
status
:
val
})
}
>
{
outSideStatusList
.
map
((
item
,
index
)
=>
{
return
<
Option
key=
{
index
}
value=
{
item
.
value
}
>
{
item
.
label
}
</
Option
>
})
}
</
Select
>
</
Space
>
</
Col
>
}
...
...
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