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
shenshaokai
jinfa-platform
Commits
9c35319a
Commit
9c35319a
authored
Aug 28, 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
ead61aee
97dd7ab1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
26 deletions
+31
-26
commodityRoute.ts
config/routes/commodityRoute.ts
+2
-2
addDirectChannel.tsx
src/pages/commodity/products/addDirectChannel.tsx
+7
-7
addProducts.tsx
src/pages/commodity/products/addProducts.tsx
+14
-0
productImageForm.tsx
...s/commodity/products/addProductsItem/productImageForm.tsx
+4
-4
directChannel.tsx
src/pages/commodity/products/directChannel.tsx
+4
-4
channelSchema.tsx
src/pages/commodity/products/schema/channelSchema.tsx
+0
-9
No files found.
config/routes/commodityRoute.ts
View file @
9c35319a
...
...
@@ -139,14 +139,14 @@ const CommodityRoute = {
component
:
'@/pages/commodity/products/directChannel'
,
},
{
path
:
'/memberCenter/commodityAbility/commodity/products/addDirectChannel'
,
path
:
'/memberCenter/commodityAbility/commodity/products/
directChannel/
addDirectChannel'
,
name
:
'addDirectChannel'
,
hideInMenu
:
true
,
icon
:
'smile'
,
component
:
'@/pages/commodity/products/addDirectChannel'
,
},
{
path
:
'/memberCenter/commodityAbility/commodity/products/viewDirectChannel'
,
path
:
'/memberCenter/commodityAbility/commodity/products/
directChannel/
viewDirectChannel'
,
name
:
'viewDirectChannel'
,
hideInMenu
:
true
,
icon
:
'smile'
,
...
...
src/pages/commodity/products/addDirectChannel.tsx
View file @
9c35319a
...
...
@@ -89,7 +89,7 @@ const AddDirectChannel:React.FC<{}> = (props) => {
const
[
memberColumn
,
setMemberColumn
]
=
useState
<
any
[]
>
([])
const
[
queryId
,
setQueryId
]
=
useState
<
number
>
()
const
[
productInfoByEdit
,
setProductInfoByEdit
]
=
useState
<
GetProductChannelCommodityGetChannelCommodityResponse
>
()
//
const [productInfoByEdit, setProductInfoByEdit] = useState<GetProductChannelCommodityGetChannelCommodityResponse>()
const
productColumns
:
ColumnType
<
any
>
[]
=
[
{
...
...
@@ -153,7 +153,7 @@ const AddDirectChannel:React.FC<{}> = (props) => {
if
(
id
)
PublicApi
.
getProductChannelCommodityGetChannelCommodity
({
id
:
id
}).
then
(
res
=>
{
const
{
data
}
=
res
setProductInfoByEdit
(
data
)
//
setProductInfoByEdit(data)
formProduct
.
setFieldsValue
({
source
:
data
.
source
})
setSource
(
data
.
source
)
// @ts-ignore
...
...
@@ -192,10 +192,10 @@ const AddDirectChannel:React.FC<{}> = (props) => {
useEffect
(()
=>
{
if
(
visibleAddTabs
)
console
.
log
(
productRef
.
current
,
productFormActions
,
'132456'
)
// productRef.current.schemaAction.setFieldState('parentMemberId', state => {
//
state.visible = source===1 ? true : false
//
})
productRef
?.
current
?.
schemaAction
?.
setFieldState
(
'parentMemberId'
,
state
=>
{
console
.
log
(
'parentMemberId'
)
state
.
visible
=
source
===
1
?
true
:
false
})
},
[
visibleAddTabs
])
// 获取渠道商品
...
...
@@ -734,7 +734,7 @@ const AddDirectChannel:React.FC<{}> = (props) => {
confirm=
{
handleOkAddTabs
}
cancel=
{
handleCancelAddTabs
}
visible=
{
visibleAddTabs
}
resetModal=
{
{
destroyOnClose
:
true
}
}
resetModal=
{
{
destroyOnClose
:
true
,
forceRender
:
true
}
}
columns=
{
productColumns
}
rowSelection=
{
productRowSelection
}
fetchTableData=
{
(
params
:
any
)
=>
fetchProductData
(
params
)
}
...
...
src/pages/commodity/products/addProducts.tsx
View file @
9c35319a
...
...
@@ -125,6 +125,8 @@ const AddProducts: React.FC<{}> = (props) => {
if
(
productAttributeAndImageParams
.
length
>
0
){
productAttributeAndImageParams
.
map
(
_item
=>
{
if
(
_item
.
goodsCustomerAttributeList
.
length
>
0
){
_item
.
goods
=
{
id
:
_item
.
goodsId
}
delete
_item
.
goodsId
_item
.
goodsCustomerAttributeList
.
map
(
__item
=>
{
delete
__item
.
customerAttributeName
// __item.customerAttributeValueId = __item.id
...
...
@@ -136,6 +138,8 @@ const AddProducts: React.FC<{}> = (props) => {
delete
__item
.
customerAttributeId
})
}
_item
.
attributeAndValueList
=
_item
.
goodsCustomerAttributeList
delete
_item
.
goodsCustomerAttributeList
if
(
_item
.
commodityPic
.
length
>
0
){
// 编辑情况下兼顾手动添加图片列表属性
_item
.
commodityPic
=
_item
.
commodityPic
.
map
(
__item
=>
__item
?.
response
?.
data
||
__item
?.
url
)
...
...
@@ -176,6 +180,16 @@ const AddProducts: React.FC<{}> = (props) => {
_params
.
packing
=
productInfoByEdit
.
packing
_params
.
afterService
=
productInfoByEdit
.
afterService
}
// 校验价格
try
{
let
hasPriceArray
=
_params
.
unitPriceAndPicList
.
map
(
item
=>
item
.
unitPrice
)
hasPriceArray
.
map
(
item
=>
{
if
(
JSON
.
stringify
(
item
)
===
'{}'
)
throw
new
Error
(
'商品价格为必填项!'
)
})
}
catch
(
e
){
return
e
}
console
.
log
(
_params
,
'params'
)
PublicApi
.
postProductCommoditySaveOrUpdateCommodity
(
_params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
){
...
...
src/pages/commodity/products/addProductsItem/productImageForm.tsx
View file @
9c35319a
...
...
@@ -87,9 +87,9 @@ const ProductImageForm: React.FC<Iprops> = (props) => {
// }
setPriceAttributeParamsByRender
(
_priceAttributeParams
)
setProductAttributeAndImageParams
(
_priceAttributeParams
)
console
.
log
(
_priceAttributeParams
,
priceAttributeParams
,
'_p'
)
console
.
log
(
_priceAttributeParams
,
priceAttributeParams
,
'_p'
)
// 这里可能为空数组
// 初始化若是按所有属性共用做显示处理
if
(
setImageType
){
if
(
setImageType
&&
_priceAttributeParams
.
length
>
0
){
setCommonImageList
(
_priceAttributeParams
[
0
].
commodityPic
)
}
...
...
@@ -261,7 +261,7 @@ const ProductImageForm: React.FC<Iprops> = (props) => {
banner
showIcon=
{
false
}
message=
""
description=
{
<>
1.
(按属性设置)
一次可以选择 6 张图片
<
br
/>
2. 图片尺寸为 800*800,单张大小不超过 600K,仅支持JPEG/JPG/PNG格式
<
br
/>
3. 图片质量要清晰,不要虚化,建议主图为白色背景正面图
</>
}
description=
{
<>
1. 一次可以选择 6 张图片
<
br
/>
2. 图片尺寸为 800*800,单张大小不超过 600K,仅支持JPEG/JPG/PNG格式
<
br
/>
3. 图片质量要清晰,不要虚化,建议主图为白色背景正面图
</>
}
type=
"info"
closable
style=
{
{
backgroundColor
:
'#F0F8FF'
,
color
:
'#1B9AEE'
}
}
...
...
@@ -289,7 +289,7 @@ const ProductImageForm: React.FC<Iprops> = (props) => {
banner
showIcon=
{
false
}
message=
""
description=
{
<>
1.
(所有属性共用)
一次可以选择 6 张图片
<
br
/>
2. 图片尺寸为 800*800,单张大小不超过 600K,仅支持JPEG/JPG/PNG格式
<
br
/>
3. 图片质量要清晰,不要虚化,建议主图为白色背景正面图
</>
}
description=
{
<>
1. 一次可以选择 6 张图片
<
br
/>
2. 图片尺寸为 800*800,单张大小不超过 600K,仅支持JPEG/JPG/PNG格式
<
br
/>
3. 图片质量要清晰,不要虚化,建议主图为白色背景正面图
</>
}
type=
"info"
closable
style=
{
{
backgroundColor
:
'#F0F8FF'
,
color
:
'#1B9AEE'
}
}
...
...
src/pages/commodity/products/directChannel.tsx
View file @
9c35319a
...
...
@@ -67,7 +67,7 @@ const DirectChannel: React.FC<{}> = () => {
key
:
'name'
,
className
:
'commonPickColor'
,
render
:
(
text
:
any
,
record
:
any
)
=>
<
EyePreview
url=
{
`/memberCenter/commodityAbility/commodity/products/viewDirectChannel?id=${record.id}`
}
url=
{
`/memberCenter/commodityAbility/commodity/products/
directChannel/
viewDirectChannel?id=${record.id}`
}
>
{
text
}
</
EyePreview
>
...
...
@@ -162,7 +162,7 @@ const DirectChannel: React.FC<{}> = () => {
];
const
clickModify
=
(
paramId
:
number
)
=>
{
history
.
push
(
`/memberCenter/commodityAbility/commodity/products/addDirectChannel?id=
${
paramId
}
`
)
history
.
push
(
`/memberCenter/commodityAbility/commodity/products/
directChannel/
addDirectChannel?id=
${
paramId
}
`
)
}
// paramId ? 单个删除 : 批量删除
...
...
@@ -294,7 +294,7 @@ const DirectChannel: React.FC<{}> = () => {
<
Space
>
<
Button
type=
'primary'
onClick=
{
()
=>
history
.
push
(
'/memberCenter/commodityAbility/commodity/products/addDirectChannel'
)
}
onClick=
{
()
=>
history
.
push
(
'/memberCenter/commodityAbility/commodity/products/
directChannel/
addDirectChannel'
)
}
>
<
PlusOutlined
/>
新建
</
Button
>
...
...
@@ -362,7 +362,7 @@ const DirectChannel: React.FC<{}> = () => {
<
Checkbox
.
Group
style=
{
{
width
:
'100%'
}
}
onChange=
{
onChangeUpShop
}
value=
{
checkedValues
}
>
<
Row
>
{
Array
.
isArray
(
shopsOption
)
&&
shopsOption
.
map
((
item
,
index
)
=>
<
Col
key=
{
index
}
span=
{
6
}
>
Array
.
isArray
(
shopsOption
)
&&
shopsOption
.
map
((
item
,
index
)
=>
<
Col
key=
{
index
}
span=
{
8
}
>
<
Checkbox
value=
{
item
}
>
{
item
.
name
}
</
Checkbox
>
</
Col
>)
}
...
...
src/pages/commodity/products/schema/channelSchema.tsx
View file @
9c35319a
...
...
@@ -228,9 +228,6 @@ export const addChannelSchema: ISchema = {
placeholder
:
'请选择品类'
,
className
:
'fixed-ant-selected-down'
,
// 该类强制将显示的下拉框出现在select下, 只有这里出现问题, ??
fetchSearch
:
PublicApi
.
getProductSelectGetSelectCategory
,
style
:
{
width
:
160
}
}
},
brandId
:
{
...
...
@@ -239,9 +236,6 @@ export const addChannelSchema: ISchema = {
"x-component-props"
:
{
placeholder
:
'请选择品牌'
,
fetchSearch
:
PublicApi
.
getProductSelectGetSelectBrand
,
style
:
{
width
:
160
}
}
},
parentMemberId
:
{
...
...
@@ -249,9 +243,6 @@ export const addChannelSchema: ISchema = {
enum
:
[],
'x-component-props'
:
{
placeholder
:
'上级渠道'
,
style
:
{
width
:
160
}
},
},
submit
:
{
...
...
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