添加客户列表页的标签、查询改进

master
chen 2022-01-12 12:24:29 +08:00
parent 34d33e70ed
commit 13ad619d26
28 changed files with 177 additions and 44 deletions

View File

@ -4,13 +4,28 @@
<view v-if="isXiala" class="pad-x20">
<view class="mar-s30 mar-x40 tc">请选择客服</view>
<view @tap="openXia" class="disjbac radius10 pad-zy20 mar-zy20 xialak mar-x50 posir">
<view class="col3">{{category[current].title}}</view>
<view class="col3" v-if="!isTag">{{category[current].title}}</view>
<view class="col3 disac width100" v-if="isTag"><input class="width100 mar-y20" disabled v-model="tagStr"></view>
<image :class="isZhuan?'zhuan':'nozhuan'" src="/static/public/sanj.png" mode="aspectFill"></image>
<!-- 下拉列表 -->
<view v-if="isZhuan" class="posia bacf radius10 xial-box">
<view class="pad-zy20 xial-item-box">
<!-- 普通下拉 -->
<view class="pad-zy20 xial-item-box" v-if="!isTag">
<view @tap="chooseXia(index)":class="current==index?'pcol':''" v-for="(item,index) in category" :key="index">{{item.title}}</view>
</view>
<!-- 标签下拉 -->
<view class="pad-zy20 xial-item-box" v-if="isTag">
<view class="disac" @tap.stop="quanEv" :class="isAll?'pcol':''">
<checkbox style="width: 60rpx;height: 60rpx;display: inherit;" color="#3875F6" :checked="isAll" />
全选
</view>
<view @tap.stop="chooseXiaTag(index)" class="disac" :class="item.checked?'pcol':''" v-for="(item,index) in category" :key="index">
<view v-if="" class="disac">
<checkbox style="width: 60rpx;height: 60rpx;display: inherit;" color="#3875F6" :data-id="item.id" :checked="item.checked" />
</view>
{{item.title}}
</view>
</view>
</view>
</view>
</view>
@ -56,13 +71,21 @@
default:function(){
return ['许嵩']
}
},
isTag:{
type:Boolean,
default:false
}
},
data() {
return {
publicColor:uni.getStorageSync('publicColor'),
isZhuan:false,
current:0
current:0,
tagIds:[],
tagVal:[],
tagStr:'请选择',
isAll:false
};
},
methods:{
@ -82,7 +105,46 @@
},
openXia(){
this.isZhuan = !this.isZhuan
},
//
chooseXiaTag(index){
let isexistence = this.tagIds.indexOf(this.category[index].id);
this.category[index].checked = !this.category[index].checked;
if(isexistence!=-1){
this.tagIds.splice(isexistence,1);
this.tagVal.splice(isexistence,1)
} else {
this.tagIds.push(this.category[index].id)
this.tagVal.push(this.category[index].title)
}
this.tagStr = this.tagVal.join(',')
//
if(this.tagIds.length==this.category.length){
this.isAll = true;
} else this.isAll = false;
if(!this.tagIds.length) {
this.tagStr = '请选择'
}
this.$emit('chooseXiaT',{arr:this.category,id:this.tagIds.join(',')})
},
//
quanEv(){
this.isAll = !this.isAll;
this.tagIds = [];
this.tagVal = [];
if(this.isAll){
this.category.forEach(item=>{
item.checked = true;
this.tagIds.push(item.id)
this.tagVal.push(item.title)
})
this.tagStr = this.tagVal.join(',')
} else {
this.category.forEach(item=>{item.checked = false;})
this.tagStr = '请选择'
}
this.$emit('chooseXiaT',{arr:this.category,id:this.tagIds.join(',')})
},
}
}
</script>

View File

@ -404,7 +404,7 @@
goPageNew(index){
if(index==0){uni.navigateTo({url:'/pagesA/pointsMall/pointsMall'})}
if(index==1){uni.navigateTo({url:'/pagesA/myAddress/myAddress'})}
if(index==2){uni.navigateTo({url:'/pagesB/messagecenter/messagecenter?index=true'})}
if(index==2){uni.navigateTo({url:'/pagesB/messagecenter/messagecenter?index=true&comeNum=0'})}
if(index==3){uni.navigateTo({url:'/pagesA/activityTask/activityTask'})}
if(index==4){uni.navigateTo({url:'/pagesA/coupon/coupon'})}
if(index==5){uni.navigateTo({url:'/pagesA/peacockCoin/peacockCoin'})}
@ -418,7 +418,7 @@
if(index==1) newUrl = '/pagesB/personalPoster/personalPoster'
if(index==2) newUrl = '/pagesB/myCollection/myCollection'
if(index==3) newUrl = '/pagesB/sharingCenter/sharingCenter'
if(index==4) newUrl = '/pagesB/messagecenter/messagecenter'
if(index==4) newUrl = '/pagesB/messagecenter/messagecenter?comeNum=0'
if(index==5) newUrl = '/pagesA/my-diary/my-diary'
if(index==6) newUrl = '/pagesA/suggestions/suggestions'
if(index==7) newUrl = '/pagesB/aboutUs/aboutUs'

View File

@ -46,7 +46,7 @@
<!-- <view v-if="indexd==7" @tap="openPicker" class="width100 mar-y20">{{region}}</view> -->
<view v-if="indexd==7" @tap="openAddres2" class="width100 mar-y20">{{pickerText}}</view>
<!-- 用户昵称真实姓名联系电话输入框 -->
<input @focus="inputFo(indexd)" @blur="inputB(indexd)" v-if="indexd==1 || indexd==5 || indexd==6" :type="(indexd==1 || indexd==5)?'text':'number'" :maxlength="indexd==6?11:10" v-model="itemd.content" class="mar-y20 tright pad-sx40 width100" style="border: none;" :placeholder="itemd.fcon"/>
<input @focus="inputFo(indexd)" @blur="inputB(indexd)" v-if="indexd==1 || indexd==5 || indexd==6" :disabled="indexd==6" :type="(indexd==1 || indexd==5)?'text':'number'" :maxlength="indexd==6?11:10" v-model="itemd.content" class="mar-y20 tright pad-sx40 width100" style="border: none;" :placeholder="itemd.fcon"/>
<!-- 用户头像 -->
<image v-if="indexd==0" :src="itemd.imgSrc || moHead" :class="indexd==0?'head_img':'head_next'" class="" mode="aspectFill"></image>
<!-- <image @tap="chooseHead" v-if="itemd.imgSrc!=''" :src="itemd.imgSrc" :class="indexd==0?'head_img':'head_next'" class="" mode="aspectFill"></image> -->

View File

@ -12,6 +12,7 @@
<image :class="isZhuan?'zhuan':'nozhuan'" src="/static/public/sanj.png" mode="aspectFill"></image>
<!-- 下拉列表 -->
<view v-if="isZhuan" class="posia bacf radius10 xial-box">
<input @tap.stop="entryEv" @confirm="searchEv" type="text" class="pad20" v-model="searchVal" placeholder="请输入昵称/姓名/手机" />
<view class="pad-zy20 xial-item-box">
<view @tap="chooseXia(indexl)" :class="xialCurrent==indexl?'pcol':''" v-for="(iteml,indexl) in xialone" :key="indexl">{{iteml.title}}</view>
</view>
@ -23,7 +24,7 @@
<!-- 列表 -->
<view v-if="dataList.length!=0" class="dis bacf radius10 pad20 mar-x20 posir" v-for="(item,index) in dataList" :key="index">
<image class="mar-y20 flexs" :src="item.imgSrc" style="width: 98rpx;height: 98rpx;" mode="aspectFill"></image>
<view class="fon24 col3 width100 mar-x40">
<view class="fon24 col3 width100 mar-x40" style="margin-bottom: 80rpx;">
<view class="bold disjbac">
<view class="fon28 clips1">{{item.name}}</view>
<view class="flexs">来源{{item.come}}</view>
@ -35,15 +36,26 @@
<view class="col3">{{item.qudao}}</view>
</view>
</view>
<view @tap="fenCustomer(index)" class="posia colf fon24 radius10 tc customer-btn" style="right: 20rpx;top: 80rpx;" v-if="item.customer=='' || item.customer==null" :style="{background:publicColor}"></view>
<view @tap="fenCustomer(index)" class="posia colf fon24 radius10 tc customer-btn" style="right: 20rpx;top: 80rpx;z-index: 1;" v-if="item.customer=='' || item.customer==null" :style="{background:publicColor}"></view>
<view @tap="tuneUpTag(index)" class="posia colf fon24 radius10 tc customer-btn" style="right: 20rpx;bottom: 20rpx;z-index: 1;" v-if="!item.tags.length" :style="{background:publicColor}"></view>
<view class="fon24 col3 posia bold disac" style="bottom: 60rpx;left: 20rpx;right: 20rpx;"><text class="flexs">标签</text>
<block v-if="item.tags.length">
<scroll-view scroll-x="true" >
<view class="disac"><view v-for="(item1,tagIndex) in item.tags" :key="tagIndex" class="pcol pad-zy10">{{item1}}</view></view>
</scroll-view>
</block>
<block v-else class="col9"></block>
</view>
<view class="fon24 col3 posia clips1 bold" style="bottom: 20rpx;left: 20rpx;right: 20rpx;">详细来源{{item.source_detail}}</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>
<!-- 弹框 -->
<!-- 分配客服弹框 -->
<pu-po :category="xialtList" @chooseXiaT="chooseXiaT" :isXiala="true" :isShowT="isShowT" :clearVal="'暂不分配'" :comfrimVal="'立即分配'" @comfirmev="comfirmev" @cancleev="cancleev"></pu-po>
<!-- 设置标签弹框 -->
<pu-po :category="tagList" @chooseXiaT="chooseTag" :isXiala="true" :isTag="true" :isShowT="isShowTag" :clearVal="'暂不设置'" :comfrimVal="'立即设置'" @comfirmev="comfirmevTag" @cancleev="cancleevTag"></pu-po>
<!-- 返回顶部 -->
<!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> -->
</view>
@ -73,7 +85,12 @@
size:10,
total:'',
isZanw:true,
ntype:''
ntype:'all',
tagList:[],
tag_id:'',
isShowTag:false,
tagId:'',
searchVal:''
}
},
onPageScroll(e) {
@ -99,8 +116,34 @@
this.checkKF()//
this.checkCL()//
this.checkLY()//
this.obtainTag();//
},
methods: {
obtainTag(){//
this.$requst.post('user/tag-list').then(res=>{
// console.log('',res);
if(res.code==0){
if(res.data.length!=0){
res.data.forEach(item=>{
let obj = {
title:item.name,
id:item.id,
checked:false
}
this.tagList.push(obj)
})
}
}
},error=>{})
},
//
tuneUpTag(index){
// console.log('');
this.isShowTag = true
//
this.customer_id = this.dataList[index].id//ID
if(this.tagList.length==0) this.tagList = ['暂无可设置的标签']
},
checkKF(){//
this.$requst.post('user/servicer-list').then(res=>{
// console.log('',res);
@ -140,7 +183,7 @@
},error=>{})
},
checkCL(ntype){//
this.$requst.post('user/customer',{page:this.page,size:this.size,type:ntype}).then(res=>{
this.$requst.post('user/customer',{page:this.page,size:this.size,type:ntype,keyword:this.searchVal}).then(res=>{
// console.log('',res);
if(res.code==0){
if(this.page==1) this.dataList = []
@ -157,12 +200,14 @@
time:item.created_at,
qudao:item.tag[0],
service:item.service,
source_detail:item.source_detail
source_detail:item.source_detail,
tags:item.tag
}
this.dataList.push(cuObj)
})
}
}
this.isZhuan = false;
} else this.$toolAll.tools.showToast(res.msg)
},error=>{})
},
fenCustomer(index){//
@ -190,21 +235,47 @@
}
},error=>{})
},
//
comfirmevTag(){
this.$toolAll.tools.showToast('设置中...')
// console.log('');
this.$requst.post('user/set-tags',{tag_ids:this.tagId,ids:this.customer_id}).then(res=>{
// console.log(':',res);
if(res.code==0){
this.page = 1
this.$toolAll.tools.showToast('设置成功')
this.isShowTag = false
this.checkCL(this.ntype)//
} else this.$toolAll.tools.showToast(res.msg)
},error=>{})
},
cancleev(){
this.isShowT = false
},
//
cancleevTag(){
this.isShowTag = false
},
openXial(){
this.isZhuan = !this.isZhuan
this.searchVal = '';
// console.log('');
},
chooseXia(index){
this.xialCurrent = index;
this.ntype = this.xialone[index].name;
console.log(this.ntype);
this.category = this.xialone[index].title;
},
chooseXiaT(e){
this.staff_id = e.id
},
//
chooseTag(e){
this.tagId = e.id;
this.tagList = e.arr;
},
entryEv(){
this.isXiala = true;
}
}
}

View File

@ -1,7 +1,7 @@
<template>
<view>
<!-- 状态栏 -->
<status-nav :titleVal="'消息'" :statusTitle="true"></status-nav>
<status-nav :titleVal="'消息'" :whereCome="comeNum" :statusTitle="true"></status-nav>
<view id="daoh" class="bacf pad-zy30 pad-sx20 isTopf fon28 col3 disja" :style="{top:statusHNH+'px'}">
<view @tap="switchEv(true)" :class="isWen?'isWen bold':'col9'" class="posir">日程提醒</view>
<view @tap="switchEv(false)" :class="!isWen?'isWen bold':'col9'" class="posir">消息中心</view>
@ -66,7 +66,8 @@
size:10,
total:0,
isZanw:true,
ntype:'reminders'//
ntype:'reminders',//
comeNum:0
}
},
onPageScroll(e) {
@ -85,6 +86,8 @@
this.$toolAll.tools.isLogin();
},
onLoad(options) {
//
if(options.comeNum==undefined) this.comeNum = 2;
const query = wx.createSelectorQuery()
query.select('#daoh').boundingClientRect((rect) => {
// console.log('+',rect);

View File

@ -349,9 +349,6 @@
})
},
lianK() { //
// if(!this.jieDuan){
// let isAuth = this.$toolAll.tools.returnAuth()
// if(!isAuth){
if (this.haveImg == false) {
this.vision = true
} else {
@ -366,7 +363,7 @@
e: 5, //
t: new Date().getTime() //
}
this.$toolAll.tools.maiDian(maiOjb)
this.$toolAll.tools.maiDian(maiOjb);
}
// } else this.jieDuan = true
// }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long