emis-sapp/components/buns-way-sheet/buns-way-sheet.vue
2023-12-10 13:53:38 +08:00

114 lines
2.4 KiB
Vue

<template>
<tpx-dialog :show="show" title="选择线路" @onClose="handleCloseModal()">
<view class="shet-cont">
<!-- 关键字搜索框 -->
<tpx-search placeholder="请输入" v-model:value="keyword" bgColor="#FFF"></tpx-search>
<view class="mt-20 mb-10">
<tpx-tags :list="hisList" :value="value" type="single" @onItemClick="handleHisItemClick"></tpx-tags>
</view>
<u-line></u-line>
<view class="">
<tpx-checkitems :list="dataList.filter(v=> !keyword || (v.title.indexOf(keyword) > -1))" :value="value" v-slot="dlCurrent" min-checked="1" type="single"
@onChange="handleDataItemChange"
>
<view slot class="mt-20">
<u-row justify="between">
<u-col span="10">
<u-text size="28" :text="dlCurrent.item.title"></u-text>
</u-col>
<view span="2" class="chk-icon">
<u-checkbox-group>
<u-checkbox :checked="dlCurrent.checked" shape="circle" size="32" activeColor="#B12D29"></u-checkbox>
</u-checkbox-group>
</view>
</u-row>
<u-line margin="20rpx 0 0 0"></u-line>
</view>
</tpx-checkitems>
</view>
</view>
</tpx-dialog>
</template>
<script>
export default {
// computed: {
// filDataList() {
// return []
// },
// },
props: {
show: {
default () {
return false
}
},
value: {
default () {
return ''
}
}
},
data() {
return {
hisList: [
{ title: '柬-铁运', val: 1 },
{ title: '越-铁运', val: 2 }
],
dataList: [
{ title: '柬埔寨-铁卡联运', val: 1 },
{ title: '越南-铁卡联运', val: 2 },
{ title: '泰国-铁卡联运', val: 3 },
{ title: '巴厘岛-铁卡联运', val: 4 }
],
keyword: ''
}
},
created() {
},
onHide() {
},
destroyed() {},
methods: {
handleCloseModal() {
this.$emit('update:show', false)
},
handleHisItemClick(res) {
this.updateValue(res.val)
},
handleDataItemChange(val) {
this.updateValue(val)
},
updateValue(val) {
this.$emit('onChange', val)
this.$emit('update:value', val)
this.handleCloseModal()
}
}
}
</script>
<style scoped lang="scss">
.shet-cont{
min-height: 500rpx;
padding: 10rpx 0 30rpx 0;
}
.chk-icon{
position: relative;
&::after {
position: absolute;
content: ' ';
top: 0;
right: 0;
bottom: 0;
left: 0;
}
}
</style>