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
98587de9
Commit
98587de9
authored
Sep 17, 2020
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:商品详情接口对接
parent
11e7af7d
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
49 additions
and
9 deletions
+49
-9
index.tsx
src/pages/channel/channelInfo/index.tsx
+10
-0
index.tsx
...opsSettings/components/CategoryreCommendSetting/index.tsx
+4
-0
index.tsx
...ingsPanel/propsSettings/components/GoodsSetting/index.tsx
+3
-0
index.tsx
src/pages/editor/settingsPanel/propsSettings/index.tsx
+1
-1
index.tsx
src/pages/lxMall/commodityDetail/index.tsx
+17
-4
index.tsx
src/pages/shop/shopInfo/index.tsx
+10
-0
LoginWrap.tsx
src/pages/user/components/LoginWrap.tsx
+2
-3
request.ts
src/utils/request.ts
+2
-1
No files found.
src/pages/channel/channelInfo/index.tsx
View file @
98587de9
...
...
@@ -210,6 +210,9 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
const
handleMallSelectChange
=
(
mallId
:
number
)
=>
{
setShopId
(
mallId
)
if
(
!
shopInfo
)
{
return
}
if
(
shopInfo
.
shopId
&&
shopInfo
.
memberId
)
{
let
resUrl
=
getMallItemAndSetUrl
(
mallId
)
setStoreUrl
(
resUrl
)
...
...
@@ -219,8 +222,12 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
}
const
getMallItemAndSetUrl
=
(
mallId
)
=>
{
let
result
=
""
let
mallItem
=
allMallList
.
filter
(
item
=>
item
.
id
===
mallId
)[
0
]
if
(
!
mallItem
)
{
return
""
}
if
(
mallItem
.
environment
===
1
)
{
switch
(
mallItem
.
type
)
{
case
3
:
...
...
@@ -247,6 +254,9 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
}
const
getSelectMallStoreUrl
=
()
=>
{
if
(
!
shopInfo
)
{
return
null
}
if
(
shopId
&&
shopInfo
.
shopId
&&
shopInfo
.
memberId
)
{
let
resUrl
=
getMallItemAndSetUrl
(
shopId
)
return
resUrl
?
(
...
...
src/pages/editor/settingsPanel/propsSettings/components/CategoryreCommendSetting/index.tsx
View file @
98587de9
...
...
@@ -104,6 +104,10 @@ const CategoryRecommendSetting: React.FC<CategoryRecommendSettingPropsType> = (p
reject
()
return
}
if
(
selectKeys
.
length
>
4
)
{
message
.
error
(
'最多推荐4个二级品类'
)
return
}
let
param
=
{
templateId
:
templateid
,
categoryId
:
categoryid
,
...
...
src/pages/editor/settingsPanel/propsSettings/components/GoodsSetting/index.tsx
View file @
98587de9
...
...
@@ -153,6 +153,9 @@ const GoodsSetting: React.FC<GoodsSettingPropsType> = (props) => {
if
(
selectGoodsList
.
length
<=
0
)
{
message
.
error
(
"请选择要推荐的商品"
)
return
}
else
if
(
selectGoodsList
.
length
>
10
)
{
message
.
error
(
"最多只能推荐10件商品"
)
return
}
setConfirmLoading
(
true
)
saveGoods
().
then
(()
=>
{
...
...
src/pages/editor/settingsPanel/propsSettings/index.tsx
View file @
98587de9
...
...
@@ -62,7 +62,7 @@ const PropsSettings: React.FC<PropsSettingsPropsType> = (props) => {
return
(
<
Drawer
//
maskClosable={false}
maskClosable=
{
false
}
title=
{
drawerTitle
}
placement=
"right"
onClose=
{
onClose
}
...
...
src/pages/lxMall/commodityDetail/index.tsx
View file @
98587de9
...
...
@@ -15,10 +15,12 @@ import ProductDescription from './components/ProductDescription'
import
InputNumber
from
'@/components/InputNumber'
import
{
PublicApi
}
from
'@/services/api'
import
{
GetSearchShopStoreGetCommodityDetailResponse
}
from
'@/services/SearchApi'
import
{
getAuth
}
from
'@/utils/auth'
import
{
numFormat
,
priceFormat
}
from
'@/utils/numberFomat'
import
jinhuodanIcon
from
'@/assets/imgs/jinhuodan.png'
import
styles
from
'./index.less'
import
{
isEmpty
}
from
'lodash'
import
{
LAYOUT_TYPE
}
from
'@/constants'
enum
COMMODITY_TYPE
{
/**
...
...
@@ -53,8 +55,7 @@ interface imgItemType {
const
CommodityDetail
=
(
props
)
=>
{
const
{
query
:
{
id
}
}
=
props
.
location
const
{
shopInfo
=
{}
}
=
props
const
{
shopInfo
=
{},
layoutType
,
memberId
}
=
props
const
OrderStore
=
useLocalStore
(()
=>
store
.
OrderStore
)
const
{
updateOrderInfo
}
=
OrderStore
const
[
addSuccessVisible
,
setAddSuccessVisible
]
=
useState
<
boolean
>
(
false
)
...
...
@@ -80,12 +81,24 @@ const CommodityDetail = (props) => {
* 获取商品详情
*/
const
fetchDetail
=
()
=>
{
PublicApi
.
getSearchShopStoreGetCommodityDetail
({
commodityId
:
id
}).
then
(
res
=>
{
let
getDetailFn
let
params
:
any
=
{
commodityId
:
id
}
if
(
layoutType
===
LAYOUT_TYPE
.
channel
)
{
params
.
channelMemberId
=
memberId
getDetailFn
=
PublicApi
.
getSearchShopChannelGetCommodityDetail
}
else
{
getDetailFn
=
PublicApi
.
getSearchShopStoreGetCommodityDetail
}
getDetailFn
(
params
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setCommodityDetail
(
res
.
data
)
initAttributeAndValueList
(
res
.
data
)
getPayWayListByMemberId
(
res
.
data
?.
memberId
)
res
.
data
?.
isMemberPrice
&&
getMemberCredit
(
res
.
data
?.
memberId
,
res
.
data
?.
memberRoleId
)
if
(
getAuth
()
&&
res
.
data
?.
isMemberPrice
)
{
getMemberCredit
(
res
.
data
?.
memberId
,
res
.
data
?.
memberRoleId
)
}
}
})
}
...
...
src/pages/shop/shopInfo/index.tsx
View file @
98587de9
...
...
@@ -209,6 +209,9 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
const
handleMallSelectChange
=
(
mallId
:
number
)
=>
{
// let selectItem = allMallList.filter(item => item.id === mallId)
setShopId
(
mallId
)
if
(
!
shopInfo
)
{
return
null
}
if
(
shopInfo
.
shopId
&&
shopInfo
.
memberId
)
{
let
resUrl
=
getMallItemAndSetUrl
(
mallId
)
setStoreUrl
(
resUrl
)
...
...
@@ -219,7 +222,11 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
const
getMallItemAndSetUrl
=
(
mallId
)
=>
{
let
result
=
""
console
.
log
(
mallId
,
allMallList
,
"mallId"
)
let
mallItem
=
allMallList
.
filter
(
item
=>
item
.
id
===
mallId
)[
0
]
if
(
!
mallItem
)
{
return
""
}
if
(
mallItem
.
environment
===
1
)
{
switch
(
mallItem
.
type
)
{
case
1
:
...
...
@@ -243,6 +250,9 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
}
const
getSelectMallStoreUrl
=
()
=>
{
if
(
!
shopInfo
)
{
return
null
}
if
(
shopId
&&
shopInfo
.
shopId
&&
shopInfo
.
memberId
)
{
let
resUrl
=
getMallItemAndSetUrl
(
shopId
)
return
resUrl
?
(
...
...
src/pages/user/components/LoginWrap.tsx
View file @
98587de9
...
...
@@ -24,11 +24,10 @@ const LoginWrap: React.FC = () => {
setRouters
(
data
.
urls
)
// 此处需使用href跳转, 否则无法触发app.ts中的路由初始化校验
if
(
redirect
)
{
window
.
location
.
href
=
decodeURIComponent
(
atob
(
redirect
))
window
.
location
.
replace
(
decodeURIComponent
(
atob
(
redirect
)
))
}
else
{
window
.
location
.
href
=
'/memberCenter/home'
window
.
location
.
replace
(
'/memberCenter/home'
)
}
}
})
}
...
...
src/utils/request.ts
View file @
98587de9
...
...
@@ -116,8 +116,9 @@ class ApiRequest {
baseRequest
<
IRequestSuccess
<
T
>>
(
url
,
options
).
then
(
res
=>
{
// 登录验证
if
(
res
.
code
===
1101
)
{
removeAuth
()
// history.replace(`/user/login?redirect=${btoa(encodeURIComponent(String(window.location)))}`)
removeAuth
()
window
.
location
.
replace
(
`/user/login?redirect=
${
btoa
(
encodeURIComponent
(
String
(
window
.
location
)))}
`
)
message
.
destroy
()
message
.
error
(
res
.
message
)
...
...
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