Browse Source

修改点击分类时回不到顶部,标的详情里有空隙改小

master
liaoxinyu 2 years ago
parent
commit
4d3ba1d9ba
  1. 4
      config.js
  2. 25
      pages/category/index.vue
  3. 6
      pages/goods/detail.scss
  4. 3
      pages/goods/detail.vue

4
config.js

@ -12,8 +12,8 @@ module.exports = {
// product env
// apiUrl: "http://10.24.4.14:80/",
// apiUrl: "http://10.24.4.156/",
apiUrl: "./kk/",
// apiUrl: "http://192.168.66.219:8081/kk/",
// apiUrl: "./kk/",
apiUrl: "http://192.168.66.219:8081/kk/",
/**
* 是否启用商城设置缓存

25
pages/category/index.vue

@ -18,7 +18,7 @@
</scroll-view>
<!-- 右侧 二级分类 -->
<mescroll-body ref="mescrollRef" :sticky="true" @init="mescrollInit" :down="{ native: true }" @down="downCallback" :up="upOption" @up="upCallback">
<scroll-view v-if="list.length>0 && type==0" class="cate-right" :scroll-top="scrollTop" :scroll-y="true" :style="{ height: `${scrollHeight}px` }">
<scroll-view v-if="list.length>0 && type==0" @scroll="scroll" class="cate-right" :scroll-top="scrollTop" :scroll-y="true" :style="{ height: `${scrollHeight}px` }">
<!-- 有数据的时候 -->
<view class="cate-right-cont">
<view class="cate-two-box">
@ -35,7 +35,7 @@
</view>
</view>
</scroll-view>
<scroll-view v-else-if="userList.length>0 && type==1" class="cate-right" :scroll-top="scrollTop" :scroll-y="true" :style="{ height: `${scrollHeight}px` }">
<scroll-view v-else-if="userList.length>0 && type==1" @scroll="scroll" class="cate-right" :scroll-top="scrollTop" :scroll-y="true" :style="{ height: `${scrollHeight}px` }">
<view class="cate-right-cont">
<view class="cate-two-box">
<view class="cate-cont-box">
@ -56,7 +56,7 @@
</view>
</view>
</scroll-view>
<scroll-view v-else-if="informationList.length>0 && type==2" class="cate-right" :scroll-top="scrollTop" :scroll-y="true" :style="{ height: `${scrollHeight}px` }">
<scroll-view v-else-if="informationList.length>0 && type==2" @scroll="scroll" class="cate-right" :scroll-top="scrollTop" :scroll-y="true" :style="{ height: `${scrollHeight}px` }">
<view class="cate-right-cont">
<view class="cate-two-box">
<view class="cate-cont-box">
@ -70,7 +70,7 @@
</view>
</view>
</scroll-view>
<scroll-view v-else-if="serviceProvidersList.length>0 && type==3" class="cate-right" :scroll-top="scrollTop" :scroll-y="true" :style="{ height: `${scrollHeight}px` }">
<scroll-view v-else-if="serviceProvidersList.length>0 && type==3" @scroll="scroll" class="cate-right" :scroll-top="scrollTop" :scroll-y="true" :style="{ height: `${scrollHeight}px` }">
<view class="cate-right-cont">
<view class="cate-two-box">
<view class="cate-cont-box">
@ -86,7 +86,7 @@
</view>
</view>
</scroll-view>
<scroll-view v-else-if="transactionList.length>0 && type==4" class="cate-right" :scroll-top="scrollTop" :scroll-y="true" :style="{ height: `${scrollHeight}px` }">
<scroll-view v-else-if="transactionList.length>0 && type==4" @scroll="scroll" class="cate-right" :scroll-top="scrollTop" :scroll-y="true" :style="{ height: `${scrollHeight}px` }">
<view class="cate-right-cont">
<view class="cate-two-box">
<view class="cate-cont-box">
@ -194,6 +194,9 @@
tip: '暂无记录'
}
},
old: {
scrollTop: 0
}
}
},
@ -221,6 +224,10 @@
this.setListHeight()
},
methods: {
scroll: function(e) {
// console.log(e)
this.old.scrollTop = e.detail.scrollTop
},
//
setListHeight() {
const { windowHeight } = uni.getSystemInfoSync()
@ -280,8 +287,14 @@
//
handleSelectNav(index) {
this.curIndex = index
this.scrollTop = 0
// this.scrollTop = 0
//
this.scrollTop = this.old.scrollTop
this.$nextTick(function() {
this.scrollTop = 0
});
this.upCallback(1)
},
//
getCatList(pageNo = 1){

6
pages/goods/detail.scss

@ -172,6 +172,12 @@
.item-content-long{
margin-bottom: 90rpx;
}
.last-content-long{
margin-bottom: 50rpx;
}
.last-item{
margin-bottom: 90rpx;
}
}
// 店铺详情

3
pages/goods/detail.vue

@ -116,7 +116,8 @@
</view>
</view>
<!-- 资源信息 -->
<view class="item-content b-f" v-else-if="tabKey === 3" v-for="(item,index) in goods.source" :class="shopyear_show || talprice_show ? 'item-content-long' : '' ">
<view class="item-content b-f" v-else-if="tabKey === 3" v-for="(item,index) in goods.source"
:class="[shopyear_show || talprice_show ? 'last-content-long' : '', index === goods.source.length - 1 ? 'last-item' : '']">
<view class="gdic">
<text class="gdic-tit">资源类型</text>
<text class="gdic-txt">{{item.source_type}}</text>

Loading…
Cancel
Save