|
|
|
@ -12,12 +12,12 @@ |
|
|
|
@click="handleSelectNav(index)">{{ item.name }}</text> |
|
|
|
</scroll-view> |
|
|
|
<!-- 右侧 二级分类 --> |
|
|
|
<scroll-view class="cate-right" scroll-top="true" scroll-y="true" > |
|
|
|
<scroll-view class="cate-right" :scroll-top="scrollTop" :scroll-y="true" :style="{ height: `${scrollHeight}px` }"> |
|
|
|
|
|
|
|
<view v-if="list" class="cate-right-cont"> |
|
|
|
<view class="cate-two-box"> |
|
|
|
<view class="cate-cont-box"> |
|
|
|
<view class="flex-three" v-for="(item, idx) in list" :key="idx" @click="onTargetGoodsList(item.category_id)"> |
|
|
|
<view class="flex-two" v-for="(item, idx) in list" :key="idx" @click="onTargetGoods(item)"> |
|
|
|
<view class="cate-img-padding"> |
|
|
|
<view v-if="item.goods_image" class="cate-img"> |
|
|
|
<image class="image" mode="scaleToFill" :src="item.goods_image"></image> |
|
|
|
@ -47,6 +47,7 @@ |
|
|
|
import Empty from '@/components/empty' |
|
|
|
import Search from '@/components/search' |
|
|
|
import Secondary from './components/secondary' |
|
|
|
import { rpx2px } from '@/utils/util' |
|
|
|
|
|
|
|
|
|
|
|
// 左侧菜单(固定) |
|
|
|
@ -83,6 +84,10 @@ |
|
|
|
curIndex: 0, |
|
|
|
//默认显示第一页 |
|
|
|
page:1, |
|
|
|
// 列表高度 |
|
|
|
scrollHeight: 0, |
|
|
|
// 内容区竖向滚动条位置 |
|
|
|
scrollTop: 0, |
|
|
|
// 菜单 |
|
|
|
menus, |
|
|
|
} |
|
|
|
@ -106,8 +111,18 @@ |
|
|
|
this.onRefreshPage() |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
|
// 设置分类列表高度 |
|
|
|
this.setListHeight() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
|
|
|
|
// 设置列表内容的高度 |
|
|
|
setListHeight() { |
|
|
|
const { windowHeight } = uni.getSystemInfoSync() |
|
|
|
this.scrollHeight = windowHeight - rpx2px(96) |
|
|
|
}, |
|
|
|
|
|
|
|
// 刷新页面 |
|
|
|
onRefreshPage() { |
|
|
|
// 记录刷新时间 |
|
|
|
@ -147,6 +162,7 @@ |
|
|
|
this.scrollTop = 0 |
|
|
|
|
|
|
|
// 加载对应的数据 |
|
|
|
this.getCatList(this.curIndex) |
|
|
|
}, |
|
|
|
|
|
|
|
// 展示所有的数据 |
|
|
|
@ -157,12 +173,14 @@ |
|
|
|
|
|
|
|
// 查询分类 获取列表 |
|
|
|
getCatList(type){ |
|
|
|
if(type>0){ |
|
|
|
let rd={"record_type":type,"goods_status":1,"page":this.page,"limit":limit} |
|
|
|
this.bindData(rd) |
|
|
|
}else{ |
|
|
|
this.getAllGoods() |
|
|
|
} |
|
|
|
this.$toast(type) |
|
|
|
|
|
|
|
// if(type>0){ |
|
|
|
// let rd={"record_type":type,"goods_status":1,"page":this.page,"limit":limit} |
|
|
|
// this.bindData(rd) |
|
|
|
// }else{ |
|
|
|
// this.getAllGoods() |
|
|
|
// } |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
@ -224,6 +242,11 @@ |
|
|
|
margin-right: 22rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.flex-two{ |
|
|
|
float: left; |
|
|
|
width: 50%; |
|
|
|
} |
|
|
|
|
|
|
|
.cate-right { |
|
|
|
display: flex; |
|
|
|
flex-direction: column; |
|
|
|
|