|
@@ -56,7 +56,7 @@
|
|
</view>
|
|
</view>
|
|
|
|
|
|
</view>
|
|
</view>
|
|
- <u-divider color="#B6BDC3" v-if="list.length ==recordsTotal" style="margin-top:20px;">已经到底了</u-divider>
|
|
|
|
|
|
+ <u-divider color="#19be6b" style="margin-bottom:20px;" font-size="28rpx" @click="changeList">点击换一批</u-divider>
|
|
|
|
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
@@ -84,15 +84,18 @@
|
|
}],
|
|
}],
|
|
current: 0,
|
|
current: 0,
|
|
wrapList: [
|
|
wrapList: [
|
|
- ],
|
|
|
|
|
|
+ ],
|
|
|
|
+ timeOut: false,
|
|
|
|
+ totalPage: 1,
|
|
|
|
+ uuid:'',
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- onReachBottom() {
|
|
|
|
- if (this.list.length < this.recordsTotal) {
|
|
|
|
|
|
+ // onReachBottom() {
|
|
|
|
+ // if (this.list.length < this.recordsTotal) {
|
|
|
|
|
|
- this.myLoadmore();
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
|
|
+ // this.myLoadmore();
|
|
|
|
+ // }
|
|
|
|
+ // },
|
|
computed:{
|
|
computed:{
|
|
defaultvalue(){
|
|
defaultvalue(){
|
|
for(var i in this.listQy){
|
|
for(var i in this.listQy){
|
|
@@ -135,10 +138,31 @@
|
|
this.list = [];
|
|
this.list = [];
|
|
this.homePage();
|
|
this.homePage();
|
|
},
|
|
},
|
|
- myLoadmore() {
|
|
|
|
-
|
|
|
|
- this.pageIndex += 1;
|
|
|
|
- this.homePage()
|
|
|
|
|
|
+ changeList() {
|
|
|
|
+ this.list = [];
|
|
|
|
+ this.pageIndex += 1;
|
|
|
|
+ if(this.pageIndex == this.totalPage+1) {
|
|
|
|
+ this.pageIndex = 1;
|
|
|
|
+ }
|
|
|
|
+ this.homePage()
|
|
|
|
+
|
|
|
|
+ clearInterval(this.uuid)
|
|
|
|
+ this.uuid='';
|
|
|
|
+ if(!this.uuid){
|
|
|
|
+ this.uuid=setInterval(()=>{
|
|
|
|
+ if(this.timeOut){
|
|
|
|
+ this.timingchangeList();
|
|
|
|
+ }
|
|
|
|
+ },10*1000)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ timingchangeList() {
|
|
|
|
+ this.list = [];
|
|
|
|
+ this.pageIndex += 1;
|
|
|
|
+ if(this.pageIndex == this.totalPage+1) {
|
|
|
|
+ this.pageIndex = 1;
|
|
|
|
+ }
|
|
|
|
+ this.homePage()
|
|
},
|
|
},
|
|
change(index) {
|
|
change(index) {
|
|
this.current = index;
|
|
this.current = index;
|
|
@@ -222,7 +246,8 @@
|
|
...this.list,
|
|
...this.list,
|
|
...res.data.data
|
|
...res.data.data
|
|
];
|
|
];
|
|
- this.recordsTotal = res.data.recordsTotal
|
|
|
|
|
|
+ this.recordsTotal = res.data.recordsTotal
|
|
|
|
+ this.totalPage = res.data.totalPage
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
this.getBaseDictionary()
|
|
this.getBaseDictionary()
|
|
}).catch(error => {
|
|
}).catch(error => {
|
|
@@ -250,6 +275,28 @@
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ },
|
|
|
|
+ onUnload() {
|
|
|
|
+ if(this.uuid){
|
|
|
|
+ clearInterval(this.uuid)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ onHide() {
|
|
|
|
+ this.timeOut = false;
|
|
|
|
+ if(this.uuid){
|
|
|
|
+ clearInterval(this.uuid)
|
|
|
|
+ this.uuid='';
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ onShow() {
|
|
|
|
+ this.timeOut=true
|
|
|
|
+ if(!this.uuid){
|
|
|
|
+ this.uuid=setInterval(()=>{
|
|
|
|
+ if(this.timeOut){
|
|
|
|
+ this.timingchangeList();
|
|
|
|
+ }
|
|
|
|
+ },10*1000)
|
|
|
|
+ }
|
|
},
|
|
},
|
|
onLoad() {
|
|
onLoad() {
|
|
var logo=this.carhelp.getConfig().logo
|
|
var logo=this.carhelp.getConfig().logo
|