|
@@ -321,7 +321,7 @@
|
|
|
import qs from 'qs'
|
|
|
import { mapActions, mapGetters, mapState } from 'vuex'
|
|
|
import { Button, Cell, Icon, List, Popover, Popup, Tab, Tabs, Tag } from 'vant'
|
|
|
-import { throttle } from 'lodash'
|
|
|
+import { throttle, uniqBy } from 'lodash'
|
|
|
import AdSingle from '@/components/ad/Ad'
|
|
|
import BiddingSearchFilters from '@/components/search/sun/filters'
|
|
|
import SearchFilterHistoryDialog from '@/components/search/bidding/filterHistoryDialog'
|
|
@@ -399,6 +399,7 @@ export default {
|
|
|
// 顶部精简列表/详细列表切换滚动显示隐藏距离
|
|
|
tabSwitchShowOffset: 150,
|
|
|
listTabActiveStorageKey: 'sun_listTabActive',
|
|
|
+ listArticleInfoStorageKey: 'sun_list_info_clicked',
|
|
|
leaveSource: {
|
|
|
article: 'article_collection'
|
|
|
},
|
|
@@ -1502,6 +1503,11 @@ export default {
|
|
|
app: `/jyapp/article/content/${id}.html?${qs.stringify(query)}`
|
|
|
}
|
|
|
this.saveState()
|
|
|
+ try {
|
|
|
+ this.saveClickItemInfo(item)
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error)
|
|
|
+ }
|
|
|
if (!this.isLogin) {
|
|
|
return openLinkOfOther(LINKS.APP登录页.app, {
|
|
|
query: {
|
|
@@ -1511,6 +1517,35 @@ export default {
|
|
|
}
|
|
|
openAppOrWxPage(targetMap)
|
|
|
},
|
|
|
+ createClickInfoItem(item) {
|
|
|
+ if (!item) {
|
|
|
+ return {}
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ id: item.id,
|
|
|
+ title: item.title || ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 处理拆条信息:详情页中需要判断purchasingList长度>1,就使用列表页标题+‘等’。
|
|
|
+ saveClickItemInfo(item) {
|
|
|
+ const key = this.conf.listArticleInfoStorageKey
|
|
|
+ const saved = sessionStorage.getItem(key)
|
|
|
+ const info = this.createClickInfoItem(item)
|
|
|
+ let list = []
|
|
|
+ if (saved) {
|
|
|
+ list = JSON.parse(saved)
|
|
|
+ if (Array.isArray(list)) {
|
|
|
+ list.unshift(info)
|
|
|
+ } else {
|
|
|
+ list = [info]
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ list = [info]
|
|
|
+ }
|
|
|
+ // 去重
|
|
|
+ list = uniqBy(list, 'id')
|
|
|
+ sessionStorage.setItem(key, JSON.stringify(list))
|
|
|
+ },
|
|
|
// 保存更多关键词到历史记录中
|
|
|
saveAdditionalWordsToHistory() {
|
|
|
const { moreKeywordsMode } = this.filters
|