From 4ed223d30881b4d1f566cfa465c8f0390012f57d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E5=B9=B3=E8=89=BA?= <52643018@qq.com> Date: Thu, 2 Sep 2021 14:46:10 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=AE=8C=E6=88=90=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/styles/theme.css | 4 +- components/index-banner/index-banner.vue | 14 +- components/index-nav/index-nav.less | 8 +- components/index-nav/index-nav.vue | 113 ++++- components/lf-indexFind/lf-indexFind.vue | 77 +++ .../lf-indexShopMatrix/lf-indexShopMatrix.vue | 82 ++++ .../lf-shopGoodsCard/lf-shopGoodsCard.vue | 94 ++++ components/lf-tabbar/lf-tabbar-box.vue | 2 +- components/lf-tabbar/lf-tabbar.vue | 14 + pages.json | 9 +- pages/index/category/category.vue | 445 ++++++++++++++++++ pages/index/category/testdata.js | 225 +++++++++ .../classification - 副本.vue | 181 +++++++ pages/index/classification/classification.vue | 129 ++--- pages/index/index/index.vue | 98 +++- store/index.js | 2 +- 16 files changed, 1392 insertions(+), 105 deletions(-) create mode 100644 components/lf-indexFind/lf-indexFind.vue create mode 100644 components/lf-indexShopMatrix/lf-indexShopMatrix.vue create mode 100644 components/lf-shopGoodsCard/lf-shopGoodsCard.vue create mode 100644 pages/index/category/category.vue create mode 100644 pages/index/category/testdata.js create mode 100644 pages/index/classification/classification - 副本.vue diff --git a/common/styles/theme.css b/common/styles/theme.css index cd95db8..bfd1b09 100644 --- a/common/styles/theme.css +++ b/common/styles/theme.css @@ -61,11 +61,11 @@ radio:not([disabled]) .wx-radio-input:hover checkbox:not([disabled]) .wx-checkbo /* #endif */ .lf-color-primary { - color: #1998FE !important; + color: #186c6b !important; } .lf-bg-primary { - background: #1998FE !important; + background: #186c6b !important; } .lf-color-secondary { diff --git a/components/index-banner/index-banner.vue b/components/index-banner/index-banner.vue index 94ef4aa..301d41f 100644 --- a/components/index-banner/index-banner.vue +++ b/components/index-banner/index-banner.vue @@ -25,6 +25,7 @@ indicator-dots="true" autoplay="true" circular="true" + indicator-active-color="#186c6b" > @@ -40,7 +41,7 @@ export default { // 对应data data() { return { - imgHeight: '' + imgHeight: '450' }; }, options: { @@ -74,6 +75,7 @@ export default { methods: { //内部方法建议以下划线开头 _imgLoad(e) { + return; // PS 不执行自动高 var height = e.detail.height; var width = e.detail.width; var ratio = width / height; @@ -102,9 +104,9 @@ export default { - \ No newline at end of file diff --git a/components/lf-indexFind/lf-indexFind.vue b/components/lf-indexFind/lf-indexFind.vue new file mode 100644 index 0000000..96ce7ca --- /dev/null +++ b/components/lf-indexFind/lf-indexFind.vue @@ -0,0 +1,77 @@ + + + + + diff --git a/components/lf-indexShopMatrix/lf-indexShopMatrix.vue b/components/lf-indexShopMatrix/lf-indexShopMatrix.vue new file mode 100644 index 0000000..bc72b59 --- /dev/null +++ b/components/lf-indexShopMatrix/lf-indexShopMatrix.vue @@ -0,0 +1,82 @@ + + + + + diff --git a/components/lf-shopGoodsCard/lf-shopGoodsCard.vue b/components/lf-shopGoodsCard/lf-shopGoodsCard.vue new file mode 100644 index 0000000..0ac1163 --- /dev/null +++ b/components/lf-shopGoodsCard/lf-shopGoodsCard.vue @@ -0,0 +1,94 @@ + + + + + diff --git a/components/lf-tabbar/lf-tabbar-box.vue b/components/lf-tabbar/lf-tabbar-box.vue index bb3cc09..90f88b3 100644 --- a/components/lf-tabbar/lf-tabbar-box.vue +++ b/components/lf-tabbar/lf-tabbar-box.vue @@ -90,7 +90,7 @@ export default { }, activeColor: { type: String, - default: '#409EFF' + default: '#186c6b' }, inactiveTextColor: String, activeTextColor: String, diff --git a/components/lf-tabbar/lf-tabbar.vue b/components/lf-tabbar/lf-tabbar.vue index 7508ca9..6f65a60 100644 --- a/components/lf-tabbar/lf-tabbar.vue +++ b/components/lf-tabbar/lf-tabbar.vue @@ -40,6 +40,20 @@ computed: { ...mapGetters(['currentTabBar', 'tabbars', 'isShowTabBar']) }, + created(){ + // 组件被创建时检查当前在哪个页面,然后校验currentTabBar是否与之匹配 + let pages = getCurrentPages(); + let page = pages[pages.length - 1].route; + let tabbar_name = ''; + this.tabbars.map(item => { + if(item.path == '/'+ page){ + tabbar_name = item.name; + } + }) + if(tabbar_name != this.currentTabBar){ + this.$store.commit('setCurrentTabBar', tabbar_name); + } + }, methods: { handleClick (options) { this.$store.commit('setCurrentTabBar', options.name); diff --git a/pages.json b/pages.json index f4c3e7e..710ea86 100644 --- a/pages.json +++ b/pages.json @@ -664,6 +664,13 @@ "navigationBarTitleText": "欢迎使用", "navigationStyle": "custom" } + }, + { + "path" : "pages/index/category/category", + "style" : { + "navigationBarTitleText": "分类", + "navigationStyle": "custom" + } } ], "globalStyle": { @@ -716,7 +723,7 @@ }, { "name": "测试", - "path": "pages/index/openScreenAd/openScreenAd", + "path": "pages/index/classification/classification", "query": "" } diff --git a/pages/index/category/category.vue b/pages/index/category/category.vue new file mode 100644 index 0000000..c6ea0e2 --- /dev/null +++ b/pages/index/category/category.vue @@ -0,0 +1,445 @@ + + + + + diff --git a/pages/index/category/testdata.js b/pages/index/category/testdata.js new file mode 100644 index 0000000..a46f780 --- /dev/null +++ b/pages/index/category/testdata.js @@ -0,0 +1,225 @@ +export default [{ + name: '面部护肤', + subArr: [{ + img: 'https://picsum.photos/200', + name: '名称' + }, + { + img: 'https://picsum.photos/200', + name: '名称' + }, + { + img: 'https://picsum.photos/200', + name: '名称' + }, + { + img: 'https://picsum.photos/200', + name: '名称' + }, + { + img: 'https://picsum.photos/200', + name: '名称' + } + ] + }, + { + name: '香水彩妆', + subArr: [{ + img: 'https://picsum.photos/200', + name: '名称' + }, + { + img: 'https://picsum.photos/200', + name: '名称' + } + ] + }, + { + name: '精致洗护', + subArr: [{ + img: 'https://picsum.photos/200', + name: '名称2' + }, + { + img: 'https://picsum.photos/200', + name: '名称2' + } + ] + }, + { + name: '国际精品', + subArr: [{ + img: 'https://picsum.photos/200', + name: '水果2' + }, + { + img: 'https://picsum.photos/200', + name: '水果2' + }, + { + img: 'https://picsum.photos/200', + name: '水果2' + }, + { + img: 'https://picsum.photos/200', + name: '水果2' + }, + { + img: 'https://picsum.photos/200', + name: '水果2' + }, + { + img: 'https://picsum.photos/200', + name: '水果2' + }, + { + img: 'https://picsum.photos/200', + name: '水果2' + }, + { + img: 'https://picsum.photos/200', + name: '水果2' + }, + { + img: 'https://picsum.photos/200', + name: '水果2' + }, + { + img: 'https://picsum.photos/200', + name: '水果2' + }, + { + img: 'https://picsum.photos/200', + name: '水果2' + }, + { + img: 'https://picsum.photos/200', + name: '水果2' + }, + { + img: 'https://picsum.photos/200', + name: '水果2' + } + ] + }, + { + name: '服装内衣', + subArr: [{ + img: 'https://picsum.photos/200', + name: '悲剧2' + }, + { + img: 'https://picsum.photos/200', + name: '悲剧2' + } + ] + }, + { + name: '首饰配饰', + subArr: [{ + img: 'https://picsum.photos/200', + name: '名称' + }, + { + img: 'https://picsum.photos/200', + name: '名称' + }, + { + img: 'https://picsum.photos/200', + name: '名称' + }, + { + img: 'https://picsum.photos/200', + name: '名称' + }, + { + img: 'https://picsum.photos/200', + name: '名称' + }, + { + img: 'https://picsum.photos/200', + name: '名称' + }, + { + img: 'https://picsum.photos/200', + name: '名称' + }, + { + img: 'https://picsum.photos/200', + name: '名称' + }, + { + img: 'https://picsum.photos/200', + name: '名称' + }, + { + img: 'https://picsum.photos/200', + name: '名称' + }, + { + img: 'https://picsum.photos/200', + name: '名称' + }, + { + img: 'https://picsum.photos/200', + name: '名称' + }, + { + img: 'https://picsum.photos/200', + name: '名称' + }, + { + img: 'https://picsum.photos/200', + name: '名称' + } + ] + }, + { + name: '服装内衣', + subArr: [{ + img: 'https://picsum.photos/200', + name: '悲剧2' + }, + { + img: 'https://picsum.photos/200', + name: '悲剧2' + } + ] + }, + { + name: '服装内衣', + subArr: [{ + img: 'https://picsum.photos/200', + name: '悲剧2' + }, + { + img: 'https://picsum.photos/200', + name: '悲剧2' + } + ] + }, + { + name: '滴滴滴等', + subArr: [{ + img: 'https://picsum.photos/200', + name: '悲剧2' + }, + { + img: 'https://picsum.photos/200', + name: '悲剧2' + } + ] + }, + { + name: '好好说说', + subArr: [{ + img: 'https://picsum.photos/200', + name: '悲剧2' + }, + { + img: 'https://picsum.photos/200', + name: '悲剧2' + } + ] + } +] diff --git a/pages/index/classification/classification - 副本.vue b/pages/index/classification/classification - 副本.vue new file mode 100644 index 0000000..1b503bf --- /dev/null +++ b/pages/index/classification/classification - 副本.vue @@ -0,0 +1,181 @@ + + + diff --git a/pages/index/classification/classification.vue b/pages/index/classification/classification.vue index 1b503bf..a2dc82a 100644 --- a/pages/index/classification/classification.vue +++ b/pages/index/classification/classification.vue @@ -1,80 +1,9 @@