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
4d3b078c
Commit
4d3b078c
authored
Sep 07, 2020
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:商品详情选择商品属性
parent
e73b5644
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
33 additions
and
10 deletions
+33
-10
index.tsx
src/pages/channel/channelTemplate/index.tsx
+4
-1
defaultData.ts
src/pages/editor/shopEdit/defaultData.ts
+1
-1
index.tsx
src/pages/editor/shopEdit/index.tsx
+2
-2
index.tsx
src/pages/lxMall/commodityDetail/index.tsx
+14
-1
index.tsx
src/pages/lxMall/components/TopBar/index.tsx
+1
-1
index.tsx
src/pages/shop/shopTemplate/index.tsx
+4
-1
LoginWrap.tsx
src/pages/user/components/LoginWrap.tsx
+1
-1
request.ts
src/utils/request.ts
+6
-2
No files found.
src/pages/channel/channelTemplate/index.tsx
View file @
4d3b078c
...
...
@@ -20,8 +20,11 @@ const ShopTemplate: React.FC = () => {
if
(
res
.
code
===
1000
)
{
setTemplateList
(
res
.
data
)
}
else
if
(
res
.
code
===
47001
)
{
message
.
destroy
()
message
.
info
(
"您还未创建渠道商城,请先创建渠道商城"
)
history
.
push
(
'/memberCenter/channekAbility/infoManage'
)
setTimeout
(()
=>
{
history
.
push
(
'/memberCenter/channekAbility/infoManage'
)
},
2000
);
}
})
}
...
...
src/pages/editor/shopEdit/defaultData.ts
View file @
4d3b078c
...
...
@@ -10,7 +10,7 @@ export const mallLayoutConfig = {
"background"
:
"#FFF"
}
},
"childNodes"
:
[
"1"
,
"3"
,
"4"
,
"5"
,
"6"
]
"childNodes"
:
[
"1"
,
"3"
,
"4"
,
"5"
,
"
18"
,
"
6"
]
},
}
...
...
src/pages/editor/shopEdit/index.tsx
View file @
4d3b078c
...
...
@@ -158,7 +158,7 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
initIndex
+=
100
}
mallLayoutConfig
[
"0"
].
childNodes
=
[...
mallLayoutConfig
[
"0"
].
childNodes
,
...
floorLineKeys
,
serviceAdvertConfig
.
key
,
CommonTitle2Config
.
key
,
AboutUsConfig
.
key
,
InformationConfig
.
key
,
FooterConfig
.
key
]
mallLayoutConfig
[
"0"
].
childNodes
=
[...
mallLayoutConfig
[
"0"
].
childNodes
,
...
floorLineKeys
,
serviceAdvertConfig
.
key
,
CommonTitle2Config
.
key
,
InformationConfig
.
key
,
FooterConfig
.
key
]
let
config
=
{
...
mallLayoutConfig
,
...
topBarConfig
,
...
...
@@ -166,11 +166,11 @@ const ShopEdit: React.FC<ShopEditPropsType> = (props) => {
...
headerConfig
,
...
mainNavConfig
,
...
bannerAdvertConfig
,
...
AboutUsConfig
,
...
CommonTitle1Config
,
...
floorLineConfig
,
...
serviceAdvertConfig
,
...
CommonTitle2Config
,
...
AboutUsConfig
,
...
InformationConfig
,
...
FooterConfig
}
...
...
src/pages/lxMall/commodityDetail/index.tsx
View file @
4d3b078c
...
...
@@ -104,7 +104,8 @@ const CommodityDetail = (props) => {
attrValId
:
attrItem
.
customerAttributeValue
.
id
}
})
if
(
JSON
.
stringify
(
temp
)
===
JSON
.
stringify
(
selectAttrVal
))
{
if
(
judgeArrisCommon
(
temp
,
selectAttrVal
))
{
setSelectCommodityId
(
item
.
id
)
setCurrentPriceRange
(
item
.
unitPrice
)
}
...
...
@@ -112,6 +113,17 @@ const CommodityDetail = (props) => {
}
}
const
judgeArrisCommon
=
(
list
,
otherList
)
=>
{
if
(
list
.
length
===
otherList
.
length
)
{
let
result
=
list
.
every
(
listItem
=>
{
return
otherList
.
some
(
item
=>
JSON
.
stringify
(
item
)
===
JSON
.
stringify
(
listItem
))
})
return
result
}
else
{
return
false
}
}
const
handleAddToPurchase
=
()
=>
{
if
(
!
selectCommodityId
)
{
...
...
@@ -217,6 +229,7 @@ const CommodityDetail = (props) => {
setCurrentPriceRange
(
unitPriceAndPicList
[
0
].
unitPrice
)
setCommodityImgList
(
tempImgList
)
console
.
log
(
tempAttrList
,
"tempAttrList"
)
setAttributeList
(
tempAttrList
)
}
...
...
src/pages/lxMall/components/TopBar/index.tsx
View file @
4d3b078c
...
...
@@ -33,7 +33,7 @@ const TopBar: React.FC<TopBarPropsType> = (props) => {
)
:
(
<>
<
li
className=
{
styles
.
topbar_menu_item
}
>
<
a
href=
{
`/user/login?redirect=${
window.location
}`
}
>
请登录
</
a
>
<
a
href=
{
`/user/login?redirect=${
btoa(encodeURIComponent(String(window.location)))
}`
}
>
请登录
</
a
>
</
li
>
<
li
className=
{
styles
.
topbar_menu_item
}
>
<
a
href=
"/user/register"
>
注册
</
a
>
...
...
src/pages/shop/shopTemplate/index.tsx
View file @
4d3b078c
...
...
@@ -20,8 +20,11 @@ const ShopTemplate: React.FC = () => {
if
(
res
.
code
===
1000
)
{
setTemplateList
(
res
.
data
)
}
else
if
(
res
.
code
===
47001
)
{
message
.
destroy
()
message
.
info
(
"您还未创建店铺,请先创建店铺"
)
history
.
push
(
'/memberCenter/shopAbility/infoManage'
)
setTimeout
(()
=>
{
history
.
push
(
'/memberCenter/shopAbility/infoManage'
)
},
2000
);
}
})
}
...
...
src/pages/user/components/LoginWrap.tsx
View file @
4d3b078c
...
...
@@ -22,7 +22,7 @@ const LoginWrap: React.FC = () => {
setRouters
(
data
.
urls
)
// 此处需使用href跳转, 否则无法触发app.ts中的路由初始化校验
if
(
redirect
)
{
window
.
location
.
href
=
redirect
window
.
location
.
href
=
decodeURIComponent
(
atob
(
redirect
))
}
else
{
window
.
location
.
href
=
'/memberCenter/home'
}
...
...
src/utils/request.ts
View file @
4d3b078c
...
...
@@ -111,17 +111,21 @@ class ApiRequest {
createRequest
<
T
>
(
url
:
string
,
options
:
IApiRequest
=
{
ctlType
:
'none'
}):
Promise
<
IRequestSuccess
<
T
>>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
baseRequest
<
IRequestSuccess
<
T
>>
(
url
,
options
).
then
(
res
=>
{
message
.
destroy
()
// 登录验证
if
(
res
.
code
===
1101
)
{
removeAuth
()
// history.replace('/user/login')
window
.
location
.
href
=
`/user/login?redirect=
${
window
.
location
}
`
window
.
location
.
href
=
`/user/login?redirect=
${
btoa
(
encodeURIComponent
(
String
(
window
.
location
)))}
`
message
.
destroy
()
message
.
error
(
res
.
message
)
return
false
}
if
(
res
.
code
===
1000
)
{
if
(
options
.
ctlType
===
'message'
)
{
message
.
destroy
()
}
options
.
ctlType
===
'message'
&&
message
.
success
(
res
.
message
)
resolve
(
res
)
}
else
{
...
...
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