Procházet zdrojové kódy

圈在网小程序修改

347617796@qq.com před 4 roky
rodič
revize
7ad85e3ffd
3 změnil soubory, kde provedl 23 přidání a 17 odebrání
  1. 0 1
      App.vue
  2. 21 16
      pages/index/index.vue
  3. 2 0
      pages/myOrder/index.vue

+ 0 - 1
App.vue

@@ -62,7 +62,6 @@
 					     				  },
 					     				  success: (res) => {
 											  let { data } = res.data;
-											  console.log(data);
 											  data.code = code;
 											  that.setcode(data);
 											  let token = data.token;

+ 21 - 16
pages/index/index.vue

@@ -291,8 +291,8 @@ export default {
 
 		// 滚到底部
 		lower(e) {
-			this.page = this.page + 1;
 			if (this.ispull) {
+				this.page = this.page + 1;
 				this.gethotelist();
 			}
 		},
@@ -369,6 +369,9 @@ export default {
 					this.lat = data[0].latitude; // 经度
 					this.lot = data[0].longitude; // 纬度
 					this.allow = false;
+					this.page = 1;
+					this.ispull=true;
+					this.hotelist=[];
 					this.gethotelist();
 					uni.hideLoading();
 				},
@@ -402,22 +405,24 @@ export default {
 				success: res => {
 					let { data, code } = res.data;
 					if (code == 1000) {
-						if (data.store_list.length < 10) {
-							this.ispull = false;
-						}
-						data.store_list.forEach((items, index) => {
-							items.tages = items.store_summary.split(' ');
-							items.tageslist = [];
-							items.tages.forEach((item, index) => {
-								if (item != '') {
-									items.tageslist.push(item);
-								}
+						if(this.ispull){
+							if (data.store_list.length < 10) {
+								this.ispull = false;
+							}
+							data.store_list.forEach((items, index) => {
+								items.tages = items.store_summary.split(' ');
+								items.tageslist = [];
+								items.tages.forEach((item, index) => {
+									if (item != '') {
+										items.tageslist.push(item);
+									}
+								});
 							});
-						});
-						if (this.hotelist.length == 0) {
-							this.hotelist = data.store_list;
-						} else {
-							this.hotelist = this.hotelist.concat(data.store_list);
+							if (this.hotelist.length == 0) {
+								this.hotelist = data.store_list;
+							} else {
+								this.hotelist = this.hotelist.concat(data.store_list);
+							}
 						}
 					} else {
 						this.$msg('网络错误稍后再试');

+ 2 - 0
pages/myOrder/index.vue

@@ -64,6 +64,7 @@
 				<view style="text-align: center;color: #909399;">去买点什么</view>
 			</view>
 		</view>
+		
 		<view v-if="(order_list.length == 0 && !successlogion) || (order_list.length == 0 && !hasLogin)">
 			<view style="margin: 160upx auto;text-align: center;">
 				<van-icon size="160rpx" color="#909399" name="description" />
@@ -140,6 +141,7 @@ export default {
 			this.getlist();
 		});
 		if (this.successlogion && this.hasLogin) {
+			
 			this.getlist(); // 获取订单
 		} else {
 			uni.navigateTo({