linwe
2024-08-08 3c738f4fe2762bba8087e5a22fc0dc06560eab0e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<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>