Просмотр исходного кода

【前端模版】修复diy首页分类下拉加载的问题

evoxwht 3 лет назад
Родитель
Сommit
65178f0e9e
2 измененных файлов с 21 добавлено и 42 удалено
  1. 11 39
      template/uni-app/pages/index/diy/index.vue
  2. 10 3
      template/uni-app/pages/index/index.vue

+ 11 - 39
template/uni-app/pages/index/diy/index.vue

@@ -402,39 +402,6 @@
 				}
 			} catch (e) {}
 			// #endif
-			// const {
-			// 	state,
-			// 	scope
-			// } = options;
-			// #ifndef H5
-			uni.getLocation({
-				type: 'wgs84',
-				success: function(res) {
-					try {
-						uni.setStorageSync('user_latitude', res.latitude);
-						uni.setStorageSync('user_longitude', res.longitude);
-					} catch {}
-				}
-			});
-			// #endif
-			// #ifdef H5
-			if (this.$wechat.isWeixin()) {
-				this.$wechat.location().then(res => {
-					uni.setStorageSync('user_latitude', res.latitude);
-					uni.setStorageSync('user_longitude', res.longitude);
-				})
-			} else {
-				uni.getLocation({
-					type: 'wgs84',
-					success: function(res) {
-						try {
-							uni.setStorageSync('user_latitude', res.latitude);
-							uni.setStorageSync('user_longitude', res.longitude);
-						} catch {}
-					}
-				});
-			}
-			// #endif
 			this.diyData();
 			this.getIndexData();
 			// #ifdef MP
@@ -799,7 +766,7 @@
 					uni.stopPullDownRefresh({
 						success: (e) => {},
 					});
-					
+
 				}).catch(error => {
 					// #ifdef APP-PLUS
 					if (error.status) {
@@ -888,13 +855,18 @@
 					});
 				});
 			},
+			onsollBotton() {
+				console.log('????', this.isSortType)
+				if (this.isSortType == 0) {
+					// this.getGroomList();
+				} else {
+					this.getGoodsList();
+				}
+			}
 		},
+
 		onReachBottom: function() {
-			if (this.isSortType == 0) {
-				// this.getGroomList();
-			} else {
-				this.getGoodsList();
-			}
+
 		},
 		onPageScroll(e) {
 			// #ifdef H5

+ 10 - 3
template/uni-app/pages/index/index.vue

@@ -1,17 +1,19 @@
 <template>
-	<diy v-if="isDiy"></diy>
+	<diy ref="diy" v-if="isDiy"></diy>
 	<visualization v-else></visualization>
 </template>
 
 <script>
 	import diy from './diy'
 	import visualization from './visualization'
-	import {getShare} from "@/api/public.js";
+	import {
+		getShare
+	} from "@/api/public.js";
 	export default {
 		data() {
 			return {
 				isDiy: uni.getStorageSync('is_diy'),
-				shareInfo:{}
+				shareInfo: {}
 			}
 		},
 		components: {
@@ -58,6 +60,11 @@
 				});
 			},
 		},
+		onReachBottom: function() {
+			if (this.isDiy) {
+				this.$refs.diy.onsollBotton()
+			}
+		},
 		// #ifdef MP
 		//发送给朋友
 		onShareAppMessage(res) {