diff --git a/src/components/CommodityCard/CommodityCard.vue b/src/components/CommodityCard/CommodityCard.vue index 4ee7115..8143d6f 100644 --- a/src/components/CommodityCard/CommodityCard.vue +++ b/src/components/CommodityCard/CommodityCard.vue @@ -77,7 +77,7 @@ image { } .name { width: 92%; - height: 54rpx; + height: 56rpx; padding: 5px 4%; display: -webkit-box; -webkit-box-orient: vertical; diff --git a/src/components/HMFilterDropdown/HMFilterDropdown.vue b/src/components/HMFilterDropdown/HMFilterDropdown.vue index d01799e..69d04ac 100644 --- a/src/components/HMFilterDropdown/HMFilterDropdown.vue +++ b/src/components/HMFilterDropdown/HMFilterDropdown.vue @@ -12,7 +12,7 @@ {{item.name}} @@ -372,14 +372,14 @@ export default { this.$forceUpdate() }, // 菜单开关 - togglePage (index) { + togglePage (index, isRequest = true) { if (index === this.showPage) { - this.hidePageLayer(true) + this.hidePageLayer(true, isRequest) this.hideMask() this.showPage = -1 } else { if (this.showPage > -1) { - this.hidePageLayer(false) + this.hidePageLayer(false, isRequest) } this.showPageLayer(index) this.showMask() @@ -416,14 +416,17 @@ export default { }) }, // hide菜单页 - hidePageLayer (isAnimation) { + hidePageLayer (isAnimation,isRequset = true) { this.triangleDeg[this.showPage] = 0 const tmpIndex = this.showPage if (isAnimation) { setTimeout(() => { this.pageState.splice(tmpIndex, 1, false) - }, 200) - this.confirm() + }, 200) + // debugger + if(isRequset){ + this.confirm() + } } else { this.pageState.splice(tmpIndex, 1, false) } @@ -812,20 +815,21 @@ export default { } .labels { flex-direction: row; - flex-wrap: wrap; + flex-wrap: wrap; + justify-content: space-between; .on { border-color: #ff6b4a; background-color: #ff6b4a; color: #fff; } > view { - width: 148rpx; + width: 220rpx; height: 30px; border: solid 1rpx #adadad; border-radius: 2px; - margin-right: 15px; + margin-right: 2px; margin-top: 8px; - padding: 0 16rpx; + padding: 0 10rpx; box-sizing: border-box; font-size: 12px; flex-direction: row; diff --git a/src/components/sl-filter/filter-view.vue b/src/components/sl-filter/filter-view.vue new file mode 100644 index 0000000..e8e49a5 --- /dev/null +++ b/src/components/sl-filter/filter-view.vue @@ -0,0 +1,475 @@ + + + + + diff --git a/src/components/sl-filter/iconfont/iconfont.css b/src/components/sl-filter/iconfont/iconfont.css new file mode 100644 index 0000000..56b06be --- /dev/null +++ b/src/components/sl-filter/iconfont/iconfont.css @@ -0,0 +1,20 @@ +@font-face { + font-family: 'sl-font'; + src: url('data:font/truetype;charset=utf-8;base64,AAEAAAALAIAAAwAwR1NVQrD+s+0AAAE4AAAAQk9TLzI8kEgOAAABfAAAAFZjbWFwZO3RAgAAAeAAAAGGZ2x5Zh0ZI/EAAANwAAAAyGhlYWQVZkUXAAAA4AAAADZoaGVhB94DhAAAALwAAAAkaG10eAwAAAAAAAHUAAAADGxvY2EAMgBkAAADaAAAAAhtYXhwAREAKAAAARgAAAAgbmFtZT5U/n0AAAQ4AAACbXBvc3TohGjqAAAGqAAAADMAAQAAA4D/gABcBAAAAAAABAAAAQAAAAAAAAAAAAAAAAAAAAMAAQAAAAEAANxW6kVfDzz1AAsEAAAAAADZJADbAAAAANkkANsAAAAABAACZAAAAAgAAgAAAAAAAAABAAAAAwAcAAQAAAAAAAIAAAAKAAoAAAD/AAAAAAAAAAEAAAAKAB4ALAABREZMVAAIAAQAAAAAAAAAAQAAAAFsaWdhAAgAAAABAAAAAQAEAAQAAAABAAgAAQAGAAAAAQAAAAAAAQQAAZAABQAIAokCzAAAAI8CiQLMAAAB6wAyAQgAAAIABQMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUGZFZABA5hrmHAOA/4AAXAOAAIAAAAABAAAAAAAABAAAAAQAAAAEAAAAAAAABQAAAAMAAAAsAAAABAAAAV4AAQAAAAAAWAADAAEAAAAsAAMACgAAAV4ABAAsAAAABgAEAAEAAuYa5hz//wAA5hrmHP//AAAAAAABAAYABgAAAAEAAgAAAQYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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ovL2ZvbnRlbGxvLmNvbQAKAEMAcgBlAGEAdABlAGQAIABiAHkAIABpAGMAbwBuAGYAbwBuAHQACgBpAGMAbwBuAGYAbwBuAHQAUgBlAGcAdQBsAGEAcgBpAGMAbwBuAGYAbwBuAHQAaQBjAG8AbgBmAG8AbgB0AFYAZQByAHMAaQBvAG4AIAAxAC4AMABpAGMAbwBuAGYAbwBuAHQARwBlAG4AZQByAGEAdABlAGQAIABiAHkAIABzAHYAZwAyAHQAdABmACAAZgByAG8AbQAgAEYAbwBuAHQAZQBsAGwAbwAgAHAAcgBvAGoAZQBjAHQALgBoAHQAdABwADoALwAvAGYAbwBuAHQAZQBsAGwAbwAuAGMAbwBtAAAAAAIAAAAAAAAACgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwECAQMBBAAEZG93bgJ1cAAAAA==') format('truetype'); +} + +.sl-font { + font-family: "sl-font" !important; + font-size: 16px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.sl-down:before { + content: "\e61a"; +} + +.sl-up:before { + content: "\e61c"; +} diff --git a/src/components/sl-filter/popup-layer.vue b/src/components/sl-filter/popup-layer.vue new file mode 100755 index 0000000..7f8e3cf --- /dev/null +++ b/src/components/sl-filter/popup-layer.vue @@ -0,0 +1,122 @@ + + + + + diff --git a/src/components/sl-filter/sl-filter.vue b/src/components/sl-filter/sl-filter.vue new file mode 100644 index 0000000..8ab8239 --- /dev/null +++ b/src/components/sl-filter/sl-filter.vue @@ -0,0 +1,317 @@ + + + + + diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index ba6aad8..d2cd58e 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -106,8 +106,8 @@ - {{loadedText}} - + {{loadingText}} + {{loadedText}} @@ -140,7 +140,7 @@ export default { valueArr: "", isLoading: true, //初始化加载状态 loadingText: "data loading...", - loadedText: "~~到底啦~~", + loadedText: "~~暂无更多数据~~", filterDropdownValue: [], filterData: [], searchText: "", @@ -158,7 +158,12 @@ export default { goodsList() { // 也可以从 getters 获取 // console.log('index-list=====>',this.$store.state.index.list) - return this.$store.state.index.list; + let list = this.$store.state.index.list; + if(list.length == 0){ + this.isLoading = false; + } + this.scrollTop = 0.1; + return list }, categoryList() { return this.$store.state.index.categoryList; @@ -260,7 +265,6 @@ export default { flex-direction: column; align-items: center; justify-content: center; - background-color: #f7f6f6; } .header { display: flex; diff --git a/src/store/modules/index.js b/src/store/modules/index.js index d16ecb5..cf272d4 100644 --- a/src/store/modules/index.js +++ b/src/store/modules/index.js @@ -16,6 +16,350 @@ initArr.forEach(function (value) { list.push(initData) }); +let categoryList = [ + { + "type": "checkbox", + "name": "产品", + "value": "category", + "submenu": [ + { + "label": "镜框", + "name": "镜框", + "value": "1" + }, + { + "label": "镜片", + "name": "镜片", + "value": "2" + }, + { + "label": "特种镜", + "name": "特种镜", + "value": "146" + } + ], + "groups": [ + "001" + ] + }, + { + "type": "radio", + "name": "规则", + "value": "px", + "submenu": [ + { + "name": "按价格排", + "value": "1" + }, + { + "name": "按销量排", + "value": "2" + } + ], + "groups": [ + "002" + ] + }, + { + "type": "radio", + "name": "排序", + "value": "sort", + "submenu": [ + { + "name": "从高到低", + "value": "1" + }, + { + "name": "从低到高", + "value": "2" + } + ], + "groups": [ + "003" + ] + }, + { + "type": "filter", + "name": "筛选", + "value": "filter", + "submenu": [ + { + "type": "checkbox", + "name": "性别", + "value": "sex", + "submenu": [ + { + "label": "男性", + "name": "男性", + "value": "27" + }, + { + "label": "女性", + "name": "女性", + "value": "28" + } + ] + }, + { + "type": "checkbox", + "name": "年龄", + "value": "age", + "submenu": [ + { + "label": "通用", + "name": "通用", + "value": "24" + } + ] + }, + { + "type": "checkbox", + "name": "适用场景", + "value": "sense", + "submenu": [ + { + "label": "行政风", + "name": "行政风", + "value": "53" + }, + { + "label": "青春学子风", + "name": "青春学子风", + "value": "54" + }, + { + "label": "运动风", + "name": "运动风", + "value": "55" + }, + { + "label": "简约-极简文艺范", + "name": "简约-极简文艺范", + "value": "56" + }, + { + "label": "奶奶风", + "name": "奶奶风", + "value": "57" + }, + { + "label": "流线洛可可", + "name": "流线洛可可", + "value": "58" + }, + { + "label": "自然舒视角", + "name": "自然舒视角", + "value": "59" + }, + { + "label": "无界人文系", + "name": "无界人文系", + "value": "60" + }, + { + "label": "有机未来时", + "name": "有机未来时", + "value": "61" + }, + { + "label": "立体巴洛克", + "name": "立体巴洛克", + "value": "62" + }, + { + "label": "多元新风尚", + "name": "多元新风尚", + "value": "63" + }, + { + "label": "理性几何派", + "name": "理性几何派", + "value": "64" + }, + { + "label": "轻简北欧风", + "name": "轻简北欧风", + "value": "65" + }, + { + "label": "质感哥特潮", + "name": "质感哥特潮", + "value": "66" + }, + { + "label": "时尚", + "name": "时尚", + "value": "67" + }, + { + "label": "复古", + "name": "复古", + "value": "68" + }, + { + "label": "商务", + "name": "商务", + "value": "69" + }, + { + "label": "休闲", + "name": "休闲", + "value": "70" + }, + { + "label": "折射率", + "name": "折射率", + "value": "285" + } + ] + }, + { + "type": "checkbox", + "name": "价格", + "value": "price", + "submenu": [ + { + "name": "100以下", + "value": "1,100" + }, + { + "name": "100-300", + "value": "100,300" + }, + { + "name": "300-1000", + "value": "300,1000" + }, + { + "name": "1000以上", + "value": "1000,-1" + } + ] + }, + { + "type": "checkbox", + "name": "材质", + "value": "glasscate", + "submenu": [ + { + "label": "购易", + "name": "购易", + "value": "72" + }, + { + "label": "海俪恩", + "name": "海俪恩", + "value": "73" + }, + { + "label": "沙漠风暴", + "name": "沙漠风暴", + "value": "74" + }, + { + "label": "古诗", + "name": "古诗", + "value": "75" + }, + { + "label": "暴龙", + "name": "暴龙", + "value": "76" + }, + { + "label": "犀牛", + "name": "犀牛", + "value": "77" + }, + { + "label": "Ray-Ban雷朋", + "name": "Ray-Ban雷朋", + "value": "78" + }, + { + "label": "PARIM派丽蒙", + "name": "PARIM派丽蒙", + "value": "79" + }, + { + "label": "石狼", + "name": "石狼", + "value": "80" + }, + { + "label": "木九十", + "name": "木九十", + "value": "81" + } + ] + }, + { + "type": "checkbox", + "name": "品牌", + "value": "brand", + "submenu": [ + { + "label": "购易", + "name": "购易", + "value": "72" + }, + { + "label": "海俪恩", + "name": "海俪恩", + "value": "73" + }, + { + "label": "沙漠风暴", + "name": "沙漠风暴", + "value": "74" + }, + { + "label": "古诗", + "name": "古诗", + "value": "75" + }, + { + "label": "暴龙", + "name": "暴龙", + "value": "76" + }, + { + "label": "犀牛", + "name": "犀牛", + "value": "77" + }, + { + "label": "Ray-Ban雷朋", + "name": "Ray-Ban雷朋", + "value": "78" + }, + { + "label": "PARIM派丽蒙", + "name": "PARIM派丽蒙", + "value": "79" + }, + { + "label": "石狼", + "name": "石狼", + "value": "80" + }, + { + "label": "木九十", + "name": "木九十", + "value": "81" + } + ] + } + ], + "groups": [ + "001", + "002", + "003" + ], + } + ] + //初始化数据是为了显示默认骨架 const state = { categoryList: [], @@ -52,7 +396,6 @@ initArr.forEach(function (value) { }); commit('CATEGORY', data); resolve(data) - console.log('3333') }, fail: (res) => { console.log("fail status === > ", res); @@ -67,8 +410,7 @@ initArr.forEach(function (value) { url: shopList, success: (res) => { commit('LIST', res.data.data) - resolve(res.data) - console.log('3333') + resolve(res.data) }, fail: (res) => { console.log("fail status === > ", res);