hengmei-two/pagesB/userFootprint/userFootprint.vue

141 lines
4.1 KiB
Vue
Raw Normal View History

2021-08-19 06:40:59 +00:00
<template>
<view>
<!-- 状态栏 -->
<status-nav :titleVal="'用户足迹'" :statusTitle="true"></status-nav>
<!-- 自定义二级分类 -->
<!-- 列表 -->
<view :style="{paddingTop: statusHeight+'px'}" class="pad-zy30">
2021-08-19 06:40:59 +00:00
<view class="radius20 fon28 col3 mar-sx20">
<view class="disac">
<view class="disjbac width100 radius10 pad-zy20 xialak bacf">
2021-11-02 10:23:53 +00:00
<input class="fon28 width100" type="text" @confirm="searchEv" v-model="keyword" placeholder="请输入姓名/电话查找" placeholder-style="color: #B3B3B3;" />
2021-08-19 06:40:59 +00:00
</view>
2021-08-22 08:53:12 +00:00
<view @tap="searchEv" class="flexs tc mar-z30 colf radius10 customer-btn" :style="{background:publicColor}">搜索</view>
2021-08-19 06:40:59 +00:00
</view>
</view>
<!-- 列表 -->
2022-01-18 02:43:26 +00:00
<view @tap="chooseId(item.id)" v-if="item.name!=null" class="bacf radius10 pad20 mar-x20 fon28" v-for="(item,index) in dataList" :key="index">
2022-04-15 11:53:53 +00:00
<view style="color: #B3B3B3;" class="disjbac">{{item.time}} <view style="color: #000000;">{{item.mobile}}</view></view>
2021-08-19 06:40:59 +00:00
<view class="mar-s20">
<text class="bold col3">{{item.name}}</text>
2021-08-22 08:53:12 +00:00
<text style="color: #B3B3B3;">{{item.action}}</text>
<text class="bold col3" v-if="item.title!=null && item.title!=''">{{item.title}}</text>
<text style="color: #B3B3B3;" v-if="item.zwhat!=null && item.zwhat!=''">{{item.zwhat}}</text>
2021-08-19 06:40:59 +00:00
</view>
</view>
2022-01-18 02:43:26 +00:00
<view v-if="dataList.length==0 && keyword!=''" class="disjcac fc" style="margin-top: 50%;">
2021-08-22 08:53:12 +00:00
<image class="zanw-img" src="/static/public/nothing.png" mode="aspectFill"></image>
<view class="fon24 col3">您搜索的内容暂无结果换个关键词试试吧</view>
</view>
2021-08-19 06:40:59 +00:00
<!-- 返回顶部 -->
2022-01-18 02:43:26 +00:00
<!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> -->
2021-08-19 06:40:59 +00:00
</view>
2021-08-26 09:57:04 +00:00
<!-- 底部客服 -->
<public-customer :nbottom="100"></public-customer>
2022-03-04 08:48:40 +00:00
<!-- 用户信息授权手机号授权 -->
<auth-userInfo-mobileInfo></auth-userInfo-mobileInfo>
2021-08-19 06:40:59 +00:00
</view>
</template>
<script>
export default {
data() {
return {
2021-08-22 08:53:12 +00:00
dataList:[],//数据列表
showTop:false,//是否显示返回顶部的箭头
customer_id:'',//客户ID
keyword:'',//关键词
page:1,
size:10,
total:'',//总数
2021-12-02 09:31:26 +00:00
isZanw:true,
2021-08-19 06:40:59 +00:00
}
},
computed: {
// 主题颜色
publicColor() {
return this.$store.state.publicColor
},
statusHeight() {
return this.$store.state.statusHeight
}
},
2021-08-19 06:40:59 +00:00
onPageScroll(e) {
e.scrollTop > 360 ? this.showTop = true : this.showTop = false
},
onReachBottom() {//触底事件
2021-08-22 08:53:12 +00:00
if(this.total!=this.dataList.length){
this.page++
this.checkList()
} else {
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多足迹内容')
this.isZanw = false
2021-08-19 06:40:59 +00:00
}
},
onShow() {
2022-07-27 00:59:52 +00:00
},
2021-12-02 09:31:26 +00:00
onLoad(options) {
2022-03-04 08:48:40 +00:00
if(uni.getStorageSync('token')!='') {
this.checkList();
}
2021-08-19 06:40:59 +00:00
},
methods: {
2021-08-22 08:53:12 +00:00
chooseId(id){
this.backTop()
this.page = 1
this.isZanw = true
this.customer_id = id
this.keyword = ''
this.checkList()
},
searchEv(){//搜索事件
if(this.keyword!='') this.customer_id = ''
this.page = 1
this.isZanw = true
this.checkList()
},
checkList(){//查询列表事件
let params = {
page:this.page,
size:this.size,
customer_id:this.customer_id,//客户ID
2022-01-18 02:43:26 +00:00
keyword:this.keyword,
// user_id:uni.getStorageSync('userId')
2021-08-22 08:53:12 +00:00
}
this.$requst.post('user/footmarks',params).then(res=>{
// console.log('足迹列表查询:',res);
2022-03-04 08:48:40 +00:00
if(this.page==1) this.dataList = []
this.total = res.data.total
if(res.data.list.length!=0){
res.data.list.forEach(item=>{
let newCate = ''
if(item.content_id > 0) newCate = item.category
else newCate = ''
let obj = {
id:item.account_id,
name:item.nickname,
action:item.action,
title:item.title,
time:item.created_at,
zwhat:newCate,
mobile:item.mobile
}
this.dataList.push(obj)
})
2021-08-22 08:53:12 +00:00
}
2022-03-04 08:48:40 +00:00
})
2021-08-22 08:53:12 +00:00
},
2021-08-19 06:40:59 +00:00
backTop(){//回到顶部事件
uni.pageScrollTo({
scrollTop: 0,
duration: 300
});
},
}
}
</script>
<style>
</style>