Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
40d7f578
authored
Nov 04, 2024
by
puhui999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【功能完善】商城客服: 会员足迹样式调整
parent
34fe09e2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
24 deletions
+68
-24
src/views/mall/promotion/kefu/components/member/MemberInfo.vue
+68
-24
No files found.
src/views/mall/promotion/kefu/components/member/MemberInfo.vue
View file @
40d7f578
...
@@ -2,18 +2,35 @@
...
@@ -2,18 +2,35 @@
<
template
>
<
template
>
<el-container
class=
"kefu"
>
<el-container
class=
"kefu"
>
<el-header
class=
"kefu-header"
>
<el-header
class=
"kefu-header"
>
<el-tabs
v-model=
"activeName"
class=
"kefu-tabs"
@
tab-click=
"handleClick"
>
<div
<el-tab-pane
label=
"最近浏览"
name=
"a"
/>
:class=
"
{ 'kefu-header-item-activation': tabActivation('会员信息') }"
<el-tab-pane
label=
"订单列表"
name=
"b"
/>
class="kefu-header-item cursor-pointer flex items-center justify-center"
</el-tabs>
@click="handleClick('会员信息')"
>
会员信息
</div>
<div
:class=
"
{ 'kefu-header-item-activation': tabActivation('最近浏览') }"
class="kefu-header-item cursor-pointer flex items-center justify-center"
@click="handleClick('最近浏览')"
>
最近浏览
</div>
<div
:class=
"
{ 'kefu-header-item-activation': tabActivation('交易订单') }"
class="kefu-header-item cursor-pointer flex items-center justify-center"
@click="handleClick('交易订单')"
>
交易订单
</div>
</el-header>
</el-header>
<el-main
class=
"kefu-content"
>
<el-main
class=
"kefu-content"
>
<div
v-show=
"!isEmpty(conversation)"
>
<div
v-show=
"!isEmpty(conversation)"
>
<el-scrollbar
ref=
"scrollbarRef"
always
@
scroll=
"handleScroll"
>
<el-scrollbar
ref=
"scrollbarRef"
always
@
scroll=
"handleScroll"
>
<!-- 最近浏览 -->
<!-- 最近浏览 -->
<ProductBrowsingHistory
v-if=
"active
Name === 'a
'"
ref=
"productBrowsingHistoryRef"
/>
<ProductBrowsingHistory
v-if=
"active
Tab === '最近浏览
'"
ref=
"productBrowsingHistoryRef"
/>
<!--
订单列表
-->
<!--
交易订单
-->
<OrderBrowsingHistory
v-if=
"active
Name === 'b
'"
ref=
"orderBrowsingHistoryRef"
/>
<OrderBrowsingHistory
v-if=
"active
Tab === '交易订单
'"
ref=
"orderBrowsingHistoryRef"
/>
</el-scrollbar>
</el-scrollbar>
</div>
</div>
<el-empty
v-show=
"isEmpty(conversation)"
description=
"请选择左侧的一个会话后开始"
/>
<el-empty
v-show=
"isEmpty(conversation)"
description=
"请选择左侧的一个会话后开始"
/>
...
@@ -22,7 +39,6 @@
...
@@ -22,7 +39,6 @@
</
template
>
</
template
>
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
type
{
TabsPaneContext
}
from
'element-plus'
import
ProductBrowsingHistory
from
'./ProductBrowsingHistory.vue'
import
ProductBrowsingHistory
from
'./ProductBrowsingHistory.vue'
import
OrderBrowsingHistory
from
'./OrderBrowsingHistory.vue'
import
OrderBrowsingHistory
from
'./OrderBrowsingHistory.vue'
import
{
KeFuConversationRespVO
}
from
'@/api/mall/promotion/kefu/conversation'
import
{
KeFuConversationRespVO
}
from
'@/api/mall/promotion/kefu/conversation'
...
@@ -32,25 +48,26 @@ import { ElScrollbar as ElScrollbarType } from 'element-plus/es/components/scrol
...
@@ -32,25 +48,26 @@ import { ElScrollbar as ElScrollbarType } from 'element-plus/es/components/scrol
defineOptions
({
name
:
'MemberBrowsingHistory'
})
defineOptions
({
name
:
'MemberBrowsingHistory'
})
const
active
Name
=
ref
(
'a
'
)
const
active
Tab
=
ref
(
'会员信息
'
)
const
tabActivation
=
computed
(()
=>
(
tab
:
string
)
=>
activeTab
.
value
===
tab
)
/** tab 切换 */
/** tab 切换 */
const
productBrowsingHistoryRef
=
ref
<
InstanceType
<
typeof
ProductBrowsingHistory
>>
()
const
productBrowsingHistoryRef
=
ref
<
InstanceType
<
typeof
ProductBrowsingHistory
>>
()
const
orderBrowsingHistoryRef
=
ref
<
InstanceType
<
typeof
OrderBrowsingHistory
>>
()
const
orderBrowsingHistoryRef
=
ref
<
InstanceType
<
typeof
OrderBrowsingHistory
>>
()
const
handleClick
=
async
(
tab
:
TabsPaneContext
)
=>
{
const
handleClick
=
async
(
tab
:
string
)
=>
{
active
Name
.
value
=
tab
.
paneName
as
string
active
Tab
.
value
=
tab
await
nextTick
()
await
nextTick
()
await
getHistoryList
()
await
getHistoryList
()
}
}
/** 获得历史数据 */
/** 获得历史数据 */
// TODO @puhui:不要用 a、b 哈。就订单列表、浏览列表这种噶
const
getHistoryList
=
async
()
=>
{
const
getHistoryList
=
async
()
=>
{
switch
(
activeName
.
value
)
{
switch
(
activeTab
.
value
)
{
case
'a'
:
case
'会员信息'
:
break
case
'最近浏览'
:
await
productBrowsingHistoryRef
.
value
?.
getHistoryList
(
conversation
.
value
)
await
productBrowsingHistoryRef
.
value
?.
getHistoryList
(
conversation
.
value
)
break
break
case
'
b
'
:
case
'
交易订单
'
:
await
orderBrowsingHistoryRef
.
value
?.
getHistoryList
(
conversation
.
value
)
await
orderBrowsingHistoryRef
.
value
?.
getHistoryList
(
conversation
.
value
)
break
break
default
:
default
:
...
@@ -60,11 +77,13 @@ const getHistoryList = async () => {
...
@@ -60,11 +77,13 @@ const getHistoryList = async () => {
/** 加载下一页数据 */
/** 加载下一页数据 */
const
loadMore
=
async
()
=>
{
const
loadMore
=
async
()
=>
{
switch
(
activeName
.
value
)
{
switch
(
activeTab
.
value
)
{
case
'a'
:
case
'会员信息'
:
break
case
'最近浏览'
:
await
productBrowsingHistoryRef
.
value
?.
loadMore
()
await
productBrowsingHistoryRef
.
value
?.
loadMore
()
break
break
case
'
b
'
:
case
'
交易订单
'
:
await
orderBrowsingHistoryRef
.
value
?.
loadMore
()
await
orderBrowsingHistoryRef
.
value
?.
loadMore
()
break
break
default
:
default
:
...
@@ -75,7 +94,7 @@ const loadMore = async () => {
...
@@ -75,7 +94,7 @@ const loadMore = async () => {
/** 浏览历史初始化 */
/** 浏览历史初始化 */
const
conversation
=
ref
<
KeFuConversationRespVO
>
({}
as
KeFuConversationRespVO
)
// 用户会话
const
conversation
=
ref
<
KeFuConversationRespVO
>
({}
as
KeFuConversationRespVO
)
// 用户会话
const
initHistory
=
async
(
val
:
KeFuConversationRespVO
)
=>
{
const
initHistory
=
async
(
val
:
KeFuConversationRespVO
)
=>
{
active
Name
.
value
=
'a
'
active
Tab
.
value
=
'会员信息
'
conversation
.
value
=
val
conversation
.
value
=
val
await
nextTick
()
await
nextTick
()
await
getHistoryList
()
await
getHistoryList
()
...
@@ -95,9 +114,6 @@ const handleScroll = debounce(() => {
...
@@ -95,9 +114,6 @@ const handleScroll = debounce(() => {
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
.kefu
{
.kefu
{
margin
:
0
;
padding
:
0
;
height
:
100%
;
width
:
300px
!important
;
width
:
300px
!important
;
background-color
:
#fff
;
background-color
:
#fff
;
border-left
:
var
(
--el-border-color
)
solid
1px
;
border-left
:
var
(
--el-border-color
)
solid
1px
;
...
@@ -107,12 +123,40 @@ const handleScroll = debounce(() => {
...
@@ -107,12 +123,40 @@ const handleScroll = debounce(() => {
box-shadow
:
0
0
0
0
#dcdfe6
;
box-shadow
:
0
0
0
0
#dcdfe6
;
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
justify-content
:
center
;
justify-content
:
space-around
;
&-title
{
&-title
{
font-size
:
18px
;
font-size
:
18px
;
font-weight
:
bold
;
font-weight
:
bold
;
}
}
&
-item
{
height
:
100%
;
width
:
100%
;
position
:
relative
;
&
-activation
::
before
{
content
:
''
;
position
:
absolute
;
/* 绝对定位 */
top
:
0
;
left
:
0
;
right
:
0
;
bottom
:
0
;
/* 覆盖整个元素 */
border-bottom
:
2px
solid
black
;
/* 边框样式 */
pointer-events
:
none
;
/* 确保点击事件不会被伪元素拦截 */
}
&
:hover::before
{
content
:
''
;
position
:
absolute
;
/* 绝对定位 */
top
:
0
;
left
:
0
;
right
:
0
;
bottom
:
0
;
/* 覆盖整个元素 */
border-bottom
:
2px
solid
black
;
/* 边框样式 */
pointer-events
:
none
;
/* 确保点击事件不会被伪元素拦截 */
}
}
}
}
&
-content
{
&
-content
{
...
...
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