zkx 2 年之前
父节点
当前提交
5a4f30705e
共有 1 个文件被更改,包括 36 次插入6 次删除
  1. 36 6
      pages/index/index.vue

+ 36 - 6
pages/index/index.vue

@@ -397,12 +397,19 @@
 					</view>
 				</view>
 			</view>
-			<view class="bottom" @click="goSearch()"    >
+			<view class="bottom" @click="searchStationData(true)" v-if="recordsTotal2!=stationList.length"   >
 				<view class="bot">
 					<view class="bot-line"></view>
 					<view class="bot-text " style="color: #00B962;" >点击查看更多站点</view>
 					<view class="bot-line"></view>
 				</view>
+			</view>
+			<view class="bottom"  v-else  >
+				<view class="bot">
+					<view class="bot-line"></view>
+					<view class="bot-text " style="color: #00B962;" >已经到底了</view>
+					<view class="bot-line"></view>
+				</view>
 			</view>
 		</template>
 		
@@ -609,7 +616,9 @@
 				showNtStep:0,
 				showNtValue:30,
 				couponList:[],
-				couponSelect:{},
+				couponSelect:{},
+				pageIndex2:1,
+				recordsTotal2:0,
 				
 			}
 		},
@@ -1435,10 +1444,14 @@
 					})
 				})
 			},
-			searchStationData(){
+			searchStationData(bl){
+				if(bl){
+					this.pageIndex2++;
+				}
 				var data={
 					longitude: this.longitude,
-					latitude: this.latitude,
+					latitude: this.latitude,
+					pageIndex:this.pageIndex2,
 					pageSize:6
 				}
 				if (this.carhelp.getPersonInfo()) {
@@ -1446,10 +1459,27 @@
 				}
 				
 				siteApi.searchStationData(data).then((response) => {
-					this.stationList = response.data.data;
+					
+					
+					if (this.pageIndex2 == 1) {
+						this.stationList = response.data.data;
+					
+						this.listForm.totalPage = response.totalPage;
+					} else {
+						this.stationList = [
+							...this.stationList,
+							...response.data.data
+						];
+					}
+					this.recordsTotal2=response.data.recordsTotal;
+					
 					
 					if(response.data.data.length){
-						var stationDataList = response.data.data;
+						var stationDataList = response.data.data;
+						
+						
+						
+						
 						MapLoader().then(AMap1 => {
 							for(var i in stationDataList){
 								var item=stationDataList[i]