瀏覽代碼

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

zhupeng 3 年之前
父節點
當前提交
269aa78dec
共有 7 個文件被更改,包括 260 次插入4 次删除
  1. 0 0
      apis/parking.js
  2. 18 0
      pages.json
  3. 22 0
      pages/parking/pay.vue
  4. 155 0
      pages/parking/search.vue
  5. 6 2
      pages/user/freeInstallment.vue
  6. 7 2
      pages/user/toJoin.vue
  7. 52 0
      utils/requestParking.js

+ 0 - 0
apis/parking.js


+ 18 - 0
pages.json

@@ -403,6 +403,24 @@
 			}
 			}
 		}
 		}
         
         
+        ,{
+			 "name":"停车场-查询",
+            "path" : "pages/parking/search",
+            "style" :                                                                                    
+            {
+            
+            }
+            
+        }
+        ,{
+			 "name":"停车场-支付",
+            "path" : "pages/parking/pay",
+            "style" :                                                                                    
+            {
+            
+            }
+            
+        }
     ],
     ],
 	"globalStyle": {
 	"globalStyle": {
 		"navigationStyle": "custom", // 隐藏系统导航栏
 		"navigationStyle": "custom", // 隐藏系统导航栏

+ 22 - 0
pages/parking/pay.vue

@@ -0,0 +1,22 @@
+<template>
+	<view>
+		
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				
+			}
+		},
+		methods: {
+			
+		}
+	}
+</script>
+
+<style>
+
+</style>

+ 155 - 0
pages/parking/search.vue

@@ -0,0 +1,155 @@
+<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>
+		<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 ucarkeyboard from '@/components/Ucarkeyboard.vue'
+
+	export default {
+		components: {
+			ucarkeyboard
+		},
+		data() {
+			return {
+				isLogin:false,
+				maxlength:8,
+				keyShow: true,
+				code:"",
+				codeId:"",
+				form: {
+					carNum: '鄂',
+					defaultFlag: true,
+				},
+			}
+		},
+		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;
+			}
+		},
+		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'
+					})
+				}else {
+					uni.navigateBack({
+						url: '/pages/user/car/index'
+					})
+				}
+			},
+			checkboxChange() {
+				this.form.defaultFlag = !this.form.defaultFlag;
+			},
+			// 按键被点击(点击退格键不会触发此事件)
+			valChange(val) {
+				if(this.form.carNum.length>=this.maxlength){
+					return
+				}
+				// 将每次按键的值拼接到form.carNum变量中,注意+=写法
+				this.form.carNum += val;
+				console.log(this.form.carNum);
+				
+				if(this.form.carNum.length == 1) {
+					this.$refs.uKeyboard.changeCarInputMode();
+				}
+			},
+			// 退格键被点击
+			backspace() {
+				// 删除form.carNum的最后一个字符
+				if (this.form.carNum.length) this.form.carNum = this.form.carNum.substr(0, this.form.carNum.length - 1);
+				console.log(this.form.carNum);
+				
+				var aaa =	this.$refs.uKeyboard.changeCarInputValue();
+				if(this.form.carNum.length == 0 && aaa) {
+					this.$refs.uKeyboard.changeCarInputMode();
+				}
+			},
+			keepCar() {
+				console.log(this.form)
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				userApi.addRegUserCar(this.form).then((res) => {
+					uni.hideLoading();
+					
+					this.gotoLink()
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			}
+		}
+	}
+</script>
+<style>
+	page {
+		background-color: #fff;
+	}
+</style>
+<style lang="scss" scoped>
+	.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;
+	}
+</style>

+ 6 - 2
pages/user/freeInstallment.vue

@@ -68,7 +68,7 @@
 				</view>
 				</view>
 			      <view class="hint">
 			      <view class="hint">
 			      	*请保持手机畅通,我们将安排专人与您联系。您也可以拨打 
 			      	*请保持手机畅通,我们将安排专人与您联系。您也可以拨打 
-					 <text class="tel-num">400-8899-619</text>查询申请审核进度!
+					 <text class="tel-num"  @click="calltel('400-8899-619')" >400-8899-619</text>查询申请审核进度!
 			      </view>
 			      </view>
 				 <u-button type="warning" @click="submit" >提交申请</u-button>
 				 <u-button type="warning" @click="submit" >提交申请</u-button>
 			</view>
 			</view>
@@ -142,7 +142,11 @@
 				}
 				}
 			},
 			},
 			methods:{
 			methods:{
-				
+				calltel(tel){
+					uni.makePhoneCall({
+						phoneNumber:tel //仅为示例
+					});
+				},
 				submit(){
 				submit(){
 				
 				
 					var obj=[]
 					var obj=[]

+ 7 - 2
pages/user/toJoin.vue

@@ -47,7 +47,7 @@
 						</view>
 						</view>
 				</view>
 				</view>
 				<view class="want">
 				<view class="want">
-					<p>自由电桩数量</p>
+					<p>自有电桩地点</p>
 					<view class="radio-box">
 					<view class="radio-box">
 						
 						
 									<view class="">
 									<view class="">
@@ -67,7 +67,7 @@
 				</view>
 				</view>
 			      <view class="hint">
 			      <view class="hint">
 			      	*请保持手机畅通,我们将安排专人与您联系。您也可以拨打 
 			      	*请保持手机畅通,我们将安排专人与您联系。您也可以拨打 
-					 <text class="tel-num">400-8899-619</text>查询申请审核进度!
+					 <text class="tel-num" @click="calltel('400-8899-619')">400-8899-619</text>查询申请审核进度!
 			      </view>
 			      </view>
 				 <u-button type="warning"  @click="submit"  >提交申请</u-button>
 				 <u-button type="warning"  @click="submit"  >提交申请</u-button>
 			</view>
 			</view>
@@ -149,6 +149,11 @@
 				}
 				}
 			},
 			},
 			methods:{
 			methods:{
+				calltel(tel){
+					uni.makePhoneCall({
+						phoneNumber:tel //仅为示例
+					});
+				},
 				
 				
 				submit(){
 				submit(){
 				
 				

+ 52 - 0
utils/requestParking.js

@@ -0,0 +1,52 @@
+import carhelp from '@/utils/mixin.js'
+
+
+var baseUrl = process.car.PARK_URL;
+
+
+const request = (options) => {
+
+
+	return new Promise((resolve, reject) => {
+		//如果特殊链接需要传入token
+
+		uni.request({
+			method: options.method ? options.method : 'get',
+			url: baseUrl + options.url,
+			data: options.data ? options.data : {},
+
+			header: options.header ? {
+				...options.header,
+
+			} : {
+				'Content-Type': 'application/x-www-form-urlencoded',
+				'X-Requested-With': 'XMLHttpRequest',
+				// 'Authorization':token
+			}
+		}).then((response) => {
+
+			resCount++
+			//防止连续请求多个接口时loading闪现
+			let [error, res] = response;
+
+
+			if (res.data.code != 200) {
+				reject(res.data.message)
+			} else {
+				if (!res.data.result) {
+
+					reject(res.data.message);
+				} else {
+					resolve(res.data);
+				}
+
+			}
+		}).catch(error => {
+			resCount++
+
+			let [err, res] = error;
+			reject(err)
+		})
+	});
+}
+export default request