<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>
|