|
@@ -1,3 +1,4 @@
|
|
|
+<!-- 目录是不是叫 member 好点。然后这个组件是 MemberInfo,里面有浏览足迹 -->
|
|
|
<template>
|
|
|
<div v-show="!isEmpty(conversation)" class="kefu">
|
|
|
<div class="header-title h-60px flex justify-center items-center">他的足迹</div>
|
|
@@ -7,9 +8,9 @@
|
|
|
</el-tabs>
|
|
|
<div>
|
|
|
<el-scrollbar ref="scrollbarRef" always height="calc(100vh - 400px)" @scroll="handleScroll">
|
|
|
- <!-- 最近浏览 -->
|
|
|
+ <!-- 最近浏览 -->
|
|
|
<ProductBrowsingHistory v-if="activeName === 'a'" ref="productBrowsingHistoryRef" />
|
|
|
- <!-- 订单列表 -->
|
|
|
+ <!-- 订单列表 -->
|
|
|
<OrderBrowsingHistory v-if="activeName === 'b'" ref="orderBrowsingHistoryRef" />
|
|
|
</el-scrollbar>
|
|
|
</div>
|
|
@@ -29,6 +30,7 @@ import { ElScrollbar as ElScrollbarType } from 'element-plus/es/components/scrol
|
|
|
defineOptions({ name: 'MemberBrowsingHistory' })
|
|
|
|
|
|
const activeName = ref('a')
|
|
|
+
|
|
|
/** tab 切换 */
|
|
|
const productBrowsingHistoryRef = ref<InstanceType<typeof ProductBrowsingHistory>>()
|
|
|
const orderBrowsingHistoryRef = ref<InstanceType<typeof OrderBrowsingHistory>>()
|
|
@@ -37,7 +39,9 @@ const handleClick = async (tab: TabsPaneContext) => {
|
|
|
await nextTick()
|
|
|
await getHistoryList()
|
|
|
}
|
|
|
+
|
|
|
/** 获得历史数据 */
|
|
|
+// TODO @puhui:不要用 a、b 哈。就订单列表、浏览列表这种噶
|
|
|
const getHistoryList = async () => {
|
|
|
switch (activeName.value) {
|
|
|
case 'a':
|
|
@@ -50,6 +54,7 @@ const getHistoryList = async () => {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
/** 加载下一页数据 */
|
|
|
const loadMore = async () => {
|
|
|
switch (activeName.value) {
|
|
@@ -63,6 +68,7 @@ const loadMore = async () => {
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
/** 浏览历史初始化 */
|
|
|
const conversation = ref<KeFuConversationRespVO>({} as KeFuConversationRespVO) // 用户会话
|
|
|
const initHistory = async (val: KeFuConversationRespVO) => {
|