5e8e44f88f
commitf9e9899e0eAuthor: 浅念 <email@sample.com> Date: Fri Mar 28 11:10:56 2025 +0800 设置默认语言为英语 commit303121ba81Author: 浅念 <email@sample.com> Date: Fri Mar 28 11:00:05 2025 +0800 调用接口调整 commit37e0e55d96Author: 浅念 <email@sample.com> Date: Fri Mar 28 10:33:48 2025 +0800 线上接口地址 commit11dd7de521Author: 浅念 <email@sample.com> Date: Thu Mar 27 16:54:52 2025 +0800 修改样式 commit8ceb98b321Author: 浅念 <email@sample.com> Date: Thu Mar 27 16:47:04 2025 +0800 隐藏我的名片 commitf58e712684Author: 浅念 <email@sample.com> Date: Thu Mar 27 16:44:43 2025 +0800 样式调整 commit54ad6c9e37Author: 浅念 <email@sample.com> Date: Thu Mar 27 16:35:21 2025 +0800 修改语言包 commit526f934a75Author: 浅念 <email@sample.com> Date: Thu Mar 27 16:13:47 2025 +0800 标签功能 commit8583ff2543Author: 浅念 <email@sample.com> Date: Wed Mar 26 17:02:04 2025 +0800 标签管理页面 commitbe8674fd51Author: 浅念 <email@sample.com> Date: Tue Mar 25 17:29:37 2025 +0800 样式调整 commita5d5ce4e7cAuthor: 浅念 <email@sample.com> Date: Tue Mar 25 17:23:40 2025 +0800 倒计时组件 commitf88048b876Author: 浅念 <email@sample.com> Date: Tue Mar 25 17:19:43 2025 +0800 首页添加跟进提醒 commitf9a39d5aaaAuthor: 浅念 <email@sample.com> Date: Tue Mar 25 13:13:39 2025 +0800 提交 commite3abe0bf18Author: 浅念 <email@sample.com> Date: Tue Mar 25 13:12:24 2025 +0800 名片部分页面。地图定位。国家下拉搜索 回收站
125 lines
2.4 KiB
Vue
125 lines
2.4 KiB
Vue
<template>
|
|
<view>
|
|
<view class="text">
|
|
<view class="qx" @click="close('showarea') ">{{$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 areaList"
|
|
: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>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name:"select",
|
|
props: {
|
|
showarea: {
|
|
type: Boolean,
|
|
default: true
|
|
},
|
|
areaList:[],
|
|
},
|
|
data() {
|
|
return {
|
|
searchKeyword:'',
|
|
filteredOptions:'',
|
|
|
|
};
|
|
},
|
|
methods:{
|
|
// 搜索处理函数
|
|
handleSearch(){
|
|
if (this.searchKeyword) {
|
|
console.log(this.searchKeyword)
|
|
this.filteredOptions = this.areaList.filter((item) =>
|
|
item.name.includes(this.searchKeyword)
|
|
);
|
|
console.log(this.filteredOptions)
|
|
} else {
|
|
// 如果搜索框为空,显示全部数据
|
|
this.filteredOptions = this.areaList;
|
|
}
|
|
},
|
|
// 选择选项
|
|
handleSelect(item) {
|
|
this.selectedLabel = item.name; // 回显选中的值
|
|
// this.searchKeyword = item.name
|
|
this.actives = item.id
|
|
// this.showPicker = false; // 关闭弹窗
|
|
console.log("选中的值:", item.id);
|
|
console.log("选中的值:", item.name);
|
|
},
|
|
arerfn(){
|
|
this.showPicker = false; // 关闭弹窗
|
|
this.country_name = this.selectedLabel
|
|
this.userinfo.country_id = this.actives
|
|
|
|
},
|
|
close(val){
|
|
this[val] = false
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
.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;
|
|
}
|
|
</style> |