zkx há 5 meses atrás
pai
commit
4b1e3fb2c7

+ 11 - 3
pages/index/index.vue

@@ -339,7 +339,7 @@
 			<!-- 附近站点 -->
 			<template v-for="(stationData,i) in stationList">
 				<view class="station" :key="i+'abc'" v-show="!listShow||i==0"
-					@click="gotoUrl('pages/searchPile/stationAndPile/stationDetails?id=' + stationData.id)">
+					@click="gotoStationDetails(stationData)">
 					<view class="head">
 						<view class="title oldTextjp" oldstyle="font-size: 20px;">
 							{{stationData.name}}
@@ -533,7 +533,7 @@
 		<!-- 附近站点 -->
 		<view class="station" v-for="(stationData,i) in defaultStation" :key="i"
 			v-if="stationList.length == 0 && chargeList.length == 0"
-			@click="gotoUrl('pages/searchPile/stationAndPile/stationDetails?id=' + stationData.id)">
+			@click="gotoStationDetails(stationData)">
 			<view class="head">
 				<view class="title oldTextjp" oldstyle="font-size: 20px;">
 					{{stationData.name}}
@@ -1022,7 +1022,15 @@
 		updated() {
 			this.onPageScrollMethod()
 		},
-		methods: {
+		methods: {
+			gotoStationDetails(stationData){
+					if(stationData.fastNum==0&&stationData.slowNum==1){
+						this.gotoUrl('pages/searchPile/stationAndPile/chargingPileDetails?isback=1&sid=' + stationData.id)
+						
+					}else{
+						this.gotoUrl('pages/searchPile/stationAndPile/stationDetails?id=' + stationData.id)
+					}
+			},
 			getPercent(chargingRecord) {
 				if (!chargingRecord.startTime) {
 					return '00:00:00'

+ 12 - 4
pages/search/search.vue

@@ -201,6 +201,14 @@
 		},
 		 // conponents:{charingSlows},
 		methods: { 
+			gotoStationDetails(stationData){
+					if(stationData.fastNum==0&&stationData.slowNum==1){
+						this.gotoUrl('pages/searchPile/stationAndPile/chargingPileDetails?isback=1&sid=' + stationData.id)
+						
+					}else{
+						this.gotoUrl('pages/searchPile/stationAndPile/stationDetails?id=' + stationData.id)
+					}
+			},
 			theme(type) {
 			  if(type == 'elder')	
 			  {
@@ -245,11 +253,11 @@
 				 
 			},
 			stationDetail(item){
-				 
+				 this.gotoStationDetails(item)
 				//('stationDetail item'+JSON.stringify(item))
-				uni.navigateTo({
-					url:'../searchPile/stationAndPile/stationDetails?id='+item.id
-				})
+				// uni.navigateTo({
+				// 	url:'../searchPile/stationAndPile/stationDetails?id='+item.id
+				// })
 					/*
 				uni.navigateTo({
 					url:'stationAndPile/stationDetails?station='+encodeURIComponent(JSON.stringify(item))

+ 13 - 5
pages/searchPile/searchPile.vue

@@ -720,7 +720,15 @@ import {
 				return true
 			},
 		},
-		methods: {
+		methods: {
+			gotoStationDetails(stationData){
+					if(stationData.fastNum==0&&stationData.slowNum==1){
+						this.gotoUrl('pages/searchPile/stationAndPile/chargingPileDetails?isback=1&sid=' + stationData.id)
+						
+					}else{
+						this.gotoUrl('pages/searchPile/stationAndPile/stationDetails?id=' + stationData.id)
+					}
+			},
 			spring() {
 				this.springShow=false;
 				try{
@@ -865,11 +873,11 @@ import {
 				if (!this.isEnabled()) {
 					return;
 				}
+				this.gotoStationDetails(item)
 
-
-				uni.navigateTo({
-					url: '/pages/searchPile/stationAndPile/stationDetails?id=' + item.id
-				})
+				// uni.navigateTo({
+				// 	url: '/pages/searchPile/stationAndPile/stationDetails?id=' + item.id
+				// })
 			},
 			setCenter() {
 				//('getPoint')

+ 13 - 5
pages/searchPile/stationAndPile/charging/chargingPileDetailsFamily.vue

@@ -101,9 +101,13 @@
 				</view>
 				
 				<view class="charging-info">
-					<view class="row" @click="startTypeShow=true">
-						<view class="key">充电方式</view>
-						<view class="value">{{startTypeList[startType].label}}<u-icon name="arrow-right"></u-icon></view>
+					<view class="row">
+						<view class="key">开启定时</view>
+						
+						<view class="value"> 	<u-switch v-model="startType"
+						  @change="startTypeConfirm" active-color="#eee" inactive-color="#00b962"
+						 :active-value="0" :inactive-value="1"></u-switch>
+						</view>
 					</view>
 					<view class="row" v-show="startType==0"  @click="startTypeTimeShow=true" >
 						<view class="key">定时充电</view>
@@ -477,6 +481,9 @@
 		},
 
 		computed: {
+			checked(){
+				return !this.startType
+			},
 			prevMonthKwhBL(){
 				if(this.carImg3span1>=1000){
 					return false
@@ -534,10 +541,11 @@
 			},
 			startTypeConfirm(e){
 				console.log(e);
-				this.startType=e[0].value
+				this.startType=e?0:1
+				console.log(this.startType);
 				if(this.lastTiming==null){
 					this.startTypeTimeValue1=new Date().getHours()
-					this.startTypeTimeValue2=new Date().getMinutes()+10
+					this.startTypeTimeValue2=new Date().getMinutes()
 				}
 			},
 			onShowK() {

+ 41 - 8
pages/searchPile/stationAndPile/chargingPileDetails.vue

@@ -9,7 +9,7 @@
 <script>
 	
 	import * as API from "@/apis/chargeProcess.js"
-	
+	import * as api from "@/apis/site.js"
 	import chargingPileDetails from '@/pages/searchPile/stationAndPile/charging/chargingPileDetails.vue'
 	import chargingPileDetailsFamily from '@/pages/searchPile/stationAndPile/charging/chargingPileDetailsFamily.vue'
 	
@@ -33,13 +33,14 @@
 
 		onLoad(op) {
 			//this.startCarCharging()
-			this.op=op
-			if (op.id) {
+			this.op=op
+			if (op.sid) {
+				this.sid = op.sid
+					
+					
+			} else if (op.id) {
 				this.id = op.id
 		
-				
-			
-				
 		
 			} else {
 				uni.showToast({
@@ -47,8 +48,14 @@
 				})
 			}
 		},
-		onReady() {
-				this.getPile()
+		onReady() {
+			if(this.sid){
+				this.getChargingStationDetail()
+			}
+			if(this.id){
+				this.getPile()
+			}
+				
 		},
 		onShow() {
 			if(this.detail.id){
@@ -62,7 +69,33 @@
 			
 		},
 		methods: {
+			getChargingStationDetail(bl) {
+				
+				var _self = this;
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+			
+				let data = {
+					stationId: this.sid
+				};
+			
+			
+				api.getChargingStationDetail(data).then(function(res) {
+					//uni.hideLoading()
 			
+					if (res && res.result && res.data) {
+			
+						let data = res.data.devices;
+						console.log(data)
+						_self.id=data[0].gunList[0].gunNo
+						_self.op.id=_self.id
+						_self.getPile()
+					}
+			
+				})
+			},
 			getPile() {
 				uni.showLoading({
 					title: "加载中",