qukaidi il y a 4 ans
Parent
commit
e4a9990781
3 fichiers modifiés avec 27 ajouts et 21 suppressions
  1. 4 3
      pages.json
  2. 19 18
      pages/home/index.vue
  3. 4 0
      pages/me/index.vue

+ 4 - 3
pages.json

@@ -26,7 +26,8 @@
 				"navigationBarTextStyle": "black",
 				"app-plus": {
 					"titleNView": false
-				}
+				},
+				"enablePullDownRefresh":true
 			}
 
 		},
@@ -45,9 +46,9 @@
 				// "navigationBarTitleText": "我的",
 				"app-plus": {
 					"titleNView": false
-				}
+				},
+				"enablePullDownRefresh":true
 			}
-
 		},
 		//登录
 		{

+ 19 - 18
pages/home/index.vue

@@ -82,6 +82,7 @@
 			uni.$on('login', (data) => {
 				this.loginStatus = data.msg
 			})
+			// uni.startPullDownRefresh();
 		},
 		onReady() {
 			if (this.loginStatus == "登录成功") {
@@ -98,6 +99,7 @@
 				axios.all([this.getBanners(), this.getTiceList()])
 					.then(axios.spread((one, two) => {
 						this.bannersList = one.data.data.map(t => t.imgPath)
+						console.log(one)
 						this.noticebarList = two.data.data.map(t => t.msgContent)
 					}))
 					.catch(err => {
@@ -112,6 +114,23 @@
 		onShow() {
 			this.system()
 		},
+		onPullDownRefresh() {
+			axios.all([this.getBanners(), this.getTiceList()])
+				.then(axios.spread((one, two) => {
+					this.bannersList = one.data.data.map(t => t.imgPath)
+					this.noticebarList = two.data.data.map(t => t.msgContent)
+				}))
+				.catch(err => {
+
+				})
+				.finally(() => {
+					this.loading = false;
+					uni.stopPullDownRefresh();
+				})
+			// setTimeout(function() {
+				
+			// }, 1000);
+		},
 		computed: {
 			...mapState(['hasLogin'])
 		},
@@ -238,18 +257,12 @@
 								// })
 
 							} else if (wgtinfo.version != res.data.forceVersion) {
-
 								this.Copywriting = res.data.msg
-
 								this.show_s = true
-
 								this.url = res.data.url
 								this.is_force = true
 							} else if (wgtinfo.version == res.data.forceVersion) {
-
 								this.Copywriting = res.data.msg
-
-
 								this.is_force = false
 								this.show_s = true
 								this.url = res.data.url
@@ -332,18 +345,6 @@
 						}
 				}
 			},
-			inInlineshop() {
-				this.$u.toast('线上订货暂不开放');
-				// this.$u.route({
-				// 	url: 'pages/home/inline-shop/inline_shop',
-				// })
-			},
-			inIntegral() {
-				this.$u.toast('积分商城暂不开放');
-				// this.$u.route({
-				// 	url: 'pages/home/integral-mall/integral_mall',
-				// })
-			}
 		},
 	}
 </script>

+ 4 - 0
pages/me/index.vue

@@ -207,6 +207,9 @@
 				this.getMyinfo();
 			}
 		},
+		onPullDownRefresh() {
+			this.getMyinfo();
+		},
 		methods: {
 			...mapMutations(["outStore"]),
 			getMyinfo() {
@@ -227,6 +230,7 @@
 						this.loading = false;
 						this.outStore();
 						uni.hideLoading();
+						uni.stopPullDownRefresh();
 					});
 			},
 			inPage(index) {