Explorar el Código

调整 车辆认证

zhengkaixin hace 1 año
padre
commit
f610986a68

+ 2 - 2
.env.dev.js

@@ -2,7 +2,7 @@ const UNI_APP = {
 	ProjectName :"51充电联盟",
 	BASE_URL: 'https://51team.xiaoxinda.com/charging-station-server/',
 
-	//BASE_URL: 'https://charging.xiaoxinda.com/charging-station-test/',
+	BASE_URL: 'https://charging.xiaoxinda.com/charging-station-test/',
 
 	//BASE_URL: 'http://192.168.77.162:8081/charging-station/' ,
 	//PARK_URL: 'http://192.168.11.120:8082/charging-parking/' ,
@@ -15,7 +15,7 @@ const UNI_APP = {
 	//defaultStation:[],
 	openId:"zkxtest",//zkx
 	
-	//openId:"oK9Wr54VbEh3xvWYmD_zT5NbH4AY",//zkx
+	openId:"oK9Wr54VbEh3xvWYmD_zT5NbH4AY",//zkx
 	//openId:"oK9Wr59rru-i3bm7dtTtxnkR-i4s",//杨所
 	//openId:"oK9Wr56vX9nP_B56_Pyigg5n5Ce8",//
 	//openId:"oK9Wr5_2USr1yP4MRew9KbJA0-ng",//老板

+ 2 - 8
apis/common.js

@@ -52,18 +52,12 @@ export function upload(formData) {
 
 //上传图片
 export function uploadBase64(formData) {
-	var localData = formData.photoFile?formData.photoFile:formData.photoBase64Data;
-	
-	if (localData.indexOf('data:image') != 0) {
-	    //判断是否有这样的头部
-	    localData = 'data:image/jpeg;base64,' + localData
-	}
-	formData.photoBase64Data = localData.replace(/\r|\n/g, '').replace('data:image/jgp', 'data:image/jpeg')
 	
 	
 	return request({
-		url: '/mobile/jobUserApi/uploadBase64',
+		url: '/uploadBase64',
 		data: formData,
+		
 		method: 'post',
 		timeout: 60000,
 	})

+ 5 - 2
apis/user.js

@@ -50,8 +50,11 @@ export function exchangeGroupDetail (data) {
 	 var data={
 		 group:data
 	 }
-	 if (process.env.NODE_ENV === "development"&&process.car.BASE_URL=='https://charging.xiaoxinda.com/charging-station-test/') {
-		//  data.jumpFive=1
+	 // if (process.env.NODE_ENV === "development"&&process.car.BASE_URL=='https://charging.xiaoxinda.com/charging-station-test/') {
+		//   data.jumpFive=1
+	 // }
+	 if (process.car.BASE_URL=='https://charging.xiaoxinda.com/charging-station-test/') {
+	 		  data.jumpFive=1
 	 }
 	return request({
 		method: 'post',

BIN
assets/img/carDet/authtest.png


+ 6 - 0
assets/img/carDet/riFill-arrow-right-circle-fill.svg

@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32" width="20" height="20" style="border-color: rgba(0,0,0,0);border-width: bpx;border-style: undefined" filter="none">
+    
+    <g>
+    <path d="M16 2.667c7.36 0 13.333 5.973 13.333 13.333s-5.973 13.333-13.333 13.333-13.333-5.973-13.333-13.333 5.973-13.333 13.333-13.333zM16 14.667h-5.333v2.667h5.333v4l5.333-5.333-5.333-5.333v4z" fill="rgba(88.99499999999999,196.095,146.11499999999998,1)"></path>
+    </g>
+  </svg>

+ 6 - 0
assets/img/carDet/riFill-parking-box-fill.svg

@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32" width="20" height="20" style="border-color: rgba(0,0,0,0);border-width: bpx;border-style: undefined" filter="none">
+    
+    <g>
+    <path d="M14.667 18.667h2c2.577 0 4.667-2.089 4.667-4.667s-2.089-4.667-4.667-4.667v0h-4.667v13.333h2.667v-4zM5.333 4h21.333c0.736 0 1.333 0.597 1.333 1.333v0 21.333c0 0.736-0.597 1.333-1.333 1.333v0h-21.333c-0.736 0-1.333-0.597-1.333-1.333v0-21.333c0-0.736 0.597-1.333 1.333-1.333v0zM14.667 12h2c1.105 0 2 0.895 2 2s-0.895 2-2 2v0h-2v-4z" fill="rgba(88.99499999999999,196.095,146.11499999999998,1)"></path>
+    </g>
+  </svg>

+ 6 - 0
assets/img/carDet/riFill-ticket-2-fill.svg

@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32" width="20" height="20" style="border-color: rgba(0,0,0,0);border-width: bpx;border-style: undefined" filter="none">
+    
+    <g>
+    <path d="M28 4c0.736 0 1.333 0.597 1.333 1.333v0 7.333c-1.841 0-3.333 1.492-3.333 3.333s1.492 3.333 3.333 3.333v0 7.333c0 0.736-0.597 1.333-1.333 1.333v0h-24c-0.736 0-1.333-0.597-1.333-1.333v0-7.333c1.841 0 3.333-1.492 3.333-3.333s-1.492-3.333-3.333-3.333v0-7.333c0-0.736 0.597-1.333 1.333-1.333v0h24zM21.333 12h-10.667v8h10.667v-8z" fill="rgba(88.99499999999999,196.095,146.11499999999998,1)"></path>
+    </g>
+  </svg>

+ 112 - 124
pages/index/index.vue

@@ -65,81 +65,7 @@
 				</view>
 			</view>
 
-			<u-modal v-if="false" v-model="showNt" class="showOss" :show-title="false" :show-confirm-button="false">
-				<view class="slot-content">
-
-					<u-image width="600" style="margin: auto;min-height: 250px;" mode="widthFix" v-show="showNtStep==0"
-						src="@/assets/img/nt/f5surprised-1.png">
-
-						<view slot="loading" style="height: 200px;">
-							<u-loading mode="flower" size="186">
-
-							</u-loading>
-
-						</view>
-
-					</u-image>
-					<view style="color: #ecc07d;
-							font-size: 64rpx;
-							position: relative;
-							top: -220rpx;
-							right: -100rpx; width: 400rpx;" @click="showNtStepClick" v-show="showNtStep==0">
-						<span>.</span>
-					</view>
-
-					<u-image width="600" style="margin: auto;;min-height: 250px;" mode="widthFix"
-						v-show="showNtStep==1" src="@/assets/img/nt/f5surprised-2.png">
-
-					</u-image>
-					<u-image width="600" style="margin: auto;;min-height: 250px;" mode="widthFix"
-						v-show="showNtStep==2" src="@/assets/img/nt/nt-activity-3.png">
-
-					</u-image>
-					<u-image width="500" style="color: #FFFFFF;
-							font-size: 64rpx;
-							position: relative;
-							top: -540rpx;
-							right: -60rpx;height: 0;
-						" mode="widthFix" v-show="showNtStep==2" src="@/assets/img/nt/f5surprised-3.png">
-
-					</u-image>
-
-					<u-image width="36px" v-show="showNtStep==1||showNtStep==2" style="margin: auto; " mode="widthFix"
-						@click="showNt=false" src="../../assets/img/if-close-line-circled.png"></u-image>
-					<view style="color: #ecc07d;
-							font-size: 72rpx;
-							position: relative;
-							top: -280rpx;
-							right: -144rpx; width: 310rpx;" @click="showNtStepClick" v-show="showNtStep==2">
-						<span>.</span>
-					</view>
-					<view style="color: #FFFFFF;
-							font-size: 64rpx;
-							position: relative;
-							top: -688rpx;
-							right: -80rpx;" :style="{
-						right:showNtValue>99?'-80rpx':(showNtValue>9?'-95rpx':'-110rpx')
-					}" v-show="showNtStep==1"><b>{{showNtValue}}</b>
-						<span style="font-size: 28rpx;">元</span>
-					</view>
-
-					<view style="color: #ecc07d;
-					 		font-size: 72rpx;
-					 		position: relative;
-					 		top: -390rpx;
-					 		right: -144rpx; width: 310rpx;" @click="showNtStepClick" v-show="showNtStep==1">
-						<span>.</span>
-					</view>
-
-					<view v-show="showNtStep==1" style="color: #ecc07d;
-					 		font-size: 32rpx;
-					 		position: relative;
-					 		top: -180rpx;
-					 		right: -60rpx; width: 440rpx;">注:逢5红包用完后下次才可以领取新红包哦!</view>
-
-
-				</view>
-			</u-modal>
+			
 
 
 			<u-modal v-model="showOss" class="showOss" :show-title="false" :show-confirm-button="false">
@@ -193,26 +119,11 @@
 
 						</view>
 					</view> -->
-			<u-modal v-model="showTop" class="showOss" :show-title="false" :show-confirm-button="false">
+			<u-modal v-model="showTop" v-if="getBannerInfoTopBl" class="showOss" :show-title="false" :show-confirm-button="false">
 				<view class="slot-content" >
 					<swiper class="swiper" circular :indicator-dots="true" :autoplay="true" :interval="2500"
 									:duration="500">
-							<swiper-item class="swiperitem" v-for="(item,i) in bannerListTop" :key="i">
-										
-					
-					
-					<u-image width="500" height="500"  bgColor="#ff000000" style="margin: auto;min-height: 250px;"
-						mode="widthFix" @click="clickBannerTopI(i)" :src="item.picUrl">
-						<view slot="loading" style="height: 200px;">
-							<u-loading mode="flower" size="186">
-					
-							</u-loading>
-					
-						</view>
-					
-					</u-image>
-					
-						</swiper-item>
+							
 						<swiper-item class="swiperitem" v-if="showNt">
 							
 							
@@ -235,7 +146,7 @@
 									<span>.</span>
 								</view>
 							
-								<u-image width="600" style="margin: auto;;min-height: 250px;" mode="widthFix"
+								<u-image width="600" height="700" style="margin: auto;;min-height: 250px;" mode="scaleToFill"
 									v-show="showNtStep==1" src="@/assets/img/nt/f5surprised-2.png">
 							
 								</u-image>
@@ -252,19 +163,19 @@
 							
 								</u-image>
 							
-								<u-image width="36px" v-show="showNtStep==1||showNtStep==2" style="margin: auto; " mode="widthFix"
-									@click="showNt=false" src="../../assets/img/if-close-line-circled.png"></u-image>
+							
 								<view style="color: #ecc07d;
 										font-size: 72rpx;
 										position: relative;
-										top: -280rpx;
+										top: -180rpx;
 										right: -144rpx; width: 310rpx;" @click="showNtStepClick" v-show="showNtStep==2">
 									<span>.</span>
 								</view>
+								
 								<view style="color: #FFFFFF;
 										font-size: 64rpx;
 										position: relative;
-										top: -688rpx;
+										top: -528rpx;
 										right: -80rpx;" :style="{
 									right:showNtValue>99?'-80rpx':(showNtValue>9?'-95rpx':'-110rpx')
 								}" v-show="showNtStep==1"><b>{{showNtValue}}</b>
@@ -274,20 +185,32 @@
 								<view style="color: #ecc07d;
 								 		font-size: 72rpx;
 								 		position: relative;
-								 		top: -390rpx;
+								 		top: -270rpx;
 								 		right: -144rpx; width: 310rpx;" @click="showNtStepClick" v-show="showNtStep==1">
 									<span>.</span>
 								</view>
 							
-								<!-- <view v-show="showNtStep==1" style="color: #ecc07d;
-								 		font-size: 32rpx;
-								 		position: relative;
-								 		top: -180rpx;
-								 		right: -60rpx; width: 440rpx;">注:逢5红包用完后下次才可以领取新红包哦!</view> -->
 							
 							
 							
 						</swiper-item>
+						
+						<swiper-item class="swiperitem" v-for="(item,i) in bannerListTop" :key="i">
+											
+						
+						
+						<u-image width="500" height="500"  bgColor="#ff000000" style="margin: auto;min-height: 250px;"
+							mode="widthFix" @click="clickBannerTopI(i)" :src="item.picUrl">
+							<view slot="loading" style="height: 200px;">
+								<u-loading mode="flower" size="186">
+						
+								</u-loading>
+						
+							</view>
+						
+						</u-image>
+						
+							</swiper-item>
 					</swiper>
 				
 				
@@ -726,6 +649,18 @@
 				登录显示更多会员服务
 				<text class="button" @click="toLogin">登录/注册</text>
 			</view>
+		</view>
+		
+		<view  class="slogan-4 "  v-show="couponList.length||bannerListTop.length"
+		
+		 @click="showTop=true,getBannerInfoTopBl=true">
+		 
+						<u-icon   :class="{
+							imageshake :couponList.length&&showNtStep==0
+						 }"
+						 size="45"
+						 name="gift"></u-icon>
+		
 		</view>
 		<Tabbar :current="0" ref="tabbarMain" :elderStatus="elderStatus"></Tabbar>
 	</view>
@@ -779,7 +714,7 @@
 				showTop: false,
 				showTopImg: '',
 				showTopIndex: 0,
-
+				getBannerInfoTopBl:true,
 				show: false,
 				list: [{
 						name: '长辈模式',
@@ -1140,25 +1075,43 @@
 			showNtStepClick() {
 				if (this.showNtStep == 0) {
 
-					if (this.personInfo.userType != 1) {
-						this.redeemF5(this.couponSelect.key);
-					} else {
-						//this.showNt = false;
-						uni.showModal({
-							title: "提示",
-							content: "游客无法兑换,请先注册为会员后再兑换",
-							confirmText: "前往注册",
-							success: res1 => {
-								if (res1.confirm) {
-									uni.navigateTo({
-										url: '/pages/login/login'
-									})
-								} else if (res1.cancel) {
-									//('用户点击取消');
-								}
-							}
+					if (this.personInfo.userType == 1) {
+							this.showTop = false;
+						//this.showNt = false;
+						uni.showModal({
+							title: "提示",
+							content: "游客无法兑换,请先注册为会员后再兑换",
+							confirmText: "前往注册",
+							success: res1 => {
+								if (res1.confirm) {
+									uni.navigateTo({
+										url: '/pages/login/login'
+									})
+								} else if (res1.cancel) {
+									//('用户点击取消');
+								}
+							}
 						})
-
+						
+					}else if(!this.personInfo.carLicense){
+						this.showTop = false;
+						uni.showModal({
+							title: "提示",
+							content: "请先车辆认证后再兑换",
+							confirmText: "车辆信息",
+							success: res1 => {
+								if (res1.confirm) {
+									uni.navigateTo({
+										url: '/pages/user/car/carDet'
+									})
+								} else if (res1.cancel) {
+									//('用户点击取消');
+								}
+							}
+						})
+					}else {
+						
+						this.redeemF5(this.couponSelect.key);
 					}
 
 				} else if (this.showNtStep == 1 || this.showNtStep == 2 || this.showNtStep == 3 || this.showNtStep == 4) {
@@ -1403,7 +1356,7 @@
 				var nowtime = parseUnixTime(currentTimeStamp(), '{y}-{m}-{d}')
 				var time = this.carhelp.get("bannerListTop");
 				if ((time && nowtime == time)) {
-					return;
+					this.getBannerInfoTopBl=false;
 				}
 				uni.showLoading({
 					title: "加载中",
@@ -2817,5 +2770,40 @@
 		}
 	}
 	
-	
+	.slogan-4 {
+		margin-top: 10px;
+		display: flex;
+		    justify-content: center;
+		/* text-decoration: underline; */
+		color: #9F9C99;
+	
+		text-align: center;
+		position: fixed;
+		/* top: 40px; */
+		bottom: 120px;
+		right: 20px;
+		height: 80rpx;
+		width: 80rpx;
+		line-height: 20px;
+		font-size: 16px;
+		background: linear-gradient(95deg, #FF9800, #FF5722);
+		box-shadow: 0 4rpx 24rpx 0 #FF5722;
+		//padding-top: 8px;
+		color: #fff;
+		border-radius: 25px;
+	
+	}
+	
+	
+	.imageshake {
+	position: relative;
+	animation: shake 0.5s ease-in-out infinite;
+	}
+	@keyframes shake {
+	0% { transform: rotate(0deg); }
+	25% { transform: rotate(8deg); }
+	50% { transform: rotate(0deg); }
+	75% { transform: rotate(-8deg); }
+	100% { transform: rotate(0deg); }
+	}
 </style>

+ 202 - 15
pages/login/completeInfo.vue

@@ -2,7 +2,6 @@
 	<view>
 		<ujp-navbar title="完善信息">
 
-
 			<view slot="right" @click="gotoLink" style=" margin-right: 20rpx;"> 跳过</view>
 
 		</ujp-navbar>
@@ -17,12 +16,12 @@
 
 			<view class="data-input">
 				<u-form :model="form" ref="uForm">
-					<u-form-item label-position="top" label="昵称"><u-input v-model="form.nickName"
+					<u-form-item label-position="top" required label="昵称"><u-input v-model="form.nickName"
 							placeholder="请填写昵称" /></u-form-item>
 				</u-form>
 			</view>
 			
-			<p class="car-num" >车牌号码
+			<p class="car-num" ><span style="color:rgba(238, 49, 56, 1)">*</span>车牌号码
 					
 					<span  @click="gotoLink" 
 							style="color: rgb(63, 189, 112);float: right;">临时车牌,点击快速充电</span>
@@ -38,7 +37,7 @@
 			</view>
 			<p class="car-num" ><span @tap="keyShow=!keyShow"
 					style="float: right;color: #9e9e9e;">点击输入框{{keyShow?'收起':'唤起'}}键盘</span></p>
-			<p class="car-num" v-show="!keyShow">车辆用途</p>
+			<p class="car-num" v-show="!keyShow"><span style="color:rgba(238, 49, 56, 1)">*</span>车辆用途</p>
 			<view class="car-type" v-show="!keyShow">
 				
 				<view class="card"  v-for="(item,i) in carlist" :key="i"
@@ -64,7 +63,35 @@
 						</p>
 					</view>
 				</view>
-			</view>
+			</view>
+			
+			<p class="car-num"  v-show="!keyShow">
+						
+						 车辆认证
+				<view style="font-size: 12px;color:rgba(51, 51, 51, 1);margin: 2px 0;">上传机动车行驶证清晰照片</view>
+			</p>
+			<view class="car-type" v-show="!keyShow">
+				
+				<view class="carAuth">
+					<view class="mark" v-show="!carAuthImg">
+						<view class="text">例</view>
+					</view>
+					<view class="carAuthIcon" @click="uploadPhoto2">
+						<u-icon name="camera-fill" custom-prefix="custom-icon" color="#fff" size="48"></u-icon>
+						
+					</view>
+					<image class="carAuthImg"  @click="uploadPhoto2" v-show="carAuthImg" :src="carAuthImg"></image>
+					
+					<image class="carAuthImg"  @click="uploadPhoto2" v-show="!carAuthImg" src="@/assets/img/carDet/authtest.png"></image>
+					
+				</view>
+				<view class="position" v-if="!carLicense">
+					<view id="talkbubble">首次认证送5元代金卷</view>
+				</view>
+			</view>
+			
+			
+			
 			<view class="default" v-show="!keyShow">
 				<view style="width: 350px;">
 					<u-checkbox-group>
@@ -117,7 +144,9 @@
 			umessageInput
 		},
 		data() {
-			return {
+			return {
+				carLicense:"",
+				carAuthImg:"",
 				value: false,
 				selectIndex: -1,
 				maxlength: 8,
@@ -178,7 +207,73 @@
 			this.$refs.uKeyboard.changeCarInputMode();
 			this.getUserInfo();
 		},
-		methods: {
+		methods: {
+			
+			uploadFile(imageSrc){
+				var action=process.car.BASE_URL+"uploadPicture"
+				var token=this.carhelp.getToken()
+				var header={
+					'Authorization':token
+				}
+				var formData={
+					subFolder:"/team51/message"
+				}
+				var _this=this
+				uni.showLoading({
+				   					title: '上传中'
+				   				})
+				   				  uni.uploadFile({
+				   					url: action, //仅为示例,非真实的接口地址
+				   					filePath: imageSrc,
+				   					name: 'photoFile',
+									header: header,
+				   					formData: formData,
+				   					success: (res) => {
+				   						
+				   						uni.hideLoading();
+				   						uni.showToast({
+				   							title: '上传成功',
+				   							icon: 'success',
+				   							duration: 1000
+				   						})
+										
+				   						_this.carAuthImg = JSON.parse(res.data).data
+										_this.$forceUpdate()
+										
+										
+				   					},
+				   					fail: (err) => {
+				   						console.log('uploadImage fail', err);
+				   						uni.hideLoading();
+				   						uni.showModal({
+				   							content: err.errMsg,
+				   							showCancel: false
+				   						});
+				   					},
+				   				});
+			},
+			uploadPhoto2() {
+				if(this.carLicense){
+					uni.showToast({
+						title: "车辆认证后不可修改",
+						mask: true,
+					})	
+					return 
+				}
+				uni.chooseImage({
+					count: 1,
+					sizeType:['compressed'],
+					success: async (res) => {
+						console.log(res)
+						var imageSrc = res.tempFilePaths[0]
+						this.uploadFile(imageSrc);
+			
+					},
+					fail: (err) => {
+					   	console.log('chooseImage fail', err)
+					}
+				})
+			},
 			getUserInfo() {
 				uni.showLoading({
 					title: "加载中",
@@ -280,6 +375,10 @@
 					uni.redirectTo({
 						url: '/pages/index/index'
 					})
+				}else{
+					uni.redirectTo({
+						url: '/pages/index/index'
+					})
 				}
 			},
 			checkboxChange() {
@@ -384,20 +483,28 @@
 				
 				
 				//(this.form)
-				this.form.usage=this.usage;
+				this.form.usage=this.usage;
+				this.form.photoFile=this.carAuthImg;
 				uni.showLoading({
 					title: "加载中",
 					mask: true,
 				})
 				userApi.perfectPersonInformation(this.form).then((res) => {
 					uni.hideLoading();
-
+					if(this.carAuthImg){
+						var obj=this.carhelp.getPersonInfo()
+						obj.carLicense=this.carAuthImg
+						this.carhelp.setPersonInfo(obj)
+					}
+					 
 					this.gotoLink()
 				}).catch(error => {
-					uni.showToast({
-						title: error,
-						icon: "none"
-					})
+					
+					uni.hideLoading();
+					uni.showModal({
+						content: error,
+						showCancel: false
+					});
 				})
 			}
 		}
@@ -434,8 +541,8 @@
 
 	.data-img {
 		margin: 10px auto;
-		height: 108px;
-		width: 108px;
+		height: 216rpx;
+		width: 216rpx;
 		position: relative;
 	}
 
@@ -550,5 +657,85 @@
 			}
 		}
 		
+	}
+	
+	
+	.carAuth{
+		border-radius: 12px;
+		background-color: rgba(255, 255, 255, 1);
+		border: 2px dashed rgba(187, 187, 187, 1);
+		//height: 400rpx;
+		width: 100%;
+		    overflow: hidden;
+			text-align: center;
+			.carAuthImg{
+				margin-top: 10px;
+				margin-bottom: 10px;
+				width: 510rpx;
+				height: 360rpx;
+			}
+			.carAuthIcon{
+				    position: absolute;
+				    background: #6e7175;
+				    width: 44px;
+				    height: 44px;
+					border-radius: 50px;
+				    /* left: 200px; */
+				    /* top: 200px; */
+				    margin: 160rpx 280rpx;
+				    z-index: 999;
+					    display: flex; 
+					    justify-content: center;
+	
+			}
+	}
+	.mark {
+	    width: 0px;
+	    height: 0px;
+	    border-top: 40px solid rgba(0, 185, 98, 1);
+	    border-right: 40px solid transparent;
+	       position: absolute;
+	       z-index: 999;
+		.text{
+		    white-space: nowrap;
+		    transform: rotate(-45deg) scale(0.5);
+		    position: absolute;
+		    top: -45px;
+		    background-color: rgba(0, 185, 98, 1);
+		    color: rgba(255, 255, 255, 1);
+			font-size: 25px;
+		}
+	}
+	
+	.position {
+		    position: relative;
+		    top: -520rpx;
+		    left: 54%;
+		    z-index: 999;
+		    width: 130px;
+	}
+	
+	#talkbubble {
+		
+		top: 0;
+		left: 0;
+		padding: 0 10rpx;
+		line-height: 20px;
+		font-size: 12px;
+		color: #fff;
+		background: red;
+		position: relative;
+		border-radius: 4px;
+		text-align: center;
+	}
+	
+	#talkbubble:before {
+		content: "";
+		position: absolute;
+		top: 100%;
+		right: 25%;
+		border-top: 5px solid red;
+		border-right: 5px solid transparent;
+		border-left: 5px solid transparent;
 	}
 </style>

+ 372 - 15
pages/user/car/carDet.vue

@@ -1,19 +1,39 @@
 <template>
 	<view class="wrap">
-		<ujp-navbar title="添加车牌">
+		<ujp-navbar title="车辆信息" :background="{
+						background: '#b9ead0'
+					}" class="wrapbackground1">
  		</ujp-navbar>
 		<!-- <p class="car-num" style="padding: 10px  40px;" >根据平台要求,车牌号码输入后暂时<span style="color:red">不可以修改</span>,后续修改需要联系客服人员,请认真填写</p>
 		 -->
-		 <p class="car-num" @tap="keyShow=!keyShow">车牌号码<span
-		 		style="color: #9e9e9e;float: right;padding-right: 10px;">(点击{{keyShow?'收起':'唤起'}}键盘)</span></p>
+		 <view class="wrapbackground2">
+			<view class="car-head" >
+				<view class="car-head-item">
+					<img src="@/assets/img/carDet/riFill-parking-box-fill.svg"/>减免停车费
+				</view  >
+				<view class="car-head-item">
+					<img src="@/assets/img/carDet/riFill-arrow-right-circle-fill.svg"/>快速离场
+				</view >
+				<view class="car-head-item">
+					<img src="@/assets/img/carDet/riFill-ticket-2-fill.svg"/>首次认证送卷
+				</view>
+			</view>
+		
+		 <p class="car-num" @tap="keyShowBtn(!keyShow)">
+			 <span style="color:rgba(238, 49, 56, 1)">*</span>
+			 车牌号码<span v-show="!carLicense"
+		 		style="color: #9e9e9e;float: right;padding-right: 10px;font-size: 24rpx;">(点击{{keyShow?'收起':'唤起'}}键盘)</span>
+				<view style="font-size: 12px;color:rgba(51, 51, 51, 1);margin: 2px 0;">正确填写<span style="color:#ec4f27 ;">绑定车辆</span>的车牌号,可减免部分停车费</view>
+				</p>
 		 
-		<view class="key-input"  @tap="keyShow=true">
+		<view class="key-input"  @tap="keyShowBtn(true)">
 			<umessageInput :focus="true" 
 			@selectIndex="getSelectIndex"
 			:value="form.carNum" :maxlength="maxlength" :disabled-keyboard="true"></umessageInput>
 		
 		</view>
-		<p class="car-num" v-show="!keyShow">车辆用途</p>
+		 </view>
+		<p class="car-num" v-show="!keyShow"> <span style="color:rgba(238, 49, 56, 1)">*</span>车辆用途</p>
 		<view class="car-type" v-show="!keyShow">
 			
 			<view class="card"  v-for="(item,i) in carlist" :key="i"
@@ -38,6 +58,31 @@
 			</view>
 		</view>
 		
+		<p class="car-num"  v-show="!keyShow">
+					
+					 车辆认证
+			<view style="font-size: 12px;color:rgba(51, 51, 51, 1);margin: 2px 0;">上传机动车行驶证清晰照片</view>
+		</p>
+		<view class="car-type" v-show="!keyShow">
+			
+			<view class="carAuth">
+				<view class="mark" v-show="!carAuthImg">
+					<view class="text">例</view>
+				</view>
+				<view class="carAuthIcon" @click="uploadPhoto">
+					<u-icon name="camera-fill" custom-prefix="custom-icon" color="#fff" size="48"></u-icon>
+					
+				</view>
+				<image class="carAuthImg"  @click="uploadPhoto" v-show="carAuthImg" :src="carAuthImg"></image>
+				
+				<image class="carAuthImg"  @click="uploadPhoto" v-show="!carAuthImg" src="@/assets/img/carDet/authtest.png"></image>
+				
+			</view>
+			<view class="position" v-if="!carLicense">
+				<view id="talkbubble">首次认证送5元代金卷</view>
+			</view>
+		</view>
+		
 		<ucarkeyboard ref="uKeyboard" mode="car"
 		  style="    z-index: 999;" :style="!keyShow?'display: none':''"
 		 :showTips="true" :confirmBtn="false" :mask-close-able="false" :tooltip="false" v-model="keyShow" @change="valChange" @backspace="backspace">
@@ -54,7 +99,11 @@
 			">确定</span>
 							</view>
 		</ucarkeyboard>
+		
+		
+		
 		<view class="default"  v-show="!keyShow" >
+			
 			 <view style="width: 350px;">
 			 	<u-checkbox-group>
 			 		<u-checkbox class="tips" active-color="green" v-model="value" shape="circle"
@@ -66,6 +115,7 @@
 			 
 			 </view>
 			 <u-button class="login-btn" type="success" shape="circle" @click="keepCar">保存</u-button>
+			 <view>.</view>
 			 
 		</view>
 	</view>
@@ -75,7 +125,8 @@
 	import * as userApi from '@/apis/user.js'
 	import ucarkeyboard from '@/components/Ucarkeyboard.vue'
 	import umessageInput from '@/components/UmessageInput.vue'
-
+	import * as WxJsApi from '@/utils/wxJsApi'
+	
 	var car1=require("@/assets/img/cartype/car1.png")
 	var car2=require("@/assets/img/cartype/car2.png")
 	var car3=require("@/assets/img/cartype/car3.png")
@@ -87,6 +138,8 @@
 		},
 		data() {
 			return {
+				carLicense:"",
+				carAuthImg:"",
 				isLogin:false,
 				maxlength:8,
 				keyShow: false,
@@ -123,7 +176,17 @@
 				]
 			}
 		},
-		onLoad(op) {
+		onLoad(op) {
+			
+			// //获取微信配置
+			// WxJsApi.getWxConfig().then((res)=>{
+			
+			
+			// }).catch(error => {
+			// 		//(res)
+			// })
+			
+			
 			if(op.id){
 				this.form.id = op.id;	
 			}
@@ -146,8 +209,179 @@
 		},
 		onReady() {
 			this.$refs.uKeyboard.changeCarInputMode();
+			
+			this.carLicense=this.carhelp.getPersonInfo().carLicense
+			if(this.carLicense){
+				this.carAuthImg=this.carLicense
+			}
+			
 		},
 		methods: {
+			keyShowBtn(keyShow){
+				if(this.carLicense){
+					uni.showToast({
+						title: "车辆认证后不可修改",
+						mask: true,
+					})	
+					return 
+				}
+				this.keyShow=keyShow;
+			},
+			uploadFile3(imageSrc){
+				// var formData = new FormData();
+				// formData.append('photoName', '1.jpg');
+				// formData.append('photoBase64Data', imageSrc);
+				
+				
+					var action=process.car.BASE_URL+"uploadBase64"
+					var token=this.carhelp.getToken()
+					var header={
+						'Authorization':token
+					}
+					 var formData={
+					 	photoName:"1.jpg",
+						photoBase64Data:imageSrc
+					 }
+					var _this=this
+					uni.showLoading({
+					   					title: '上传中',
+										mask: true,
+					   				})
+					   				  uni.uploadFile({
+					   					url: action, //仅为示例,非真实的接口地址
+					   				//	filePath: imageSrc,
+					   					name: 'photoFile',
+										header: header,
+					   					formData: formData,
+					   					success: (res) => {
+					   						
+					   						uni.hideLoading();
+					   						uni.showToast({
+					   							title: '上传成功',
+					   							icon: 'success',
+					   							duration: 1000
+					   						})
+											
+					   						_this.carAuthImg = JSON.parse(res.data).data+"?x-oss-process=image/resize,h_1500,m_lfit"
+											_this.$forceUpdate()
+											
+											
+					   					},
+					   					fail: (err) => {
+					   						console.log('uploadImage fail', err);
+					   						uni.hideLoading();
+					   						uni.showModal({
+					   							content: err.errMsg,
+					   							showCancel: false
+					   						});
+					   					},
+					   				});
+									
+			},
+			uploadFile2(imageSrc){
+				WxJsApi.uploadPic(imageSrc).then(response => {
+					console.log("error")
+				}).catch(error => {
+					console.log(error)
+				})
+			},
+			uploadFile(imageSrc){
+				var action=process.car.BASE_URL+"uploadPicture"
+				var token=this.carhelp.getToken()
+				var header={
+					'Authorization':token
+				}
+				var formData={
+					subFolder:"/team51/carDet"
+				}
+				var _this=this
+				uni.showLoading({
+				   					title: '上传中',
+									mask: true,
+				   				})
+				   				  uni.uploadFile({
+				   					url: action, //仅为示例,非真实的接口地址
+				   					filePath: imageSrc,
+				   					name: 'photoFile',
+									header: header,
+				   					formData: formData,
+				   					success: (res) => {
+				   						
+				   						uni.hideLoading();
+				   						uni.showToast({
+				   							title: '上传成功',
+				   							icon: 'success',
+				   							duration: 1000
+				   						})
+										
+				   						_this.carAuthImg = JSON.parse(res.data).data+"?x-oss-process=image/resize,h_1500,m_lfit"
+				   						_this.$forceUpdate()
+										
+										
+				   					},
+				   					fail: (err) => {
+				   						console.log('uploadImage fail', err);
+				   						uni.hideLoading();
+				   						uni.showModal({
+				   							content: err.errMsg,
+				   							showCancel: false
+				   						});
+				   					},
+				   				});
+			},
+			uploadPhoto() {
+				if(this.carLicense){
+					uni.showToast({
+						title: "车辆认证后不可修改",
+						mask: true,
+					})	
+					return 
+				}
+				uni.chooseImage({
+					count: 1,
+					sizeType:['compressed'],
+					success: async (res) => {
+						console.log(res)
+						var imageSrc = res.tempFilePaths[0]
+						this.uploadFile(imageSrc);
+							
+					},
+					fail: (err) => {
+					   	console.log('chooseImage fail', err)
+					}
+				})
+			},
+			uploadPhoto2() {
+				if(this.carLicense){
+					uni.showToast({
+						title: "车辆认证后不可修改",
+						mask: true,
+					})	
+					return 
+				}
+				WxJsApi.chooseImage().then(res=>{
+					console.log(res)
+					var localData = res.localData;
+								
+					if (localData.indexOf('data:image') != 0) {
+						//判断是否有这样的头部
+						localData = 'data:image/jpeg;base64,' + localData
+					}
+					localData = localData.replace(/\r|\n/g, '').replace('data:image/jgp', 'data:image/jpeg')
+					var imageSrc = localData;
+					
+					
+					
+					
+					this.uploadFile3(imageSrc);
+				}).catch(error => {
+					
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
 			getCarList() {
 				uni.showLoading({
 					title: "加载中",
@@ -184,6 +418,7 @@
 				})
 			},
 			gotoLink(){
+				
 				if (this.code == 'A') {
 					uni.redirectTo({
 						url: '/pages/searchPile/stationAndPile/chargingPileDetails?id=' + this.codeId
@@ -194,7 +429,7 @@
 					})
 				}else {
 					uni.navigateBack({
-						url: '/pages/user/car/index'
+					
 					})
 				}
 			},
@@ -304,16 +539,25 @@
 					title: "加载中",
 					mask: true,
 				})
-				
+				this.form.photoFile=this.carAuthImg;
 				userApi.addRegUserCar(this.form).then((res) => {
 					uni.hideLoading();
 					
+					if(this.carAuthImg){
+						var obj=this.carhelp.getPersonInfo()
+						obj.carLicense=this.carAuthImg
+						this.carhelp.setPersonInfo(obj)
+					}
+					
 					this.gotoLink()
 				}).catch(error => {
-					uni.showToast({
-						title: error,
-						icon: "none"
-					})
+					uni.hideLoading();
+					uni.showModal({
+						title:"提示",
+						content: error,
+						showCancel: false
+					});
+				
 				})
 			}
 		}
@@ -325,6 +569,14 @@
 	}
 </style>
 <style lang="scss" scoped>
+	.wrapbackground1{
+		background: rgba(172,236,206,1);
+	}
+	.wrapbackground2{
+		padding-top: 10px;
+		padding-bottom: 20px;
+		background: linear-gradient(180deg, rgba(172,236,206,1) 0%,rgba(82,211,150,0) 110%);
+	}
 	.u-char-item{
 		width: 29px !important;
 	}
@@ -338,14 +590,38 @@
 	}
 
 	.key-input {
-		padding-top: 24px;
+		//padding-top: 24px;
+	}
+	.car-head{
+		    display: flex;
+		    align-items: center;
+		    justify-content: space-around;
+			
+			
+			border-radius: 50px;
+			padding: 12rpx 24rpx;
+			margin: 0 48rpx ;
+			background-color: #d3f1e0;
+			
+			.car-head-item{
+				display: flex;
+				color: rgba(0, 90, 48, 1);
+				img{
+					width: 40rpx;
+					height: 40rpx;
+				}
+			}
 	}
 	.car-num {
-		padding: 10px 0 0 40px;
+		
+		padding-top: 40rpx;
+		padding-left:48rpx;
+		font-size: 16px;
 		line-height: 18px;
 	}
 	.default {
 		margin: 16px 28px;
+		padding-bottom: 20px;
 	}
 
 	.login-btn {
@@ -434,4 +710,85 @@
 		}
 		
 	}
+	
+	.carAuth{
+		border-radius: 12px;
+		background-color: rgba(255, 255, 255, 1);
+		border: 2px dashed rgba(187, 187, 187, 1);
+		//height: 400rpx;
+		width: 100%;
+		    overflow: hidden;
+			text-align: center;
+			.carAuthImg{
+				margin-top: 10px;
+				margin-bottom: 10px;
+				width: 510rpx;
+				height: 360rpx;
+			}
+			.carAuthIcon{
+				    position: absolute;
+				    background: #6e7175;
+				    width: 44px;
+				    height: 44px;
+					border-radius: 50px;
+				    /* left: 200px; */
+				    /* top: 200px; */
+				    margin: 160rpx 280rpx;
+				    z-index: 999;
+					    display: flex; 
+					    justify-content: center;
+
+			}
+	}
+	.mark {
+	    width: 0px;
+	    height: 0px;
+	    border-top: 40px solid rgba(0, 185, 98, 1);
+	    border-right: 40px solid transparent;
+	       position: absolute;
+	       z-index: 999;
+		.text{
+		    white-space: nowrap;
+		    transform: rotate(-45deg) scale(0.5);
+		    position: absolute;
+		    top: -45px;
+		    background-color: rgba(0, 185, 98, 1);
+		    color: rgba(255, 255, 255, 1);
+			font-size: 25px;
+		}
+	}
+	
+	.position {
+		    position: relative;
+		    top: -520rpx;
+		    left: 54%;
+		    z-index: 999;
+		    width: 130px;
+	}
+	
+	#talkbubble {
+		
+		top: 0;
+		left: 0;
+		padding: 0 10rpx;
+		line-height: 20px;
+		font-size: 12px;
+		color: #fff;
+		background: red;
+		position: relative;
+		border-radius: 4px;
+		text-align: center;
+	}
+	
+	#talkbubble:before {
+		content: "";
+		position: absolute;
+		top: 100%;
+		right: 25%;
+		border-top: 5px solid red;
+		border-right: 5px solid transparent;
+		border-left: 5px solid transparent;
+	}
+	
+
 </style>

+ 43 - 35
pages/user/dataSet.vue

@@ -133,7 +133,9 @@
 							alt=""></text>
 					<p class="oldTextjp" oldstyle="font-size: 18px;">车辆信息</p>
 				</view>
+				
 				<view class="userCell-content oldTextjp2" oldstyle="font-size: 18px;" @click="carClick">
+					
 					<view class="value black" v-if="carList.carNum != null">
 						{{carList.carNum}}
 					</view>
@@ -143,39 +145,10 @@
 					<u-icon name="arrow-right-s-line" custom-prefix="custom-icon" color="#B3B3B3" size="48"></u-icon>
 				</view>
 			</view>
-			<!-- 长辈模式 -->
-			<!-- <view class="userCell-item">
-				<view class="userCell-title">
-					<text class="user"><img style="visibility: middle;;" src="../../assets/img/zoom-in-fill.svg"
-							alt=""></text>
-					<p class="oldTextjp" oldstyle="font-size: 18px;">长辈模式</p>
-				</view>
-				<view class="userCell-content oldTextjp2" oldstyle="font-size: 18px;">
-					<view class="value">
-
-						<view class="text black" >
-							字体更大 看得清
-						</view>
-
-						<u-switch v-model="checked" active-color="#00E266" @change="checkedChange"></u-switch>
-					</view>
-					<u-icon name="arrow-right-s-line" custom-prefix="custom-icon" color="#B3B3B3" size="48"></u-icon>
-				</view>
-			</view> -->
-			<!-- 注销账号 -->
-			<!-- <view class="userCell-item" @click="gotoUrl('pages/user/logout')">
-				<view class="userCell-title">
-					<text class="user"><img style="visibility: middle;;" src="../../assets/img/spam-3-fill.svg"
-							alt=""></text>
-					<p class="oldTextjp" oldstyle="font-size: 18px;">注销账号</p>
-				</view>
-				<view class="userCell-content">
-					<view class="value black" :style="elderStatus ? 'font-size: 14px;' : 'font-size: 12px;'">
-						注销后无法恢复,请谨慎操作
-					</view>
-					<u-icon name="arrow-right-s-line" custom-prefix="custom-icon" color="#B3B3B3" size="48"></u-icon>
-				</view>
-			</view> -->
+			<view class="position" v-show="!userInfo.carLicense">
+				<view id="talkbubble">首次认证送5元代金卷</view>
+			</view>
+			 
 		</view>
 
 		<!-- <view class="exit oldTextjp2" oldstyle="font-size: 18px;" @click="signOut">
@@ -258,6 +231,7 @@ import {
 					carNum: null,
 				},
 				elderStatus: false,
+				userInfo:{},
 			}
 		},
 		onShow() {
@@ -435,7 +409,7 @@ import {
 					this.form.headImg = res.data.regUser.headImg;
 					this.form.realName = res.data.regUser.realName;
 					this.birthday = res.data.regUser.birthday;
-					
+					this.userInfo=res.data.regUser;
 					this.userCard=res.data.userCard;
 					
 					var phone = res.data.regUser.phone;
@@ -572,8 +546,9 @@ import {
 				color: rgba(153, 153, 153, 100);
 				font-size: 16px;
 				line-height: 20px;
-
+				
 			}
+			
 
 			.value {
 				display: flex;
@@ -703,4 +678,37 @@ import {
 	/deep/.u-line{
 			transform: scaleY(0.1) !important;
 		}
+		
+		
+		.position {
+			    position: relative;
+			    top: -66px;
+			    left: 54%;
+			    z-index: 999;
+			    width: 138px;
+		}
+		
+		#talkbubble {
+			
+			top: 0;
+			left: 0;
+			padding: 0 5px;
+			line-height: 20px;
+			font-size: 12px;
+			color: #fff;
+			background: red;
+			position: relative;
+			border-radius: 4px;
+			text-align: center;
+		}
+		
+		#talkbubble:before {
+			content: "";
+			position: absolute;
+			top: 100%;
+			right: 25%;
+			border-top: 5px solid red;
+			border-right: 5px solid transparent;
+			border-left: 5px solid transparent;
+		}
 </style>

+ 7 - 0
pages/user/index.vue

@@ -1019,15 +1019,22 @@
 					
 				}
 				.rightText1{
+					margin-top: 2px;
 					font-size: 24rpx;
 					color: rgba(16, 16, 16, 1);
 				
 				}
 				.rightText2{
+					margin-bottom: 2px;
 					opacity: 0.7;
 					color: rgba(0, 0, 0, 1);
 					font-size: 20rpx;
 				}
+				.rightTextD{
+					.rightText1,.rightText2{
+						color:#fff;
+					}
+				}
 			}
 			
 		}

+ 18 - 0
utils/wxJsApi.js

@@ -86,6 +86,24 @@ export function chooseImage(count,islocalId) {
 
 
 
+//选择图片,多图上传和单图上传的回调处理不一样
+export function chooseImage2() {
+	
+	let promise = new Promise((resolve, reject) => {
+		wx.chooseImage({
+			count: 1,
+			sizeType: ['compressed'],
+			sourceType: ['album', 'camera'],
+			success: function(res) {
+				resolve(res);
+				
+			}
+		});
+	});
+	return promise;
+}
+
+
 //获取图片,用于多图上传时的递归处理
 export function getLocalImgData(localId, fun) {
 	wx.getLocalImgData({