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
6e70c912
Commit
6e70c912
authored
Oct 13, 2020
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:店铺收藏
parent
732d77dc
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
70 additions
and
11 deletions
+70
-11
detail.less
...fterService/exchangeGoods/waitSubmitOrderList/detail.less
+4
-0
detail.tsx
...afterService/exchangeGoods/waitSubmitOrderList/detail.tsx
+4
-2
index.tsx
...ages/lxMall/commodityDetail/components/ShopInfo/index.tsx
+8
-2
index.tsx
src/pages/lxMall/components/ShopHeader/index.tsx
+7
-1
index.less
src/pages/lxMall/shopAbout/index.less
+9
-0
index.tsx
src/pages/lxMall/shopAbout/index.tsx
+38
-6
No files found.
src/pages/afterService/exchangeGoods/waitSubmitOrderList/detail.less
0 → 100644
View file @
6e70c912
.detail_wrap {
position: relative;
}
\ No newline at end of file
src/pages/afterService/exchangeGoods/waitSubmitOrderList/detail.tsx
View file @
6e70c912
...
@@ -4,6 +4,7 @@ import { PageHeaderWrapper } from '@ant-design/pro-layout'
...
@@ -4,6 +4,7 @@ import { PageHeaderWrapper } from '@ant-design/pro-layout'
import
{
history
,
Helmet
}
from
'umi'
import
{
history
,
Helmet
}
from
'umi'
import
{
Button
}
from
'antd'
import
{
Button
}
from
'antd'
import
ReutrnEle
from
'@/components/ReturnEle'
import
ReutrnEle
from
'@/components/ReturnEle'
import
styles
from
'./detail.less'
interface
OrderDetailProps
{
interface
OrderDetailProps
{
location
:
any
,
location
:
any
,
...
@@ -23,7 +24,6 @@ const OrderDetail: React.FC<OrderDetailProps> = (props) => {
...
@@ -23,7 +24,6 @@ const OrderDetail: React.FC<OrderDetailProps> = (props) => {
default
:
default
:
return
''
return
''
}
}
}
}
return
(
return
(
...
@@ -41,8 +41,10 @@ const OrderDetail: React.FC<OrderDetailProps> = (props) => {
...
@@ -41,8 +41,10 @@ const OrderDetail: React.FC<OrderDetailProps> = (props) => {
</
Button
>,
</
Button
>,
]
}
]
}
>
>
OrderDetail
<
div
className=
{
styles
.
detail_wrap
}
>
</
div
>
</
PageHeaderWrapper
>
</
PageHeaderWrapper
>
</>
</>
)
)
...
...
src/pages/lxMall/commodityDetail/components/ShopInfo/index.tsx
View file @
6e70c912
import
React
,
{
useState
}
from
'react'
import
React
,
{
useState
,
useEffect
}
from
'react'
import
{
Rate
,
Button
,
message
}
from
'antd'
import
{
Rate
,
Button
,
message
}
from
'antd'
import
{
Link
}
from
'umi'
import
{
Link
}
from
'umi'
import
{
PublicApi
}
from
'@/services/api'
import
{
PublicApi
}
from
'@/services/api'
...
@@ -16,7 +16,13 @@ interface ShopInfoPropsType {
...
@@ -16,7 +16,13 @@ interface ShopInfoPropsType {
const
ShopInfo
:
React
.
FC
<
ShopInfoPropsType
>
=
(
props
)
=>
{
const
ShopInfo
:
React
.
FC
<
ShopInfoPropsType
>
=
(
props
)
=>
{
const
{
shopInfo
,
shopUrlParam
,
updateShopInfo
}
=
props
const
{
shopInfo
,
shopUrlParam
,
updateShopInfo
}
=
props
const
[
applyLoading
,
setApplyLoading
]
=
useState
<
boolean
>
(
false
)
const
[
applyLoading
,
setApplyLoading
]
=
useState
<
boolean
>
(
false
)
const
[
collectState
,
setCollectState
]
=
useState
<
boolean
>
(
shopInfo
?.
collectStatus
||
false
)
const
[
collectState
,
setCollectState
]
=
useState
<
boolean
>
(
false
)
useEffect
(()
=>
{
if
(
shopInfo
)
{
setCollectState
(
shopInfo
.
collectStatus
)
}
},
[
shopInfo
])
const
applyFroVip
=
()
=>
{
const
applyFroVip
=
()
=>
{
if
(
shopInfo
)
{
if
(
shopInfo
)
{
...
...
src/pages/lxMall/components/ShopHeader/index.tsx
View file @
6e70c912
...
@@ -21,7 +21,7 @@ const ShopHeader: React.FC<ShopHeaderPropsType> = (props) => {
...
@@ -21,7 +21,7 @@ const ShopHeader: React.FC<ShopHeaderPropsType> = (props) => {
const
{
updateShopInfo
,
shopUrlParam
,
shopInfo
,
logo
}
=
props
const
{
updateShopInfo
,
shopUrlParam
,
shopInfo
,
logo
}
=
props
const
[
searchValue
,
setSearchValue
]
=
useState
<
string
>
(
""
)
const
[
searchValue
,
setSearchValue
]
=
useState
<
string
>
(
""
)
const
[
applyLoading
,
setApplyLoading
]
=
useState
<
boolean
>
(
false
)
const
[
applyLoading
,
setApplyLoading
]
=
useState
<
boolean
>
(
false
)
const
[
collectState
,
setCollectState
]
=
useState
<
boolean
>
(
shopInfo
?.
collectStatus
||
false
)
const
[
collectState
,
setCollectState
]
=
useState
<
boolean
>
(
false
)
const
{
search
}
=
history
.
location
.
query
const
{
search
}
=
history
.
location
.
query
useEffect
(()
=>
{
useEffect
(()
=>
{
...
@@ -32,6 +32,12 @@ const ShopHeader: React.FC<ShopHeaderPropsType> = (props) => {
...
@@ -32,6 +32,12 @@ const ShopHeader: React.FC<ShopHeaderPropsType> = (props) => {
}
}
},
[
search
])
},
[
search
])
useEffect
(()
=>
{
if
(
shopInfo
)
{
setCollectState
(
shopInfo
.
collectStatus
)
}
},
[
shopInfo
])
const
handleSearchCommodity
=
()
=>
{
const
handleSearchCommodity
=
()
=>
{
if
(
!
isEmpty
(
searchValue
))
{
if
(
!
isEmpty
(
searchValue
))
{
history
.
push
(
`/shop/commodity/search?shopId=
${
shopUrlParam
}
&search=
${
encodeURIComponent
(
searchValue
)}
`
)
history
.
push
(
`/shop/commodity/search?shopId=
${
shopUrlParam
}
&search=
${
encodeURIComponent
(
searchValue
)}
`
)
...
...
src/pages/lxMall/shopAbout/index.less
View file @
6e70c912
...
@@ -34,6 +34,15 @@
...
@@ -34,6 +34,15 @@
border: 1px solid #EEF0F3;
border: 1px solid #EEF0F3;
cursor: pointer;
cursor: pointer;
&.active {
background-color: var(--mall_main_color);
color: #FFFFFF;
&:hover {
background-color: var(--mall_main_color);
}
}
&:hover {
&:hover {
opacity: .9;
opacity: .9;
}
}
...
...
src/pages/lxMall/shopAbout/index.tsx
View file @
6e70c912
import
React
,
{
useState
}
from
'react'
import
React
,
{
useState
,
useEffect
}
from
'react'
import
{
Rate
,
Button
}
from
'antd'
import
{
Rate
,
Button
,
message
}
from
'antd'
import
{
LeftOutlined
,
RightOutlined
}
from
'@ant-design/icons'
import
{
LeftOutlined
,
RightOutlined
}
from
'@ant-design/icons'
import
cx
from
'classnames'
import
cx
from
'classnames'
import
shop_icon
from
'@/assets/imgs/shop_icon.png'
import
shop_icon
from
'@/assets/imgs/shop_icon.png'
import
credit_icon
from
'@/assets/imgs/credit_icon.png'
import
credit_icon
from
'@/assets/imgs/credit_icon.png'
import
{
PublicApi
}
from
'@/services/api'
import
{
PublicApi
}
from
'@/services/api'
import
styles
from
'./index.less'
import
styles
from
'./index.less'
import
{
LAYOUT_TYPE
}
from
'@/constants'
interface
ShopAboutPropType
{
interface
ShopAboutPropType
{
shopInfo
:
any
shopInfo
:
any
,
layoutType
:
LAYOUT_TYPE
,
updateShopInfo
:
Function
}
}
const
ShopAbout
:
React
.
FC
<
ShopAboutPropType
>
=
(
props
)
=>
{
const
ShopAbout
:
React
.
FC
<
ShopAboutPropType
>
=
(
props
)
=>
{
const
{
shopInfo
}
=
props
const
{
shopInfo
,
layoutType
,
updateShopInfo
}
=
props
const
[
offSetLeft
,
setOffSetLeft
]
=
useState
<
number
>
(
0
)
const
[
offSetLeft
,
setOffSetLeft
]
=
useState
<
number
>
(
0
)
const
[
applyLoading
,
setApplyLoading
]
=
useState
<
boolean
>
(
false
)
const
[
applyLoading
,
setApplyLoading
]
=
useState
<
boolean
>
(
false
)
const
[
collectState
,
setCollectState
]
=
useState
<
boolean
>
(
false
)
const
unitDistance
=
406
const
unitDistance
=
406
useEffect
(()
=>
{
if
(
shopInfo
)
{
setCollectState
(
shopInfo
.
collectStatus
)
}
},
[
shopInfo
])
const
handlePrev
=
()
=>
{
const
handlePrev
=
()
=>
{
if
(
offSetLeft
<
0
)
{
if
(
offSetLeft
<
0
)
{
setOffSetLeft
(
offSetLeft
+
unitDistance
)
setOffSetLeft
(
offSetLeft
+
unitDistance
)
...
@@ -48,6 +58,27 @@ const ShopAbout: React.FC<ShopAboutPropType> = (props) => {
...
@@ -48,6 +58,27 @@ const ShopAbout: React.FC<ShopAboutPropType> = (props) => {
}
}
}
}
const
handleCollect
=
()
=>
{
let
status
=
!
collectState
let
param
=
{
shopId
:
shopInfo
.
id
,
status
}
PublicApi
.
postTemplateShopCollect
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
updateShopInfo
()
message
.
destroy
()
if
(
status
)
{
message
.
success
(
"收藏成功"
)
setCollectState
(
true
)
}
else
{
message
.
success
(
"取消收藏成功"
)
setCollectState
(
false
)
}
}
})
}
return
(
return
(
<
div
className=
{
styles
.
shop_about
}
>
<
div
className=
{
styles
.
shop_about
}
>
<
div
className=
{
styles
.
shop_about_container
}
>
<
div
className=
{
styles
.
shop_about_container
}
>
...
@@ -72,10 +103,11 @@ const ShopAbout: React.FC<ShopAboutPropType> = (props) => {
...
@@ -72,10 +103,11 @@ const ShopAbout: React.FC<ShopAboutPropType> = (props) => {
</
div
>
</
div
>
<
div
className=
{
cx
(
styles
.
shop_about_info_item
)
}
>
<
div
className=
{
cx
(
styles
.
shop_about_info_item
)
}
>
<
div
className=
{
styles
.
shop_about_btn_group
}
>
<
div
className=
{
styles
.
shop_about_btn_group
}
>
<
div
className=
{
styles
.
shop_about_btn
}
>
收藏本店
</
div
>
{
layoutType
===
LAYOUT_TYPE
.
shop
&&
<
div
className=
{
cx
(
styles
.
shop_about_btn
,
collectState
?
styles
.
active
:
""
)
}
onClick=
{
()
=>
handleCollect
()
}
>
{
collectState
?
'已收藏本店'
:
'收藏本店'
}
</
div
>
}
<
Button
loading=
{
applyLoading
}
className=
{
cx
(
styles
.
shop_about_btn
,
styles
.
primary
)
}
onClick=
{
()
=>
applyFroVip
()
}
>
申请成为本店会员
</
Button
>
<
Button
loading=
{
applyLoading
}
className=
{
cx
(
styles
.
shop_about_btn
,
styles
.
primary
)
}
onClick=
{
()
=>
applyFroVip
()
}
>
申请成为本店会员
</
Button
>
</
div
>
</
div
>
</
div
>
</
div
>
<
div
className=
{
cx
(
styles
.
shop_about_info_item
,
styles
.
auto_width
)
}
>
<
div
className=
{
cx
(
styles
.
shop_about_info_item
,
styles
.
auto_width
)
}
>
<
i
className=
{
styles
.
shop_about_info_item_character
}
>
“
</
i
>
<
i
className=
{
styles
.
shop_about_info_item_character
}
>
“
</
i
>
...
...
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