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
2ed2c378
Commit
2ed2c378
authored
Nov 13, 2020
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:1.修改所有商品列表接口价格类型字段;2.商品详情询价保存商品参数到sessionstorage
parent
4442f6d2
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
185 additions
and
45 deletions
+185
-45
index.less
...xMall/commodityDetail/components/BrowseRecords/index.less
+11
-0
index.tsx
...lxMall/commodityDetail/components/BrowseRecords/index.tsx
+26
-2
index.less
...s/lxMall/commodityDetail/components/Interested/index.less
+10
-0
index.tsx
...es/lxMall/commodityDetail/components/Interested/index.tsx
+48
-12
index.less
...onents/ProductDescription/components/Recommand/index.less
+14
-0
index.tsx
...ponents/ProductDescription/components/Recommand/index.tsx
+32
-5
index.tsx
src/pages/lxMall/commodityDetail/index.tsx
+40
-21
index.ts
src/store/filter/index.ts
+4
-5
No files found.
src/pages/lxMall/commodityDetail/components/BrowseRecords/index.less
View file @
2ed2c378
...
...
@@ -26,6 +26,17 @@
.browse_records_product_list {
.inquiry_price {
color: #FFF;
background-color: var(--mall_main_color);
font-size: 14px;
height: 18px;
line-height: 14px;
padding: 2px 8px;
display: inline-block;
margin-top: 4px;
}
&_item {
padding: 0 15px;
margin-bottom: 10px;
...
...
src/pages/lxMall/commodityDetail/components/BrowseRecords/index.tsx
View file @
2ed2c378
...
...
@@ -43,6 +43,31 @@ const BrowseRecords: React.FC<BrowseRecordsPropsType> = (props) => {
return
link
}
const
showPriceByType
=
(
info
:
any
)
=>
{
if
(
info
)
{
switch
(
info
.
priceType
)
{
case
COMMODITY_TYPE
.
inquiry
:
return
(
<
div
className=
{
styles
.
inquiry_price
}
>
<
label
>
在线询价
</
label
>
</
div
>
)
case
COMMODITY_TYPE
.
integral
:
return
(
<
div
className=
{
cx
(
styles
.
product_price
,
styles
.
integral
)
}
>
{
info
.
min
===
info
.
max
?
`${numFormat(info.min)}积分`
:
`${numFormat(info.min)}~${numFormat(info.max)}积分`
}
</
div
>
)
case
COMMODITY_TYPE
.
prompt
:
return
<
div
className=
{
styles
.
product_price
}
>
¥
{
priceFormat
(
info
.
min
)
}
</
div
>
default
:
return
null
break
}
}
return
null
}
return
(
priceType
&&
list
.
length
>
0
)
?
(
<
div
className=
{
styles
.
browse_records
}
>
<
div
className=
{
styles
.
browse_records_title
}
>
...
...
@@ -63,8 +88,7 @@ const BrowseRecords: React.FC<BrowseRecordsPropsType> = (props) => {
<
ImageBox
width=
{
110
}
height=
{
110
}
imgUrl=
{
childItem
.
mainPic
}
direction=
"column"
/>
</
div
>
{
priceType
===
COMMODITY_TYPE
.
integral
?
<
div
className=
{
cx
(
styles
.
product_price
,
styles
.
integral
)
}
>
{
numFormat
(
childItem
.
min
)
}
~
{
numFormat
(
childItem
.
max
)
}
积分
</
div
>
:
<
div
className=
{
styles
.
product_price
}
>
¥
{
priceFormat
(
childItem
.
min
)
}
</
div
>
showPriceByType
(
childItem
)
}
</
a
>
</
div
>
...
...
src/pages/lxMall/commodityDetail/components/Interested/index.less
View file @
2ed2c378
...
...
@@ -10,6 +10,16 @@
font-weight: bold;
}
.inquiry_price {
color: #FFF;
background-color: var(--mall_main_color);
font-size: 14px;
height: 18px;
line-height: 14px;
padding: 2px 8px;
display: inline-block;
}
.interested_product_list {
&_item {
padding: 0 20px;
...
...
src/pages/lxMall/commodityDetail/components/Interested/index.tsx
View file @
2ed2c378
import
React
,
{
useEffect
,
useState
}
from
'react'
import
{
COMMODITY_TYPE
,
LAYOUT_TYPE
}
from
'@/constants'
import
cx
from
'classnames'
import
{
message
}
from
'antd'
import
{
PublicApi
}
from
'@/services/api'
import
ImageBox
from
'@/components/ImageBox'
import
{
GlobalConfig
}
from
'@/global/config'
...
...
@@ -26,34 +27,44 @@ const Interested: React.FC<InterestedPropsType> = (props) => {
const
getchLatelyCommodity
=
()
=>
{
let
getFn
let
param
:
any
=
{}
let
param
:
any
=
{
current
:
1
,
pageSize
:
5
}
switch
(
layoutType
)
{
case
LAYOUT_TYPE
.
shop
:
case
LAYOUT_TYPE
.
mall
:
param
.
storeId
=
shopInfo
.
id
if
(
priceType
===
COMMODITY_TYPE
.
integral
)
{
param
.
isScore
=
true
}
else
{
param
.
isScore
=
false
param
.
priceTypeList
=
[
3
]
getFn
=
PublicApi
.
postSearchShopScoreGetCommodityList
}
else
if
(
priceType
===
COMMODITY_TYPE
.
inquiry
)
{
param
.
priceTypeList
=
[
2
]
getFn
=
PublicApi
.
postSearchShopStoreGetCommodityList
}
else
if
(
priceType
===
COMMODITY_TYPE
.
prompt
)
{
param
.
priceTypeList
=
[
1
]
getFn
=
PublicApi
.
postSearchShopStoreGetCommodityList
}
getFn
=
PublicApi
.
getSearchShopStoreGetLatelyCommodity
break
case
LAYOUT_TYPE
.
channel
:
case
LAYOUT_TYPE
.
ichannel
:
param
.
channelMemberId
=
shopInfo
.
memberId
if
(
priceType
===
COMMODITY_TYPE
.
integral
)
{
param
.
isScore
=
true
}
else
{
param
.
isScore
=
false
param
.
priceTypeList
=
[
3
]
}
else
if
(
priceType
===
COMMODITY_TYPE
.
inquiry
)
{
param
.
priceTypeList
=
[
2
]
}
else
if
(
priceType
===
COMMODITY_TYPE
.
prompt
)
{
param
.
priceTypeList
=
[
1
]
}
getFn
=
PublicApi
.
getSearchShopChannelGetLatelyCommodity
getFn
=
PublicApi
.
postSearchShopChannelGetCommodityList
break
default
:
break
;
}
getFn
&&
getFn
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setCommodityList
(
res
.
data
)
message
.
destroy
()
setCommodityList
(
res
.
data
.
data
)
}
})
}
...
...
@@ -73,6 +84,32 @@ const Interested: React.FC<InterestedPropsType> = (props) => {
return
link
}
const
showPriceByType
=
(
info
:
any
)
=>
{
if
(
info
)
{
switch
(
info
.
priceType
)
{
case
COMMODITY_TYPE
.
inquiry
:
return
(
<
div
className=
{
styles
.
inquiry_price
}
>
<
label
>
在线询价
</
label
>
</
div
>
)
case
COMMODITY_TYPE
.
integral
:
return
(
<
div
className=
{
cx
(
styles
.
interested_product_list_item_price
,
styles
.
integral
)
}
>
{
info
.
min
===
info
.
max
?
`${numFormat(info.min)}积分`
:
`${numFormat(info.min)}~${numFormat(info.max)}积分`
}
</
div
>
)
case
COMMODITY_TYPE
.
prompt
:
return
<
div
className=
{
styles
.
interested_product_list_item_price
}
><
span
>
¥
</
span
>
{
priceFormat
(
info
.
min
)
}
</
div
>
default
:
return
null
break
}
}
return
null
}
return
(
<
div
className=
{
styles
.
interested
}
>
<
div
className=
{
styles
.
interested_title
}
>
最近销售
</
div
>
...
...
@@ -86,8 +123,7 @@ const Interested: React.FC<InterestedPropsType> = (props) => {
</
div
>
<
div
className=
{
styles
.
interested_product_list_item_name
}
>
{
item
.
name
}
</
div
>
{
priceType
===
COMMODITY_TYPE
.
integral
?
<
div
className=
{
cx
(
styles
.
interested_product_list_item_price
,
styles
.
integral
)
}
>
{
item
.
min
===
item
.
max
?
`${numFormat(item.min)}积分`
:
`${numFormat(item.min)}~${numFormat(item.max)}积分`
}
</
div
>
:
<
div
className=
{
styles
.
interested_product_list_item_price
}
><
span
>
¥
</
span
>
{
priceFormat
(
item
.
min
)
}
</
div
>
showPriceByType
(
item
)
}
</
div
>
</
a
>
...
...
src/pages/lxMall/commodityDetail/components/ProductDescription/components/Recommand/index.less
View file @
2ed2c378
...
...
@@ -11,6 +11,16 @@
padding-left: 20px;
}
.inquiry_price {
color: #FFF;
background-color: var(--mall_main_color);
font-size: 14px;
height: 18px;
line-height: 14px;
padding: 2px 8px;
display: inline-block;
}
.recommand_list {
display: flex;
flex-wrap: wrap;
...
...
@@ -44,6 +54,10 @@
color: #D32F2F;
margin-top: 10px;
&.integral {
color: #EA8000;
}
&>span {
font-size: 12px;
}
...
...
src/pages/lxMall/commodityDetail/components/ProductDescription/components/Recommand/index.tsx
View file @
2ed2c378
import
React
from
'react'
import
{
LAYOUT_TYPE
}
from
'@/constants'
import
{
LAYOUT_TYPE
,
COMMODITY_TYPE
}
from
'@/constants'
import
ImageBox
from
'@/components/ImageBox'
import
{
GlobalConfig
}
from
'@/global/config'
import
cx
from
'classnames'
import
{
numFormat
,
priceFormat
}
from
'@/utils/numberFomat'
import
styles
from
'./index.less'
interface
RecommandPropsTyep
{
...
...
@@ -28,6 +30,32 @@ const Recommand: React.FC<RecommandPropsTyep> = (props) => {
return
link
}
const
showPriceByType
=
(
info
:
any
)
=>
{
if
(
info
)
{
switch
(
info
.
priceType
)
{
case
COMMODITY_TYPE
.
inquiry
:
return
(
<
div
className=
{
styles
.
inquiry_price
}
>
<
label
>
在线询价
</
label
>
</
div
>
)
case
COMMODITY_TYPE
.
integral
:
return
(
<
div
className=
{
cx
(
styles
.
recommand_list_item_price
,
styles
.
integral
)
}
>
{
info
.
min
===
info
.
max
?
`${numFormat(info.min)}积分`
:
`${numFormat(info.min)}~${numFormat(info.max)}积分`
}
</
div
>
)
case
COMMODITY_TYPE
.
prompt
:
return
<
div
className=
{
styles
.
recommand_list_item_price
}
>
¥
{
priceFormat
(
info
.
min
)
}
</
div
>
default
:
return
null
break
}
}
return
null
}
return
(
dataList
&&
dataList
.
length
>
0
)
&&
(
<
div
className=
{
styles
.
recommand
}
>
<
div
className=
{
styles
.
recommand_title
}
>
买家还在看
</
div
>
...
...
@@ -40,10 +68,9 @@ const Recommand: React.FC<RecommandPropsTyep> = (props) => {
<
ImageBox
width=
{
184
}
height=
{
184
}
imgUrl=
{
item
.
mainPic
}
direction=
"column"
/>
</
div
>
<
div
className=
{
styles
.
recommand_list_item_name
}
>
{
item
.
name
}
</
div
>
<
div
className=
{
styles
.
recommand_list_item_price
}
>
<
span
>
¥
</
span
>
{
item
.
min
}
</
div
>
{
showPriceByType
(
item
)
}
</
div
>
</
a
>
))
...
...
src/pages/lxMall/commodityDetail/index.tsx
View file @
2ed2c378
...
...
@@ -96,47 +96,49 @@ const CommodityDetail = (props) => {
let
getListFn
switch
(
layoutType
)
{
case
LAYOUT_TYPE
.
shop
:
param
.
storeId
=
shopId
switch
(
priceType
)
{
case
COMMODITY_TYPE
.
prompt
:
param
.
storeId
=
shopId
param
.
priceTypeList
=
[
1
]
getListFn
=
PublicApi
.
postSearchShopStoreGetCommodityList
break
case
COMMODITY_TYPE
.
inquiry
:
getListFn
=
PublicApi
.
postSearchShopScoreGetCommodityList
param
.
priceTypeList
=
[
2
]
getListFn
=
PublicApi
.
postSearchShopStoreGetCommodityList
break
case
COMMODITY_TYPE
.
integral
:
param
.
priceTypeList
=
[
3
]
getListFn
=
PublicApi
.
postSearchShopScoreGetCommodityList
break
default
:
break
}
break
;
case
LAYOUT_TYPE
.
channel
:
headers
=
{
type
:
3
}
param
.
channelMemberId
=
memberId
if
(
priceType
===
COMMODITY_TYPE
.
prompt
)
{
param
.
channelMemberId
=
memberId
headers
=
{
type
:
3
}
param
.
priceTypeList
=
[
1
]
}
else
if
(
priceType
===
COMMODITY_TYPE
.
inquiry
)
{
param
.
priceTypeList
=
[
2
]
}
else
{
param
.
channelMemberId
=
memberId
param
.
priceType
=
3
headers
=
{
type
:
3
}
param
.
priceTypeList
=
[
3
]
}
getListFn
=
PublicApi
.
postSearchShopChannelGetCommodityList
break
case
LAYOUT_TYPE
.
ichannel
:
headers
=
{
type
:
4
}
param
.
channelMemberId
=
memberId
if
(
priceType
===
COMMODITY_TYPE
.
prompt
)
{
param
.
channelMemberId
=
memberId
headers
=
{
type
:
4
}
param
.
priceTypeList
=
[
1
]
}
else
if
(
priceType
===
COMMODITY_TYPE
.
inquiry
)
{
param
.
priceTypeList
=
[
2
]
}
else
{
param
.
channelMemberId
=
memberId
param
.
priceType
=
3
headers
=
{
type
:
4
}
param
.
priceTypeList
=
[
3
]
}
getListFn
=
PublicApi
.
postSearchShopChannelGetCommodityList
break
...
...
@@ -194,6 +196,8 @@ const CommodityDetail = (props) => {
if
(
getAuth
()
&&
res
.
data
?.
isMemberPrice
)
{
getMemberCredit
(
res
.
data
?.
memberId
,
res
.
data
?.
memberRoleId
)
}
}
else
{
message
.
info
(
res
.
message
)
}
})
}
...
...
@@ -518,7 +522,22 @@ const CommodityDetail = (props) => {
if
(
!
checkoutUserInfo
())
{
return
}
window
.
location
.
href
=
`/memberCenter/tranactionAbility/goodsOffer/addEnquiryOrder/rfq?id=
${
id
}
&memberId=
${
memberId
}
`
let
inquiryParam
=
{
id
:
selectCommodityId
,
brand
:
commodityDetail
.
brand
,
logistics
:
commodityDetail
.
logistics
,
memberId
:
commodityDetail
.
memberId
,
memberRoleId
:
commodityDetail
.
memberRoleId
,
memberRoleName
:
commodityDetail
.
memberRoleName
,
name
:
commodityDetail
.
name
,
packing
:
commodityDetail
.
packing
,
unitName
:
commodityDetail
.
unitName
,
}
let
sessionKey
=
`inquiry
${
selectCommodityId
}${
new
Date
().
getTime
()}
`
updateOrderInfo
(
inquiryParam
,
sessionKey
).
then
(()
=>
{
window
.
location
.
href
=
`/memberCenter/tranactionAbility/goodsOffer/addEnquiryOrder/rfq?id=
${
id
}
&memberId=
${
memberId
}
&spam_id=
${
sessionKey
}
`
})
}
/**
...
...
src/store/filter/index.ts
View file @
2ed2c378
import
{
action
,
computed
,
observable
,
runInAction
}
from
'mobx'
import
isEmpty
from
'lodash/isEmpty'
import
{
action
,
observable
,
runInAction
}
from
'mobx'
import
{
PublicApi
}
from
'@/services/api'
import
{
FILTER_TYPE
}
from
'@/constants'
...
...
@@ -143,7 +142,7 @@ class FilterStore {
tempFilterParam
.
brandId
=
filterItem
.
key
break
case
FILTER_TYPE
.
commodityType
:
tempFilterParam
.
priceType
=
filterItem
.
key
tempFilterParam
.
priceType
List
=
[
filterItem
.
key
]
break
case
FILTER_TYPE
.
minPoints
:
case
FILTER_TYPE
.
minPrice
:
...
...
@@ -211,7 +210,7 @@ class FilterStore {
tempFilterParam
.
brandName
=
filterItem
.
title
break
case
FILTER_TYPE
.
commodityType
:
tempFilterParam
.
priceType
=
filterItem
.
key
tempFilterParam
.
priceType
List
=
[
filterItem
.
key
]
break
case
FILTER_TYPE
.
minPrice
:
tempFilterParam
.
min
=
filterItem
.
key
...
...
@@ -347,7 +346,7 @@ class FilterStore {
if
(
data
.
priceType
)
{
tempFilter
.
push
({
type
:
FILTER_TYPE
.
commodityType
,
title
:
getItemText
(
data
.
priceType
)
,
title
:
[
getItemText
(
data
.
priceType
)]
,
key
:
data
.
priceType
})
}
...
...
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