This commit is contained in:
木瓜一块八 2025-08-26 16:43:41 +08:00
parent 086ccbff0d
commit a621c6402a
2 changed files with 16 additions and 10 deletions

View File

@ -14,13 +14,13 @@
<span class="radio-text">企业需求</span>
</label>
</div>
<div class="history-list" v-if="productList.length > 0">
<div v-loading="loadingBox" class="history-list" v-if="productList.length > 0">
<div class="history-item" v-for="item in productList" :key="item.id">
<div class="history-date">
<span class="date-text">{{ formatBrowseDate(item.create_at) }}</span>
<span class="relative-time">{{ getRelativeTime(item.create_at) }}</span>
<span class="date-text">{{ formatBrowseDate(item.browse_date) }}</span>
<span class="relative-time">{{ getRelativeTime(item.browse_date) }}</span>
</div>
<div class="follow-content">
<div class="history-content">
<productCard
contentType="favorite"
:productList="item.products"
@ -44,6 +44,7 @@ export default {
name: 'followBox',
data() {
return {
loadingBox:false,
productList: [],
value1: null,
publish_type: '1', //
@ -67,10 +68,12 @@ export default {
this.reqFavoriteSearch();
},
reqFavoriteSearch() {
this.loadingBox = true;
reqFavoriteSearch({
url_list: window.location.href,
publish_type: this.publish_type //
}).then(res => {
this.loadingBox = false;
if (res.status) {
// product_info
this.productList = this.flattenProductInfo(res.data.favorites);
@ -235,11 +238,11 @@ export default {
}
/* 关注记录列表样式 */
.follow-list {
.history-list {
margin-top: 20px;
}
.follow-item {
.history-item {
background: #fff;
border-radius: 12px;
padding: 20px;
@ -249,12 +252,12 @@ export default {
transition: all 0.3s ease;
}
.follow-item:hover {
.history-item:hover {
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
/* transform: translateY(-2px); */
}
.follow-date {
.history-date {
display: flex;
align-items: center;
margin-bottom: 16px;
@ -277,7 +280,7 @@ export default {
border-radius: 12px;
}
.follow-content {
.history-content {
margin-top: 8px;
}

View File

@ -14,7 +14,7 @@
<span class="radio-text">企业需求</span>
</label>
</div>
<div class="history-list" v-if="productList.length > 0">
<div v-loading="loadingBox" class="history-list" v-if="productList.length > 0">
<div class="history-item" v-for="item in productList" :key="item.id">
<div class="history-date">
<span class="date-text">{{ formatBrowseDate(item.browse_date) }}</span>
@ -44,6 +44,7 @@ export default {
name: 'historyBox',
data() {
return {
loadingBox:false,
productList: [],
value1: null,
publish_type: '1', //
@ -67,10 +68,12 @@ export default {
this.reqUserBrowseHistorySearch();
},
reqUserBrowseHistorySearch() {
this.loadingBox = true;
reqUserBrowseHistorySearch({
url_list: window.location.href,
publish_type: this.publish_type //
}).then(res => {
this.loadingBox = false;
if (res.status) {
// product_info
this.productList = this.flattenProductInfo(res.data.history_list);