Merge pull request 'xbx' (#173) from xbx into master

Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/173
This commit is contained in:
luyuan 2020-08-13 15:38:48 +08:00
commit 4413250c40
2 changed files with 33 additions and 13 deletions

View File

@ -7,7 +7,7 @@
</view>
<view class="evaluation" :class="{ 'current' : current == 2 }" @click="switchCurrent(2)">社区</view>
</view>
<scroll-view scroll-y class="goods-container" :style="{ height: scrollHeight }" @scrolltolower="loadMore" v-show="current == 0">
<scroll-view scroll-y class="goods-container" :style="{ height: scrollHeight }" @scrolltolower="loadMore" v-show="current == 0" :scroll-top="scrollTop" @scroll="scroll">
<view v-for="goods in goodsList" :key="goods.store_id" class="goods-item" @click="toDetailsPage(goods.store_id)">
<image :src="goods.store_avatar"></image>
<view class="right">
@ -18,7 +18,7 @@
<u-loadmore :status="loadStatus" bgColor="#FFFFFF" margin-top="20" margin-bottom="20" v-if="goodsList.length >= pageSize"></u-loadmore>
<u-empty mode="list" v-if="!goodsList.length"></u-empty>
</scroll-view>
<scroll-view style="width:100%;" :style="{ height: scrollHeight }" scroll-y="true" @scrolltolower="loadMore" v-if=" current == 2 ">
<scroll-view style="width:100%;" :style="{ height: scrollHeight }" scroll-y="true" @scrolltolower="loadMore" v-if=" current == 2 " :scroll-top="scrollTop" @scroll="scroll">
<view class="box" style="padding: 0 30rpx;">
<view style="display:flex">
<view>
@ -34,7 +34,7 @@
<u-loadmore :status="loadStatus" bgColor="#FFFFFF" margin-top="20" margin-bottom="20" v-if="goodsList.length >= pageSize"></u-loadmore>
<u-empty mode="list" v-if="!goodsList.length"></u-empty>
</scroll-view>
<scroll-view style="width:100%;padding: 20rpx 30rpx;margin-right:23rpx;" :style="{ height: scrollHeight }" scroll-y="true" @scrolltolower="loadMore" v-if=" current == 1 ">
<scroll-view style="width:100%;padding: 0rpx 30rpx;margin-right:23rpx;" :style="{ height: scrollHeight }" scroll-y="true" @scrolltolower="loadMore" v-if=" current == 1 " :scroll-top="scrollTop" @scroll="scroll">
<view class="list" >
<darenItem style="margin-top:20rpx;margin-right:23rpx;box-shadow:0px 3rpx 7rpx 0px rgba(153, 153, 153, 0.35);" v-for="item in goodsList" :key="item.id" :info="item" v-on:pChangeType="changeType"></darenItem>
</view>
@ -59,7 +59,11 @@ export default {
scrollHeight: '',
loadStatus: 'loadmore',
timer: true, // ,
value:""
value:"",
scrollTop: 0,
old: {
scrollTop: 0
}
}
},
components:{
@ -86,10 +90,14 @@ export default {
},
onNavigationBarSearchInputConfirmed(value) {
this.value = value.text
this.page = 1
// console.log(this.value)
this.ShopSearch()
},
methods: {
scroll: function(e) {
this.old.scrollTop = e.detail.scrollTop; //
},
//
setNavSearchInput(keyword) {
// #ifdef APP-PLUS
@ -212,7 +220,7 @@ export default {
},
setViewHeight() {
const res = uni.getSystemInfoSync();
this.scrollHeight = res.windowHeight - res.windowWidth / 750 * 90 + 'px';
this.scrollHeight = res.windowHeight - res.windowWidth / 750 * 92 + 'px';
},
toDetailsPage(id) {
this.$u.route('/pageC/merchant/index', {
@ -234,10 +242,11 @@ export default {
box-sizing: border-box;
padding: 30rpx 40rpx;
display: flex;
margin-bottom: 30rpx;
// margin-bottom: 30rpx;
height: 92rpx;
> view {
height: 30rpx;
line-height: 30rpx;
line-height: 1;
flex: 1;
font-size: 32rpx;
color: rgba(51,51,51,1);

View File

@ -11,7 +11,7 @@
</view>
<view class="evaluation" :class="{ 'current' : current == 2 }" @click="switchCurrent(2)">好评</view>
</view>
<scroll-view scroll-y class="goods-container" :style="{ height: scrollHeight }" @scrolltolower="loadMore" :scroll-top="top">
<scroll-view scroll-y class="goods-container" :style="{ height: scrollHeight }" @scrolltolower="loadMore" :scroll-top="scrollTop" @scroll="scroll">
<view v-for="goods in goodsList" :key="goods.goods_id" class="goods-item" @click="toDetailsPage(goods.goods_id)">
<image :src="goods.goods_image"></image>
<view class="right">
@ -39,7 +39,10 @@ export default {
loadStatus: 'loadmore',
timer: true, // ,
value:"",
top:0
scrollTop: 0,
old: {
scrollTop: 0
}
}
},
watch: {
@ -61,9 +64,13 @@ export default {
},
onNavigationBarSearchInputConfirmed(value) {
this.value = value.text
this.page = 1
this.ShopSearch()
},
methods: {
scroll: function(e) {
this.old.scrollTop = e.detail.scrollTop; //
},
setNavSearchInput(keyword) {
console.log(keyword);
// #ifdef APP-PLUS
@ -132,13 +139,16 @@ export default {
switchCurrent(current) {
this.page = 1
if(current == 1 && this.current == 1) this.priceOrderAsc = !this.priceOrderAsc;
this.top=0
this.scrollTop = this.old.scrollTop
this.$nextTick(function() {
this.scrollTop = 0
});
this.ShopSearch()
this.current = current;
},
setViewHeight() {
const res = uni.getSystemInfoSync();
this.scrollHeight = res.windowHeight - res.windowWidth / 750 * 90 + 'px';
this.scrollHeight = res.windowHeight - res.windowWidth / 750 * 92 + 'px';
},
toDetailsPage(id) {
this.$u.route('/pageB/sdetails/index', {
@ -154,10 +164,11 @@ export default {
box-sizing: border-box;
padding: 30rpx 40rpx;
display: flex;
margin-bottom: 30rpx;
// margin-bottom: 30rpx;
height: 92rpx;
> view {
height: 30rpx;
line-height: 30rpx;
line-height: 1;
flex: 1;
font-size: 32rpx;
color: rgba(51,51,51,1);