|
@@ -1,11 +1,11 @@
|
|
|
<template>
|
|
<template>
|
|
|
<view class="list">
|
|
<view class="list">
|
|
|
- <Blank v-if="list.length<0"></Blank>
|
|
|
|
|
|
|
+ <Blank v-if="list.length<=0"></Blank>
|
|
|
<view class="scroll-view" v-else>
|
|
<view class="scroll-view" v-else>
|
|
|
- <scroll-view class="scroll-list" scroll-y="true" style="height: 100%;" @scrolltolower="onReachScollBottom"
|
|
|
|
|
|
|
+ <scroll-view class="scroll-list" scroll-y="true" :style="listStyle" @scrolltolower="onReachScollBottom"
|
|
|
:scroll-top="scrollTop" @scroll="scroll">
|
|
:scroll-top="scrollTop" @scroll="scroll">
|
|
|
<slot name="listInfo" v-bind:pagingData="list"></slot>
|
|
<slot name="listInfo" v-bind:pagingData="list"></slot>
|
|
|
- <view class="toMore" v-show="isAjax">加载中-----</view>
|
|
|
|
|
|
|
+ <view class="toMore" v-show="isAjax">加载中...</view>
|
|
|
</scroll-view>
|
|
</scroll-view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
@@ -17,6 +17,15 @@ import Blank from 'components/en-utils/en-blank/en-blank'
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
components: {Blank},
|
|
components: {Blank},
|
|
|
|
|
+ props:{
|
|
|
|
|
+ 'height':{
|
|
|
|
|
+ default:''
|
|
|
|
|
+ },
|
|
|
|
|
+ 'isAll':{
|
|
|
|
|
+ type:Boolean,
|
|
|
|
|
+ default:false
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
list: [],
|
|
list: [],
|
|
@@ -24,12 +33,37 @@ export default {
|
|
|
page: 1,
|
|
page: 1,
|
|
|
total: null,
|
|
total: null,
|
|
|
isAjax: false,
|
|
isAjax: false,
|
|
|
|
|
+ listStyle:{
|
|
|
|
|
+ 'height':'calc(100vh - env(safe-area-inset-bottom))'
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ watch: {
|
|
|
|
|
+ 'height':function (){
|
|
|
|
|
+ this.setHeight()
|
|
|
|
|
+ },
|
|
|
|
|
+ 'isAll':function () {
|
|
|
|
|
+ this.setHeight()
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
mounted() {
|
|
mounted() {
|
|
|
this.getList()
|
|
this.getList()
|
|
|
|
|
+ this.setHeight()
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ setHeight(){
|
|
|
|
|
+ if(this.isAll){
|
|
|
|
|
+ this.listStyle.height='100vh'
|
|
|
|
|
+ }else {
|
|
|
|
|
+ if(this.height){
|
|
|
|
|
+ if(this.height>0){
|
|
|
|
|
+ this.listStyle.height='calc(100vh - env(safe-area-inset-bottom) - '+this.height+'rpx)'
|
|
|
|
|
+ }else if(this.height<0){
|
|
|
|
|
+ this.listStyle.height='calc(100vh - env(safe-area-inset-bottom) + '+(this.height*-1)+'rpx)'
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
scroll: function (e) {
|
|
scroll: function (e) {
|
|
|
this.scrollTop = e.detail.scrollTop
|
|
this.scrollTop = e.detail.scrollTop
|
|
|
},
|
|
},
|
|
@@ -55,7 +89,7 @@ export default {
|
|
|
})
|
|
})
|
|
|
this.total = total
|
|
this.total = total
|
|
|
this.isAjax = false
|
|
this.isAjax = false
|
|
|
- ++this.page;
|
|
|
|
|
|
|
+ ++this.page
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
},
|
|
},
|