diff --git a/src/api/home.js b/src/api/home.js index 5607c00..48eb6e3 100644 --- a/src/api/home.js +++ b/src/api/home.js @@ -1,8 +1,8 @@ import request from '@/utils/request' -export function getGoodsList(query) { +export function getRecommonGoodsList(query) { return request({ - url: '/home/goodsList', + url: '/home/recommonGoodsList', method: 'get', params: query }) diff --git a/src/api/search.js b/src/api/search.js index 77a869e..3200e21 100644 --- a/src/api/search.js +++ b/src/api/search.js @@ -14,3 +14,11 @@ export function getSearchList(data) { params: data }) } + +export function getSearchSuggest(data) { + return request({ + url: '/search/sugguest', + method: 'get', + params: data + }) +} diff --git a/src/permission.js b/src/permission.js index b6df2a0..f7cc3d0 100644 --- a/src/permission.js +++ b/src/permission.js @@ -4,7 +4,7 @@ import { Toast } from 'vant' import { getToken } from '@/utils/auth' // get token from cookie import { pathMatcher } from '@/utils/index' -const whiteList = ['/login', '/registry', '/', '/index', '/category', '/detail/**', '/diamondGoodsList/**'] // 白名单 +const whiteList = ['/login', '/registry', '/', '/index', '/category', '/detail/**', '/diamondGoodsList/**', '/search/**'] // 白名单 router.beforeEach(async(to, from, next) => { // 设置标题 diff --git a/src/views/home/index.vue b/src/views/home/index.vue index 6f4efb3..fbcdbd4 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -2,7 +2,7 @@
- + + + + diff --git a/src/views/search/index1.vue b/src/views/search/index1.vue new file mode 100644 index 0000000..1d40512 --- /dev/null +++ b/src/views/search/index1.vue @@ -0,0 +1,47 @@ + + + diff --git a/src/views/search/modules/NavBar.vue b/src/views/search/modules/NavBar.vue index 5085946..05ca929 100644 --- a/src/views/search/modules/NavBar.vue +++ b/src/views/search/modules/NavBar.vue @@ -13,9 +13,8 @@ show-action clearable autofocus - shape="round" @search="onSearch" - @cancel="$router.back()" + @cancel="onCancel" >