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> @click="handleSelectNav(index)">{{ item.name }}</text>
</scroll-view> </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 v-if="list" class="cate-right-cont">
<view class="cate-two-box"> <view class="cate-two-box">
<view class="cate-cont-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 class="cate-img-padding">
<view v-if="item.goods_image" class="cate-img"> <view v-if="item.goods_image" class="cate-img">
<image class="image" mode="scaleToFill" :src="item.goods_image"></image> <image class="image" mode="scaleToFill" :src="item.goods_image"></image>
@ -47,6 +47,7 @@
import Empty from '@/components/empty' import Empty from '@/components/empty'
import Search from '@/components/search' import Search from '@/components/search'
import Secondary from './components/secondary' import Secondary from './components/secondary'
import { rpx2px } from '@/utils/util'
// () // ()
@ -83,6 +84,10 @@
curIndex: 0, curIndex: 0,
// //
page:1, page:1,
//
scrollHeight: 0,
//
scrollTop: 0,
// //
menus, menus,
} }
@ -106,8 +111,18 @@
this.onRefreshPage() this.onRefreshPage()
} }
}, },
created() {
//
this.setListHeight()
},
methods: { methods: {
//
setListHeight() {
const { windowHeight } = uni.getSystemInfoSync()
this.scrollHeight = windowHeight - rpx2px(96)
},
// //
onRefreshPage() { onRefreshPage() {
// //
@ -147,6 +162,7 @@
this.scrollTop = 0 this.scrollTop = 0
// //
this.getCatList(this.curIndex)
}, },
// //
@ -157,12 +173,14 @@
// //
getCatList(type){ getCatList(type){
if(type>0){ this.$toast(type)
let rd={"record_type":type,"goods_status":1,"page":this.page,"limit":limit}
this.bindData(rd) // if(type>0){
}else{ // let rd={"record_type":type,"goods_status":1,"page":this.page,"limit":limit}
this.getAllGoods() // this.bindData(rd)
} // }else{
// this.getAllGoods()
// }
}, },
@ -224,6 +242,11 @@
margin-right: 22rpx; margin-right: 22rpx;
} }
.flex-two{
float: left;
width: 50%;
}
.cate-right { .cate-right {
display: flex; display: flex;
flex-direction: column; flex-direction: column;

Loading…
Cancel
Save