diff --git a/bundle_b/pages/local_shop_street/index.vue b/bundle_b/pages/local_shop_street/index.vue index 310d9f8..5d48303 100644 --- a/bundle_b/pages/local_shop_street/index.vue +++ b/bundle_b/pages/local_shop_street/index.vue @@ -10,46 +10,62 @@ + + + 距离 + + + + + + + + - + + :src="item.shopLogo"> - 东龙汇超市 - 0 件商品 + {{item.shopName}} + {{item.goods_count >= 1 ? item.goods_count + ' 件商品' : '暂无商品'}} - 距离1.1km + 距离{{item.distance}} - + - - - - - ¥ - 100 - + + + + + @@ -75,7 +91,10 @@ import { getStreetlList } from '@/api/local_store.js' - + import { + sortType, + } from '@/utils/type'; + export default { mixins: [MescrollMixin], data() { @@ -84,8 +103,7 @@ enable: true, navSwiperH: '', currentSwiper: 0, - active: 1, - distanceSort: 'asc', + active: 0, navList: [], downOption: { auto: false, @@ -103,11 +121,12 @@ } }, list: [], - width: '120rpx' + width: '120rpx', + keyword: '', + distanceSort: sortType.NONE, } }, onLoad(options) { - console.log(this.cityInfo) if (this.cityInfo && this.cityInfo.gcj02_lng) { this.mescroll.resetUpScroll() } @@ -116,6 +135,26 @@ ...mapActions(['initLocationFunc', 'getCartNum']), ...mapMutations(['setCityInfo']), + // 排序 + sortChange(i) { + const { + distanceSort + } = this + + this.active = parseInt(i) + switch (i) { + case 1: + if (distanceSort == sortType.DESC || distanceSort == sortType.NONE) { + this.distanceSort = sortType.ASC + } else if (distanceSort == sortType.ASC) { + this.distanceSort = sortType.DESC + } + break; + } + + this.mescroll.resetUpScroll() + }, + upCallback(page) { const pageNum = page.num; const pageSize = page.size; @@ -182,10 +221,32 @@ } .shop-name { - width: calc(100% - 140rpx); + width: calc(100% - 160rpx); } .row-end { justify-content: flex-end; } + + .filter { + display: flex; + align-items: center; + padding: 30rpx; + + .arrow-icon { + transform: scale(0.5); + } + + view { + margin-right: 20rpx; + } + + .mr-0 { + margin-right: 0; + } + + .active { + color: $-color-primary; + } + } \ No newline at end of file diff --git a/pages/local_life/local_life.vue b/pages/local_life/local_life.vue index 6079f5f..433a0dc 100644 --- a/pages/local_life/local_life.vue +++ b/pages/local_life/local_life.vue @@ -22,11 +22,11 @@ - + - + @@ -64,7 +64,7 @@ - + 距离 @@ -94,6 +94,9 @@ ¥ + @@ -109,9 +112,11 @@ {{item.title}} - ¥ - + @@ -158,7 +163,7 @@ }, upOption: { toTop: { - bottom: '300rpx' + bottom: '300rpx' }, auto: false, empty: { @@ -253,7 +258,7 @@ distanceSort, keyword } = this - + if (this.cityInfo && this.cityInfo.gcj02_lng) { getLocalList({ page_size: pageSize, @@ -284,14 +289,14 @@ this.$refs.uWaterfall.clear() this.mescroll.resetUpScroll() }, - + // 排序 sortChange(i) { const { moneySort, distanceSort } = this - + this.active = parseInt(i) switch (i) { case 1: @@ -303,7 +308,7 @@ this.distanceSort = sortType.NONE break; - case 2: + case 2: if (distanceSort == sortType.DESC || distanceSort == sortType.NONE) { this.distanceSort = sortType.ASC } else if (distanceSort == sortType.ASC) { @@ -312,7 +317,7 @@ this.moneySort = sortType.NONE break; } - + this.search() },