diff --git a/components/multi-level-nav/vertical-nav.vue b/components/multi-level-nav/vertical-nav.vue index 86d7bfe..c1bded9 100644 --- a/components/multi-level-nav/vertical-nav.vue +++ b/components/multi-level-nav/vertical-nav.vue @@ -49,6 +49,10 @@ containerHeight: { type: String, default: '100vh' + }, + isClick2ShowProducts: { + type: Boolean, + default: false } }, data() { diff --git a/main.js b/main.js index f66a7a0..402353b 100644 --- a/main.js +++ b/main.js @@ -1,27 +1,44 @@ // #ifndef VUE3 import Vue from 'vue'; import App from './App'; -import CuCustom from 'colorui/components/cu-custom.vue'; +import CuCustom from 'colorui/components/cu-custom.vue'; import ConfirmModal from '@/components/modal/confirm-modal.vue'; -import Data from './common/js/data.js'; -import globalFun from './common/js/glogalFun.js'; +import Data from './common/js/data.js'; +import globalFun from './common/js/glogalFun.js'; import validate from './common/js/validate.js'; -Vue.component('cu-custom', CuCustom) +Vue.component('cu-custom', CuCustom) Vue.component('confirm-modal', ConfirmModal); const data = type => { //模拟异步请求数据 return new Promise(resolve => { - setTimeout(() => { - resolve(Data[type]); - }, 0) + resolve(Data[type]); }) } Vue.prototype.$api = { data } -Vue.prototype.$globalFun = globalFun; -Vue.prototype.$validate = validate; +Vue.prototype.$globalFun = globalFun; +Vue.prototype.$validate = validate; + +// 异步接口拦截 +uni.addInterceptor('request', { + invoke(args) { + // request 触发前拼接 url + args.url = 'http://127.0.0.1:80' + args.url; + console.log("停止触发"); + return false; + }, + success(args) { + console.log('interceptor-success', args); + }, + fail(err) { + console.log('interceptor-fail', err) + }, + complete(res) { + console.log('interceptor-complete', res) + } +}) Vue.config.productionTip = false diff --git a/pages.json b/pages.json index 9c5a2b4..dc0d097 100644 --- a/pages.json +++ b/pages.json @@ -16,6 +16,10 @@ "path": "product-pick" }, { "path": "shop-detail" + }, { + "path": "product-category" + }, { + "path": "filtered-products" }] }, { "root": "pages/my/", diff --git a/pages/index/home.vue b/pages/index/home.vue index 2cb0a29..682bff5 100644 --- a/pages/index/home.vue +++ b/pages/index/home.vue @@ -24,7 +24,7 @@ - + 分类 @@ -133,6 +133,11 @@ uni.navigateTo({ url: '../product/product-detail' }); + }, + showProductCategories() { + uni.navigateTo({ + url: '/pages/product/product-category' + }) } } } diff --git a/pages/product/filtered-products.vue b/pages/product/filtered-products.vue new file mode 100644 index 0000000..584055a --- /dev/null +++ b/pages/product/filtered-products.vue @@ -0,0 +1,145 @@ + + + + + diff --git a/pages/product/product-category.vue b/pages/product/product-category.vue new file mode 100644 index 0000000..6e18a32 --- /dev/null +++ b/pages/product/product-category.vue @@ -0,0 +1,64 @@ + + + + +