浏览代码

pagesRest

guhongwei 2 年之前
父节点
当前提交
721141ab7e
共有 2 个文件被更改,包括 28 次插入26 次删除
  1. 13 17
      pagesRest/activity/list.vue
  2. 15 9
      pagesRest/recom/index.vue

+ 13 - 17
pagesRest/activity/list.vue

@@ -50,8 +50,12 @@
 			const that = this;
 			that.searchConfig();
 			that.search();
-			// 下拉刷新
-			
+		},
+		onPullDownRefresh: async function() {
+			const that = this;
+			that.clearPage();
+			await that.search();
+			uni.stopPullDownRefresh();
 		},
 		methods: {
 			// 查询基本设置
@@ -116,6 +120,12 @@
 				that.clearPage();
 				that.search();
 			},
+			toInfo(e) {
+				const that = this;
+				uni.navigateTo({
+					url: `/pagesRest/activity/info?id=${e._id}`
+				})
+			},
 			// 清空列表
 			clearPage() {
 				const that = this;
@@ -123,23 +133,9 @@
 				that.$set(that, `skip`, 0)
 				that.$set(that, `limit`, 6)
 				that.$set(that, `page`, 0)
-			},
-			toInfo(e) {
-				const that = this;
-				uni.navigateTo({
-					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>
 

+ 15 - 9
pagesRest/recom/index.vue

@@ -61,6 +61,12 @@
 			that.searchOther();
 			that.search();
 		},
+		onPullDownRefresh: async function() {
+			const that = this;
+			that.clearPage()
+			await that.search();
+			uni.stopPullDownRefresh();
+		},
 		methods: {
 			// 查询基本设置
 			searchConfig() {
@@ -153,16 +159,16 @@
 					url: `/pagesHome/order/detail?id=${e._id}`
 				})
 			},
+			// 清空列表
+			clearPage() {
+				const that = this;
+				that.$set(that, `list`, [])
+				that.$set(that, `skip`, 0)
+				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>