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
41c49a52
Commit
41c49a52
authored
Aug 18, 2020
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:
parent
9fd9e0c4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
27 deletions
+30
-27
index.tsx
src/pages/classAndProperty/propertyValue/index.tsx
+0
-2
addProducts.tsx
src/pages/commodity/products/addProducts.tsx
+16
-13
fastModifyPrice.tsx
src/pages/commodity/products/fastModifyPrice.tsx
+0
-0
index.tsx
src/pages/commodity/products/index.tsx
+7
-4
viewProducts.tsx
src/pages/commodity/products/viewProducts.tsx
+1
-3
addBrand.tsx
src/pages/trademark/addBrand.tsx
+6
-5
No files found.
src/pages/classAndProperty/propertyValue/index.tsx
View file @
41c49a52
...
@@ -153,14 +153,12 @@ const PropertyValue: React.FC<{}> = () => {
...
@@ -153,14 +153,12 @@ const PropertyValue: React.FC<{}> = () => {
const
confirm
=
(
record
:
any
)
=>
{
const
confirm
=
(
record
:
any
)
=>
{
PublicApi
.
postProductCustomerUpdateCustomerAttributeValueStatus
({
id
:
record
.
id
,
isEnable
:
!
record
.
isEnable
}).
then
(
res
=>
{
PublicApi
.
postProductCustomerUpdateCustomerAttributeValueStatus
({
id
:
record
.
id
,
isEnable
:
!
record
.
isEnable
}).
then
(
res
=>
{
//@ts-ignore
ref
.
current
.
reload
()
ref
.
current
.
reload
()
})
})
}
}
const
clickDelete
=
(
record
:
any
)
=>
{
const
clickDelete
=
(
record
:
any
)
=>
{
PublicApi
.
postProductCustomerDeleteCustomerAttributeValue
({
id
:
record
.
id
}).
then
(
res
=>
{
PublicApi
.
postProductCustomerDeleteCustomerAttributeValue
({
id
:
record
.
id
}).
then
(
res
=>
{
//@ts-ignore
ref
.
current
.
reload
()
ref
.
current
.
reload
()
})
})
}
}
...
...
src/pages/commodity/products/addProducts.tsx
View file @
41c49a52
...
@@ -60,8 +60,8 @@ const AddProducts: React.FC<{}> = (props) => {
...
@@ -60,8 +60,8 @@ const AddProducts: React.FC<{}> = (props) => {
},
[])
},
[])
const
onSave
=
()
=>
{
const
onSave
=
()
=>
{
console
.
log
(
'点击保存'
)
//
console.log('点击保存')
console
.
log
(
formRefs
,
'formrefs'
)
//
console.log(formRefs, 'formrefs')
if
(
formRefs
.
length
>
0
){
if
(
formRefs
.
length
>
0
){
try
{
try
{
let
data
=
formRefs
.
map
(
async
__
=>
{
let
data
=
formRefs
.
map
(
async
__
=>
{
...
@@ -69,10 +69,10 @@ const AddProducts: React.FC<{}> = (props) => {
...
@@ -69,10 +69,10 @@ const AddProducts: React.FC<{}> = (props) => {
await
__
.
current
.
validateFields
()
await
__
.
current
.
validateFields
()
)
)
})
})
console
.
log
(
data
,
'data'
)
//
console.log(data,'data')
Promise
.
all
(
data
).
then
((
values
)
=>
{
Promise
.
all
(
data
).
then
((
values
)
=>
{
// 提交的数据进行处理
// 提交的数据进行处理
console
.
log
(
values
,
productSelectAttribute
,
productAttributeAndImageParams
,
'所有数据'
)
//
console.log(values, productSelectAttribute, productAttributeAndImageParams, '所有数据')
productSelectAttribute
.
length
>
0
&&
productSelectAttribute
.
map
(
_itme
=>
{
productSelectAttribute
.
length
>
0
&&
productSelectAttribute
.
map
(
_itme
=>
{
delete
_itme
.
attributeName
delete
_itme
.
attributeName
delete
_itme
.
isPrice
delete
_itme
.
isPrice
...
@@ -112,16 +112,19 @@ const AddProducts: React.FC<{}> = (props) => {
...
@@ -112,16 +112,19 @@ const AddProducts: React.FC<{}> = (props) => {
_params
.
logistics
.
weight
=
Number
(
_params
.
logistics
.
weight
)
_params
.
logistics
.
weight
=
Number
(
_params
.
logistics
.
weight
)
// 处理地址
// 处理地址
let
_commodityAreaList
:
any
=
[]
let
_commodityAreaList
:
any
=
[]
// console.log(_params, '_params')
_params
.
commodityAreaList
.
length
>
0
&&
_params
.
commodityAreaList
.
map
(
_itme
=>
{
_params
.
commodityAreaList
.
length
>
0
&&
_params
.
commodityAreaList
.
map
(
_itme
=>
{
let
_temp
:
any
=
{}
if
(
_itme
){
let
pobj
=
areaOption
.
filter
(
_
=>
_
.
code
===
_itme
[
0
])[
0
]
let
_temp
:
any
=
{}
let
cobj
=
pobj
.
areaResponses
.
filter
(
__
=>
__
.
code
===
_itme
[
1
])[
0
]
let
pobj
=
areaOption
.
filter
(
_
=>
_
.
code
===
_itme
[
0
])[
0
]
_temp
.
provinceCode
=
pobj
.
code
let
cobj
=
pobj
.
areaResponses
.
filter
(
__
=>
__
.
code
===
_itme
[
1
])[
0
]
_temp
.
provinceName
=
pobj
.
name
,
_temp
.
provinceCode
=
pobj
.
code
_temp
.
cityCode
=
cobj
.
code
,
_temp
.
provinceName
=
pobj
.
name
,
_temp
.
cityName
=
cobj
.
name
,
_temp
.
cityCode
=
cobj
.
code
,
_commodityAreaList
.
push
(
_temp
)
_temp
.
cityName
=
cobj
.
name
,
console
.
log
(
_itme
,
_temp
,
'地址的每一项'
)
_commodityAreaList
.
push
(
_temp
)
// console.log(_itme, _temp, '地址的每一项')
}
})
})
_params
.
commodityAreaList
=
_commodityAreaList
_params
.
commodityAreaList
=
_commodityAreaList
const
{
id
}
=
history
.
location
.
query
const
{
id
}
=
history
.
location
.
query
...
...
src/pages/commodity/products/fastModifyPrice.tsx
View file @
41c49a52
This diff is collapsed.
Click to expand it.
src/pages/commodity/products/index.tsx
View file @
41c49a52
...
@@ -59,6 +59,7 @@ const Products: React.FC<{}> = () => {
...
@@ -59,6 +59,7 @@ const Products: React.FC<{}> = () => {
const
[
shopsOption
,
setShopsOption
]
=
useState
<
GetProductCommodityGetShopResponse
>
([])
const
[
shopsOption
,
setShopsOption
]
=
useState
<
GetProductCommodityGetShopResponse
>
([])
const
[
checkedValues
,
setCheckedValues
]
=
useState
<
any
>
([])
const
[
checkedValues
,
setCheckedValues
]
=
useState
<
any
>
([])
const
[
currentOptionId
,
setCurrentOptionId
]
=
useState
()
const
[
currentOptionId
,
setCurrentOptionId
]
=
useState
()
const
[
isDisabledOKbtn
,
setIsDisabledOKbtn
]
=
useState
<
boolean
>
(
false
)
let
[
isHighSearch
,
setIsHighSearch
]
=
useState
(
false
)
let
[
isHighSearch
,
setIsHighSearch
]
=
useState
(
false
)
const
[
filterParams
,
setFilterParams
]
=
useState
<
paramItem
>
({
const
[
filterParams
,
setFilterParams
]
=
useState
<
paramItem
>
({
...
@@ -414,7 +415,7 @@ const Products: React.FC<{}> = () => {
...
@@ -414,7 +415,7 @@ const Products: React.FC<{}> = () => {
setCheckedValues
(
values
)
setCheckedValues
(
values
)
}
}
const
clickUp
=
(
param
:
any
,
id
:
any
)
=>
{
// 0 下架 1上架
const
clickUp
=
(
param
:
any
,
id
:
any
)
=>
{
//
param:
0 下架 1上架
setCurrentOptionId
(
id
)
setCurrentOptionId
(
id
)
PublicApi
.
getProductCommodityGetShop
({
id
:
id
}).
then
(
res
=>
{
PublicApi
.
getProductCommodityGetShop
({
id
:
id
}).
then
(
res
=>
{
setShopsOption
(
res
.
data
)
setShopsOption
(
res
.
data
)
...
@@ -425,6 +426,7 @@ const Products: React.FC<{}> = () => {
...
@@ -425,6 +426,7 @@ const Products: React.FC<{}> = () => {
}
}
const
handleUp
=
()
=>
{
const
handleUp
=
()
=>
{
setIsDisabledOKbtn
(
true
)
let
params
=
{
let
params
=
{
id
:
currentOptionId
,
id
:
currentOptionId
,
shopList
:
checkedValues
shopList
:
checkedValues
...
@@ -433,11 +435,13 @@ const Products: React.FC<{}> = () => {
...
@@ -433,11 +435,13 @@ const Products: React.FC<{}> = () => {
PublicApi
.
postProductCommodityPublishCommodity
(
params
).
then
(
res
=>
{
PublicApi
.
postProductCommodityPublishCommodity
(
params
).
then
(
res
=>
{
setUpDownModal
(
false
)
setUpDownModal
(
false
)
ref
.
current
.
reload
()
ref
.
current
.
reload
()
setIsDisabledOKbtn
(
false
)
})
})
else
else
PublicApi
.
postProductCommodityOffPublishCommodity
(
params
).
then
(
res
=>
{
PublicApi
.
postProductCommodityOffPublishCommodity
(
params
).
then
(
res
=>
{
setUpDownModal
(
false
)
setUpDownModal
(
false
)
ref
.
current
.
reload
()
ref
.
current
.
reload
()
setIsDisabledOKbtn
(
false
)
})
})
}
}
...
@@ -475,7 +479,7 @@ const Products: React.FC<{}> = () => {
...
@@ -475,7 +479,7 @@ const Products: React.FC<{}> = () => {
const
handleBatchDelete
=
(
ids
:
string
[])
=>
{
const
handleBatchDelete
=
(
ids
:
string
[])
=>
{
console
.
log
(
'删除'
,
ids
)
console
.
log
(
'删除'
,
ids
)
//@ts-ignore
//
@ts-ignore
PublicApi
.
postProductCommodityDeleteBatchCommodity
({
idList
:
ids
}).
then
(
res
=>
{
PublicApi
.
postProductCommodityDeleteBatchCommodity
({
idList
:
ids
}).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
if
(
res
.
code
===
1000
)
ref
.
current
.
reload
()
ref
.
current
.
reload
()
...
@@ -487,7 +491,6 @@ const Products: React.FC<{}> = () => {
...
@@ -487,7 +491,6 @@ const Products: React.FC<{}> = () => {
setFilterParams
(
restObj
)
setFilterParams
(
restObj
)
setBrandValue
(
undefined
)
setBrandValue
(
undefined
)
setClassValue
(
undefined
)
setClassValue
(
undefined
)
//@ts-ignore
ref
.
current
.
reload
(
restObj
)
ref
.
current
.
reload
(
restObj
)
}
}
...
@@ -533,7 +536,6 @@ const Products: React.FC<{}> = () => {
...
@@ -533,7 +536,6 @@ const Products: React.FC<{}> = () => {
console
.
log
(
val
)
console
.
log
(
val
)
let
obj
=
val
?
{...
filterParams
,
name
:
val
}
:
{
...
filterParams
}
let
obj
=
val
?
{...
filterParams
,
name
:
val
}
:
{
...
filterParams
}
setFilterParams
(
obj
)
setFilterParams
(
obj
)
//@ts-ignore
ref
.
current
.
reload
(
obj
)
ref
.
current
.
reload
(
obj
)
}
}
...
@@ -774,6 +776,7 @@ const Products: React.FC<{}> = () => {
...
@@ -774,6 +776,7 @@ const Products: React.FC<{}> = () => {
onOk=
{
handleUp
}
onOk=
{
handleUp
}
onCancel=
{
handleCancelUp
}
onCancel=
{
handleCancelUp
}
forceRender=
{
true
}
forceRender=
{
true
}
okButtonProps=
{
{
disabled
:
isDisabledOKbtn
}
}
>
>
<
Form
<
Form
layout=
"vertical"
layout=
"vertical"
...
...
src/pages/commodity/products/viewProducts.tsx
View file @
41c49a52
...
@@ -142,8 +142,6 @@ const viewProducts: React.FC<{}> = () => {
...
@@ -142,8 +142,6 @@ const viewProducts: React.FC<{}> = () => {
},
},
];
];
/* 商品属性显示 */
/* 商品属性显示 */
//以属性组和属性名称归档的数据
//以属性组和属性名称归档的数据
const
renderDataByTab
=
(
data
:
GetProductCommodityGetCommodityResponse
)
=>
{
const
renderDataByTab
=
(
data
:
GetProductCommodityGetCommodityResponse
)
=>
{
...
@@ -582,7 +580,7 @@ const viewProducts: React.FC<{}> = () => {
...
@@ -582,7 +580,7 @@ const viewProducts: React.FC<{}> = () => {
{
/* 视频区块 */
}
{
/* 视频区块 */
}
<
div
className=
{
styles
.
descriptionBox
}
>
<
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
src=
{
_item
}
controls=
{
true
}
>
您的浏览器不支持视频标签,请及时升级。
您的浏览器不支持视频标签,请及时升级。
</
video
>
</
video
>
...
...
src/pages/trademark/addBrand.tsx
View file @
41c49a52
...
@@ -121,18 +121,19 @@ const AddBrand: React.FC<{}> = () => {
...
@@ -121,18 +121,19 @@ const AddBrand: React.FC<{}> = () => {
const
handleSave
=
()
=>
{
const
handleSave
=
()
=>
{
form
.
validateFields
().
then
((
values
:
any
)
=>
{
form
.
validateFields
().
then
((
values
:
any
)
=>
{
if
(
values
?.
proveUrl
?.
fileList
&&
fileList
.
length
){
console
.
log
(
values
,
'vvv'
)
delete
values
.
proveUrl
.
fileList
delete
values
.
proveUrl
.
file
}
if
(
history
.
location
.
query
.
id
){
if
(
history
.
location
.
query
.
id
){
values
.
id
=
Number
(
history
.
location
.
query
.
id
)
values
.
id
=
Number
(
history
.
location
.
query
.
id
)
let
obj
=
{};
let
obj
=
{};
fileList
.
forEach
((
item
,
index
)
=>
{
fileList
.
forEach
((
item
,
index
)
=>
{
obj
[
index
]
=
item
?.
url
obj
[
index
]
=
item
?.
url
||
item
?.
response
?.
data
})
})
values
.
proveUrl
=
obj
values
.
proveUrl
=
obj
}
}
if
(
values
?.
proveUrl
?.
fileList
&&
fileList
.
length
){
delete
values
.
proveUrl
.
fileList
delete
values
.
proveUrl
.
file
}
PublicApi
.
postProductBrandSaveOrUpdateBrand
(
values
).
then
(
res
=>
{
PublicApi
.
postProductBrandSaveOrUpdateBrand
(
values
).
then
(
res
=>
{
setIsEnableCheck
(
false
)
setIsEnableCheck
(
false
)
//@ts-ignore
//@ts-ignore
...
...
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