zhengkaixin 3 年之前
父节点
当前提交
aa9496ad64
共有 16 个文件被更改,包括 837 次插入66 次删除
  1. 11 7
      .env.dev.js
  2. 4 1
      .env.prod.js
  3. 7 1
      .env.test.js
  4. 40 0
      apis/parking.js
  5. 8 0
      apis/weixin.js
  6. 17 2
      main.js
  7. 8 0
      pages.json
  8. 276 1
      pages/parking/pay.vue
  9. 143 0
      pages/parking/payResult.vue
  10. 237 48
      pages/parking/search.vue
  11. 1 1
      pages/user/freeInstallment.vue
  12. 1 1
      pages/user/toJoin.vue
  13. 31 0
      utils/alipay.js
  14. 46 0
      utils/initALI.js
  15. 4 1
      utils/mixin.js
  16. 3 3
      utils/requestParking.js

+ 11 - 7
.env.dev.js

@@ -1,16 +1,20 @@
 const UNI_APP = {  
 	ProjectName :"51充电联盟",
-	BASE_URL: 'https://charging.xiaoxinda.com/charging-station-test/',
-//    BASE_URL: 'http://192.168.77.162:8080/charging-station/' ,
+//	BASE_URL: 'https://51team.xiaoxinda.com/charging-station-server/',
+	
+	//BASE_URL: 'https://charging.xiaoxinda.com/charging-station-test/',
+	BASE_URL: 'http://192.168.77.162:8080/charging-station/' ,
+    PARK_URL: 'https://51team.xiaoxinda.com/charging-parking/' ,
 	NODE_ENV :"dev",
 	SIMPLE_RUN:true,// 无视权限控制跳转页面   , 用于样式人员快速访问各种功能 ,快速测试等
-	//openId:"oHjCawsxTJkxixR74OVp7aCKahj8",//测试用openId  
-	//openId:"oHjCawgwCGen5k1-hAsimdEX5lZo",
-	//openId:"oHjCawgwCGen5k1-hAsimdEX5lZo",
-	openId:"oHjCawigqi8SEAwutwkQ-VEgdp3k",
+
+	//openId:"oK9Wr54VbEh3xvWYmD_zT5NbH4AY", 
+	openId:"oK9Wr59rru-i3bm7dtTtxnkR-i4s",
+	//	openId:"test113",
 	//小鹏管家appid
 	//VUE_APP_WXAPPID:"wx7e70eb62a8459869",
-	VUE_APP_WXAPPID:"wx3afdb1b60188c1e5"
+	VUE_APP_WXAPPID:"wx3afdb1b60188c1e5",
+	VUE_APP_ALIAPPID:"2018070260539153",
 }  
 
 module.exports = UNI_APP;

+ 4 - 1
.env.prod.js

@@ -1,11 +1,14 @@
 const UNI_APP = {  	
 		ProjectName :"51充电联盟",
     BASE_URL: 'https://51team.xiaoxinda.com/charging-station-server/',
+	PARK_URL: 'https://51team.xiaoxinda.com/charging-parking/' ,
+	
 	NODE_ENV :"prod",
 	SIMPLE_RUN:false,
 	openId:"oHjCawigqi8SEAwutwkQ-VEgdp3k",//测试用openId
 	//小鹏管家appid
-	VUE_APP_WXAPPID:"wx3afdb1b60188c1e5"
+	VUE_APP_WXAPPID:"wx3afdb1b60188c1e5",
+	VUE_APP_ALIAPPID:"2018070260539153",
 }  
 
 module.exports = UNI_APP;

+ 7 - 1
.env.test.js

@@ -2,6 +2,8 @@ const UNI_APP = {
 	ProjectName :"51充电联盟",
    // BASE_URL: 'http://192.168.77.162:8080/charging-station/' ,
 	BASE_URL: 'https://charging.xiaoxinda.com/charging-station-test/',
+	PARK_URL: 'https://51team.xiaoxinda.com/charging-parking/' ,
+	
     //BASE_URL: 'https://charging.xiaoxinda.com/charging-station-server/',
    
 
@@ -11,12 +13,16 @@ const UNI_APP = {
 	//openId:"oHjCawmHqG44pqUW54iBlenaHYB8",D
 	//小鹏管家appid
 	VUE_APP_WXAPPID:"wx3afdb1b60188c1e5",
+	VUE_APP_ALIAPPID:"2018070260539153",
 	//zkx的测试openId
 	// openId:"oHjCawsJ5blME36lHaSpSVfEhleU",
 	// openId:"oHjCawigqi8SEAwutwkQ-VEgdp3k",
 	// openId:"oK9Wr55J1J1eL6BqI2tW749NTxNU",
 	//zq的测试openId
-	openId:"oK9Wr55J1J1eL6BqI2tW749NTxNU"
+	//openId:"oK9Wr55J1J1eL6BqI2tW749NTxNU"
+	//openId:"test004",
+	openId:"oK9Wr54VbEh3xvWYmD_zT5NbH4AY",
+	
 }  
 
 module.exports = UNI_APP;

+ 40 - 0
apis/parking.js

@@ -0,0 +1,40 @@
+import request from '../utils/requestParking.js';
+
+import Qs from 'qs';
+
+export function carPayDetail(data) {
+	 
+	return request({
+		method: 'post',
+		data:data ,
+		url: '/parkingRecord/carPayDetail'
+	})
+}
+
+export function channelPayDetail(data) {
+	 
+	return request({
+		method: 'post',
+		data:data ,
+		url: '/parkingRecord/channelPayDetail' 
+	})
+}
+
+
+export function parkingTradeWebPay(data) {
+	 
+	return request({
+		method: 'post',
+		data:data ,
+		url: '/aliPay/parkingTradeWebPay' 
+	})
+}
+
+export function parkingWxPay(data) {
+	 
+	return request({
+		method: 'post',
+		data:data ,
+		url: '/wxPay/parkingWxPay' 
+	})
+}

+ 8 - 0
apis/weixin.js

@@ -1,5 +1,6 @@
 import request from '@/utils/request'
 import requestWhite from '../utils/requestWhite.js';
+ import requestAli from '../utils/requestParking.js';
  
 import Qs from 'qs';
 
@@ -29,6 +30,13 @@ export function getDataByCode(code) {
 	})
 }
 
+export function getDataByCodeALi(code) {
+	return requestAli({
+		url: '/aliPay/findUserInfo/' + code,
+		params: {},
+		method: 'get',
+	})
+}
 
 
 //获得配置

+ 17 - 2
main.js

@@ -2,8 +2,23 @@ import Vue from 'vue'
 import App from './App'
 //import MyCommon from '@/components/Common.vue'
 //import CarLoading from '@/components/Loading.vue'
-import getOpenId from './utils/init.js'
-getOpenId.init()
+import getOpenId from './utils/init.js'
+//支付宝的
+import getALIOpenId from './utils/initALI.js'
+
+
+var IS_WEIXIN = /MicroMessenger/.test(window.navigator.userAgent)
+var IS_ALI = /AlipayClient/.test(window.navigator.userAgent)
+// if(IS_WEIXIN){
+	
+// }
+
+if(IS_ALI){
+	getALIOpenId.init()
+}else{
+	getOpenId.init()
+}
+
 
 import mixin from './utils/mixin.js'
 

+ 8 - 0
pages.json

@@ -421,6 +421,14 @@
             }
             
         }
+        ,{
+            "path" : "pages/parking/payResult",
+            "style" :                                                                                    
+            {
+            
+            }
+            
+        }
     ],
 	"globalStyle": {
 		"navigationStyle": "custom", // 隐藏系统导航栏

+ 276 - 1
pages/parking/pay.vue

@@ -1,22 +1,297 @@
 <template>
 	<view>
 		
+		<view class="carNone" v-if="kongResult">
+			<u-navbar title="停车缴费" :is-back="false">
+				
+			</u-navbar>
+			<img src="static/img/暂无数据-缺省页.png" alt="">
+			<p>未查询到停车数据</p>
+			<u-button class="login-btn2"  type="default" shape="circle" @click="channelPayDetail">刷新</u-button>
+			
+		</view>
+		<view class="wrap"  v-if="!kongResult"  >
+			<u-navbar title="停车缴费" :is-back="false">
+				
+			</u-navbar>
+			
+			<view >
+				<view class="">
+					<view class="cartitle"> 缴费信息</view>
+					<view class="info" >
+						<view class="info-name">
+							车牌号
+						</view>
+						<view class="info-text">
+							{{detail.carNumber}}			
+						
+						</view>
+					</view>
+					
+					<view class="info" >
+						<view class="info-name"  style="font-size: 16px;">
+							停车费
+						</view>
+						<view class="info-text" style="font-size: 16px;">
+							 			
+ 					{{detail.price}}元
+						</view>
+					</view>
+					<view class="cartitle"> 停车详情</view>
+					<view class="info" >
+						<view class="info-name">
+							停车位置
+						</view>
+						<view class="info-text">
+							 			
+					{{detail.parkingName}}
+						</view>
+					</view>
+					<view class="info" >
+						<view class="info-name">
+							入场时间
+						</view>
+						<view class="info-text">
+							 			
+						{{detail.inParkingTime}}
+						</view>
+					</view>
+					<view class="info" >
+						<view class="info-name">
+							停车时间
+						</view>
+						<view class="info-text">
+							 			
+					{{detail.parkingTimeStr}}
+						</view>
+					</view>
+				
+				
+ 			</view>
+			<u-button class="login-btn" type="success" shape="circle" @click="pay()">支付离场</u-button>
+			
+			<u-button class="login-btn2"  type="default" shape="circle" @click="channelPayDetail">刷新</u-button>
+			
+			 
+		</view>
+		
+		
+		</view>
 	</view>
 </template>
 
 <script>
+	
+	import * as API from '@/apis/parking.js'
+ 
+	import {
+		wxPayJs
+	} from '@/utils/wxpay'
+	import {
+		aliPayJs
+	} from '@/utils/alipay'
+	
 	export default {
+		components: {
+			 
+		},
 		data() {
 			return {
+			 
+			
+				form: {
 				
+					channelId: "",
+				},
+				detail:{},	
+				kongResult: false,
+			}
+		},
+		onLoad(op) {
+			if(op.id){
+				this.form.channelId=op.id
+			}else{
+				uni.showModal({
+					content:"参数错误"
+				})
 			}
+			
+		},
+		onReady() {
+		 this.channelPayDetail()
 		},
 		methods: {
+			channelPayDetail(){
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				
+				API.channelPayDetail(this.form).then(data => {
+					uni.hideLoading()
+					this.detail=data.data
+					this.kongResult=false;
+				}).catch(error => {
+						this.kongResult=true;
+						uni.hideLoading()
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
+			//微信支付
+			payWx() {
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				
+				API.parkingWxPay({
+					id: this.detail.id,
+					openId: this.carhelp.getOpenId()
+				}).then(data => {
+					
+					data.data.url = window.location.href.split("#")[0] + "/#/car/payResult";
+			
+					uni.hideLoading()
+					wxPayJs(data.data)
+				}).catch(error => {
+						uni.hideLoading()
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
+			//支付宝支付
+			payAli() {
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				API.parkingTradeWebPay({
+					id: this.detail.id,
+					openId:  this.carhelp.getOpenIdALI()
+				}).then(response => {
+				 	uni.hideLoading()
+					let opthions = {
+						tradeNo: response.data.tradeOrder.tradeNo,
+						succUrl: window.location.href.split("#")[0] + "/#/pages/parking/payResult?id="+ response.data.tradeOrder.tradeNo,
+						cancelUrl: window.location.href.split("#")[0] + "/#/pages/parking/pay?id=" + this.form.channelId,
+					}
+					console.log(opthions);
+					aliPayJs(opthions);
+				}).catch(error => {
+						uni.hideLoading()
+					 uni.showToast({
+					 	title: error,
+					 	icon: "none"
+					 })
+				})
+			},
+			//支付
+			pay() {
+				var IS_WEIXIN = /MicroMessenger/.test(window.navigator.userAgent)
+				var IS_ALI = /AlipayClient/.test(window.navigator.userAgent)
+				
+				
+				if (IS_WEIXIN) {
+					this.payWx();
+				} else if (IS_ALI) {
+					this.payAli();
+				} else {
+					this.payWx();
+					uni.showModal({
+						content:"请用微信或支付宝打开"
+					})
+				}
+			},
+			
+			 
+		  
 			
 		}
 	}
 </script>
-
 <style>
+	page {
+		background-color: #fff;
+	}
+</style>
+<style lang="scss" scoped>
+	.cartitle{
+		font-size: 16px;
+		margin-left: 20px;
+		font-weight: bold;
+		 margin-top: 5px;
+	}
+	.color4fc5f7{
+		color:#4fc5f7;
+		margin-left: 5px;
+	}
+	.info {
+		    font-size: 14px;
+			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;
+			}
+		}
+	.carNone{
+		display: flex;
+		flex-direction: column;
+		justify-content: center;
+		align-items: center;
+		img{
+			width: 100%;
+			height: 100%;
+		}
+		p{
+			margin-top: -60px;
+		}
+	}
+	.u-char-item{
+		width: 29px !important;
+	}
+	.u-drawer{
+		z-index: -1 !important;
+	}
+	/deep/.u-char-item {
+		width: 30px !important;
+		height: 40px !important;
+		font-size: 18px !important;
+	}
 
+	.key-input {
+		padding-top: 24px;
+	}
+
+	.default {
+		margin: 16px 28px;
+	}
+
+	.login-btn {
+		margin: 28px;
+		background-color: #00B962 !important;
+		border-color: #00B962 !important;
+		color: #fff !important;
+	}
+	.login-btn2 {
+		margin: 28px;
+	
+	}
 </style>

+ 143 - 0
pages/parking/payResult.vue

@@ -0,0 +1,143 @@
+<template>
+	<view>
+		<u-navbar title="充值结果" :is-back="false"></u-navbar>
+		<view class="paySuccess">
+			<u-icon name="chenggong" custom-prefix="custom-icon" size="180" color="#00B962"></u-icon>
+			<view class="title oldTextjp" oldstyle="font-size: 20px;">{{detail.payStatusStr}}</view>
+			<view class="payPrice">
+				<font>{{detail.totalFee}}</font><span>元</span>
+			</view>
+			<p class="oldTextjp2" oldstyle="font-size: 16px;">{{detail.payNameStr}}</p>
+		</view>
+		<view class="paySuccess-btn">
+			
+		</view>
+	</view>
+</template>
+
+<script>
+	import * as API from '@/apis/finance.js'
+	
+	export default {
+		data() {
+			return {
+				detail: {},
+				id: "",
+				charge:false,
+				chargeObj:{},
+				
+
+			}
+		},
+		onLoad(op) {
+			if(op.id){
+				this.id=op.id
+				this.getInfo();
+			}
+			var obj=this.carhelp.getGunIdCharge();
+			if(obj){
+				this.charge=true
+				this.chargeObj=obj
+			}
+			
+		},
+		onReady() {
+			
+		},
+		methods: {
+
+			getInfo() {
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				API.accountDetail({
+					outOrderNo: this.id
+				}).then((res) => {
+					uni.hideLoading()
+
+					this.detail = res.data.orderInfo;
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
+			rechargeContinue() {
+				uni.redirectTo({
+					url: '/pages/user/finance/recharge'
+				})
+			},
+			chargeLook(){
+				
+				uni.redirectTo({
+					url:'/pages/searchPile/chargeProcess/charge?isback=1&deviceNo='+this.chargeObj.deviceNo+"&gun="+this.chargeObj.channelNo+"&carNumber="+this.chargeObj.carNumber
+				})
+				
+			},
+			balanceLook() {
+				uni.redirectTo({
+					url: '/pages/user/finance/balance'
+				})
+			}
+		}
+	}
+</script>
+<style>
+	page {
+		background-color: #fff;
+	}
+</style>
+<style lang="scss" scoped>
+	.paySuccess {
+		text-align: center;
+		padding: 50px 0;
+
+		.title {
+			font-size: 20px;
+			margin-top: 20px;
+		}
+
+		.payPrice {
+			display: flex;
+			align-items: flex-end;
+			justify-content: center;
+
+			font {
+				font-size: 36px;
+				line-height: 36px;
+			}
+
+			margin-top: 20px;
+		}
+
+		p {
+			color: #999;
+			margin-top: 4px;
+		}
+	}
+
+	.paySuccess-btn {
+		display: flex;
+		justify-content: space-between;
+		padding: 0 40px;
+	}
+
+	.success-btn1 {
+		color: #BBBBBB !important;
+		background-color: #fff !important;
+		flex: 0.4;
+
+		span {
+			color: #333;
+		}
+	}
+
+	.success-btn2 {
+		background-color: #00B962 !important;
+		flex: 0.4;
+		border-color: #00B962 !important;
+		color: #fff !important;
+	}
+</style>

+ 237 - 48
pages/parking/search.vue

@@ -1,81 +1,213 @@
 <template>
-	<view class="wrap">
-		<u-navbar title="添加车牌">
-			<view slot="right" v-if="isLogin" @click="gotoLink" style=" margin-right: 10px;"> 跳过</view>
-		</u-navbar>
-		<view class="key-input">
-			<u-message-input :focus="true" :value="form.carNum" :maxlength="maxlength" :disabled-keyboard="true"></u-message-input>
+	<view>
+		<view class="wrap" v-if="!kongResult">
+			<u-navbar title="车牌查询" :is-back="false">
+			</u-navbar>
+			<view class="key-input">
+				<u-message-input :focus="true" :value="form.carNum" :maxlength="maxlength" :disabled-keyboard="true"></u-message-input>
+			</view>
+			<ucarkeyboard ref="uKeyboard" mode="car" :showTips="true" :confirmBtn="false" :mask-close-able="false" :tooltip="false" v-model="keyShow" @change="valChange" @backspace="backspace"></ucarkeyboard>
+			 
+			<!-- <view class="carNone"  v-if="kongResult">
+				<img src="static/img/暂无数据-缺省页.png" alt="">
+				<p>没有找到停车信息</p>
+			</view> -->
+			<u-button class="login-btn" type="success" shape="circle" @click="keepCar">查询</u-button>
+			
+			<view style="padding: 20px;">
+				<b>停车场收费说明:</b><br>
+				缴费后请于规定时间离场,离场会自动抬杆。如果找不到停车信息,或者临牌停车,请至集中缴费处缴纳现金。
+				
+			</view>
+		</view>
+		
+		<view class="wrap"  v-if="kongResult">
+			<u-navbar title="停车缴费">
+				
+			</u-navbar>
+			
+			<view >
+				<view class="">
+					<view class="cartitle"> 缴费信息</view>
+					<view class="info" >
+						<view class="info-name">
+							车牌号
+						</view>
+						<view class="info-text">
+							{{detail.carNumber}}			
+							<a @click="goToBack" class="color4fc5f7 marginl5">修改</a>
+					
+						</view>
+					</view>
+					
+					<view class="info" >
+						<view class="info-name"  style="font-size: 16px;">
+							停车费
+						</view>
+						<view class="info-text" style="font-size: 16px;">
+							 			
+ 					{{detail.price}}元
+						</view>
+					</view>
+					<view class="cartitle"> 停车详情</view>
+					<view class="info" >
+						<view class="info-name">
+							停车位置
+						</view>
+						<view class="info-text">
+							 			
+					{{detail.parkingName}}
+						</view>
+					</view>
+					<view class="info" >
+						<view class="info-name">
+							入场时间
+						</view>
+						<view class="info-text">
+							 			
+						{{detail.inParkingTime}}
+						</view>
+					</view>
+					<view class="info" >
+						<view class="info-name">
+							停车时间
+						</view>
+						<view class="info-text">
+							 			
+					{{detail.parkingTimeStr}}
+						</view>
+					</view>
+				
+				
+ 			</view>
+			<u-button class="login-btn" type="success" shape="circle" @click="pay()">支付离场</u-button>
+			
+			<u-button class="login-btn2"  type="default" shape="circle" @click="keepCar">刷新</u-button>
+			
+			 
 		</view>
-		<ucarkeyboard ref="uKeyboard" mode="car" :showTips="true" :confirmBtn="false" :mask-close-able="false" :tooltip="false" v-model="keyShow" @change="valChange" @backspace="backspace"></ucarkeyboard>
-		<view class="default">
-			<u-checkbox-group>
-				<u-checkbox class="tips" v-model="form.defaultFlag" shape="circle" @change="checkboxChange()">设为默认车辆</u-checkbox>
-			</u-checkbox-group>
+		
+		
 		</view>
-		<u-button class="login-btn" type="success" shape="circle" @click="keepCar">保存</u-button>
 	</view>
 </template>
 
 <script>
-	import * as userApi from '@/apis/user.js'
+	
+	import * as API from '@/apis/parking.js'
 	import ucarkeyboard from '@/components/Ucarkeyboard.vue'
 
+	import {
+		wxPayJs
+	} from '@/utils/wxpay'
+	import {
+		aliPayJs
+	} from '@/utils/alipay'
+	
 	export default {
 		components: {
 			ucarkeyboard
 		},
 		data() {
 			return {
-				isLogin:false,
+			 
 				maxlength:8,
 				keyShow: true,
-				code:"",
-				codeId:"",
+				detail:{},
 				form: {
-					carNum: '鄂',
-					defaultFlag: true,
+					carNum: '鄂DD12345',
+					parkId: "",
 				},
+				
+				kongResult: false,
 			}
 		},
 		onLoad(op) {
-			if (op.jpcode) {
-				var str1 = op.jpcode.slice(0, 19);
-				var str2 = op.jpcode.slice(20, 21);
-				var str3 = op.jpcode.slice(22);
-
-				if (str1 == 'jp_team51_charge_id') {
-					if (str2 == 'A') {
-						this.code = str2;
-						this.codeId = str3;
-					}
-				}
-			}
-			if(op.login){
-				this.isLogin=true;
+			if(op.id){
+				this.form.parkId=op.id
+			}else{
+				uni.showModal({
+					content:"参数错误"
+				})
 			}
+			
 		},
 		onReady() {
 			this.$refs.uKeyboard.changeCarInputMode();
 		},
 		methods: {
-			gotoLink(){
-				if (this.code == 'A') {
-					uni.redirectTo({
-						url: '/pages/searchPile/stationAndPile/chargingPileDetails?id=' + this.codeId
-					})
-				} else if (this.isLogin){
-					uni.redirectTo({
-						url: '/pages/index/index'
+			//微信支付
+			payWx() {
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				
+				API.parkingWxPay({
+					id: this.detail.id,
+					openId: this.carhelp.getOpenId()
+				}).then(data => {
+					debugger
+					data.data.url = window.location.href.split("#")[0] + "/#/car/payResult";
+			
+					uni.hideLoading()
+					wxPayJs(data.data)
+				}).catch(error => {
+						uni.hideLoading()
+					uni.showToast({
+						title: error,
+						icon: "none"
 					})
-				}else {
-					uni.navigateBack({
-						url: '/pages/user/car/index'
+				})
+			},
+			//支付宝支付
+			payAli() {
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				API.parkingTradeWebPay({
+					id: this.detail.id,
+					openId:  this.carhelp.getOpenIdALI()
+				}).then(response => {
+				 	uni.hideLoading()
+					let opthions = {
+						tradeNo: response.data.tradeOrder.tradeNo,
+						succUrl: window.location.href.split("#")[0] + "/#/pages/parking/payResult?id="+ response.data.tradeOrder.tradeNo,
+						cancelUrl: window.location.href.split("#")[0] + "/#/pages/parking/search?id=" + this.form.parkId,
+					}
+					console.log(opthions);
+					aliPayJs(opthions);
+				}).catch(error => {
+						uni.hideLoading()
+					 uni.showToast({
+					 	title: error,
+					 	icon: "none"
+					 })
+				})
+			},
+			//支付
+			pay() {
+				var IS_WEIXIN = /MicroMessenger/.test(window.navigator.userAgent)
+				var IS_ALI = /AlipayClient/.test(window.navigator.userAgent)
+				
+				
+				if (IS_WEIXIN) {
+					this.payWx();
+				} else if (IS_ALI) {
+					this.payAli();
+				} else {
+					this.payWx();
+					uni.showModal({
+						content:"请用微信或支付宝打开"
 					})
 				}
 			},
-			checkboxChange() {
-				this.form.defaultFlag = !this.form.defaultFlag;
-			},
+			
+			 goToBack() {
+			 	this.kongResult=false
+			 },
+			 
 			// 按键被点击(点击退格键不会触发此事件)
 			valChange(val) {
 				if(this.form.carNum.length>=this.maxlength){
@@ -102,15 +234,24 @@
 			},
 			keepCar() {
 				console.log(this.form)
+				if (this.form.carNum.length <7) {
+					uni.showToast({
+						title:"车牌号至少输入7位"
+					})
+					return false;
+				} 
 				uni.showLoading({
 					title: "加载中",
 					mask: true,
 				})
-				userApi.addRegUserCar(this.form).then((res) => {
+				API.carPayDetail(this.form).then((res) => {
+					
 					uni.hideLoading();
 					
-					this.gotoLink()
+					this.detail = res.data;
+					this.kongResult=true;
 				}).catch(error => {
+						uni.hideLoading()
 					uni.showToast({
 						title: error,
 						icon: "none"
@@ -126,6 +267,50 @@
 	}
 </style>
 <style lang="scss" scoped>
+	.cartitle{
+		font-size: 16px;
+		margin-left: 20px;
+		font-weight: bold;
+		 margin-top: 5px;
+	}
+	.color4fc5f7{
+		color:#4fc5f7;
+		margin-left: 5px;
+	}
+	.info {
+		    font-size: 14px;
+			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;
+			}
+		}
+	.carNone{
+		display: flex;
+		flex-direction: column;
+		justify-content: center;
+		align-items: center;
+		img{
+			width: 100%;
+			height: 100%;
+		}
+		p{
+			margin-top: -60px;
+		}
+	}
 	.u-char-item{
 		width: 29px !important;
 	}
@@ -152,4 +337,8 @@
 		border-color: #00B962 !important;
 		color: #fff !important;
 	}
+	.login-btn2 {
+		margin: 28px;
+	
+	}
 </style>

+ 1 - 1
pages/user/freeInstallment.vue

@@ -67,7 +67,7 @@
 						</view>
 				</view>
 			      <view class="hint">
-			      	*请保持手机畅通,我们将安排专人与您联系。您也可以拨打 
+			      	<span style="color: red;">*</span>请保持手机畅通,我们将安排专人与您联系。您也可以拨打 
 					 <text class="tel-num">400-8899-619</text>查询申请审核进度!
 			      </view>
 				 <u-button type="warning" @click="submit" >提交申请</u-button>

+ 1 - 1
pages/user/toJoin.vue

@@ -66,7 +66,7 @@
 						</view>
 				</view>
 			      <view class="hint">
-			      	*请保持手机畅通,我们将安排专人与您联系。您也可以拨打 
+			      	<span style="color: red;">*</span>请保持手机畅通,我们将安排专人与您联系。您也可以拨打 
 					 <text class="tel-num" @click="calltel('400-8899-619')">400-8899-619</text>查询申请审核进度!
 			      </view>
 				 <u-button type="warning"  @click="submit"  >提交申请</u-button>

+ 31 - 0
utils/alipay.js

@@ -0,0 +1,31 @@
+function onBridgeReady(params) {
+	AlipayJSBridge.call("tradePay", {
+		tradeNO: params.tradeNo,
+	}, function(result) {
+		if (result.resultCode == '9000') {
+			location.href = params.succUrl
+		} else {
+			location.href = params.cancelUrl;
+		}
+		//alert(JSON.stringify(result));
+	});
+}
+
+export const aliPayJs = (params) => {
+	if (typeof window.WeixinJSBridge === 'undefined') {
+		if (document.addEventListener) {
+			document.addEventListener('AlipayJSBridgeReady', function() {
+				onBridgeReady(params)
+			}, false)
+		} else if (document.attachEvent) {
+			document.attachEvent('AlipayJSBridgeReady', function() {
+				onBridgeReady(params)
+			})
+			document.attachEvent('AlipayJSBridgeReady', function() {
+				onBridgeReady(params)
+			})
+		}
+	} else {
+		onBridgeReady(params)
+	}
+}

+ 46 - 0
utils/initALI.js

@@ -0,0 +1,46 @@
+import carhelp from '@/utils/mixin.js'
+import * as API_WeiXin from '@/apis/weixin.js'
+
+import {
+	getUrlParam,
+	getAlipayRedirectURI,
+ 
+} from '@/utils'
+var checkOpenId = true; //是否需要获取openId
+var openId = carhelp.getOpenIdALI();
+
+var app = {
+	init: function() {
+		 
+		if (!openId) {
+			this.getOpenId();
+		} 
+		
+		
+	},
+	
+	getOpenId() {
+		
+		const code = getUrlParam('auth_code');
+		var openId = carhelp.getOpenId()
+		if (!openId) {
+			if (!code) {
+				
+				var authUrl = document.URL.replace('pages/parking/search', 'auth');
+				window.location.href = getAlipayRedirectURI(process.car.VUE_APP_ALIAPPID, authUrl + '&page=' +
+					encodeURIComponent(document.URL));
+			} else {
+				
+				API_WeiXin.getDataByCodeALI(code).then(response => {
+					
+					carhelp.setOpenIdALI(response.data.openid)
+				 
+					 location.reload();
+				}).catch(error => {
+					console.log(error);
+				});
+			}
+		}
+	}
+}
+module.exports = app

+ 4 - 1
utils/mixin.js

@@ -78,12 +78,15 @@ var app = {
 	},
 	signOut:()=>  uni.removeStorageSync(prefix  + 'personInfo'),
 	getOpenId : () =>   uni.getStorageSync(prefix + 'wx_openId'+process.car.VUE_APP_WXAPPID),
+	setOpenId : (value) => uni.setStorageSync(prefix + 'wx_openId'+process.car.VUE_APP_WXAPPID, value),
+	
+	getOpenIdALI : () =>   uni.getStorageSync(prefix + 'ali_openId'+process.car.VUE_APP_WXAPPID),
+	setOpenIdALI : (value) => uni.setStorageSync(prefix + 'ali_openId'+process.car.VUE_APP_WXAPPID, value),
 	
 	getUserInfo : () => {
 		 return uni.getStorageSync(prefix + 'xpgj_wx_user_info')
 	},
 
-	setOpenId : (value) => uni.setStorageSync(prefix + 'wx_openId'+process.car.VUE_APP_WXAPPID, value),
 	setPersonInfo : (value) => uni.setStorageSync(prefix + 'personInfo', value),
 	
 	setUserInfo : (value) => uni.setStorageSync(prefix + 'xpgj_wx_user_info', value),

+ 3 - 3
utils/requestParking.js

@@ -6,7 +6,7 @@ var baseUrl = process.car.PARK_URL;
 
 const request = (options) => {
 
-
+	
 	return new Promise((resolve, reject) => {
 		//如果特殊链接需要传入token
 
@@ -25,7 +25,7 @@ const request = (options) => {
 			}
 		}).then((response) => {
 
-			resCount++
+			 
 			//防止连续请求多个接口时loading闪现
 			let [error, res] = response;
 
@@ -42,7 +42,7 @@ const request = (options) => {
 
 			}
 		}).catch(error => {
-			resCount++
+			 
 
 			let [err, res] = error;
 			reject(err)