Browse Source

Merge branch 'master' of http://47.92.161.104:10080/zkx/JP-ChargeTeam51 into master

zhupeng 3 years ago
parent
commit
87d5a28731
4 changed files with 349 additions and 15 deletions
  1. 37 8
      pages/index/index.vue
  2. 50 0
      pages/login/login.vue
  3. 194 7
      pages/searchPile/chargeProcess/dcCharging.vue
  4. 68 0
      pages/user/data.vue

+ 37 - 8
pages/index/index.vue

@@ -19,7 +19,7 @@
 				</view>
 
 			</view>
-			<view class="list-item">
+			<view class="list-item" @click="fastRecharge">
 				<view class="icon iconfont" style="background-color:#4BD2C0;">
 					&#xe629;
 				</view>
@@ -28,7 +28,7 @@
 				</view>
 
 			</view>
-			<view class="list-item">
+			<view class="list-item" @click="chargingRecord">
 				<view class="icon iconfont" style="background-color: #6FA5FF;">
 					&#xe625;
 				</view>
@@ -88,7 +88,7 @@
 					<view class="text-2">
 						授权定位后可查询附近充电站
 					</view>
-					<view class="text-3">
+					<view class="text-3" @click="getPoint()">
 						重新定位
 					</view>
 				</view>
@@ -195,6 +195,7 @@
 	export default {
 		data() {
 			return {
+				userId: '',
 				newsList: [],
 				pageIndex: 1,
 				recordsTotal: 0,
@@ -235,6 +236,10 @@
 			}
 		},
 		onReady() {
+			if(this.carhelp.getPersonInfo().id != null) {
+				this.userId = this.carhelp.getPersonInfo().id;
+			}
+			
 			WxJsApi.getWxConfig(['getLocation','addEventListener','scanQRCode']).then((res)=>{
 				// console.log(res)
 			}).catch(error => {
@@ -252,11 +257,35 @@
 			},
 			//微信扫二维码
 			scanCode() {
-				WxJsApi.scanQRCode(1).then(res => {
-					
-				}).catch(error => {
-					
-				})
+				if(this.userId != null) {
+					WxJsApi.scanQRCode(1).then(res => {
+						
+					}).catch(error => {
+						
+					})
+				} else {
+					uni.redirectTo({
+						url: '/pages/login/login'
+					})
+				}
+			},
+			fastRecharge() {
+				if(this.userId != null) {
+					this.gotoUrl('pages/user/finance/recharge?id=' + this.userId)
+				} else {
+					uni.redirectTo({
+						url: '/pages/login/login'
+					})
+				}
+			},
+			chargingRecord() {
+				if(this.userId != null) {
+					this.gotoUrl('pages/user/finance/rechargeList?id=' + this.userId)
+				} else {
+					uni.redirectTo({
+						url: '/pages/login/login'
+					})
+				}
 			},
 			getPoint() {
 				WxJsApi.getLocation().then((res) => {

+ 50 - 0
pages/login/login.vue

@@ -125,7 +125,57 @@
 				this.value = !this.value;
 			},
 			login() {
+				var checkPhoneResult = checkPhone(this.form.telephone);
+				
+				if(!this.form.telephone || checkPhoneResult != true) {
+					uni.showToast({
+						title: checkPhoneResult,
+						icon: "none"
+					})
+					return;
+				}
+				if(!this.form.verifyCode) {
+					uni.showToast({
+						title: "请输入验证码",
+						icon: "none"
+					})
+					return
+				}
+				if(!this.value) {
+					uni.showToast({
+						title: "请勾选协议",
+						icon: "none"
+					})
+					return
+				}
 				
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})		
+				loginApi.validateCode({
+					verifyCode: this.form.verifyCode,
+					telephone: this.form.telephone,
+					openId: this.carhelp.getOpenId(),
+				}).then((response) => {
+					uni.hideLoading();
+					
+					var token = response ? response.data.token : '';
+					this.carhelp.setToken(token);
+					this.carhelp.setPersonInfo(response.data.regUser);
+					
+					uni.redirectTo({
+						url: '/pages/index/index'
+					})
+					// uni.switchTab({
+					// 	url: '/pages/index/index'
+					// })
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
 			}
 		}
 	}

+ 194 - 7
pages/searchPile/chargeProcess/dcCharging.vue

@@ -1,5 +1,5 @@
 <template>
-	<view style="background-color: #fff;">
+	<view style="background-color: #fff; padding-bottom: 196px;">
 		<u-navbar title="启动中">
 		</u-navbar>
 		<view class="iconfont tittle-font">
@@ -7,14 +7,98 @@
 		</view>
 		
 		<view class="progress-bar">
-				<u-circle-progress width="300" active-color="#2979ff" :percent="0">
+				<u-circle-progress width="500" active-color="#2979ff" :percent="0" border-width="50">
 					<view class="u-progress-content">
 						<view class="u-progress-dot"></view>
 						<text class='u-progress-info'>0.0%</text>
 					</view>
 				</u-circle-progress>
 		</view>
+		<view class="starting">
+			启动中...</view>
+		<view class="timer">
+			00:00:00
+		</view>
+		<view class="charged">
+			已充电0度
+		</view>
+		<view class="cost">
+			<view class="">
+				<view class="cost-top">
+					0元
+				</view>
+				<view class="cost-bottom">
+					实时费用
+				</view>
+			</view>
+			<view class="line"></view>
+			<view class="">
+				<view class="cost-top">
+					50.00元
+					<view class="iconfont cost-font">&#xe633;</view>
+				</view>
+				<view class="cost-bottom">
+					账户余额
+				</view>
+			</view>
+		</view>
+		<view class="power">
+			<view>
+				<view class="power-num">
+					0.0v
+				</view>
+				<view class="power-text">
+					电压
+				</view>
+			</view>
+			<view class="line"></view>
+			<view>
+				<view class="power-num">
+					0.00kW
+				</view>
+				<view class="power-text">
+					功率
+				</view>
+			</view>
+			<view class="line"></view>
+			<view>
+				<view class="power-num">
+					0.0A
+				</view>
+				<view class="power-text">
+					电流
+				</view>
+			</view>
+		</view>
+	     <view class="info">
+	     	<view class="info-name">
+	     		充电车辆
+	     	</view>
+			<view class="info-text">
+				鄂D999999
+			</view>
+	     </view>
+		 <view class="info">
+		 	<view class="info-name">
+		 		站点
+		 	</view>
+		 			<view class="info-text">
+		 				荆鹏软件充电站 / A000152
+		 			</view>
+		 </view>
+		 <view class="info">
+		 	<view class="info-name">
+		 		占位费说明
+		 	</view>
+		 			<view class="info-text">
+		 				停止充电后30分钟即开始收取占位费用,1元/分钟
+		 			</view>
+		 </view>
+		<view class="bottom">
+			 <u-button type="primary" shape="circle">主要按钮</u-button>
+		</view>
 	</view>
+	
 </template>
 
 <script>
@@ -31,9 +115,9 @@
 	}
 	
 .progress-bar{
-	margin:10px auto;
-	width: 220px;
-	height: 220px;
+	margin:0 auto;
+	width: 100%;
+	// height: 400px;
 	
 	
 	.u-progress-content {
@@ -41,6 +125,9 @@
 			align-items: center;
 			justify-content: center;
 		}
+		/deep/.u-circle-progress{
+			margin: 0 auto;
+		}
 		
 		.u-progress-dot {
 			width: 16rpx;
@@ -50,9 +137,10 @@
 		}
 		
 		.u-progress-info {
-			font-size: 28rpx;
+			font-size: 36px;
 			padding-left: 16rpx;
-			letter-spacing: 2rpx
+			letter-spacing: 2rpx;
+			color: rgba(51, 51, 51, 100);
 		}
 		/deep/.u-progress-dot[data-v-05b104e0]{
 			display: none;
@@ -62,4 +150,103 @@
 		}
 	
 }
+
+.starting{
+	height: 22px;
+	color: rgba(0, 185, 98, 100);
+	font-size: 16px;
+	text-align: center;
+}
+.timer{
+	height: 43px;
+	color: rgba(51, 51, 51, 100);
+	font-size: 36px;
+	text-align: center;
+	margin-top: 40px;
+}
+.charged{
+	height: 20px;
+	color: rgba(153, 153, 153, 100);
+	font-size: 14px;
+	text-align: center;
+	margin-top: 4px;
+}
+.cost{
+	// width: 50%;
+	padding: 0 90px;
+	margin-top: 16px;
+	display: flex;
+	justify-content: space-between;
+	.cost-top{
+		line-height: 33px;
+		text-align: center;
+		font-size: 24px;
+		position: relative;
+		.cost-font{
+			position: absolute;
+			top: 0;right: -25px;
+			color: #ff6200;
+			font-size: 24px
+		}
+	}
+	.cost-bottom{
+		line-height: 20px;
+		color: #999999;text-align: center;
+	}
+}
+.line{
+	width: 0;
+	height:36px;
+	border: 1px solid rgba(237, 237, 237, 100);
+	margin-top: 10px;
+	background-color: #ededed;
+}
+
+.power{
+	display: flex;
+	justify-content: space-around;
+	padding: 0 55px;
+	margin-top: 40px;
+	.power-num{
+		height: 27px;
+		color: rgba(51, 51, 51, 100);
+		font-size: 20px;
+		text-align: center;
+	}
+	.power-text{
+		height: 20px;
+		color: rgba(153, 153, 153, 100);
+		font-size: 14px;
+		text-align: center;
+	}
+}
+
+.info{
+	display: flex;
+	justify-content: space-between;
+	margin: 0 40px;
+	// height: 48px;
+	line-height: 48px;
+	background-color: rgba(255, 255, 255, 100);
+	color: rgba(16, 16, 16, 100);
+	border-bottom: 1px solid #ededed;
+	.info-text{
+		line-height: 23px;
+		padding: 13px 0 12px;
+		width: 200px;
+		text-align: right;
+	}
+}
+
+.bottom{
+	  width: 343px;
+	  position: fixed;
+	  bottom: 0;
+	  left: 0;
+	  right: 0;
+	  margin: auto;
+	  .u-btn--primary[data-v-3bf2dba7]{
+		  background-color: #9be6c2;
+	  }
+}
 </style>

+ 68 - 0
pages/user/data.vue

@@ -0,0 +1,68 @@
+<template>
+	<view>
+		<u-navbar title="个人资料"></u-navbar>
+		<view class="data">
+			<view class="data-img">
+				<view class="data-icon">
+					<u-icon name="camera-fill" custom-prefix="custom-icon" color="#fff" size="32"></u-icon>
+				</view>
+				<u-avatar src="/static/img/head.png" size="216"></u-avatar>
+			</view>
+			<view class="data-input">
+				<u-form :model="form" ref="uForm" >
+					<u-form-item label-position="top" label="昵称"><u-input v-model="form.name" /></u-form-item>
+				</u-form>
+			</view>
+			<u-button class="login-btn" type="success" shape="circle" @click="submit">提交</u-button>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				form: {
+					name: '',
+				},
+			}
+		},
+		methods: {
+		}
+	}
+</script>
+<style>
+	page{
+		background: #fff;
+	}
+</style>
+<style lang="scss" scoped>
+	.data-icon{
+		height: 28px;
+		width: 28px;
+		background-color: #00B962;
+		border-radius: 14px;
+		border: 2px solid #fff;
+		text-align: center;
+		line-height: 24px;
+		position: absolute;
+		z-index: 999;
+		right: 0;
+		bottom:0px
+	}
+	.data-img{
+		margin: 30px auto;
+		height: 108px;
+		width: 108px;
+		position: relative;
+	}
+	.data-input{
+		margin: 0 40px;
+	}
+	.login-btn {
+		margin: 28px ;
+		background-color:#00B962!important;
+		border-color: #00B962!important;
+		color:#fff!important;
+	}
+</style>