Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-admin
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
shenshaokai
jinfa-admin
Commits
85b2c78a
Commit
85b2c78a
authored
Aug 21, 2020
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:处理不同设置方式的商品图片显示,商品区域为空显示,优化输入搜索
parent
07afc5c4
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
119 additions
and
57 deletions
+119
-57
global.d.ts
src/global/config/global.d.ts
+77
-0
reset.less
src/global/styles/reset.less
+6
-0
index.tsx
src/pages/commodity/productWillCheck/index.tsx
+14
-25
checkProducts.tsx
src/pages/commodity/products/checkProducts.tsx
+4
-3
index.tsx
src/pages/commodity/products/index.tsx
+13
-25
viewProducts.tsx
src/pages/commodity/products/viewProducts.tsx
+5
-4
No files found.
src/global/config/global.d.ts
0 → 100644
View file @
85b2c78a
export
interface
MemberType
{
id
:
number
;
typeName
:
string
;
}
export
interface
BusinessType
{
id
:
number
;
typeName
:
string
;
}
export
interface
UseType
{
memberType
:
MemberType
[];
businessType
:
BusinessType
[];
}
export
interface
UserRegister
{
useType
:
UseType
;
useDetail
?:
any
;
}
export
interface
RuleConfiguration
{
value
:
number
;
label
:
string
;
platformType
:
number
;
}
export
interface
PayWayResponse
{
payType
:
number
;
value
:
number
;
label
:
string
;
}
export
interface
PayInitializeConfig
{
payType
:
number
;
ruleConfigurations
:
RuleConfiguration
[];
payWayResponses
:
PayWayResponse
[];
}
export
interface
PayPlatformPayConfig
{
id
:
number
;
payType
:
number
;
way
:
string
;
isPitchOn
:
number
;
}
export
interface
PayConfig
{
payInitializeConfig
:
PayInitializeConfig
[];
payPlatformPayConfig
:
PayPlatformPayConfig
[];
}
export
interface
CountryList
{
name
:
string
;
key
:
string
;
icon
:
string
;
}
export
interface
Children
{
code
:
string
;
}
export
interface
MenuList
{
code
:
string
;
children
:
Children
[];
}
export
interface
Global
{
logo
:
string
;
countryList
:
CountryList
[];
menuList
:
MenuList
[];
}
export
interface
RootObject
{
userRegister
:
UserRegister
;
payConfig
:
PayConfig
;
global
:
Global
;
}
\ No newline at end of file
src/global/styles/reset.less
View file @
85b2c78a
...
...
@@ -30,4 +30,9 @@
margin-right: 24px;
}
}
// 处理PageHeaderWrapper外边距冲突
.ant-pro-basicLayout-content .ant-pro-page-header-wrap {
margin: 0;
}
}
\ No newline at end of file
src/pages/commodity/productWillCheck/index.tsx
View file @
85b2c78a
...
...
@@ -26,7 +26,7 @@ interface paramItem {
}
const
Products
:
React
.
FC
<
{}
>
=
()
=>
{
const
ref
=
useRef
({})
const
ref
=
useRef
<
any
>
({})
let
[
isHighSearch
,
setIsHighSearch
]
=
useState
(
false
)
const
[
filterParams
,
setFilterParams
]
=
useState
<
paramItem
>
({
name
:
''
,
...
...
@@ -169,49 +169,36 @@ const Products: React.FC<{}> = () => {
ref
.
current
.
reload
(
restObj
)
}
const
handleBrandSearch
=
(
value
:
any
)
=>
{
// end value
console
.
log
(
value
,
'handleBrandSearch'
)
if
(
value
)
{
PublicApi
.
getProductSelectGetSelectBrand
({
name
:
value
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
setBrandData
(
res
.
data
)
})
}
else
{
setBrandData
([])
}
const
handleBrandSearch
=
(
value
?:
any
)
=>
{
// end value
PublicApi
.
getProductSelectGetSelectBrand
({
name
:
value
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
setBrandData
(
res
.
data
)
})
}
const
handleBrandChange
=
(
value
:
any
)
=>
{
setBrandValue
(
value
)
console
.
log
(
value
,
'handleBrandChange'
)
let
obj
=
{...
filterParams
,
brandId
:
value
}
setFilterParams
(
obj
)
}
const
handleClassSearch
=
(
value
:
any
)
=>
{
console
.
log
(
value
,
'handleClassSearch'
)
if
(
value
)
{
PublicApi
.
getProductSelectGetSelectCustomerCategory
({
name
:
value
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
setClassData
(
res
.
data
)
})
}
else
{
setClassData
([])
}
const
handleClassSearch
=
(
value
?:
any
)
=>
{
PublicApi
.
getProductSelectGetSelectCustomerCategory
({
name
:
value
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
setClassData
(
res
.
data
)
})
}
const
handleClassChange
=
(
value
:
any
)
=>
{
setClassValue
(
value
)
let
obj
=
{...
filterParams
,
customerCategoryId
:
value
}
setFilterParams
(
obj
)
console
.
log
(
value
,
'handleClassChange'
)
}
const
handleSearch
=
(
val
:
string
)
=>
{
const
handleSearch
=
(
val
?
:
string
)
=>
{
console
.
log
(
val
)
let
obj
=
val
?
{...
filterParams
,
name
:
val
}
:
{
...
filterParams
}
setFilterParams
(
obj
)
//@ts-ignore
ref
.
current
.
reload
(
obj
)
}
...
...
@@ -264,6 +251,7 @@ const Products: React.FC<{}> = () => {
filterOption=
{
false
}
onSearch=
{
handleBrandSearch
}
onChange=
{
handleBrandChange
}
onFocus=
{
()
=>
handleBrandSearch
(
null
)
}
notFoundContent=
{
null
}
style=
{
{
width
:
'100%'
}
}
>
...
...
@@ -280,6 +268,7 @@ const Products: React.FC<{}> = () => {
filterOption=
{
false
}
onSearch=
{
handleClassSearch
}
onChange=
{
handleClassChange
}
onFocus=
{
()
=>
handleClassSearch
(
null
)
}
notFoundContent=
{
null
}
style=
{
{
width
:
'100%'
}
}
>
...
...
src/pages/commodity/products/checkProducts.tsx
View file @
85b2c78a
...
...
@@ -402,7 +402,7 @@ const viewProducts: React.FC<{}> = () => {
<
Col
span=
{
20
}
>
<
p
>
{
productDetail
?.
commodityAreaList
.
map
(
_item
=>
<
p
>
{
_item
.
provinceName
+
'/'
+
_item
.
cityName
}
</
p
>)
productDetail
?.
commodityAreaList
.
map
(
_item
=>
<
p
>
{
_item
.
provinceName
+
'/'
+
(
_item
.
cityName
||
''
)
}
</
p
>)
}
</
p
>
</
Col
>
...
...
@@ -571,7 +571,8 @@ const viewProducts: React.FC<{}> = () => {
<
Space
direction=
"vertical"
style=
{
{
width
:
'100%'
}
}
>
<
Card
headStyle=
{
{
borderBottom
:
'none'
}
}
title=
"商品图片"
>
{
productDetail
?.
unitPriceAndPicList
[
0
].
attributeAndValueList
.
length
===
0
?
<>
// productDetail?.unitPriceAndPicList[0].attributeAndValueList.length === 0 ? <>
productDetail
?.
isAllAttributePic
?
<>
<
Row
>
<
Col
span=
{
3
}
>
<
p
>
设置方式:
</
p
>
...
...
@@ -641,7 +642,7 @@ const viewProducts: React.FC<{}> = () => {
{
/* 图片区块 */
}
<
div
className=
{
styles
.
descriptionBox
}
>
{
productDetail
?.
commodityRemark
?.
image
.
length
>
0
?
productDetail
?.
commodityRemark
?.
image
.
map
((
_item
,
_index
)
=>
<
div
key=
{
_index
}
className=
{
styles
.
imgItem
}
>
productDetail
?.
commodityRemark
?.
image
?
.
length
>
0
?
productDetail
?.
commodityRemark
?.
image
.
map
((
_item
,
_index
)
=>
<
div
key=
{
_index
}
className=
{
styles
.
imgItem
}
>
<
img
src=
{
_item
}
/>
</
div
>)
:
<
p
>
暂无数据
</
p
>
}
...
...
src/pages/commodity/products/index.tsx
View file @
85b2c78a
...
...
@@ -39,7 +39,7 @@ interface paramItem {
}
const
Products
:
React
.
FC
<
{}
>
=
()
=>
{
const
ref
=
useRef
({})
const
ref
=
useRef
<
any
>
({})
let
[
isHighSearch
,
setIsHighSearch
]
=
useState
(
false
)
const
[
filterParams
,
setFilterParams
]
=
useState
<
paramItem
>
({
name
:
''
,
...
...
@@ -168,53 +168,39 @@ const Products: React.FC<{}> = () => {
setFilterParams
(
restObj
)
setBrandValue
(
undefined
)
setClassValue
(
undefined
)
//@ts-ignore
ref
.
current
.
reload
(
restObj
)
}
const
handleBrandSearch
=
(
value
:
any
)
=>
{
// end value
console
.
log
(
value
,
'handleBrandSearch'
)
if
(
value
)
{
PublicApi
.
getProductSelectGetSelectBrand
({
name
:
value
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
setBrandData
(
res
.
data
)
})
}
else
{
setBrandData
([])
}
const
handleBrandSearch
=
(
value
?:
any
)
=>
{
// end value
PublicApi
.
getProductSelectGetSelectBrand
({
name
:
value
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
setBrandData
(
res
.
data
)
})
}
const
handleBrandChange
=
(
value
:
any
)
=>
{
setBrandValue
(
value
)
console
.
log
(
value
,
'handleBrandChange'
)
let
obj
=
{...
filterParams
,
brandId
:
value
}
setFilterParams
(
obj
)
}
const
handleClassSearch
=
(
value
:
any
)
=>
{
console
.
log
(
value
,
'handleClassSearch'
)
if
(
value
)
{
PublicApi
.
getProductSelectGetSelectCustomerCategory
({
name
:
value
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
setClassData
(
res
.
data
)
})
}
else
{
setClassData
([])
}
const
handleClassSearch
=
(
value
?:
any
)
=>
{
PublicApi
.
getProductSelectGetSelectCustomerCategory
({
name
:
value
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
setClassData
(
res
.
data
)
})
}
const
handleClassChange
=
(
value
:
any
)
=>
{
setClassValue
(
value
)
let
obj
=
{...
filterParams
,
customerCategoryId
:
value
}
setFilterParams
(
obj
)
console
.
log
(
value
,
'handleClassChange'
)
}
const
handleSearch
=
(
val
?:
string
)
=>
{
console
.
log
(
val
)
let
obj
=
val
?
{...
filterParams
,
name
:
val
}
:
{
...
filterParams
}
setFilterParams
(
obj
)
//@ts-ignore
ref
.
current
.
reload
(
obj
)
}
...
...
@@ -267,6 +253,7 @@ const Products: React.FC<{}> = () => {
filterOption=
{
false
}
onSearch=
{
handleBrandSearch
}
onChange=
{
handleBrandChange
}
onFocus=
{
()
=>
handleBrandSearch
(
null
)
}
notFoundContent=
{
null
}
style=
{
{
width
:
'100%'
}
}
>
...
...
@@ -283,6 +270,7 @@ const Products: React.FC<{}> = () => {
filterOption=
{
false
}
onSearch=
{
handleClassSearch
}
onChange=
{
handleClassChange
}
onFocus=
{
()
=>
handleClassSearch
(
null
)
}
notFoundContent=
{
null
}
style=
{
{
width
:
'100%'
}
}
>
...
...
src/pages/commodity/products/viewProducts.tsx
View file @
85b2c78a
...
...
@@ -369,7 +369,7 @@ const viewProducts: React.FC<{}> = () => {
<
Col
span=
{
20
}
>
<
p
>
{
productDetail
?.
commodityAreaList
.
map
(
_item
=>
<
p
>
{
_item
.
provinceName
+
'/'
+
_item
.
cityName
}
</
p
>)
productDetail
?.
commodityAreaList
.
map
(
_item
=>
<
p
>
{
_item
.
provinceName
+
'/'
+
(
_item
.
cityName
||
''
)
}
</
p
>)
}
</
p
>
</
Col
>
...
...
@@ -538,7 +538,8 @@ const viewProducts: React.FC<{}> = () => {
<
Space
direction=
"vertical"
style=
{
{
width
:
'100%'
}
}
>
<
Card
headStyle=
{
{
borderBottom
:
'none'
}
}
title=
"商品图片"
>
{
productDetail
?.
unitPriceAndPicList
[
0
].
attributeAndValueList
.
length
===
0
?
<>
// productDetail?.unitPriceAndPicList[0].attributeAndValueList.length === 0 ? <>
productDetail
?.
isAllAttributePic
?
<>
<
Row
>
<
Col
span=
{
3
}
>
<
p
>
设置方式:
</
p
>
...
...
@@ -598,7 +599,7 @@ const viewProducts: React.FC<{}> = () => {
{
/* 视频区块 */
}
<
div
className=
{
styles
.
descriptionBox
}
>
{
productDetail
?.
commodityRemark
?.
video
.
length
>
0
?
productDetail
?.
commodityRemark
?.
video
.
map
((
_item
,
_index
)
=>
<
div
key=
{
_index
}
className=
{
styles
.
videoItem
}
>
productDetail
?.
commodityRemark
?.
video
?
.
length
>
0
?
productDetail
?.
commodityRemark
?.
video
.
map
((
_item
,
_index
)
=>
<
div
key=
{
_index
}
className=
{
styles
.
videoItem
}
>
<
video
src=
{
_item
}
controls=
{
true
}
>
您的浏览器不支持视频标签,请及时升级。
</
video
>
...
...
@@ -608,7 +609,7 @@ const viewProducts: React.FC<{}> = () => {
{
/* 图片区块 */
}
<
div
className=
{
styles
.
descriptionBox
}
>
{
productDetail
?.
commodityRemark
?.
image
.
length
>
0
?
productDetail
?.
commodityRemark
?.
image
.
map
((
_item
,
_index
)
=>
<
div
key=
{
_index
}
className=
{
styles
.
imgItem
}
>
productDetail
?.
commodityRemark
?.
image
?
.
length
>
0
?
productDetail
?.
commodityRemark
?.
image
.
map
((
_item
,
_index
)
=>
<
div
key=
{
_index
}
className=
{
styles
.
imgItem
}
>
<
img
src=
{
_item
}
/>
</
div
>)
:
<
p
>
暂无数据
</
p
>
}
...
...
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