Kaynağa Gözat

下拉刷新

YY 2 yıl önce
ebeveyn
işleme
5143f5f342

+ 11 - 0
pagesHome/exchange/index.vue

@@ -40,6 +40,8 @@
 			const that = this;
 			// 监听用户是否登录
 			that.watchLogin();
+			// 下拉刷新
+			uni.startPullDownRefresh();
 		},
 		onShow: function() {
 			const that = this;
@@ -158,6 +160,15 @@
 				that.$set(that, `limit`, 6)
 				that.$set(that, `page`, 0)
 			}
+		},
+		onPullDownRefresh: async function() {
+			const that = this;
+			that.$set(that, `list`, [])
+			that.$set(that, `skip`, 0)
+			that.$set(that, `limit`, 6)
+			that.$set(that, `page`, 0)
+			await that.search();
+			uni.stopPullDownRefresh();
 		}
 	}
 </script>

+ 13 - 0
pagesHome/market/type.vue

@@ -82,6 +82,8 @@
 			const that = this;
 			that.searchConfig();
 			that.search();
+			// 下拉刷新
+			uni.startPullDownRefresh();
 		},
 		methods: {
 			// 查询基本设置
@@ -219,6 +221,17 @@
 				})
 			},
 		},
+		onPullDownRefresh: async function() {
+			const that = this;
+			that.$set(that, `typeList`, [])
+			that.$set(that, `marketList`, [])
+			that.$set(that, `list`, [])
+			that.$set(that, `skip`, 0)
+			that.$set(that, `limit`, 6)
+			that.$set(that, `page`, 0)
+			await that.search();
+			uni.stopPullDownRefresh();
+		}
 
 	}
 </script>

+ 13 - 0
pagesHome/shop/index.vue

@@ -216,6 +216,8 @@
 			await that.watchLogin();
 			await that.search();
 			await that.searchOther();
+			// 下拉刷新
+			uni.startPullDownRefresh();
 		},
 		methods: {
 			// 查询基本设置
@@ -445,6 +447,17 @@
 				that.$set(that, `limit`, 5)
 				that.$set(that, `page`, 0)
 			}
+		},
+		onPullDownRefresh: async function() {
+			const that = this;
+			that.$set(that, `info`, {})
+			that.$set(that, `shoplist`, [])
+			that.$set(that, `list`, [])
+			that.$set(that, `skip`, 0)
+			that.$set(that, `limit`, 6)
+			that.$set(that, `page`, 0)
+			await that.search();
+			uni.stopPullDownRefresh();
 		}
 	}
 </script>

+ 11 - 0
pagesRest/activity/list.vue

@@ -50,6 +50,8 @@
 			const that = this;
 			that.searchConfig();
 			that.search();
+			// 下拉刷新
+			uni.startPullDownRefresh();
 		},
 		methods: {
 			// 查询基本设置
@@ -128,6 +130,15 @@
 					url: `/pagesRest/activity/info?id=${e._id}`
 				})
 			}
+		},
+		onPullDownRefresh: async function() {
+			const that = this;
+			that.$set(that, `list`, [])
+			that.$set(that, `skip`, 0)
+			that.$set(that, `limit`, 6)
+			that.$set(that, `page`, 0)
+			await that.search();
+			uni.stopPullDownRefresh();
 		}
 	}
 </script>

+ 11 - 0
pagesRest/recom/index.vue

@@ -51,6 +51,8 @@
 			that.searchConfig();
 			that.searchOther();
 			that.search();
+			// 下拉刷新
+			uni.startPullDownRefresh();
 		},
 		methods: {
 			// 查询基本设置
@@ -114,6 +116,15 @@
 					url: `/pagesHome/order/detail?id=${e._id}`
 				})
 			},
+		},
+		onPullDownRefresh: async function() {
+			const that = this;
+			that.$set(that, `list`, [])
+			that.$set(that, `skip`, 0)
+			that.$set(that, `limit`, 6)
+			that.$set(that, `page`, 0)
+			await that.search();
+			uni.stopPullDownRefresh();
 		}
 	}
 </script>