tianhui 3 роки тому
батько
коміт
f3f005a3ee
3 змінених файлів з 44 додано та 16 видалено
  1. 17 1
      pages/getout/getout.vue
  2. 9 15
      pages/parking/parking.scss
  3. 18 0
      pages/parking/parking.vue

+ 17 - 1
pages/getout/getout.vue

@@ -27,6 +27,11 @@
 		<view class="bottom-btn-wrap">
 			<!-- <view class="bottom-btn" @click="jumpToMain()">返回主页</view> -->
 			<u-button class="bt1"  @click="last(list.pageNum)"><</u-button>
+			<view class="pagesInput"><u-input v-model="pageNum" type="text" :border="true" :clearable="false" /></view>
+			<view class="num">
+			第{{currentPageNum}}页
+			<u-button @click="jump(list.pageNum)" size="mini">跳转</u-button>
+			</view>
 			<u-button class="bt2" @click="next(list.pageNum)">></u-button>
 		</view>
 		<u-action-sheet :list="actionList" @click="actionClick" v-model="actionShow"></u-action-sheet>
@@ -122,7 +127,9 @@
 				list:{
 					pageNum:''
 				},
-				pages:''
+				pages:'',
+				pageNum:'',
+				currentPageNum:''
 			}
 		},
 		onShow() {
@@ -135,6 +142,15 @@
 			}, 1000);
 		},
 		methods:{
+			jump(){
+				this.$u.api.getRoadspace({roadNo:this.roadNo,placeStatus:1,pageNum:this.pageNum || ''})
+				.then(res => {
+					this.pages=res.data.pages;
+					this.currentPageNum=res.data.page;
+					this.list.pageNum=res.data.page;
+					this.roadspaceList = res.data.rows;
+				})
+			},
 			spaceSearch(){
 				console.log(this.roadspaceList.spaceName)
 				this.$u.api.getRoadspace({roadNo:this.roadNo,placeStatus:1,spaceName:this.roadspaceList.spaceName})

+ 9 - 15
pages/parking/parking.scss

@@ -60,21 +60,15 @@
 .search{
 	margin: 10rpx 28rpx;
 }
-.bottom-btn{
-	position: fixed;
-	left: 40rpx;
-	right: 40rpx;
-	bottom: 47rpx;
-	height: 85rpx;
-	line-height: 85rpx;
-	background: #3397FA;
-	box-shadow: 0px 9rpx 9rpx 0px rgba(0, 0, 0, 0.03);
-	border-radius: 10rpx;
-	text-align: center;
-	font-size: 28rpx;
-	font-weight: 500;
-	color: #FFF;
-	letter-spacing: 1px
+.pagesInput{
+	width: 45px;
+	margin: auto 30rpx;
+}
+.num{
+	margin: auto 0;
+}
+.bottom-btn-wrap{
+	display: flex;
 }
 .page{
 	z-index: 99;

+ 18 - 0
pages/parking/parking.vue

@@ -20,6 +20,11 @@
 		</view>
 		<view class="bottom-btn-wrap">
 			<u-button class="bt1" @click="last(list.pageNum)"><</u-button>
+			<view class="pagesInput"><u-input v-model="pageNum" type="text" :border="true" :clearable="false" /></view>
+			<view class="num">
+			第{{currentPageNum}}页
+			<u-button @click="jump(list.pageNum)" size="mini">跳转</u-button>
+			</view>
 			<u-button class="bt2" @click="next(list.pageNum)">></u-button>
 			<!-- <view class="bottom-btn" @click="openPage('pages/index/index')">返回主页</view> -->
 			<!-- <uni-pagination class="page" v-if="roadspaceList" title="标题文字" :total='total'  @change='uni_pagination_change'></uni-pagination> -->
@@ -46,8 +51,10 @@
 				actionShow:false,
 				roadspaceList:[],
 				spaceId:null,
+				pageNum:'',
 				spaceName:'',
 				total:'',
+				currentPageNum:'',
 				list:{
 					pageNum:''
 				},
@@ -70,11 +77,21 @@
 			// 	console.log(e)
 			// 	// {type: "next", current: 2}
 			// },
+			jump(){
+				this.$u.api.getRoadspace({roadNo:this.roadNo,placeStatus:0,pageNum:this.pageNum})
+				.then(res => {
+					this.pages=res.data.pages;
+					this.currentPageNum=res.data.page;
+					this.list.pageNum=res.data.page;
+					this.roadspaceList = res.data.rows;
+				})
+			},
 			spaceSearch(){
 				console.log(this.roadspaceList.spaceName)
 				this.$u.api.getRoadspace({roadNo:this.roadNo,placeStatus:0,spaceName:this.roadspaceList.spaceName})
 				.then(res => {
 					this.pages=res.data.pages;
+					this.currentPageNum=res.data.page;
 					this.list.pageNum=res.data.page;
 					this.roadspaceList = res.data.rows;
 				})
@@ -118,6 +135,7 @@
 					// 	type: 'success',
 					// });
 					this.pages=res.data.pages;
+					this.currentPageNum=res.data.page;
 					this.list.pageNum=res.data.page;
 					this.total=res.data.total;
 					this.roadspaceList = res.data.rows;