wkyy 2 лет назад
Родитель
Сommit
e853ac4271
4 измененных файлов с 129 добавлено и 15 удалено
  1. 59 12
      pages/index/index.vue
  2. 64 2
      pagesA/pages/login/register.vue
  3. 6 1
      pagesB/pages/login/step4.vue
  4. BIN
      static/img/addImage.png

+ 59 - 12
pages/index/index.vue

@@ -56,7 +56,7 @@
 			</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>
 </template>
@@ -84,15 +84,18 @@
 				}],
 				current: 0,
 				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:{
 		 defaultvalue(){
 		 	for(var i in this.listQy){
@@ -135,10 +138,31 @@
 				this.list = [];
 				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) {
 				this.current = index;
@@ -222,7 +246,8 @@
 							...this.list,
 							...res.data.data
 						];
-						this.recordsTotal = res.data.recordsTotal
+						this.recordsTotal = res.data.recordsTotal
+						this.totalPage = res.data.totalPage
 						uni.hideLoading()
 						this.getBaseDictionary()
 					}).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() {
 			 var  logo=this.carhelp.getConfig().logo

Разница между файлами не показана из-за своего большого размера
+ 64 - 2
pagesA/pages/login/register.vue


+ 6 - 1
pagesB/pages/login/step4.vue

@@ -189,7 +189,12 @@
 				})
 			},
 			formsubmit(){
-			
+				if(this.faceImg == '/static/img/head.png') {
+					uni.showToast({
+						title: "请先上传头像"
+					})
+					return
+				}
 				_self.personal_info.faceImage = _self.faceImg;
 				_self.personal_info.type = 0;
 				let personalInfo = this.carhelp.getPersonInfo();

BIN
static/img/addImage.png


Некоторые файлы не были показаны из-за большого количества измененных файлов