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
6e70c912
Commit
6e70c912
authored
Oct 13, 2020
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:店铺收藏
parent
732d77dc
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
73 additions
and
14 deletions
+73
-14
detail.less
...fterService/exchangeGoods/waitSubmitOrderList/detail.less
+4
-0
detail.tsx
...afterService/exchangeGoods/waitSubmitOrderList/detail.tsx
+6
-4
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
+10
-1
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'
import
{
history
,
Helmet
}
from
'umi'
import
{
Button
}
from
'antd'
import
ReutrnEle
from
'@/components/ReturnEle'
import
styles
from
'./detail.less'
interface
OrderDetailProps
{
location
:
any
,
...
...
@@ -23,7 +24,6 @@ const OrderDetail: React.FC<OrderDetailProps> = (props) => {
default
:
return
''
}
}
return
(
...
...
@@ -38,12 +38,14 @@ const OrderDetail: React.FC<OrderDetailProps> = (props) => {
extra=
{
[
<
Button
key=
"1"
onClick=
{
()
=>
{
}
}
loading=
{
btnLoading
}
type=
"primary"
icon=
{
<
SaveOutlined
/>
}
>
保存
</
Button
>,
</
Button
>,
]
}
>
OrderDetail
<
div
className=
{
styles
.
detail_wrap
}
>
</
PageHeaderWrapper
>
</
div
>
</
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
{
Link
}
from
'umi'
import
{
PublicApi
}
from
'@/services/api'
...
...
@@ -16,7 +16,13 @@ interface ShopInfoPropsType {
const
ShopInfo
:
React
.
FC
<
ShopInfoPropsType
>
=
(
props
)
=>
{
const
{
shopInfo
,
shopUrlParam
,
updateShopInfo
}
=
props
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
=
()
=>
{
if
(
shopInfo
)
{
...
...
src/pages/lxMall/components/ShopHeader/index.tsx
View file @
6e70c912
...
...
@@ -21,7 +21,7 @@ const ShopHeader: React.FC<ShopHeaderPropsType> = (props) => {
const
{
updateShopInfo
,
shopUrlParam
,
shopInfo
,
logo
}
=
props
const
[
searchValue
,
setSearchValue
]
=
useState
<
string
>
(
""
)
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
useEffect
(()
=>
{
...
...
@@ -32,6 +32,12 @@ const ShopHeader: React.FC<ShopHeaderPropsType> = (props) => {
}
},
[
search
])
useEffect
(()
=>
{
if
(
shopInfo
)
{
setCollectState
(
shopInfo
.
collectStatus
)
}
},
[
shopInfo
])
const
handleSearchCommodity
=
()
=>
{
if
(
!
isEmpty
(
searchValue
))
{
history
.
push
(
`/shop/commodity/search?shopId=
${
shopUrlParam
}
&search=
${
encodeURIComponent
(
searchValue
)}
`
)
...
...
src/pages/lxMall/shopAbout/index.less
View file @
6e70c912
...
...
@@ -24,7 +24,7 @@
padding-right: 60px;
}
.shop_about_btn {
.shop_about_btn {
padding: 0 15px;
height: 32px;
...
...
@@ -34,6 +34,15 @@
border: 1px solid #EEF0F3;
cursor: pointer;
&.active {
background-color: var(--mall_main_color);
color: #FFFFFF;
&:hover {
background-color: var(--mall_main_color);
}
}
&:hover {
opacity: .9;
}
...
...
src/pages/lxMall/shopAbout/index.tsx
View file @
6e70c912
import
React
,
{
useState
}
from
'react'
import
{
Rate
,
Button
}
from
'antd'
import
React
,
{
useState
,
useEffect
}
from
'react'
import
{
Rate
,
Button
,
message
}
from
'antd'
import
{
LeftOutlined
,
RightOutlined
}
from
'@ant-design/icons'
import
cx
from
'classnames'
import
shop_icon
from
'@/assets/imgs/shop_icon.png'
import
credit_icon
from
'@/assets/imgs/credit_icon.png'
import
{
PublicApi
}
from
'@/services/api'
import
styles
from
'./index.less'
import
{
LAYOUT_TYPE
}
from
'@/constants'
interface
ShopAboutPropType
{
shopInfo
:
any
shopInfo
:
any
,
layoutType
:
LAYOUT_TYPE
,
updateShopInfo
:
Function
}
const
ShopAbout
:
React
.
FC
<
ShopAboutPropType
>
=
(
props
)
=>
{
const
{
shopInfo
}
=
props
const
{
shopInfo
,
layoutType
,
updateShopInfo
}
=
props
const
[
offSetLeft
,
setOffSetLeft
]
=
useState
<
number
>
(
0
)
const
[
applyLoading
,
setApplyLoading
]
=
useState
<
boolean
>
(
false
)
const
[
collectState
,
setCollectState
]
=
useState
<
boolean
>
(
false
)
const
unitDistance
=
406
useEffect
(()
=>
{
if
(
shopInfo
)
{
setCollectState
(
shopInfo
.
collectStatus
)
}
},
[
shopInfo
])
const
handlePrev
=
()
=>
{
if
(
offSetLeft
<
0
)
{
setOffSetLeft
(
offSetLeft
+
unitDistance
)
...
...
@@ -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
(
<
div
className=
{
styles
.
shop_about
}
>
<
div
className=
{
styles
.
shop_about_container
}
>
...
...
@@ -72,10 +103,11 @@ const ShopAbout: React.FC<ShopAboutPropType> = (props) => {
</
div
>
<
div
className=
{
cx
(
styles
.
shop_about_info_item
)
}
>
<
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
>
</
div
>
</
div
>
<
div
className=
{
cx
(
styles
.
shop_about_info_item
,
styles
.
auto_width
)
}
>
<
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