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
4835f050
Commit
4835f050
authored
Sep 16, 2020
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:会员折扣价格计算
parent
5d5cd2df
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
14 deletions
+32
-14
menu.ts
src/locales/zh-CN/menu.ts
+2
-0
index.tsx
src/pages/lxMall/commodity/index.tsx
+2
-2
index.tsx
src/pages/lxMall/commodityDetail/index.tsx
+4
-0
index.tsx
...es/lxMall/components/Filter/components/Category/index.tsx
+5
-2
index.tsx
...pages/lxMall/components/Filter/components/Price/index.tsx
+19
-10
No files found.
src/locales/zh-CN/menu.ts
View file @
4835f050
...
...
@@ -19,6 +19,8 @@ export default {
'menu.shopCommodity'
:
'商品'
,
'menu.shopCommoditySearch'
:
'商品搜索'
,
'menu.shopCommodityDetail'
:
'商品详情'
,
'menu.channelCommodityDetail'
:
'商品详情'
,
'menu.channelmallCommoditySearch'
:
'商品搜索'
,
'menu.purchaseOnline'
:
'在线求购'
,
'menu.pointsMall'
:
'积分商城'
,
'menu.shopPointsMall'
:
'积分兑换'
,
...
...
src/pages/lxMall/commodity/index.tsx
View file @
4835f050
...
...
@@ -259,9 +259,9 @@ const Commodity: React.FC<CommodityPropsType> = (props) => {
<
div
className=
{
styles
.
commodity_container
}
>
<
Filter
filterConfig=
{
filterConfig
}
{
...
props
}
/>
<
div
className=
{
styles
.
commodity_main
}
>
<
div
className=
{
styles
.
banner
}
>
{
/*
<div className={styles.banner}>
<img src={bannerImg} />
</
div
>
</div>
*/
}
<
div
className=
{
styles
.
tool_bar
}
>
<
div
className=
{
styles
.
tool_bar_left
}
>
<
div
className=
{
styles
.
tool_bar_filter_item
}
onClick=
{
()
=>
handleSort
(
FILTER_TYPE
.
soldSort
)
}
>
...
...
src/pages/lxMall/commodityDetail/index.tsx
View file @
4835f050
...
...
@@ -465,6 +465,10 @@ const CommodityDetail = (props) => {
}
}
}
// 会员折扣价格
if
(
parameter
)
{
unitPrice
=
unitPrice
*
parameter
}
return
unitPrice
}
...
...
src/pages/lxMall/components/Filter/components/Category/index.tsx
View file @
4835f050
...
...
@@ -24,14 +24,16 @@ const Category: React.FC<CategoryPropsType> = (props) => {
const
[
categoryList
,
setCategoryList
]
=
useState
<
any
>
([])
const
[
lastCategoryId
,
setLastCategoryId
]
=
useState
<
number
>
()
const
[
attributeList
,
setAttributeList
]
=
useState
<
any
>
([])
//
const [selectAttrbuteList, setSelectAttrbuteList] = useState<any>([])
const
[
selectAttrbuteList
,
setSelectAttrbuteList
]
=
useState
<
any
>
([])
useEffect
(()
=>
{
if
(
isEmpty
(
filterList
))
{
setSelectedKeys
([])
setLastCategoryId
(
null
)
setSelectAttrbuteList
([])
}
else
{
let
initKeys
=
[]
// let initAttrKeys = []
for
(
let
item
of
filterList
)
{
if
(
item
.
type
===
FILTER_TYPE
.
category
)
{
initKeys
.
push
(
String
(
item
.
key
))
...
...
@@ -200,6 +202,7 @@ const Category: React.FC<CategoryPropsType> = (props) => {
const
handleChange
=
(
attrId
,
checkedList
)
=>
{
setSelectAttrbuteList
(
checkedList
)
let
tempSelect
=
[]
let
attrInfo
:
any
=
getDetailById
(
attrId
,
attrId
,
1
)
let
tempItem
=
{
...
...
@@ -266,7 +269,7 @@ const Category: React.FC<CategoryPropsType> = (props) => {
title=
{
attrItem
.
name
}
>
<
div
className=
{
styles
.
filter_style
}
>
<
CheckboxGroup
options=
{
attrItem
.
attributeValueList
}
onChange=
{
(
val
)
=>
handleChange
(
attrItem
.
id
,
val
)
}
/>
<
CheckboxGroup
value=
{
selectAttrbuteList
}
options=
{
attrItem
.
attributeValueList
}
onChange=
{
(
val
)
=>
handleChange
(
attrItem
.
id
,
val
)
}
/>
</
div
>
</
FilterBox
>
))
...
...
src/pages/lxMall/components/Filter/components/Price/index.tsx
View file @
4835f050
...
...
@@ -10,8 +10,9 @@ interface PricePropsType {
}
const
Price
:
React
.
FC
<
PricePropsType
>
=
(
props
)
=>
{
const
{
onFilter
}
=
props
.
FilterStore
const
[
priceRange
,
setPriceRange
]
=
useState
<
any
>
([
0
,
900
])
const
{
onFilter
,
filterList
}
=
props
.
FilterStore
const
MAX_COUNT
=
900
const
[
priceRange
,
setPriceRange
]
=
useState
<
any
>
([
0
,
MAX_COUNT
])
const
handlePriceChange
=
(
value
)
=>
{
setPriceRange
(
value
)
...
...
@@ -36,32 +37,40 @@ const Price: React.FC<PricePropsType> = (props) => {
const
handleConfirmPriceRange
=
()
=>
{
let
min
=
priceRange
[
0
]
let
max
=
priceRange
[
1
]
if
(
min
===
900
)
{
if
(
min
===
MAX_COUNT
)
{
filterMinPrice
(
min
)
}
else
if
(
min
===
0
&&
max
!==
900
)
{
filterMinPrice
(
min
,
false
)
}
else
if
(
min
===
0
&&
max
!==
MAX_COUNT
)
{
if
(
checkHasType
(
FILTER_TYPE
.
minPrice
))
{
filterMinPrice
(
min
,
false
)
}
filterMaxPrice
(
max
)
}
else
if
(
min
!==
0
&&
max
===
900
)
{
}
else
if
(
min
!==
0
&&
max
===
MAX_COUNT
)
{
filterMinPrice
(
min
)
filterMaxPrice
(
max
,
false
)
}
else
if
((
min
===
0
&&
max
===
900
)
||
(
min
!==
0
&&
max
!==
900
))
{
if
(
checkHasType
(
FILTER_TYPE
.
maxPrice
))
{
filterMaxPrice
(
max
,
false
)
}
}
else
if
((
min
===
0
&&
max
===
MAX_COUNT
)
||
(
min
!==
0
&&
max
!==
MAX_COUNT
))
{
filterMinPrice
(
min
)
filterMaxPrice
(
max
)
}
}
const
checkHasType
=
(
type
)
=>
{
return
filterList
.
some
(
item
=>
item
.
type
===
type
)
}
return
(
<
FilterBox
title=
"价格"
>
<
div
className=
"filter_price"
>
<
Slider
range
step=
{
1
}
min=
{
0
}
max=
{
900
}
value=
{
priceRange
}
onChange=
{
handlePriceChange
}
/>
<
Slider
range
step=
{
1
}
min=
{
0
}
max=
{
MAX_COUNT
}
value=
{
priceRange
}
onChange=
{
handlePriceChange
}
/>
<
div
className=
"price_box"
>
<
span
className=
"price_box_brief"
>
价格:
</
span
>
<
div
className=
"price_range"
>
<
span
className=
"price"
>
¥
{
priceRange
[
0
]
}
</
span
>
<
span
className=
"split"
>
-
</
span
>
<
span
className=
"price"
>
{
priceRange
[
0
]
===
900
?
''
:
`¥${priceRange[1]}`
}
</
span
>
<
span
className=
"price"
>
{
priceRange
[
0
]
===
MAX_COUNT
?
''
:
`¥${priceRange[1]}`
}
</
span
>
</
div
>
<
div
className=
"confirm_btn"
onClick=
{
()
=>
handleConfirmPriceRange
()
}
>
确定
</
div
>
</
div
>
...
...
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