Browse Source

更新页面

master
453530270@qq.com 2 years ago
parent
commit
6333d009a8
  1. 39
      pages/category/index.vue

39
pages/category/index.vue

@ -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;

Loading…
Cancel
Save