|
|
@@ -1,19 +1,30 @@
|
|
|
<template>
|
|
|
- <div class="productPage" :style="{ minHeight: ` calc(100vh - ${barHeight}px - 44px)` }">
|
|
|
- <scroll-view :scroll-top="scrollTop" :scroll-y="true" class="left-side" v-if="menus.length > 0">
|
|
|
+ <div class="productPage" :style="{ minHeight: ` calc( 100vh - ${fixedTop}px - ${barHeight}px + 44px )` }">
|
|
|
+ <scroll-view
|
|
|
+ :style="{ height: `calc( 100vh - ${fixedTop}px - ${barHeight}px + 44px )` }"
|
|
|
+ :scroll-y="scrollEnabled"
|
|
|
+ class="left-side"
|
|
|
+ v-if="menus.length > 0"
|
|
|
+ >
|
|
|
<van-sidebar :active-key="activeKey" @change="changeCustomCate">
|
|
|
<van-sidebar-item title="全部产品" />
|
|
|
<van-sidebar-item :title="getName(item)" :key="item.id" v-for="item in menus" />
|
|
|
</van-sidebar>
|
|
|
</scroll-view>
|
|
|
-
|
|
|
- <div class="right">
|
|
|
- <sort-list :empty="empty" :loading="loading" :finish="finish" top="0px">
|
|
|
- <div class="product-row-list">
|
|
|
- <product-row v-for="item in list" :key="item.id" :info="item"></product-row>
|
|
|
- </div>
|
|
|
- </sort-list>
|
|
|
- </div>
|
|
|
+ <scroll-view
|
|
|
+ :style="{ height: `calc( 100vh - ${fixedTop}px - ${barHeight}px + 44px )` }"
|
|
|
+ :scroll-y="scrollEnabled"
|
|
|
+ class="right-side"
|
|
|
+ @scrolltolower="getMore"
|
|
|
+ >
|
|
|
+ <div class="right">
|
|
|
+ <sort-list :empty="empty" :loading="loading" :finish="finish" :top="`${fixedTop}px`">
|
|
|
+ <div class="product-row-list">
|
|
|
+ <product-row v-for="(item, index) in list" :key="index" :info="item"></product-row>
|
|
|
+ </div>
|
|
|
+ </sort-list>
|
|
|
+ </div>
|
|
|
+ </scroll-view>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
@@ -27,7 +38,8 @@ export default {
|
|
|
return {
|
|
|
menus: [],
|
|
|
activeKey: 0,
|
|
|
- url: '/product/show'
|
|
|
+ url: '/product/show',
|
|
|
+ searchTop: -1
|
|
|
};
|
|
|
},
|
|
|
mixins: [searchList],
|
|
|
@@ -37,6 +49,14 @@ export default {
|
|
|
default: () => {
|
|
|
return {};
|
|
|
}
|
|
|
+ },
|
|
|
+ fixedTop: {
|
|
|
+ type: Number,
|
|
|
+ default: 0
|
|
|
+ },
|
|
|
+ scrollEnabled: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -75,6 +95,12 @@ export default {
|
|
|
changeCustomCate(e) {
|
|
|
this.activeKey = e.detail;
|
|
|
this.refreash();
|
|
|
+ },
|
|
|
+ getMore() {
|
|
|
+ if (!this.loading && !this.finish) {
|
|
|
+ this.page++;
|
|
|
+ this.getData();
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
|
@@ -96,6 +122,8 @@ export default {
|
|
|
--sidebar-selected-font-weight: bolder;
|
|
|
background: @bg;
|
|
|
flex-shrink: 0;
|
|
|
+ position: sticky;
|
|
|
+ top: 0px;
|
|
|
.van-sidebar-item {
|
|
|
width: 121px;
|
|
|
}
|