<template>
|
<view class="">
|
<z-paging ref="paging" v-model="list" @query="queryList" @onRefresh="refreshList"
|
loading-more-no-more-text="没有更多了" :auto-show-back-to-top="true">
|
<view class="tab" slot="top">
|
<u-search placeholder="请输入关键字" v-model="keyword" :showAction="true" actionText="搜索" :animation="true"
|
@custom="onSearch" @search="onSearch"></u-search>
|
</view>
|
<view class="list ">
|
<view class="list-item bgc-ff j-c-s-b a-ic" v-for="(i,k) in list" :key="k" @click="searchLink(i)">
|
<view class="flex">
|
<text class="search-content f-28">{{i.title}}</text>
|
<view class="search-tag f-26 c-main">
|
{{i.relationship == 18 ? '租户':i.typeName}}
|
</view>
|
</view>
|
<view v-if=" i.content" class="search-address f-20 ">
|
{{i.content}}
|
</view>
|
</view>
|
</view>
|
</z-paging>
|
</view>
|
</template>
|
|
<script>
|
import {
|
searchContent
|
} from "@/api/system/index"
|
|
export default {
|
|
data() {
|
return {
|
keyword: "",
|
list: [],
|
|
}
|
},
|
onLoad(option) {
|
this.keyword = option.keyword;
|
},
|
|
methods: {
|
refreshList() {
|
this.$refs.paging.reload();
|
},
|
|
onSearch() {
|
this.$refs.paging.reload();
|
},
|
|
queryList(pageNo, pageSize) {
|
searchContent({
|
current: pageNo,
|
size: pageSize,
|
searchKey: this.keyword,
|
indexName: "jczz"
|
}).then(res => {
|
let data = res.data.records
|
|
this.$refs.paging.complete(data);
|
})
|
},
|
|
|
//搜索内容跳转
|
searchLink(item) {
|
//通知公告,经营场所,房屋,住户
|
switch (item.typeName) {
|
case "通知公告":
|
uni.navigateTo({
|
url: `/subPackage/article/detail?id=${item.tableId}&type=${item.type}`
|
})
|
break;
|
case "经营场所":
|
uni.navigateTo({
|
url: `/subPackage/house/houseNumber/index?stdId=${item.tableId}&from=search`
|
})
|
break;
|
case "房屋":
|
uni.navigateTo({
|
url: `/subPackage/house/roomDetails/index?id=${item.tableId}&from=search`
|
})
|
break;
|
default:
|
uni.navigateTo({
|
url: `/subPackage/house/member/index?id=${item.tableId}&from=search`
|
})
|
break;
|
}
|
},
|
|
}
|
}
|
</script>
|
|
<style lang="scss">
|
page {
|
background-color: #f5f5f5;
|
}
|
|
.tab {
|
width: 100%;
|
height: 88rpx;
|
// position: fixed;
|
/*#ifdef H5*/
|
top: 88rpx;
|
/*#endif*/
|
/*#ifdef MP-WEIXIN*/
|
top: 0;
|
/*#endif*/
|
left: 0;
|
background-color: #fff;
|
padding: 0 30rpx;
|
box-sizing: border-box;
|
z-index: 999;
|
}
|
|
.list {
|
margin-top: 20rpx;
|
padding: 0 30rpx;
|
}
|
|
.list-item {
|
padding: 20rpx;
|
margin-bottom: 20rpx;
|
border-radius: 10rpx;
|
|
.search-content {
|
width: 80%;
|
}
|
|
.search-tag {
|
padding: 0 10rpx;
|
height: 40rpx;
|
line-height: 40rpx;
|
border-radius: 8rpx;
|
background-color: rgb(236, 244, 255);
|
border: 1px solid currentColor;
|
}
|
|
.search-address {
|
padding: 0 10rpx;
|
// height: 40rpx;
|
line-height: 40rpx;
|
border-radius: 8rpx;
|
margin: 5rpx 0;
|
}
|
}
|
</style>
|