添加客户标签搜索等 及登录注册传参 及添加转移功能

This commit is contained in:
浅念
2025-07-24 17:31:25 +08:00
parent e6851b4c5c
commit e89ca3dd33
11 changed files with 357 additions and 62 deletions
+12 -4
View File
@@ -1,7 +1,7 @@
const baseUrl = "http://219.157.255.213:9006/"; //这里放置url域名32044
// const baseUrl = "http://219.157.255.213:9006/"; //这里放置url域名32044
// const baseUrl = "http://api.crm.hnxinyouhe.com/"; //这里放置url域名32044
// const baseUrl = "http://192.168.50.9:8787/"; //这里放置url域名32044
const baseUrl = "http://219.157.255.213:25329/"; //这里放置url域名32044
// const baseUrl = "https://api.fcrm.hnxinyouhe.com/"; //这里放置url域名32044
// const baseUrl = "https://crm-server.smt.hnxinyouhe.com/"; //这里放置url域名32044
// const baseUrl = "/api/"; //这里放置url域名32044
@@ -11,12 +11,20 @@ export function request(options){//封装的requset
uni.showLoading({
title: ''
});
var lang = uni.getStorageSync('i18locale')?uni.getStorageSync('i18locale'):uni.getLocale()
if(lang=='zh-Hans'){
lang='zh_CN'
}
console.log(lang)
return new Promise((resolve,rejext)=>{
uni.request({//这里是uniapp网络请求的api
url: baseUrl + url, //仅为示例,并非真实接口地址。
data,
header:{'content-type': 'application/x-www-form-urlencoded','Authorization': 'Bearer ' + uni.getStorageSync('token')},
header:{
'content-type': 'application/x-www-form-urlencoded',
'Authorization': 'Bearer ' + uni.getStorageSync('token'),
'fdesk-language':lang
},
method:method||"GET",//默认请求方式是get
success: (res) => {
if(res.data.code==401){
+1
View File
@@ -204,4 +204,5 @@ export default {
downmp:'Download business card',
downmpmsg:'Are you sure to download the current business card image?',
callmsg:'Are you sure you want to make the call?',
transfer:"Transfer"
}
+1
View File
@@ -203,4 +203,5 @@ export default {
downmp:'Скачать визитку',
downmpmsg:'Вы уверены в загрузке текущей карты?',
callmsg:'Вы уверены, что хотите совершить звонок?',
transfer:"Перевести"
}
+1
View File
@@ -203,4 +203,5 @@ export default {
downmp:'下载名片',
downmpmsg:'确定下载当前名片图吗?',
callmsg:'确定拨打电话吗?',
transfer:"转移"
}
+4 -5
View File
@@ -58,15 +58,14 @@
<input :placeholder="$t('customer.WhatsAppinput')" v-model="form.WhatsApp" />
</view>
</view>
<u-line></u-line>
<!-- <u-line></u-line>
<view class="cell">
<view class="item">{{$t('customer.Customerph')}} <text class="red">*</text></view>
<view class="right select" @click="showcartype = true">
<view class="" :class="['content2', { placeholder: !car_type_name }]">{{car_type_name || $t('customer.Customerphinput')}}</view>
<!-- <input :placeholder="$t('customer.Customerphinput')" disabled v-model="car_type_name" /> -->
<u-icon class="arrowright" name="arrow-right" size="18" color="#747474"></u-icon>
</view>
</view>
</view> -->
<u-line></u-line>
<view class="cell">
<view class="item">{{$t('customer.Cstomerfj')}}</view>
@@ -188,7 +187,7 @@
describe: '',
grade:'',
country_id:'',
car_type_id:'',
// car_type_id:'',
channel_id:'',
magnitude:'',
address:'',
@@ -204,7 +203,7 @@
this.getChannel()
this.getMagnitude()
this.getGrade()
this.carType()
// this.carType()
this.area()
},
onShow() {
+10 -11
View File
@@ -59,14 +59,13 @@
</view>
</view>
<u-line></u-line>
<view class="cell">
<!-- <view class="cell">
<view class="item">{{$t('customer.Customerph')}} <text class="red">*</text></view>
<view class="right select" @click="showcartype = true">
<!-- <input :placeholder="$t('customer.Customerphinput')" disabled v-model="car_type_name" /> -->
<view class="" :class="['content2', { placeholder: !car_type_name }]">{{car_type_name || $t('customer.Customerphinput')}}</view>
<u-icon class="arrowright" name="arrow-right" size="18" color="#747474"></u-icon>
</view>
</view>
</view> -->
<u-line></u-line>
<view class="cell">
<view class="item">{{$t('customer.Country')}}</view>
@@ -180,7 +179,7 @@
describe: '',
grade:'',
country_id:'',
car_type_id:'',
// car_type_id:'',
channel_id:'',
magnitude:'',
address:'',
@@ -196,7 +195,7 @@
var that = this
this.getChannel()
this.getMagnitude()
this.carType()
// this.carType()
this.area()
this.customerdetailfn()
@@ -234,12 +233,12 @@
that.defaultIndexqd=[index]
}
})
that.carTypeList1.forEach((item,index) => {
if(item.id == that.form.car_type_id){
that.car_type_name = item.name
that.defaultIndexph=[index]
}
})
// that.carTypeList1.forEach((item,index) => {
// if(item.id == that.form.car_type_id){
// that.car_type_name = item.name
// that.defaultIndexph=[index]
// }
// })
that.magnitudeList1.forEach((item,index) => {
if(item.id == that.form.magnitude){
that.magnitude_name = item.name
+310 -26
View File
@@ -8,13 +8,16 @@
<view class="topSearch">
<view class="left">
<view @click="showPicker = true" class="searchl">
{{country_name || $t('customer.Country')}}
</view>
<u-search v-model="keyword" bgColor="#fff" search-icon=" " :show-action="false" :placeholder="$t('customer.inputhd')"></u-search>
<view @click="searchCli" class="search">
<image src="/static/image/customer/search1.png" mode=""></image>
</view>
</view>
<view class="right">
<image src="/static/image/customer/search.png" @click="show = true" mode=""></image>
<image src="/static/image/customer/search.png" @click="showtagfn()" mode=""></image>
</view>
</view>
</view>
@@ -51,6 +54,7 @@
</view>
</view>
<view class="desc1">
<view class="userzy" @click="cede(item)"><image src="/static/image/customer/zhuany.png" mode=""></image> {{$t('transfer')}}</view>
<view class="" @click="callPhone(item)"><image src="/static/image/customer/phone.png" mode=""></image> {{$t('call')}}</view>
<view class="" @click="editClick(item)"><image src="/static/image/customer/edit.png" mode=""></image> {{$t('customer.addfollow')}}</view>
<!-- <view class="" @click="delClick(item)"><image src="/static/image/customer/trash.png" mode=""></image> {{$t('delete')}}</view> -->
@@ -60,7 +64,8 @@
</u-swipe-action>
</view>
</z-paging>
<u-picker closeOnClickOverlay :cancel-text="$t('cancel')" :confirm-text="$t('confirm')" :show="show" :columns="columns" @cancel="cancel" @close="cancel" @confirm="confirm" :title="$t('customer.CustomerScreening')" keyName="label"></u-picker>
<u-picker closeOnClickOverlay :cancel-text="$t('cancel')" :confirm-text="$t('confirm')" :show="show" :columns="alluserlist" @cancel="cancel" @close="cancel" @confirm="confirm" :title="$t('transfer')" keyName="name"></u-picker>
<!-- <u-picker closeOnClickOverlay :cancel-text="$t('cancel')" :confirm-text="$t('confirm')" :show="show" :columns="columns" @cancel="cancel" @close="cancel" @confirm="confirm" :title="$t('customer.CustomerScreening')" keyName="label"></u-picker> -->
<u-popup :show="showts" :closeOnClickOverlay="false" :round="20" mode="center">
<view class="popupcontent">
<view class="title">{{$t('prompt')}}</view>
@@ -80,7 +85,70 @@
</view>
</movable-view>
</movable-area>
<u-popup closeOnClickOverlay :show="showPicker" mode="bottom" :round="10" @close="close('showPicker')">
<view class="text">
<view class="qx" @click="close('showPicker') ">{{$t('cancel')}}</view>
<view class="qd" @click="arerfn">{{$t('confirm')}}</view>
</view>
<view class="popup-content">
<!-- 搜索框 -->
<u-input
v-model="searchKeyword"
:placeholder="$t('keyword')"
@input="handleSearch"
></u-input>
<!-- 选项列表 -->
<scroll-view scroll-y class="option-list">
<view
v-for="(item, index) in filteredOptions"
:key="index"
class="option-item"
@click="handleSelect(item)"
:class="actives==item.id?'actives':''"
>
{{ item.name }}
</view>
<view v-if="filteredOptions.length === 0" class="no-data">
{{$t('noresults')}}
</view>
</scroll-view>
</view>
</u-popup>
<!-- 客户标签 -->
<u-popup closeOnClickOverlay :show="showtag" mode="bottom" :round="10" @close="closetag('showtag')" :closeable="false" >
<view class="text">
<view class="qx" @click="close('showtag') ">{{$t('cancel')}}</view>
<view class="qd" @click="showtagqd">{{$t('confirm')}}</view>
</view>
<view class="popup-content">
<view>
<view class="name">{{$t('customer.CustomerScreening')}}</view>
<view class="row">
<view class="col4 tagitem" v-for="(items, indexs) in columns" :class="{ 'tagactive': isActivetime(items.id) }" @click="tagSelecttime(items)" :key="indexs">
{{ items.label }}
</view>
</view>
</view>
<scroll-view scroll-y class="tag-list">
<view
v-for="(item, index) in taglist"
:key="index"
class="tags"
>
<view class="name">{{ item.name }}</view>
<view class="row">
<view class="col4 tagitem" v-for="(item1, index1) in item.tags" :class="{ 'tagactive': isActive(item1.group_id, item1.id) }" @click="tagSelect(item1)" :key="index1">
{{ item1.name }}
</view>
</view>
</view>
</scroll-view>
</view>
</u-popup>
</view>
</template>
<script>
@@ -88,6 +156,15 @@
export default {
data() {
return {
showtag: false,
actives:'',
showPicker: false, // 控制选择器显示
searchKeyword: "", // 搜索关键词
selectedLabel: "", // 选中的值(显示在输入框中)
filteredOptions: [], // 过滤后的数据
country_name:'',
country_id:'',
tag_id:[],
current:0,
options1: [],
x: 300, //x坐标
@@ -101,7 +178,11 @@
columns:[],
list1: [],
datalist:[],
isey:false
isey:false,
activeMap: {}, // 存储每个父级下选中的子项 { 父ID: 子ID }
taglist:[],
alluserlist:[],
customer_id:''
}
},
onLoad(e) {
@@ -115,6 +196,7 @@
this.x = windowWidth-70
this.y = windowHeight-55
uni.removeStorageSync('location')
this.area()
},
onShow() {
// var location = uni.getStorageSync('i18locale')?uni.getStorageSync('i18locale'):uni.getLocale()
@@ -143,21 +225,19 @@
name: this.$t('lost'),
id:'lost'
}]
this.columns=[
[{
label: this.$t('all'),
id:''
},{
label:this.$t('tday'),
id: 0
}, {
label: this.$t('threeday'),
id: 1
}, {
label: this.$t('sevenday'),
id: 2
}]
]
this.columns=[{
label: this.$t('all'),
id:''
},{
label:this.$t('tday'),
id: 0
}, {
label: this.$t('threeday'),
id: 1
}, {
label: this.$t('sevenday'),
id: 2
}]
uni.setTabBarItem({
index: 0,
text: this.$t('tabbar.home')
@@ -176,16 +256,114 @@
})
},
methods: {
//获取转移用户
getalluser(){
request({
url:'user/getUsers?abbr=xinyouhe',
method:'get',
}).then(res => {
var list = res.data.data
this.alluserlist = [list]
})
},
// 搜索处理函数
handleSearch() {
var that = this
if (this.searchKeyword) {
this.filteredOptions = this.areaList1.filter((item) => item.name.includes(this.searchKeyword));
} else {
// 如果搜索框为空,显示全部数据
this.filteredOptions = this.areaList1;
}
},
// 选择选项
handleSelect(item) {
this.selectedLabel = item.name; // 回显选中的值
// this.searchKeyword = item.name
this.actives = item.id
// this.showPicker = false; // 关闭弹窗
},
arerfn(){
this.showPicker = false; // 关闭弹窗
this.country_name = this.selectedLabel
this.country_id = this.actives
this.queryList(1, 10)
},
//国家
area(){
request({
url:'area/getCountry',
method:'get',
}).then(res => {
var list = res.data.data
this.areaList1 = list
this.filteredOptions = list;
})
},
//标签
tagGroup(){
request({
url:'tagGroup/list',
method:'get',
}).then(res => {
this.taglist = res.data.data
})
},
//标签点击
tagSelect(item) {
// 如果已选中则取消,否则设置选中
this.$set(this.activeMap, item.group_id, this.activeMap[item.group_id] === item.id ? '' : item.id);
},
isActive(parentId, childId) {
return this.activeMap[parentId] === childId;
},
tagSelecttime(item) {
this.follow_last = item.id;
},
isActivetime(id) {
return this.follow_last === id;
},
showtagqd(){
const selectedIds = Object.values(this.activeMap).filter(id => id !== '')
this.tag_id = selectedIds
this.queryList(1, 10)
this.showtag = false
},
showtagfn(){
console.log(this.columns)
this.tagGroup()
this.showtag = true
},
searchCli(){
this.queryList(1, 10)
},
close() {
this.show= false
close(val){
this[val] = false
},
//转移客户
confirm(e) {
this.follow_last = e.value[0].id
this.show = false
this.queryList(1, 10)
request({
url:'customer/cede',
method:'post',
data: {
user_id: e.value[0].id,
customer_id:this.customer_id
}
}).then(res => {
uni.showToast({
title: res.data.message,
icon: 'none'
});
if(res.data.code ==0){
setTimeout(() => {
uni.reLaunch({
url: '/pages/index/customer',// 替换为你要跳转的页面路径
});
}, 1000);
}
})
},
cancel() {
this.show = false
@@ -212,6 +390,8 @@
per_page:10,
keyword:this.keyword,
follow_last:this.follow_last,
country_id:this.country_id,
tag_id:this.tag_id,
}
}).then(res => {
if(res.data.code ==0){
@@ -269,7 +449,6 @@
},
delClick(item){
this.del_id = item.id
this.showts=true
},
delfn(){
this.showts=false
@@ -298,6 +477,12 @@
url: '/pages/customer/add'
});
},
//转移客户
cede(item){
this.customer_id = item.id
this.getalluser()
this.show = true
}
}
}
</script>
@@ -306,6 +491,9 @@
uni-page-body {
background-color: #F6F6F6 !important;
}
::v-deep .u-search__content{
padding: 0 56px 0px 70px;
}
::v-deep .u-search__content__input{
font-size: 24rpx !important;
}
@@ -338,18 +526,42 @@
padding: 10px 15px 5px;
.left {
position: relative;
width: 88%;
flex: 1;
}
.right {
flex: 1;
text-align: right;
margin-left: 5px;
image{
width: 24px;
height: 20px;
margin-top: 5px;
}
}
.searchl{
background: linear-gradient(to right, #3471FF, #6776FF);
color: white;
border-radius: 20px;
padding: 4px 12px;
text-align: center;
position: absolute;
/* #ifdef APP-PLUS */
top: 3px;
/* #endif */
top: 2px;
left:5px;
font-size: 12px;
width: 46px; /* 你可以根据需要调整宽度 */
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
display: inline-block;
image{
width: 16px;
height: 16px;
}
}
.search{
background: linear-gradient(to right, #3471FF, #6776FF);
color: white;
@@ -440,15 +652,20 @@
color: #3471FF;
display: flex;
justify-content: flex-end;
align-items: center;
view{
margin-left:15px;
}
image{
width: 14px;
height: 14px;
// vertical-align: sub;
vertical-align: sub;
margin-right: 5px;
}
.userzy image{
width: 18px;
height: 18px;
}
}
}
.popupcontent{
@@ -490,5 +707,72 @@
line-height: 40px;
}
}
.actives{
background-color: #dfdfdf;
}
.text{
display: flex;
align-items: center;
justify-content: space-between;
line-height: 30px;
padding: 10px 15px 0px;
.qd{
color: #3471FF;
}
}
.popup-content {
padding: 20px;
background-color: #fff;
}
.option-list {
max-height: 400rpx;
margin-top: 20rpx;
}
.option-item {
padding: 20rpx;
border-bottom: 1rpx solid #eee;
}
.option-item:last-child {
border-bottom: none;
}
.no-data {
text-align: center;
padding: 20rpx;
color: #999;
}
//标签
.tag-list{
max-height: 900rpx;
margin-top: 20rpx;
}
.tags{
margin-top: 10px;
}
.name{
margin: 10px 0px;
}
.tagitem{
background: #ECF2FF;
border-radius: 8px;
color: #3471FF;
text-align: center;
padding: 5px 13px;
}
.row{
width: 100%;
}
.col4{
display: inline-block;
margin: 4px 3px;
// width: 30%;
}
.tagactive{
background: #3471FF !important;
color: #fff !important;
}
</style>
+16 -16
View File
@@ -252,22 +252,22 @@
index: 3,
text: this.$t('tabbar.mine')
})
var language = e.value[0].id
if(e.value[0].id=='zh-Hans'){
language= 'zh_CN'
}
request({
url:'user/language',
method:'POST',
data:{
language: language,
}
}).then(res => {
uni.showToast({
title: res.data.message,
icon: 'none'
});
})
// var language = e.value[0].id
// if(e.value[0].id=='zh-Hans'){
// language= 'zh_CN'
// }
// request({
// url:'user/language',
// method:'POST',
// data:{
// language: language,
// }
// }).then(res => {
// uni.showToast({
// title: res.data.message,
// icon: 'none'
// });
// })
},
//日期选择组件
confirm(e) {
+1
View File
@@ -193,6 +193,7 @@
email: this.email,
password: this.password,
language: this.language,
abbr:'hesu'
}
}).then(res => {
uni.setStorageSync('i18locale',this.language);
+1
View File
@@ -122,6 +122,7 @@
email: this.email,
password: this.password,
code: this.code,
abbr:'hesu'
}
}).then(res => {
// console.log(res.data.data)
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB