hengmei-two/pagesB/customerCheck/customerCheck.vue

135 lines
4.4 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<template>
<view>
<!-- 状态栏 -->
<status-nav :titleVal="'客服查询'" :statusTitle="true"></status-nav>
<!-- 自定义二级分类 -->
<!-- 列表 -->
<view :style="{paddingTop: statusHeight+'px'}" class="pad-zy30">
<view class="radius20 fon28 col3 mar-sx20">
<view class="disac">
<view class="disjbac width100 radius10 pad-zy20 xialak bacf">
<input class="fon28 width100" type="text" @confirm="searchEv" v-model="keyword" placeholder="客户的手机号/微信昵称查找" placeholder-style="color: #B3B3B3;" />
</view>
<view @tap="searchEv" class="flexs tc mar-z30 colf radius10 customer-btn" :style="{background:publicColor}">搜索</view>
</view>
</view>
<!-- 列表 -->
<view class="bacf radius10 pad20 mar-x20 fon28" v-for="(item,index) in dataList" :key="index">
<view class="col3 bold disjbac">客户信息 <image :src="item.headImg" mode="aspectFill" style="width: 60rpx;height: 60rpx;border-radius: 50%;"></image></view>
<view class="mar-sx20 fon24 disjbac col6">
<text class="clips1">昵称:{{item.customer_name}}</text>
<text class="flexs mar-z20"><text v-if="item.customer_phone!=''">手机号:{{item.customer_phone}}</text><text v-else>暂未绑定手机号</text></text>
</view>
<view class="col3 bold">绑定的客服</view>
<view v-if="item.service!=null" class="mar-s20 fon24 disjbac col6">
<text class="clips1">昵称:{{item.service.name}}</text>
<text class="flexs mar-z20" v-if="item.service.phone!=''">手机号:{{item.service.phone}}</text>
</view>
<!-- <view v-else class="mar-s20 fon24 disjbac col6">
<text>昵称:{{item.account.nickname}}</text>
<text><text v-if="item.account.mobile!=''">手机号:{{item.account.mobile}}</text><text v-else>暂未绑定手机号</text></text>
</view> -->
</view>
<view v-if="dataList.length==0" class="disjcac fc" style="margin-top: 50%;">
<image class="zanw-img" src="/static/public/nothing.png" mode="aspectFill"></image>
<view class="fon24 col3">您搜索的内容暂无结果,换个关键词试试吧</view>
</view>
<!-- 返回顶部 -->
<back-top :showTop="showTop" @backTop="backTop"></back-top>
</view>
<!-- 底部客服 -->
<public-customer :nbottom="100"></public-customer>
<!-- 用户信息授权手机号授权 -->
<auth-userInfo-mobileInfo></auth-userInfo-mobileInfo>
</view>
</template>
<script>
export default {
data() {
return {
dataList:[],//数据列表
showTop:false,//是否显示返回顶部的箭头
keyword:'',//关键词
page:1,
size:10,
total:'',//总数
isZanw:true,
ntype:'',//类型 mine=自己绑定的客户 否则是全部
}
},
computed: {
// 主题颜色
publicColor() {
return this.$store.state.publicColor
},
statusHeight() {
return this.$store.state.statusHeight
}
},
onPageScroll(e) {
e.scrollTop > 360 ? this.showTop = true : this.showTop = false
},
onReachBottom() {//触底事件
if(this.total!=this.dataList.length){
this.page++
this.checkList()
} else {
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多客服数据')
this.isZanw = false
}
},
onLoad(options) {
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkList()
}
},
methods: {
searchEv(){//搜索事件
if(this.keyword!='') this.ntype = ''
this.page = 1
this.isZanw = true
this.checkList()
},
checkList(){//查询列表事件
let params = {
page:this.page,
size:this.size,
type:this.ntype,//客户ID
keyword:this.keyword
}
this.$requst.post('user/get-bind-service-list',params).then(res=>{
// console.log('足迹列表查询:',res);
if(res.code==0){
if(this.page==1) this.dataList = []
this.total = res.data.total;
if(res.data.list.length!=0){
res.data.list.forEach(item=>{
let obj = {
headImg:item.headimgurl,//客户头像
id:item.account_id,
customer_name:item.nickname,
customer_phone:item.mobile,
service:item.service,
// staff:item.staff,//绑定的客服
// account:item.account//备用当staff不存在时调用
}
this.dataList.push(obj)
})
}
}
},error=>{})
},
backTop(){//回到顶部事件
uni.pageScrollTo({
scrollTop: 0,
duration: 300
});
},
}
}
</script>
<style>
</style>