Browse Source

我这边好像没问题了

zhengkaixin 2 years ago
parent
commit
021511d668

+ 4 - 2
pagesFinance/user/activatedChargingPile.vue

@@ -47,8 +47,10 @@
 		},
 		methods: {
 			test(){
-				
-				//this.getInfo("YQ20220816002")
+				if(process.env.NODE_ENV === "development"){
+					this.getInfo("YQ20220816002")
+				}
+				//
 			},
 			getInfo(id){
 				uni.showLoading({

+ 24 - 3
pagesFinance/user/confirmBinding.vue

@@ -62,7 +62,17 @@
 					{{obj2.address}}
 				</view>
 			</view>
+			<view class="item" v-if="objlist.length>1">
+				<view class="title">
+					绑定站点
+				</view>
+				<view class="content" style="color: #275cbf;"  @click="isswitchshow=true" >
+					{{obj2.name}}
+				</view>
+			</view>
 		</view>
+		<u-picker mode="selector" v-model="isswitchshow" :range="objlist" range-key="name" :default-selector="columnsindex" @confirm="switchBtn" ></u-picker>
+		
 		<view class="equipment-infos">
 			<view class="item">
 				<view class="title">
@@ -92,7 +102,9 @@
 				id:"",
 				obj1:{},obj2:{},
 				stationName:"",
-			
+				objlist:[],
+				isswitchshow:false,
+				columnsindex:[0],
 			}
 		},
 		onLoad(op) {
@@ -105,6 +117,13 @@
 			
 		},
 		methods: {
+			switchBtn(e){
+				this.columnsindex=e;
+				
+				this.obj2=this.objlist[e[0]]
+			
+				//
+			},
 			submit(){
 				if(!this.stationName){
 					this.stationName=this.obj2.name;
@@ -115,7 +134,8 @@
 				})
 				API.bindCategoryDevice({
 					deviceNo:this.id,
-					stationName:this.stationName
+					stationName:this.stationName,
+					stationId:this.obj2.id
 				}).then((res) => {
 					//this.obj = res.data
 				
@@ -142,7 +162,8 @@
 					deviceNo:this.id
 				}).then((res) => {
 					this.obj1 = res.data.chargingDevice
-					this.obj2 = res.data.chargingStation
+					this.objlist= res.data.chargingStationList;
+					this.obj2 = res.data.chargingStationList[0]
 					
 					uni.hideLoading()
 					

+ 18 - 2
pagesFinance/user/stationsList.vue

@@ -1,7 +1,18 @@
 <template>
 	<view>
-		<u-navbar title="我的站点"></u-navbar>
-	 
+		<u-navbar title="我的站点">
+			<view  slot="right" >
+				
+				<view  @click="adddevice()"  
+				 style="margin-right: 10px;" >
+					添加设备
+				</view>
+				
+			</view>
+			
+		</u-navbar>
+		
+		
 		<view class="deviceList" 	>
 		<view style="text-align: center;margin-top: 100px" v-if="!list.length">
 			<img src="@/assets/img/blankpage.png">
@@ -116,6 +127,11 @@
 			}
 		},
 		methods: {
+			adddevice(){
+				uni.redirectTo({
+					url:'/pagesFinance/user/activatedChargingPile'
+				})
+			},
 			change1(e){
 				this.form.type=e
 				if(e==-1){