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
6bc3822b
Commit
6bc3822b
authored
Oct 15, 2020
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into test
parents
221da183
251ac9fc
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
4 deletions
+21
-4
addProducts.tsx
src/pages/commodity/products/addProducts.tsx
+7
-2
productDescFormDefault.tsx
...odity/products/addProductsItem/productDescFormDefault.tsx
+0
-0
RuleSetting.tsx
...s/transaction/transactionRules/components/RuleSetting.tsx
+12
-1
index.tsx
src/pages/transaction/transactionRules/schema/index.tsx
+2
-1
No files found.
src/pages/commodity/products/addProducts.tsx
View file @
6bc3822b
...
@@ -202,14 +202,19 @@ const AddProducts: React.FC<{}> = (props) => {
...
@@ -202,14 +202,19 @@ const AddProducts: React.FC<{}> = (props) => {
_item
.
goods
=
{
id
:
_item
.
goodsId
}
// id为0表示无货品
_item
.
goods
=
{
id
:
_item
.
goodsId
}
// id为0表示无货品
delete
_item
.
goodsId
delete
_item
.
goodsId
// 过滤掉上传失败时 返回null等无效数据
if
(
_item
.
commodityPic
.
length
>
0
)
{
if
(
_item
.
commodityPic
.
length
>
0
)
{
// 编辑情况下兼顾手动添加图片列表属性
// 编辑情况下兼顾手动添加图片列表属性
_item
.
commodityPic
=
_item
.
commodityPic
.
map
(
__item
=>
__item
?.
response
?.
data
||
__item
?.
url
)
_item
.
commodityPic
=
_item
.
commodityPic
.
map
(
__item
=>
__item
?.
response
?.
data
||
__item
?.
url
)
if
(
_item
.
commodityPic
.
filter
(
Boolean
).
length
===
0
){
throw
new
Error
(
'每项请至少上传一张商品图片!'
)
}
// 多种属性组合 所有属性共用的情况下 每一行都是用第一项
// 多种属性组合 所有属性共用的情况下 每一行都是用第一项
if
(
isAllAttributePic
)
if
(
isAllAttributePic
)
{
_item
.
commodityPic
=
_productAttributeAndImageParams
[
0
].
commodityPic
_item
.
commodityPic
=
_productAttributeAndImageParams
[
0
].
commodityPic
}
}
else
{
}
else
{
if
(
isAllAttributePic
&&
_productAttributeAndImageParams
[
0
].
commodityPic
.
length
>
0
)
{
//处理所有属性共用
if
(
isAllAttributePic
&&
_productAttributeAndImageParams
[
0
].
commodityPic
.
length
>
0
&&
_productAttributeAndImageParams
[
0
].
commodityPic
.
filter
(
Boolean
).
length
>
0
)
{
//处理所有属性共用
_item
.
commodityPic
=
_productAttributeAndImageParams
[
0
].
commodityPic
_item
.
commodityPic
=
_productAttributeAndImageParams
[
0
].
commodityPic
}
}
else
else
...
...
src/pages/commodity/products/addProductsItem/productDescFormDefault.tsx
View file @
6bc3822b
src/pages/transaction/transactionRules/components/RuleSetting.tsx
View file @
6bc3822b
import
React
,
{
useEffect
,
useState
}
from
'react'
import
React
,
{
useEffect
,
use
Ref
,
use
State
}
from
'react'
import
{
usePageStatus
,
PageStatus
}
from
'@/hooks/usePageStatus'
import
{
usePageStatus
,
PageStatus
}
from
'@/hooks/usePageStatus'
import
{
useInitValue
}
from
'@/formSchema/effects/useInitValue'
import
{
useInitValue
}
from
'@/formSchema/effects/useInitValue'
import
EyePreview
from
'@/components/EyePreview'
import
EyePreview
from
'@/components/EyePreview'
...
@@ -35,6 +35,7 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
...
@@ -35,6 +35,7 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
const
[
productRowSelection
,
productRowCtl
]
=
useRowSelectionTable
({
customKey
:
'id'
})
const
[
productRowSelection
,
productRowCtl
]
=
useRowSelectionTable
({
customKey
:
'id'
})
const
[
productsLength
,
setProductsLength
]
=
useState
(
0
)
const
[
productsLength
,
setProductsLength
]
=
useState
(
0
)
const
[
initValue
,
setInitialValue
]
=
useState
({})
const
[
initValue
,
setInitialValue
]
=
useState
({})
const
[
idNotInList
,
setIdNotInList
]
=
useState
([])
const
{
const
{
id
,
id
,
...
@@ -51,6 +52,7 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
...
@@ -51,6 +52,7 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
...
params
,
...
params
,
shopType
:
shopInfo
[
0
].
type
,
shopType
:
shopInfo
[
0
].
type
,
environment
:
shopInfo
[
0
].
environment
,
environment
:
shopInfo
[
0
].
environment
,
idNotInList
:
idNotInList
,
})
})
return
res
.
data
return
res
.
data
}
else
{
}
else
{
...
@@ -266,6 +268,14 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
...
@@ -266,6 +268,14 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
}
}
}
}
// // 查询已设置交易规则的列表
const
fatchSetedProducts
=
(
id
)
=>
{
PublicApi
.
getOrderTradingRulesProductIdList
({
shopId
:
id
}).
then
(
res
=>
{
const
{
data
,
code
}
=
res
setIdNotInList
(()
=>
data
?.
productIds
||
[])
})
}
return
(
return
(
<>
<>
<
NiceForm
<
NiceForm
...
@@ -295,6 +305,7 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
...
@@ -295,6 +305,7 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
setFieldState
(
'isTacitlyApprove'
,
state
=>
{
setFieldState
(
'isTacitlyApprove'
,
state
=>
{
state
.
value
=
1
state
.
value
=
1
})
})
fatchSetedProducts
(
parentState
.
value
[
0
])
})
})
}
}
}
}
onSubmit=
{
handleSubmit
}
onSubmit=
{
handleSubmit
}
...
...
src/pages/transaction/transactionRules/schema/index.tsx
View file @
6bc3822b
...
@@ -173,7 +173,8 @@ export const ruleDetailSchema: ISchema = padRequiredMessage({
...
@@ -173,7 +173,8 @@ export const ruleDetailSchema: ISchema = padRequiredMessage({
"x-component-props"
:
{
"x-component-props"
:
{
rowKey
:
'id'
,
rowKey
:
'id'
,
columns
:
"{{tableColumns}}"
,
columns
:
"{{tableColumns}}"
,
prefix
:
"{{tableAddButton}}"
prefix
:
"{{tableAddButton}}"
,
idNotList
:
[]
}
}
}
}
}
}
...
...
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