zhengkaixin vor 2 Jahren
Ursprung
Commit
13cf97dee5
3 geänderte Dateien mit 347 neuen und 195 gelöschten Zeilen
  1. 8 0
      pages.json
  2. 76 195
      pagesFinance/user/confirmBinding.vue
  3. 263 0
      pagesFinance/user/confirmBindingStep2.vue

+ 8 - 0
pages.json

@@ -311,6 +311,14 @@
                 "enablePullDownRefresh": false
             }
             
+        },{
+            "path" : "pagesFinance/user/confirmBindingStep2",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "",
+                "enablePullDownRefresh": false
+            }
+            
         }
         ,{
             "path" : "pagesFinance/user/activateResults",

+ 76 - 195
pagesFinance/user/confirmBinding.vue

@@ -1,193 +1,78 @@
 <template>
-	<view>
-		<ujp-navbar title="确认绑定"></ujp-navbar>
-		<view class="equipment-infos">
-			<view class="item">
-				<view class="title">
-					设备编号
-				</view>
-				<view class="content">
-					{{obj1.deviceNo}}
-				</view>
-			</view>
-		
-			<view class="item">
-				<view class="title">
-					设备类型
-				</view>
-				<view class="content">
-					{{obj1.interfaceType}}{{obj1.chargingType}}
-				</view>
-			</view>
-			<view class="item" v-if="obj1.chargingPower">
-				<view class="title">
-					设备功率
-				</view>
-				<view class="content">
-					{{obj1.chargingPower}}kW
-				</view>
-			</view>
+	<view style="background-color: #fff;">
+		<ujp-navbar :title="newsDetail.title"></ujp-navbar>
+		<view class="main">
 			
-		</view>
-		
-		<view class="equipment-infos">
-			<view class="item">
-				<view class="title">
-					桩主姓名
-				</view>
-				<view class="content">
-					{{obj2.contacts}}
-				</view>
-			</view>
-			<view class="item">
-				<view class="title">
-					联系电话
-				</view>
-				<view class="content">
-					{{obj2.contactPhone}}
-				</view>
-			</view>
-			<view class="item">
-				<view class="title">
-					安装地址
-				</view>
-				<view class="content">
-					{{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="item">
-			<view class="title">
-				设备名称
-			</view>
-			<view class="content">
-				{{obj1.name}}
-			</view>
-		</view> -->
-		<view class="equipment-infos">
-			<view class="item">
-				<view class="title">
-					<text>*</text>站点名称
-				</view>
-				<view class="content" style="color: #acacac;">
-					
-				<u-input v-model="stationName"
-				 :placeholder="obj2.name"
-				 @focus="focus(0)"
-				 type="text" :border="false" />
-
-				</view>
-			</view>
-			<view class="item">
-				<view class="title">
-					<text>*</text>车位号
-				</view>
-				<view class="content" style="color: #acacac;">
-					
-				<u-input v-model="deviceName"
-				 @focus="focus(1)"
-				 :placeholder="obj1.name"
-				 type="text" :border="false" />
 			
-				</view>
+			<view class="news-content" v-html="newsDetail.value">
+				 
 			</view>
 		</view>
-		<button class="btn" @click="submit">确认绑定并激活</button>
-		<view  style="text-align: center; margin-top: 10px;color: #275cbf;"
-		 @click="gotoUrl('pagesFinance/news/index?code=AZSM')" >查看安装说明文档</view>
+		<button class="btn" @click="submit">我已阅读并同意<<{{newsDetail.title}}>></button>
+		
 	</view>
 </template>
 
 <script>
+	import * as newsApi from '@/apis/news.js'
 	import * as API from '@/apis/finance.js'
 	
 	export default {
 		data() {
 			return {
-				id:"",
+				id: '',
+				code:"",
 				stationId:"",
-				obj1:{},obj2:{},
-				stationName:"",
-				deviceName:"",
-				objlist:[],
-				isswitchshow:false,
-				columnsindex:[0],
+				newsDetail: '',
+				obj1:{},
 			}
 		},
 		onLoad(op) {
 			if(op.id){
-				this.stationId=op.stationId;
 				this.id=op.id
+				
 				this.getInfo()
 			}
-		},
-	
-		onReady() {
-			
+			if(op.stationId){
+				this.stationId=op.stationId;
+				
+			}
 		},
 		methods: {
-			focus(k){
-				if(k==0){
-					if(!this.stationName){
-						this.stationName=this.obj2.name;
-					}
-				
-				}
-				if(k==1){
-					if(!this.deviceName){
-						this.deviceName=this.obj1.name;
-					}
-				}
-			},
-			switchBtn(e){
-				this.columnsindex=e;
-				
-				this.obj2=this.objlist[e[0]]
-			
-				//
-			},
 			submit(){
-				if(!this.stationName){
-					this.stationName=this.obj2.name;
-				}
-				if(!this.deviceName){
-					this.deviceName=this.obj1.name;
+				var url="/pagesFinance/user/confirmBindingStep2?id="+this.id;
+				if(this.stationId){
+					url+="&stationId="+this.stationId;
 				}
-			
+				uni.navigateTo({
+					url:url
+					
+				})
+			},
+			getNewsInfoDetail() {
 				uni.showLoading({
 					title: "加载中",
 					mask: true,
 				})
-				API.bindCategoryDevice({
-					deviceNo:this.id,
-					stationName:this.stationName,
-					deviceName:this.deviceName,
-					stationId:this.obj2.id
-				}).then((res) => {
-					//this.obj = res.data
-				
+				var list=["","buyType1","buyType2"]
 				
-					uni.hideLoading()
-					uni.redirectTo({
-						url:"/pagesFinance/user/activateResults"
+				newsApi.findConfigureByKey({
+					key:"buyType"+this.code
+				}).then((res) => {
+					uni.hideLoading()					
+					this.newsDetail = res.data;
+					this.$nextTick(()=>{
+					    var list =document.getElementsByClassName("news-content")[0].getElementsByTagName("img");
+					    for(var i=0;i<list.length;i++){
+					        list[i].style='width: 100%;height: 100%;'
+					    }
 					})
-					
 				}).catch(error => {
 					uni.showToast({
-						title: error
+						title: error,
+						icon: "none"
 					})
 				})
-				
 			},
 			getInfo(){
 				uni.showLoading({
@@ -198,15 +83,16 @@
 				
 					deviceNo:this.id
 				}
-				if(this.stationId){
-					obj.stationId=this.stationId
-					
-				}
+				
 				
 				API.findByDeviceNo(obj).then((res) => {
 					this.obj1 = res.data.chargingDevice
-					this.objlist= res.data.chargingStationList;
-					this.obj2 = res.data.chargingStationList[0]
+					this.code=this.obj1.buyType
+					if(this.code){
+						this.getNewsInfoDetail();
+					}else{
+						this.submit()
+					}
 					
 					uni.hideLoading()
 					
@@ -217,47 +103,42 @@
 				})
 			}
 		}
-	}
+	}	
 </script>
 
 <style lang="scss" scoped>
-	page{
-		background-color: #f3f4f7;
-	}
-	.equipment-infos{
-		margin-bottom: 12px;
-		background-color: #fff;
-		.item:last-of-type{
-			border-bottom: none;
+	.main{
+		
+		margin: 0px 16px ;
+		padding-bottom: 34px;
+		.new-title{
+			color: #101010;
+			font-size: 18px;
+			height: 48px;
+			margin: 16px 0 35px;
 		}
-		.item{
-			padding: 11px 0;
-			line-height: 22px;
+		.time{
 			display: flex;
-			
-			margin-left: 32rpx;
-			border-bottom: solid 1px #C2C2C2;
-			font-size: 16px;
-			.title{
-				width: 80px;
-			
-				color: #777777;
-				text{
-					color: #ee3138;
-				}
-			}
-			.content{
-				flex: 1;
-				color: rgba(16, 16, 16, 1);
+			justify-content: space-between;
+			color: #888888;
+			.num{
+				margin-left: 4px;
 			}
+			
 		}
+		.news-content{
+			margin-top: 13px;
+			font-size: 14px;
+			line-height: 28px;
+			color: #101010;
+		}
+	}
+	.btn{
+		 width: 91.4%;
+		 line-height: 44px;
+		 border-radius: 8px;
+		 background-color: rgba(24, 90, 198, 1);
+		 color: rgba(255, 255, 255, 1);
+		 font-size: 16px;
 	}
- .btn{
-	 width: 91.4%;
-	 line-height: 44px;
-	 border-radius: 8px;
-	 background-color: rgba(24, 90, 198, 1);
-	 color: rgba(255, 255, 255, 1);
-	 font-size: 16px;
- }
 </style>

+ 263 - 0
pagesFinance/user/confirmBindingStep2.vue

@@ -0,0 +1,263 @@
+<template>
+	<view>
+		<ujp-navbar title="确认绑定"></ujp-navbar>
+		<view class="equipment-infos">
+			<view class="item">
+				<view class="title">
+					设备编号
+				</view>
+				<view class="content">
+					{{obj1.deviceNo}}
+				</view>
+			</view>
+		
+			<view class="item">
+				<view class="title">
+					设备类型
+				</view>
+				<view class="content">
+					{{obj1.interfaceType}}{{obj1.chargingType}}
+				</view>
+			</view>
+			<view class="item" v-if="obj1.chargingPower">
+				<view class="title">
+					设备功率
+				</view>
+				<view class="content">
+					{{obj1.chargingPower}}kW
+				</view>
+			</view>
+			
+		</view>
+		
+		<view class="equipment-infos">
+			<view class="item">
+				<view class="title">
+					桩主姓名
+				</view>
+				<view class="content">
+					{{obj2.contacts}}
+				</view>
+			</view>
+			<view class="item">
+				<view class="title">
+					联系电话
+				</view>
+				<view class="content">
+					{{obj2.contactPhone}}
+				</view>
+			</view>
+			<view class="item">
+				<view class="title">
+					安装地址
+				</view>
+				<view class="content">
+					{{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="item">
+			<view class="title">
+				设备名称
+			</view>
+			<view class="content">
+				{{obj1.name}}
+			</view>
+		</view> -->
+		<view class="equipment-infos">
+			<view class="item">
+				<view class="title">
+					<text>*</text>站点名称
+				</view>
+				<view class="content" style="color: #acacac;">
+					
+				<u-input v-model="stationName"
+				 :placeholder="obj2.name"
+				 @focus="focus(0)"
+				 type="text" :border="false" />
+
+				</view>
+			</view>
+			<view class="item">
+				<view class="title">
+					<text>*</text>车位号
+				</view>
+				<view class="content" style="color: #acacac;">
+					
+				<u-input v-model="deviceName"
+				 @focus="focus(1)"
+				 :placeholder="obj1.name"
+				 type="text" :border="false" />
+			
+				</view>
+			</view>
+		</view>
+		<button class="btn" @click="submit">确认绑定并激活</button>
+		<view  style="text-align: center; margin-top: 10px;color: #275cbf;"
+		 @click="gotoUrl('pagesFinance/news/index?code=AZSM')" >查看安装说明文档</view>
+	</view>
+</template>
+
+<script>
+	import * as API from '@/apis/finance.js'
+	
+	export default {
+		data() {
+			return {
+				id:"",
+				stationId:"",
+				obj1:{},obj2:{},
+				stationName:"",
+				deviceName:"",
+				objlist:[],
+				isswitchshow:false,
+				columnsindex:[0],
+			}
+		},
+		onLoad(op) {
+			if(op.id){
+				this.stationId=op.stationId;
+				this.id=op.id
+				this.getInfo()
+			}
+		},
+	
+		onReady() {
+			
+		},
+		methods: {
+			focus(k){
+				if(k==0){
+					if(!this.stationName){
+						this.stationName=this.obj2.name;
+					}
+				
+				}
+				if(k==1){
+					if(!this.deviceName){
+						this.deviceName=this.obj1.name;
+					}
+				}
+			},
+			switchBtn(e){
+				this.columnsindex=e;
+				
+				this.obj2=this.objlist[e[0]]
+			
+				//
+			},
+			submit(){
+				if(!this.stationName){
+					this.stationName=this.obj2.name;
+				}
+				if(!this.deviceName){
+					this.deviceName=this.obj1.name;
+				}
+			
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				API.bindCategoryDevice({
+					deviceNo:this.id,
+					stationName:this.stationName,
+					deviceName:this.deviceName,
+					stationId:this.obj2.id
+				}).then((res) => {
+					//this.obj = res.data
+				
+				
+					uni.hideLoading()
+					uni.redirectTo({
+						url:"/pagesFinance/user/activateResults"
+					})
+					
+				}).catch(error => {
+					uni.showToast({
+						title: error
+					})
+				})
+				
+			},
+			getInfo(){
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				var obj={
+				
+					deviceNo:this.id
+				}
+				if(this.stationId){
+					obj.stationId=this.stationId
+					
+				}
+				
+				API.findByDeviceNo(obj).then((res) => {
+					this.obj1 = res.data.chargingDevice
+					this.objlist= res.data.chargingStationList;
+					this.obj2 = res.data.chargingStationList[0]
+					
+					uni.hideLoading()
+					
+				}).catch(error => {
+					uni.showToast({
+						title: error
+					})
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	page{
+		background-color: #f3f4f7;
+	}
+	.equipment-infos{
+		margin-bottom: 12px;
+		background-color: #fff;
+		.item:last-of-type{
+			border-bottom: none;
+		}
+		.item{
+			padding: 11px 0;
+			line-height: 22px;
+			display: flex;
+			
+			margin-left: 32rpx;
+			border-bottom: solid 1px #C2C2C2;
+			font-size: 16px;
+			.title{
+				width: 80px;
+			
+				color: #777777;
+				text{
+					color: #ee3138;
+				}
+			}
+			.content{
+				flex: 1;
+				color: rgba(16, 16, 16, 1);
+			}
+		}
+	}
+ .btn{
+	 width: 91.4%;
+	 line-height: 44px;
+	 border-radius: 8px;
+	 background-color: rgba(24, 90, 198, 1);
+	 color: rgba(255, 255, 255, 1);
+	 font-size: 16px;
+ }
+</style>