diff --git a/src/components/widgets/search.vue b/src/components/widgets/search.vue
index 3738214..5d12323 100644
--- a/src/components/widgets/search.vue
+++ b/src/components/widgets/search.vue
@@ -6,7 +6,7 @@
@@ -25,6 +25,11 @@ export default {
created() {},
mounted() {},
destroyed() {},
+ watch: {
+ keywords(value) {
+ this.$emit("input", value);
+ },
+ },
methods: {},
};
diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue
index c44de6b..c6ac445 100644
--- a/src/pages/index/index.vue
+++ b/src/pages/index/index.vue
@@ -1,6 +1,6 @@
-
+
diff --git a/src/pages/service/cate.vue b/src/pages/service/cate.vue
index e97cc0b..71aa00d 100644
--- a/src/pages/service/cate.vue
+++ b/src/pages/service/cate.vue
@@ -1,7 +1,7 @@
-
+
{
response.data.forEach((item) => {
list.push({
@@ -123,6 +128,9 @@ export default {
loadCate() {
this.$request({
api: "service.cate",
+ data: {
+ keys: this.keywords,
+ },
})
.then((response) => {
response.data.forEach((item) => {
@@ -151,6 +159,23 @@ export default {
this.newId = parentId;
this.$utils.toPage("/pages/service/list?id=" + id);
},
+ /**
+ * 搜索
+ */
+ inputKeywords(kw) {
+ this.keywords = kw;
+ clearTimeout(this.keywordsTimer);
+ this.keywordsTimer = setTimeout(async () => {
+ this.data = [];
+ this.data.push({
+ id: 0,
+ name: "热门推荐",
+ cover: "",
+ child: await this.hotCate(),
+ });
+ this.loadCate();
+ }, 1000);
+ },
},
};