标签功能

This commit is contained in:
浅念
2025-03-27 16:13:47 +08:00
parent 8583ff2543
commit 526f934a75
11 changed files with 343 additions and 233 deletions
+2 -145
View File
@@ -77,14 +77,6 @@
</view>
</view>
<u-line></u-line>
<view class="cell">
<view class="item">{{$t('customer.Cstomertag')}}</view>
<view class="right select" @click="showtag = true">
<view class="" :class="['content2', { placeholder: !grade_name }]">{{grade_name || $t('customer.Cstomertaginput')}}</view>
<u-icon class="arrowright" name="arrow-right" size="18" color="#747474"></u-icon>
</view>
</view>
<u-line></u-line>
<view class="cell">
<view class="item">{{$t('customer.Country')}}</view>
<view class="right select" @click="showarea = true">
@@ -157,26 +149,7 @@
</scroll-view>
</view>
</u-popup>
<!-- 客户标签 -->
<u-popup closeOnClickOverlay :show="showtag" mode="bottom" :round="10" title="客户标签" @close="close('showtag')" :closeable="true" >
<view class="popup-content">
<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.child" :class="{ 'tagactive': isActive(item1.pid, item1.id) }" @click="tagSelect(item1)" :key="index1">
{{ item1.name }}
</view>
</view>
</view>
</scroll-view>
</view>
</u-popup>
</view>
</template>
<script>
@@ -224,85 +197,7 @@
},
location:{},
activeMap: {}, // 存储每个父级下选中的子项 { 父ID: 子ID }
taglist:[
{
name:'客户价值',
id:'1',
child:[
{name:'高价值',id:1,pid:1},
{name:'中价值',id:2,pid:1},
{name:'低价值',id:3,pid:1},
{name:'潜在高价值',id:4,pid:1},
]
},
{
name:'生命周期',
id:'2',
child:[
{name:'新客户',id:5,pid:2},
{name:'活跃',id:6,pid:2},
{name:'沉默',id:7,pid:2},
{name:'流失',id:8,pid:2},
]
},
{
name:'行为标签',
id:'3',
child:[
{name:'高频购买',id:9,pid:3},
{name:'大单',id:10,pid:3},
{name:'促销敏感',id:11,pid:3},
{name:'忠诚',id:12,pid:3},
]
},
{
name:'需求标签',
id:'4',
child:[
{name:'价格敏感',id:13,pid:4},
{name:'品质追求',id:14,pid:4},
{name:'服务',id:15,pid:4},
{name:'定制化',id:16,pid:4},
]
},
{
name:'来源标签',
id:'5',
child:[
{name:'线上',id:17,pid:5},
{name:'线下',id:18,pid:5},
{name:'推荐',id:19,pid:5},
{name:'合作伙伴',id:20,pid:5},
]
},
{
name:'风险标签',
id:'6',
child:[
{name:'高',id:21,pid:6},
{name:'中',id:22,pid:6},
{name:'低',id:23,pid:6},
]
},
{
name:'满意度标签',
id:'7',
child:[
{name:'高',id:24,pid:7},
{name:'中',id:25,pid:7},
{name:'低',id:26,pid:7},
]
},
{
name:'忠诚度标签',
id:'8',
child:[
{name:'高',id:27,pid:8},
{name:'中',id:28,pid:8},
{name:'低',id:29,pid:8},
]
}
]
taglist:[]
}
},
onLoad() {
@@ -464,13 +359,6 @@
close(val){
this[val] = false
},
//标签点击
tagSelect(item) {
this.$set(this.activeMap, item.pid, item.id);
},
isActive(parentId, childId) {
return this.activeMap[parentId] === childId;
},
//提交保存
saveFn(){
if(this.form.contacts==''){
@@ -642,35 +530,4 @@
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 0px;
}
.row{
width: 100%;
}
.col4{
display: inline-block;
margin: 4px 3px;
width: 30%;
}
}
.tagactive{
background: #3471FF !important;
color: #fff !important;
}
</style>