xuruiqian
2025-02-25 e85ab165147c37b571ea67ce6f6ae9ae55a96070
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
<template>
    <view class="u-page">
        <view class="u-block">
            <view class="u-demo-block__content">
                <view class="u-page__tag-item">
                    <u-search
                            v-model="keywords"
                            :show-action="false"
                            @change="onSearchTextChange"
                    ></u-search>
                </view>
            </view>
        </view>
    </view>
</template>
 
<script>
    import {useBasicInfoStore} from "../../store/basicInfo";
    import {getCurrentInstance, onMounted, reactive, toRefs} from "vue";
    import {GetProductCategoryListByParentName} from "../../apis/api";
 
    export default {
        name: "index",
        setup() {
            const userStore = useBasicInfoStore()
            const {proxy} = getCurrentInstance();
            const state = reactive({
                keywords: null,
                historyKeywords: [],
            })
 
            onMounted(() => {
                Init();
                loadHistoryKeywords();
            });
 
            const Init = () => {
 
            }
 
            const loadHistoryKeywords = () => {
                state.schools = [];
                state.schoolColumns = [];
 
                GetProductCategoryListByParentName("家政服务").then(resp => {
                    if (resp.data) {
                        state.categories = resp.data;
                        console.error(state.categories);
                    }
                }).catch(err => {
                    console.error(err);
                });
            }
 
            const onSearchTextChange = (data) => {
                console.log(data);
            }
 
            return {...toRefs(state), userStore, loadHistoryKeywords, onSearchTextChange}
        }
    }
</script>
 
<style scoped>
 
</style>