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
linweijiong
jinfa-platform
Commits
a2bc0d68
Commit
a2bc0d68
authored
Dec 17, 2020
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 企业商城模板信息接口更换,修复商品详情库存显示问题
parent
eca4ffe3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
20 deletions
+26
-20
index.tsx
src/pages/lxMall/channel/index.tsx
+13
-12
index.tsx
src/pages/lxMall/commodityDetail/index.tsx
+7
-3
index.tsx
src/pages/lxMall/index/index.tsx
+4
-4
index.tsx
src/pages/lxMall/shop/index.tsx
+2
-1
No files found.
src/pages/lxMall/channel/index.tsx
View file @
a2bc0d68
...
...
@@ -53,12 +53,12 @@ const ChannelIndex: React.FC<ChannelIndexPropsType> = (props) => {
},
[
shopInfo
])
const
findFirstAdvertsByType
=
(
templateId
)
=>
{
let
params
=
{
const
params
:
any
=
{
templateId
,
type
:
1
,
memberId
}
//@ts-ignore
PublicApi
.
getTemplateChannelFindAdvertsByType
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setFirstAdvertList
(
res
.
data
)
...
...
@@ -67,12 +67,12 @@ const ChannelIndex: React.FC<ChannelIndexPropsType> = (props) => {
}
const
findSecondAdvertsByType
=
(
templateId
)
=>
{
let
params
=
{
const
params
:
any
=
{
templateId
,
type
:
2
,
memberId
}
//@ts-ignore
PublicApi
.
getTemplateChannelFindAdvertsByType
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setSecondAdvertList
(
res
.
data
)
...
...
@@ -85,9 +85,11 @@ const ChannelIndex: React.FC<ChannelIndexPropsType> = (props) => {
*/
const
fetchFirstCategory
=
()
=>
{
return
new
Promise
((
resolve
)
=>
{
const
params
:
any
=
{
memberId
}
//@ts-ignore
PublicApi
.
getTemplateChannelFindAllFirstCategory
({
memberId
}).
then
(
res
=>
{
PublicApi
.
getTemplateChannelFindAllFirstCategory
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setCategoryList
(
res
.
data
)
resolve
(
res
.
data
)
...
...
@@ -101,13 +103,12 @@ const ChannelIndex: React.FC<ChannelIndexPropsType> = (props) => {
*/
const
fetchCategoryById
=
(
categoryId
,
templateId
)
=>
{
return
new
Promise
((
resolve
)
=>
{
let
param
=
{
const
param
:
any
=
{
templateId
:
templateId
,
categoryId
,
memberId
}
// @ts-ignore
PublicApi
.
getTemplateChannelFindFirstCategoryDetail
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
...
...
@@ -117,11 +118,11 @@ const ChannelIndex: React.FC<ChannelIndexPropsType> = (props) => {
}
const
getCategoryComponents
=
async
(
templateId
)
=>
{
le
t
result
=
[]
le
t
firstCategory
:
any
=
await
fetchFirstCategory
()
cons
t
result
=
[]
cons
t
firstCategory
:
any
=
await
fetchFirstCategory
()
for
(
le
t
item
of
firstCategory
)
{
le
t
categoryDetail
:
any
=
await
fetchCategoryById
(
item
.
id
,
templateId
)
for
(
cons
t
item
of
firstCategory
)
{
cons
t
categoryDetail
:
any
=
await
fetchCategoryById
(
item
.
id
,
templateId
)
result
.
push
(
<
ShopFloorLine
linkUrl=
{
`${GlobalConfig.channelRootRoute}/commodity?channelId=${shopUrlParam}&categoryId=${item.id}&categoryName=${btoa(encodeURIComponent(item.name))}`
}
...
...
src/pages/lxMall/commodityDetail/index.tsx
View file @
a2bc0d68
...
...
@@ -709,15 +709,19 @@ const CommodityDetail = (props) => {
}
}
}
if
(
unitPricePicList
.
leng
ht
>
0
)
{
setCurrentPriceRange
(
sortUnitPrice
(
unitPricePicList
[
0
].
unitPrice
))
if
(
unitPricePicList
.
leng
th
>
0
)
{
setCurrentPriceRange
(
sortUnitPrice
(
unitPricePicList
[
0
].
unitPrice
))
initStockCount
(
unitPricePicList
)
}
// setStockCount(unitPricePicList[0].stockCount)
setCommodityImgList
(
tempImgList
)
setAttributeList
(
tempAttrList
)
}
/**
* 初始化库存信息 每个规格库存总和
* @param unitPricePicList
*/
const
initStockCount
=
(
unitPricePicList
:
any
)
=>
{
if
(
!
unitPricePicList
)
{
return
...
...
src/pages/lxMall/index/index.tsx
View file @
a2bc0d68
...
...
@@ -40,7 +40,7 @@ const MallIndex: React.FC<MallIndexPropsType> = (props) => {
templateId
:
mallTemplateId
,
type
:
1
}
PublicApi
.
getTemplate
Platform
FindAdvertsByType
(
params
).
then
(
res
=>
{
PublicApi
.
getTemplate
AdornWebEnterprise
FindAdvertsByType
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setFirstAdvertList
(
res
.
data
)
}
...
...
@@ -52,7 +52,7 @@ const MallIndex: React.FC<MallIndexPropsType> = (props) => {
templateId
:
mallTemplateId
,
type
:
2
}
PublicApi
.
getTemplate
Platform
FindAdvertsByType
(
params
).
then
(
res
=>
{
PublicApi
.
getTemplate
AdornWebEnterprise
FindAdvertsByType
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setSecondAdvertList
(
res
.
data
)
}
...
...
@@ -64,7 +64,7 @@ const MallIndex: React.FC<MallIndexPropsType> = (props) => {
*/
const
fetchFirstCategory
=
()
=>
{
return
new
Promise
((
resolve
)
=>
{
PublicApi
.
getTemplate
Platform
FindAllFirstCategory
().
then
(
res
=>
{
PublicApi
.
getTemplate
WebCategoryWeb
FindAllFirstCategory
().
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setCategoryList
(
res
.
data
)
resolve
(
res
.
data
)
...
...
@@ -83,7 +83,7 @@ const MallIndex: React.FC<MallIndexPropsType> = (props) => {
categoryId
}
PublicApi
.
getTemplate
PlatformFindFirstCategoryDetail
(
param
).
then
(
res
=>
{
PublicApi
.
getTemplate
AdornWebEnterpriseCategoryAdorn
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
resolve
(
res
.
data
)
}
...
...
src/pages/lxMall/shop/index.tsx
View file @
a2bc0d68
...
...
@@ -58,7 +58,8 @@ const ShopIndex: React.FC<ChannelIndexPropsType> = (props) => {
const
params
:
any
=
{
templateId
:
shopInfo
.
templateId
,
type
:
2
,
memberId
memberId
,
roleId
:
shopInfo
.
roleId
}
PublicApi
.
getTemplateShopFindAdvertsByType
(
params
).
then
(
res
=>
{
...
...
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