|
@@ -34,8 +34,11 @@
|
|
|
|
|
|
<view class="homeWrap">
|
|
|
<u-swiper v-if="wrapList.length" :list="wrapList" @click="clickBanner" :img-mode="'aspectFit'" :name="'picUrl'" height="294" border-radius="24"></u-swiper>
|
|
|
- </view>
|
|
|
- <view class="homeUser">
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="homeUser">
|
|
|
+ <u-divider color="#19be6b" style="margin-bottom:10px;" font-size="28rpx" ><span @click="changeList" v-show="timeOut" >点击刷新</span><span style="margin-left:20px" @click="onHideMethod" v-show="timeOut" >暂停</span><span style="margin-left:20px" v-show="!timeOut" @click="changeList" >自动刷新</span></u-divider>
|
|
|
+
|
|
|
<view class="homeUser-item"
|
|
|
@click="gotoUrl('pages/friend/personal?id='+item.id)"
|
|
|
v-for="(item ,index) in list" :key="item.id" >
|
|
@@ -56,7 +59,8 @@
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
- <u-divider color="#19be6b" style="margin-bottom:20px;" font-size="28rpx" @click="changeList">点击换一批</u-divider>
|
|
|
+ <u-divider color="#19be6b" style="margin-bottom:20px;" font-size="28rpx" ><span @click="changeList" v-show="timeOut" >点击刷新</span><span style="margin-left:20px" @click="onHideMethod" v-show="timeOut" >暂停</span><span style="margin-left:20px" v-show="!timeOut" @click="changeList" >自动刷新</span></u-divider>
|
|
|
+
|
|
|
|
|
|
</view>
|
|
|
</template>
|
|
@@ -145,10 +149,13 @@
|
|
|
this.pageIndex = 1;
|
|
|
}
|
|
|
this.homePage()
|
|
|
+ if(this.uuid){
|
|
|
+ clearInterval(this.uuid)
|
|
|
+ }
|
|
|
|
|
|
- clearInterval(this.uuid)
|
|
|
this.uuid='';
|
|
|
- if(!this.uuid){
|
|
|
+ if(!this.uuid){
|
|
|
+ this.timeOut=true;
|
|
|
this.uuid=setInterval(()=>{
|
|
|
if(this.timeOut){
|
|
|
this.timingchangeList();
|
|
@@ -249,7 +256,7 @@
|
|
|
this.recordsTotal = res.data.recordsTotal
|
|
|
this.totalPage = res.data.totalPage
|
|
|
uni.hideLoading()
|
|
|
- this.getBaseDictionary()
|
|
|
+
|
|
|
}).catch(error => {
|
|
|
uni.showToast({
|
|
|
|
|
@@ -273,6 +280,23 @@
|
|
|
url:obj.linkUrl
|
|
|
})
|
|
|
|
|
|
+ },
|
|
|
+ onHideMethod(){
|
|
|
+ this.timeOut = false;
|
|
|
+ if(this.uuid){
|
|
|
+ clearInterval(this.uuid)
|
|
|
+ this.uuid='';
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onShowMethod(){
|
|
|
+ this.timeOut=true
|
|
|
+ if(!this.uuid){
|
|
|
+ this.uuid=setInterval(()=>{
|
|
|
+ if(this.timeOut){
|
|
|
+ this.timingchangeList();
|
|
|
+ }
|
|
|
+ },10*1000)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
},
|
|
@@ -281,22 +305,12 @@
|
|
|
clearInterval(this.uuid)
|
|
|
}
|
|
|
},
|
|
|
- onHide() {
|
|
|
- this.timeOut = false;
|
|
|
- if(this.uuid){
|
|
|
- clearInterval(this.uuid)
|
|
|
- this.uuid='';
|
|
|
- }
|
|
|
+ onHide() {
|
|
|
+ console.log("onHide")
|
|
|
+ this.onHideMethod()
|
|
|
},
|
|
|
onShow() {
|
|
|
- this.timeOut=true
|
|
|
- if(!this.uuid){
|
|
|
- this.uuid=setInterval(()=>{
|
|
|
- if(this.timeOut){
|
|
|
- this.timingchangeList();
|
|
|
- }
|
|
|
- },10*1000)
|
|
|
- }
|
|
|
+ this.onShowMethod()
|
|
|
},
|
|
|
onLoad() {
|
|
|
var logo=this.carhelp.getConfig().logo
|
|
@@ -305,7 +319,7 @@
|
|
|
}
|
|
|
},
|
|
|
onReady() {
|
|
|
-
|
|
|
+ this.getBaseDictionary()
|
|
|
this.getBannerInfo()
|
|
|
this.homePage()
|
|
|
}
|