Browse Source

站点地图

zhupeng 3 years ago
parent
commit
0278b51ff8

+ 2 - 2
.env.dev.js

@@ -1,7 +1,7 @@
 const UNI_APP = {  
 	ProjectName :"51充电联盟",
-//	BASE_URL: 'https://charging.xiaoxinda.com/charging-station-test/',
-    BASE_URL: 'http://192.168.77.162:8080/charging-station/' ,
+	BASE_URL: 'https://charging.xiaoxinda.com/charging-station-test/',
+//    BASE_URL: 'http://192.168.77.162:8080/charging-station/' ,
 	NODE_ENV :"dev",
 	SIMPLE_RUN:true,// 无视权限控制跳转页面   , 用于样式人员快速访问各种功能 ,快速测试等
 	//openId:"oHjCawsxTJkxixR74OVp7aCKahj8",//测试用openId  

+ 50 - 28
pages/searchPile/stationAndPile/chargePriceDetails.vue

@@ -3,11 +3,13 @@
 		<u-navbar title="充电价格详情"></u-navbar>
 		<view class="main">
 			<view class="tabs-box">
-				<u-tabs inactive-color="#888888" active-color="#101010" :list="list" :is-scroll="false"
-					:current="current" @change="change"></u-tabs>
+				<u-tabs itemStyle="width:300px" inactive-color="#888888" active-color="#101010" :list="list" :is-scroll="true"
+        :style="{
+          width: '650rpx',
+        }"					:current="current" @change="change"></u-tabs>
 			</view>
 			<view class="line-box"><u-line color="#999999" /></view>
-			<view class="time-frame" v-for="(item,index) in list[current].items" :key="index">
+			<view  class="time-frame" v-for="(item,index) in items" :key="index">
 				<view class="time-items">
 					<view class="time-price">
 						<view class="time">
@@ -36,44 +38,64 @@
 	export default {
 		data() {
 			return {
-				list: [{
-					name: '直流快充',
-/*					items:[
-						{time:'00:00-07:00',single_price:1.0,service_price:0.25,price:1.25},
-						{time:'07:00-09:00',single_price:1.0,service_price:0.25,price:1.25},
-						{time:'09:00-15:00',single_price:1.0,service_price:0.25,price:1.25},
-						{time:'15:00-20:00',single_price:1.0,service_price:0.25,price:1.25},
-						{time:'20:00-22:00',single_price:1.0,service_price:0.25,price:1.25},
-						{time:'22:00-23:00',single_price:1.0,service_price:0.25,price:1.25},
-						{time:'23:00-23:59',single_price:1.0,service_price:0.25,price:1.25},
-					]*/
+				list: [
+			 	{
+					name: '直流快充', 
 				}, {
-					name: '交流慢充',
-/*					items:[
-						{time:'00:00-07:00',single_price:0.5,service_price:0.25,price:0.75},
-						{time:'07:00-09:00',single_price:0.7,service_price:0.25,price:1.00},
-						{time:'09:00-15:00',single_price:0.7,service_price:0.25,price:1.00},
-						{time:'15:00-20:00',single_price:0.7,service_price:0.25,price:1.00},
-						{time:'20:00-22:00',single_price:0.6,service_price:0.25,price:0.90},
-						{time:'22:00-23:00',single_price:0.5,service_price:0.25,price:0.75},
-						{time:'23:00-23:59',single_price:0.5,service_price:0.25,price:0.75},
-					]*/
-				}],
+					name: '交流慢充', 
+				} 
+				],
+				items:[],
 				current: 0
 			}
 		},
 		onLoad(op){
-			_self = this;
-			api.getPriceDetails(op).then(function(res){
+			_self = this; 
+			if(op!=null && op.stationId!=null){
+				console.log('stationId'+JSON.stringify(op.stationId))
+				let data = {stationId:op.stationId};
+				api.getChargingStationPrice(data).then(function(res){
+//					console.log('data'+JSON.stringify(res))
+					if(res.result){
+						let data = res.data;
+						if(data.prices){
+							console.log('data'+JSON.stringify(data.prices))
+								
+							_self.list = [];
+							for(let i = 0;i< data.prices.length;i++){
+								let _item = data.prices[i];
+								let item = {name:data.prices[i].name,items:[]};
+								for(let j = 0;j<_item.priceList.length;j++){
+									let _subitem = _item.priceList[j];
+									console.log('priceList'+JSON.stringify(_subitem))
+									
+									let subitem = {time:'00:00-07:00',single_price:0.5,service_price:0.25,price:0.75};
+									subitem.time = _subitem.startTime + '-'+_subitem.endTime;
+									subitem.single_price = _subitem.electricityPrice;
+									subitem.service_price = _subitem.servicePrice;
+									subitem.price = _subitem.costPrice;
+									item.items.push(subitem);
+								}
+								_self.list.push(item);
+							}
+							console.log('站点价格详情'+JSON.stringify(_self.list));
+							
+						}
+					}
+				})
+			}
+
+/*			api.getPriceDetails(op).then(function(res){
 					_self.list = res;
  				},function(err){
 					
 				}
-			);
+			);*/
 		},
 		methods: {
 			change(index) {
 				this.current = index;
+				this.items = this.list[index].items;
 			}
 		}
 	}

+ 30 - 6
pages/searchPile/stationAndPile/stationDetails.vue

@@ -168,7 +168,7 @@
 					park:{ 
 						price:'免费'
 					},
-					
+					priceList:[],
 					devices:{
 						idleNum:1,
 						total:6,
@@ -203,15 +203,36 @@
 								data.station.distance = station.distance;
 								_self.stationDetail = data;
 								_self.processStationsInfo();							
-								console.log('data'+JSON.stringify(data)); 
+//								console.log('data'+JSON.stringify(data)); 
 							}
 							
 						}
 						
 					})
-					api.getChargingStationPrice(data).then(function(res){
-						console.log('站点价格详情'+JSON.stringify(res));
-					})
+					/*api.getChargingStationPrice(data).then(function(res){
+						if(res.result){
+							let data = res.data;
+							if(data.prices){
+								_self.list = [];
+								for(let i = 0;i< data.prices.length;i++){
+									let _item = data.prices[i];
+									let item = {name:data.prices[i].name,items:[]};
+									for(let j = 0;j<_item.priceList.length;j++){
+										let _subitem = _item.priceList[j];
+										let subitem = {time:'00:00-07:00',single_price:0.5,service_price:0.25,price:0.75};
+										subitem.time = _subitem.startTime + '-'+_subitem.endTime;
+										subitem.single_price = _subitem.electricityPrice;
+										subitem.service_price = _subitem.servicePrice;
+										subitem.price = _subitem.costPrice;
+										item.items.push(subitem);
+									}
+									_self.priceList.push(item);
+								}
+								console.log('站点价格详情'+JSON.stringify(list));
+								
+							}
+						}
+					})*/
 					//this.info.station = station;
 					console.log('stationDetail onLoad'+JSON.stringify(station))					
 				} 
@@ -287,8 +308,11 @@
 				})
 			},
 			map(){
+				console.log('map'+JSON.stringify(_self.station))
+				_self.station.address = 'xxxxxxxxxxxxx'
 				uni.navigateTo({
-					url:'stationDetailsMap'
+					url:'stationDetailsMap?station='+encodeURIComponent(JSON.stringify(_self.station))
+					 
 				})
 			}
 		}

File diff suppressed because it is too large
+ 10 - 49
pages/searchPile/stationAndPile/stationDetailsMap.vue


Some files were not shown because too many files changed in this diff