|
@@ -1,47 +1,29 @@
|
|
<template>
|
|
<template>
|
|
<view class="page-wrapper history" :data-theme="theme">
|
|
<view class="page-wrapper history" :data-theme="theme">
|
|
- <view class="history_count">
|
|
|
|
- <block v-if="list.length>0">
|
|
|
|
- <view class="history_header acea-row">
|
|
|
|
- <text>共{{total}}条,最多为您保存100条</text>
|
|
|
|
- </view>
|
|
|
|
- <view class="list" v-for="(item,index) in list">
|
|
|
|
- <view class="item_time">
|
|
|
|
- <view>{{item.date}}</view>
|
|
|
|
- </view>
|
|
|
|
- <view class="item_main acea-row">
|
|
|
|
- <view class="item acea-row" :class="{gary :(!itemn.isDel && itemn.isShow ==1) }"
|
|
|
|
- v-for="(itemn,indexn) in item.list">
|
|
|
|
- <view class="item item_count" @click="goPage(itemn)">
|
|
|
|
- <view class="pictrue">
|
|
|
|
- <easy-loadimage class="easy-img" mode="widthFix" :image-src="itemn.image">
|
|
|
|
- </easy-loadimage>
|
|
|
|
- <view v-if="item.activityStyle" :style="{ backgroundImage: `url(${item.activityStyle})` }" class="border-picture"></view>
|
|
|
|
- </view>
|
|
|
|
- <view class="info">
|
|
|
|
- <view class="msg">
|
|
|
|
- <block v-if="!itemn.isDel && itemn.isShow">
|
|
|
|
- <view class="price line2"><text></text>¥{{itemn.price}}</view>
|
|
|
|
- </block>
|
|
|
|
- <block v-else-if="itemn.isDel">
|
|
|
|
- <view class="tips">该商品已删除</view>
|
|
|
|
- </block>
|
|
|
|
- <block v-else>
|
|
|
|
- <view class="tips">该商品已下架</view>
|
|
|
|
- </block>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
|
|
+ <view class="history_count" style="padding-top: 20rpx;">
|
|
|
|
+
|
|
|
|
+ <scroll-view scroll-y refresher-enabled :refresher-triggered="isRefreshing" @refresherrefresh="onRefresh"
|
|
|
|
+ @scrolltolower="onLoadMore">
|
|
|
|
+ <!-- 数据列表 -->
|
|
|
|
+ <view class="his-item" v-for="item in list" @click="toStore(item)">
|
|
|
|
+ <img :src="item.avatar" alt="" />
|
|
|
|
+ <view class="item-info-box">
|
|
|
|
+ <view class="item-name">
|
|
|
|
+ <text>{{item.merName}}</text>
|
|
|
|
+ <text class="buy-count">买过{{item.buyCount}}次</text>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="item-info">
|
|
|
|
+ <text class="mr10 score">⭐️ {{item.starLevel}}分</text><text class="mr10">{{lastBrowseTag[item.lastBrowseTag]}}</text><text class="mr10">|</text><text class="mr10">{{item.distance}}km</text><text>24分钟</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- </block>
|
|
|
|
- <block v-if="(list.length==0 && !loading ) " >
|
|
|
|
- <emptyPage title="暂无浏览记录~" :imgSrc="urlDomain+'crmebimage/presets/noJilu.png'"></emptyPage>
|
|
|
|
- </block>
|
|
|
|
- <view class='loadingicon acea-row row-center-wrapper'>
|
|
|
|
- <text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>
|
|
|
|
- </view>
|
|
|
|
|
|
+ <!-- 加载提示 -->
|
|
|
|
+ <view style="text-align: center;" v-if="isEnd">没有更多了...</view>
|
|
|
|
+ <view style="text-align: center;" v-if="loading">加载中...</view>
|
|
|
|
+ <block v-if="(list.length==0 && !loading ) ">
|
|
|
|
+ <emptyPage title="暂无浏览记录~" :imgSrc="urlDomain+'crmebimage/presets/noJilu.png'"></emptyPage>
|
|
|
|
+ </block>
|
|
|
|
+ </scroll-view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
@@ -58,13 +40,13 @@
|
|
// +----------------------------------------------------------------------
|
|
// +----------------------------------------------------------------------
|
|
import emptyPage from '@/components/emptyPage.vue'
|
|
import emptyPage from '@/components/emptyPage.vue'
|
|
import {
|
|
import {
|
|
- browseRecordApi,
|
|
|
|
|
|
+ browseRecordApiv2,
|
|
historyDelete,
|
|
historyDelete,
|
|
historyBatchDelete,
|
|
historyBatchDelete,
|
|
historyBatchCollect
|
|
historyBatchCollect
|
|
} from '@/api/user.js'
|
|
} from '@/api/user.js'
|
|
import {
|
|
import {
|
|
- goProductDetail
|
|
|
|
|
|
+ goProductDetail
|
|
} from '@/libs/order.js'
|
|
} from '@/libs/order.js'
|
|
import {
|
|
import {
|
|
mapGetters
|
|
mapGetters
|
|
@@ -85,22 +67,68 @@
|
|
allArr: [],
|
|
allArr: [],
|
|
total: 0,
|
|
total: 0,
|
|
theme: app.globalData.theme,
|
|
theme: app.globalData.theme,
|
|
- loading: true
|
|
|
|
|
|
+ loading: true,
|
|
|
|
+ isRefreshing: false,
|
|
|
|
+ page: 1,
|
|
|
|
+ isEnd:false,
|
|
|
|
+ lastBrowseTag:{
|
|
|
|
+ 1:'刚刚浏览',
|
|
|
|
+ 2:'一天前测览',
|
|
|
|
+ 3:'三天前浏览',
|
|
|
|
+ 4:'一周前浏览',
|
|
|
|
+ 5:'一个月前浏览',
|
|
|
|
+ 6:'一年前浏览'
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad() {
|
|
onLoad() {
|
|
- this.getList();
|
|
|
|
|
|
+ // this.getList();
|
|
|
|
+ this.getData(() => this.loading = false);
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ toStore(item) {
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: `/pages/merchant/home/index?merId=${item.merId}`
|
|
|
|
+ // url: `/pages/goods_cate/index?id=${item.id}`
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ onRefresh() { // 下拉刷新
|
|
|
|
+ this.isRefreshing = true;
|
|
|
|
+ this.page = 1;
|
|
|
|
+ this.isEnd = false
|
|
|
|
+ this.list = [];
|
|
|
|
+ this.getData(() => this.isRefreshing = false);
|
|
|
|
+ },
|
|
|
|
+ onLoadMore() { // 上拉加载
|
|
|
|
+ if (this.loading || this.isEnd) return;
|
|
|
|
+ this.loading = true;
|
|
|
|
+ this.page++;
|
|
|
|
+ this.getData(() => this.loading = false);
|
|
|
|
+ },
|
|
|
|
+ getData(callback) {
|
|
|
|
+ const send = {
|
|
|
|
+ latitude: uni.getStorageSync('user_latitude'),
|
|
|
|
+ longitude: uni.getStorageSync('user_longitude'),
|
|
|
|
+ limit: 20,
|
|
|
|
+ page: this.page
|
|
|
|
+ }
|
|
|
|
+ browseRecordApiv2(send).then(({data}) => {
|
|
|
|
+ this.list.push(...data.list);
|
|
|
|
+ if(this.list.length >= data.total) {
|
|
|
|
+ this.isEnd = true
|
|
|
|
+ }
|
|
|
|
+ callback()
|
|
|
|
+ })
|
|
|
|
+ },
|
|
getList() {
|
|
getList() {
|
|
this.list = [];
|
|
this.list = [];
|
|
- browseRecordApi().then(({
|
|
|
|
|
|
+ browseRecordApiv2().then(({
|
|
data
|
|
data
|
|
}) => {
|
|
}) => {
|
|
this.list = data;
|
|
this.list = data;
|
|
- data.map(item => {
|
|
|
|
|
|
+ data.map(item => {
|
|
this.total += item.list.length;
|
|
this.total += item.list.length;
|
|
- item.date = item.date.slice(5, 7)+'月'+item.date.slice(8, 10)+'日' ;
|
|
|
|
|
|
+ item.date = item.date.slice(5, 7) + '月' + item.date.slice(8, 10) + '日';
|
|
})
|
|
})
|
|
this.loading = false;
|
|
this.loading = false;
|
|
}).catch(err => {
|
|
}).catch(err => {
|
|
@@ -111,8 +139,8 @@
|
|
});
|
|
});
|
|
},
|
|
},
|
|
goPage(item) {
|
|
goPage(item) {
|
|
- if(!item.isShow) return;
|
|
|
|
- goProductDetail(item.productId, 0,'');
|
|
|
|
|
|
+ if (!item.isShow) return;
|
|
|
|
+ goProductDetail(item.productId, 0, '');
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 滚动监听
|
|
// 滚动监听
|
|
@@ -124,9 +152,10 @@
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
- .pictrue{
|
|
|
|
|
|
+ .pictrue {
|
|
position: relative;
|
|
position: relative;
|
|
}
|
|
}
|
|
|
|
+
|
|
page {
|
|
page {
|
|
background: #ffffff;
|
|
background: #ffffff;
|
|
}
|
|
}
|
|
@@ -152,7 +181,7 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- .list {
|
|
|
|
|
|
+ .list {
|
|
margin-top: 20rpx;
|
|
margin-top: 20rpx;
|
|
|
|
|
|
.item_time {
|
|
.item_time {
|
|
@@ -282,8 +311,8 @@
|
|
position: absolute;
|
|
position: absolute;
|
|
top: 0;
|
|
top: 0;
|
|
right: 0;
|
|
right: 0;
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -318,7 +347,44 @@
|
|
border-color: var(--view-theme);
|
|
border-color: var(--view-theme);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
.empty-box {
|
|
.empty-box {
|
|
margin-top: 60%;
|
|
margin-top: 60%;
|
|
}
|
|
}
|
|
-</style>
|
|
|
|
|
|
+ .his-item{
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ padding: 20rpx;
|
|
|
|
+ margin-bottom: 20rpx;
|
|
|
|
+ img {
|
|
|
|
+ width: 80rpx;
|
|
|
|
+ height: 80rpx;
|
|
|
|
+ padding-right: 20rpx;
|
|
|
|
+ }
|
|
|
|
+ .item-info-box{
|
|
|
|
+ width: 100%;
|
|
|
|
+ .item-name {
|
|
|
|
+ font-size: 38rpx;
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ align-items: flex-start;
|
|
|
|
+ }
|
|
|
|
+ .buy-count{
|
|
|
|
+ font-size: 23rpx;
|
|
|
|
+ margin-top: 5rpx;
|
|
|
|
+ padding: 0 5rpx;
|
|
|
|
+ border: 1rpx solid orange;
|
|
|
|
+ color: coral;
|
|
|
|
+ }
|
|
|
|
+ .score{
|
|
|
|
+ color: coral;
|
|
|
|
+ }
|
|
|
|
+ .item-info{
|
|
|
|
+ font-size: 25rpx
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .mr10{
|
|
|
|
+ margin-right: 10rpx;
|
|
|
|
+ }
|
|
|
|
+</style>
|