Browse Source

界面微调,增加车辆图片预览

chenwen 3 years ago
parent
commit
80eac8ce19
3 changed files with 24 additions and 9 deletions
  1. 1 1
      pages/me/me.vue
  2. 13 6
      pages/parking/parkingSiteDes.vue
  3. 10 2
      pages/parking/parkinglog.vue

+ 1 - 1
pages/me/me.vue

@@ -13,7 +13,7 @@
 		<view class="page-body">
 			<view class="body-block">
 				<view class="block-item" @tap="openPage" data-url="../parking/myparkings">
-					<view>{{myParkSites.length}}</view>
+					<view>{{myParkSites.length}}<text style="font-size:28rpx;color:#999999;margin-left:10rpx;">个</text></view>
 					<text>我的停车场</text>
 				</view>
 				<view class="block-item">

+ 13 - 6
pages/parking/parkingSiteDes.vue

@@ -16,7 +16,7 @@
 		<view class="li-title">收费规则</view>
 		<view class="li-con">
 			<text space="emsp">  {{chargeRule.rule_txt}}</text>
-			<view style="margin-top:15rpx;"><text space="emsp">  {{chargeRule.oth_rule_txt}}</text></view>
+			<!-- <view style="margin-top:15rpx;"><text space="emsp">  {{chargeRule.oth_rule_txt}}</text></view> -->
 		</view>
 		
 		<view class="li-title">设备列表</view>
@@ -131,13 +131,20 @@
 						this.parkingSite.pic_url="../../static/img/header_bg.png";
 					}
 					this.chargeRule=resp.data.chargeRule;
-					this.chargeRule['rule_txt']=`燃油车免费时长:${this.chargeRule.free_duration}分钟; 新能源车免费时长:${this.chargeRule.new_energy_free_duration}分钟; 燃油车每小时费用:${this.chargeRule.hour_cost}元; 新能源每小时费用:${this.chargeRule.new_energy_hour_cost}元; 每日封顶费用:${this.chargeRule.day_capping_cost}元`;
 					let othchargeRule=resp.data.othchargeRule||[];
-					let othRuleTxt=[];
+					let othRuleTxt={ryc:[],xny:[]};
 					othchargeRule.forEach((item) => {
-						othRuleTxt.push(`${item.min_section} 到 ${item.max_section}分钟:${item.parking_cost}元;`);
-					})
-					this.chargeRule['oth_rule_txt']=othRuleTxt.join(' ');
+						if(item.car_type=='1'){ //燃油车
+							othRuleTxt.ryc.push(`${item.min_section}-${item.max_section}分钟:${item.parking_cost}元`);
+						}
+						else if(item.car_type=='2'){  //新能源车
+							othRuleTxt.xny.push(`${item.min_section}-${item.max_section}分钟:${item.parking_cost}元`);
+						}
+					});
+					
+					this.chargeRule['rule_txt']=`燃油车\n 免费时长:${this.chargeRule.free_duration}分钟,每小时费用:${this.chargeRule.hour_cost}元,${othRuleTxt.ryc.join(',')} \n新能源车\n 免费时长:${this.chargeRule.new_energy_free_duration}分钟,每小时费用:${this.chargeRule.new_energy_hour_cost}元,${othRuleTxt.xny.join(',')} \n每日封顶费用:${this.chargeRule.day_capping_cost}元`;
+					
+					//this.chargeRule['oth_rule_txt']=othRuleTxt.join(' ');
 					this.devs=resp.data.devs;
 					
 				}).catch(error => {

+ 10 - 2
pages/parking/parkinglog.vue

@@ -45,7 +45,7 @@
 			
 			<view class="tab-con-item"  v-for="(item,index) in pagedData.records" :key="item.id">
 				<view class="item-top">
-					<u-image width="200rpx" height="160rpx" :src="item.car_img" border-radius="5rpx"></u-image>
+					<u-image width="200rpx" height="160rpx" :src="item.car_img" border-radius="5rpx" @click="previewCarPhoto(item.car_img)"></u-image>
 					<view class="item-top-right">
 						<text style="">{{item.parking_name}}</text>
 						<view class="top-right-con">
@@ -159,7 +159,7 @@
 			},
 			sureFilter(){
 				this.$refs.filterDropdown.close();
-				this.loadPageData(this.getLoadParams());
+				this.loadPageData(this.getLoadParams(1));
 			},
 			scrollbtm(){
 				console.log('scroll btm')
@@ -215,6 +215,14 @@
 				uni.navigateTo({
 					url:'charging?parkingLogId='+id
 				})
+			},
+			previewCarPhoto(img){
+				let array = [];
+				array.push(img);
+				uni.previewImage({
+					urls: array,
+					current: array[0]
+				});
 			}
 		}
 	}