huangmp 4 년 전
부모
커밋
0987ad5762
12개의 변경된 파일494개의 추가작업 그리고 347개의 파일을 삭제
  1. 10 1
      assets/http/api.js
  2. 16 0
      assets/http/service.js
  3. 0 83
      comps/auth.vue
  4. 1 1
      comps/clear-user.vue
  5. 1 1
      pages/auth/auth.vue
  6. 12 9
      pages/choosePlot/householdCert/householdCert.vue
  7. 74 18
      pages/empty/empty.vue
  8. 8 1
      pages/index/index.vue
  9. 366 227
      pages/myCar/add.vue
  10. 2 2
      pages/myCar/myCar.vue
  11. 1 1
      pages/myhome/myhome.vue
  12. 3 3
      store/index.js

+ 10 - 1
assets/http/api.js

@@ -160,6 +160,14 @@ const iotDeviceList = p => http.post("/community-app-service/app/iotdevice/list"
 
 const accessRecords = p => http.post("/community-app-service/app/accessRecords/list", p)
 
+
+const parking={
+	parkingLotList:p => http.get("/community-app-service//app/parkingLot/list", {params:p}),
+	parkingAreaList:p => http.get("/community-app-service//app/parkingArea/list", {params:p}),
+	parkingSpaceList:p => http.get("/community-app-service//app/parkingSpace/list", {params:p}),
+	parkingSpaceCount:p => http.get("/community-app-service//app/parkingSpace/count", {params:p}),
+}
+
 export const api = {
 	//文件上传
 	uploadFile,
@@ -256,5 +264,6 @@ export const api = {
 	guestRecordsPage,
 	guestRecordsCount,
 	guestRecordsSubmit,
-	getOpenData
+	getOpenData,
+	parking
 }

+ 16 - 0
assets/http/service.js

@@ -9,6 +9,14 @@ let baseURL = "http://192.168.1.120"
 let tokenUrl = baseURL +
 	"/blade-auth/oauth/token?tenant_id=000000&password=21232f297a57a5a743894a0e4a801fc3&username=admin&grant_type=password"
 
+//获取tenantId
+const getTenantId = () => {
+	let tenantId = null
+	try {
+		tenantId = uni.getStorageSync('lifeData').vuex_tenantId
+	} catch (e) {}
+	return tenantId
+}
 //获取token
 const getTokenStorage = () => {
 	let token = ''
@@ -27,11 +35,19 @@ http.setConfig((config) => {
 	return config
 })
 http.interceptors.request.use((config) => {
+	console.log();
 	/* 请求之前拦截器。可以使用async await 做异步操作 */
 	config.header = {
 		...config.header,
 		"Blade-Auth": getTokenStorage()
 	}
+	let tenantId=getTenantId()
+	
+	if (config.method == 'POST' && config.data && tenantId) {
+		config.data.tenantId=tenantId
+	}
+	
+	
 	return config
 }, (config) => {
 	return Promise.reject(config)

+ 0 - 83
comps/auth.vue

@@ -1,83 +0,0 @@
-<template>
-	<view style="background-color: #fff;min-height: 100vh;">
-		<view class="default">
-			<image src="/static/common/empty.png"></image>
-			<view style="font-size: 26rpx;">
-				<text style="color: #909090;">{{msg}}</text>
-			</view>
-			<navigator :url="url" class="cu-btn sm  margin-top-50"
-				style="padding: 35rpx 65rpx;margin-left: 8rpx;background-color: #FFFFFF;border: 1rpx solid #d0d0d0;color: #606266;font-size: 26rpx;">
-				{{btnName}}
-			</navigator>
-		</view>
-	</view>
-</template>
-
-<script>
-	export default {
-		data() {
-			return {
-				msg: "您还未完成注册认证",
-				btnName: "去注册认证",
-				url: "../register/register"
-			}
-		},
-		props: ['type'],
-		created() {
-			if (this.type == '2') {
-				this.getHouseUser()
-				this.initData()
-			}
-		},
-		methods: {
-			initData() {
-				//导航栏标题
-				uni.setNavigationBarTitle({
-					title: "房屋认证"
-				})
-				//去认证
-				this.msg = "您还未完成房屋认证"
-				this.btnName = "去认证"
-			},
-			async getHouseUser() {
-				let member = getApp().globalData.member
-				if (this.$isEmpty(member)) {
-					this.url = "../auth/auth"
-					return
-				}
-				let params = {
-					name: member.name,
-					phone: member.tel
-				}
-				let res = await this.$http.getHouseUserCondition(params)
-				let list = res.data.data
-				if (this.$isEmpty(list)) {
-					this.url = "../auth/auth"
-					return
-				}
-				uni.setStorageSync('houseList', list)
-				this.url = "../bindRoom/bindRoom"
-			}
-		}
-	}
-</script>
-
-<style lang="scss">
-	.default {
-		text-align: center;
-		position: fixed;
-		left: 50%;
-		top: 40%;
-		transform: translate(-50%, -70%);
-	}
-
-	.default text {
-		color: #AAAAAA;
-	}
-
-	.default image {
-		height: 180rpx;
-		width: 180rpx;
-		display: inline-block;
-	}
-</style>

+ 1 - 1
comps/clear-user.vue

@@ -7,7 +7,7 @@
 				</view>
 				<view class="flex-sub" style="margin: 50rpx 30rpx;">
 					<text class=" text-red"
-						style="font-size: 28rpx;line-height: 56rpx;">您的个人信息,户信息,认证信息将被清空/删除,确定进行此操作?</text>
+						style="font-size: 28rpx;line-height: 56rpx;">您的个人信息,户信息,认证信息将被清空/删除,确定进行此操作?</text>
 					<view class="margin-top " v-if="hasMember">
 						<text class="cuIcon-title text-red"></text>
 						<text class="text-sm ">业主角色请到【家人管理】处移除房间下的成员</text>

+ 1 - 1
pages/auth/auth.vue

@@ -74,7 +74,7 @@
 				</view>
 			</view>
 		</view>
-		<view  class="footer-fixed" @click="next" >
+		<view  class="footer-fixed" @click="next" :style="{marginBottom:safeAreaBottom +'rpx'}">
 			<view class="cu-btn  flex  text-lg bg-red-btn" style="padding: 46rpx 0;">
 				下一步
 			</view>

+ 12 - 9
pages/choosePlot/householdCert/householdCert.vue

@@ -33,13 +33,11 @@
 					<u-form-item label="证件类型:" prop="nationalityName" label-width="150">
 						<u-input :disabled="true" :border="true" type="text" v-model="nationalityName"></u-input>
 					</u-form-item>
-					<u-form-item :required="type==0?true:false" label="证件号码" prop="id_card" label-width="150">
+					<u-form-item :required="true" label="证件号码" prop="id_card" label-width="150">
 						<u-input :border="true" placeholder="请输入证件号码" type="text" :trim="true" maxlength="18"
 							v-model="id_card"></u-input>
 					</u-form-item>
-					<view class="flex justify-end">
-						<text class="text-sm text-orange">*住户类型不是业主时,不需要等待管理员审核</text>
-					</view>
+					
 					<u-form-item :required="true" label="性别" prop="sex" label-width="150">
 						<u-radio-group v-model="sex">
 							<u-radio shape="circle" name="1">男</u-radio>
@@ -220,10 +218,10 @@
 				//小区名字
 				community_name: '',
 				//楼栋名字
-				buildingId:'',
+				buildingId: '',
 				building_name: '',
 				//单元名字
-				unitId:'',
+				unitId: '',
 				unit_name: '',
 				//房间名字
 				room_name: '',
@@ -276,13 +274,13 @@
 			};
 		},
 		onLoad: function(options) {
-			console.log(options,"options");
+			console.log(options, "options");
 			//显示用户选择的小区+楼栋+房间名字
 			this.residentialId = options.residentialId
 			this.residential_name = options.residential_name;
-			this.buildingId=options.building_id
+			this.buildingId = options.building_id
 			this.building_name = options.building_name
-			this.unitId=options.unitId
+			this.unitId = options.unitId
 			this.unit_name = options.unit_name;
 			this.room_name = options.room_name;
 			this.room_id = options.room_id;
@@ -480,7 +478,12 @@
 				params['createType'] = '0'; //申请来源0-小程序添加 1-后台添加  2-后台导入 3-app添加
 				params['recordType'] = '0'; //申请的记录类型 0--认证类型 1--新增类型 2--编辑类型
 				params['memberId'] = app.globalData.member.id; //会员id
+				uni.showLoading({
+					title:"提交中...",
+					mask:"none"
+				})
 				that.$http.authentication(params).then(res => {
+					uni.hideLoading()
 					//提交成功
 					if (res.data.success) {
 						app.globalData.oneFailHint("提交成功", function() {

+ 74 - 18
pages/empty/empty.vue

@@ -1,26 +1,82 @@
 <template>
-	<view class="">
-		<auth :type="type"></auth>
+	<view style="background-color: #fff;min-height: 100vh;">
+		<view class="default">
+			<image src="/static/common/empty.png"></image>
+			<view style="font-size: 26rpx;">
+				<text style="color: #909090;">{{msg}}</text>
+			</view>
+			<navigator :url="url" class="cu-btn sm  margin-top-50"
+				style="padding: 35rpx 65rpx;margin-left: 8rpx;background-color: #FFFFFF;border: 1rpx solid #d0d0d0;color: #606266;font-size: 26rpx;">
+				{{btnName}}
+			</navigator>
+		</view>
 	</view>
 </template>
 
 <script>
-import auth from "@/comps/auth.vue"
-export default {
-	components:{
-		auth
-	},
-	data() {
-		return {
-			type:null
-		};
-	},
-	onLoad(options) {
-		this.type=options.type
-	}
-};
+	export default {
+		data() {
+			return {
+				msg: "您还未完成注册认证",
+				btnName: "去注册认证",
+				url: "../register/register"
+			};
+		},
+		onLoad(options) {
+			if (options.type == 2) {
+				this.getHouseUser()
+				this.initData()
+			}
+		},
+		methods: {
+			initData() {
+				//导航栏标题
+				uni.setNavigationBarTitle({
+					title: "房屋认证"
+				})
+				//去认证
+				this.msg = "您还未完成房屋认证"
+				this.btnName = "去认证"
+			},
+			async getHouseUser() {
+				let member = getApp().globalData.member
+				if (this.$isEmpty(member)) {
+					this.url = "../auth/auth"
+					return
+				}
+				let params = {
+					name: member.name,
+					phone: member.tel
+				}
+				let res = await this.$http.getHouseUserCondition(params)
+				let list = res.data.data
+				if (this.$isEmpty(list)) {
+					this.url = "../auth/auth"
+					return
+				}
+				uni.setStorageSync('houseList', list)
+				this.url = "../bindRoom/bindRoom"
+			}
+		}
+	};
 </script>
 
 <style lang="scss" scoped>
-	
-</style>
+	.default {
+		text-align: center;
+		position: fixed;
+		left: 50%;
+		top: 40%;
+		transform: translate(-50%, -70%);
+	}
+
+	.default text {
+		color: #AAAAAA;
+	}
+
+	.default image {
+		height: 180rpx;
+		width: 180rpx;
+		display: inline-block;
+	}
+</style>

+ 8 - 1
pages/index/index.vue

@@ -347,13 +347,15 @@
 			},
 			//改变小区
 			typeChange: function(e) {
+				this.$u.vuex('vuex_tenantId',this.vuex_residentialList[e.detail.value].tenantId)
+				
 				let _this = this;
 				Promise.all([_this.getResidentialListByMember()]).then(result => {
 					let value = _this.plotArray[e.detail.value];
 					let residentialId = _this.residentialIdList[e.detail.value];
+					console.log(residentialId,"123456");
 					_this.fetchNoticeList(residentialId);
 					let residentialList = uni.getStorageSync('residentialList')
-
 					uni.setStorageSync("personTel", residentialList[e.detail.value].personTel);
 					uni.setStorageSync("plotName", value);
 					uni.setStorageSync("residentialId", residentialId);
@@ -527,6 +529,8 @@
 					let personTelList = []
 
 					if (res.data.success) {
+						this.$u.vuex('vuex_residentialList',res.data.data)
+						
 						that.fetchNoticeList(res.data.data[0].residentialId);
 						app.globalData.userId = res.data.data[0].userId
 
@@ -576,6 +580,9 @@
 						//为 小区 picker 设置默认项
 						let defaultPlotId = uni.getStorageSync("residentialId")
 						if (!that.$isEmpty(defaultPlotId)) {
+							let item= this.vuex_residentialList.find(item=>item.id==defaultPlotId)
+							this.$u.vuex('vuex_tenantId',item.tenantId)
+							console.log(item,"456");
 							that.plotIndex = residentialIdList.indexOf(defaultPlotId)
 						}
 						that.setData({

+ 366 - 227
pages/myCar/add.vue

@@ -1,163 +1,223 @@
 <template>
 	<view>
-		<view class="form">
-			<view class="flex">
-				<image style="width: 35rpx;height: 35rpx;display: block;padding-top: 6rpx;padding-right: 10rpx;" src="/static/myCar/tag1.png" mode=""></image>
-				<text class="text-lg text-bold">请选择基本信息</text>
+		<view v-if="step==2" class="" @click="step--"
+			style="position: absolute;right: 20rpx;top: 10rpx;font-size: 28rpx;color: #5064eb;">
+			<text>上一步</text>
+		</view>
+		<view v-show="step==1" style="margin-top: 20rpx;">
+			<view class="form">
+				<view class="flex">
+					<image style="width: 35rpx;height: 35rpx;display: block;padding-top: 6rpx;padding-right: 10rpx;"
+						src="/static/myCar/tag1.png" mode=""></image>
+					<text class="text-lg text-bold">请选择基本信息</text>
+				</view>
+				<view class="card">
+					<u-form :model="model" ref="uForm">
+						<u-form-item :required="true" :label-width="labelWidth" label="车牌号码">
+							<u-input type="text" v-model="model.number" placeholder="请填写车牌号码"></u-input>
+						</u-form-item>
+						<u-form-item :label-width="labelWidth" label="车辆类型">
+							<u-input type="select" :select-open="carTypeShow" v-model="carTypeLabel"
+								placeholder="请选择车辆类型" @click="carTypeShow=true"></u-input>
+						</u-form-item>
+						<u-form-item :label-width="labelWidth" label="车辆性质">
+							<u-input type="select" :select-open="carPropertiesShow" v-model="carPropertiesLabel"
+								placeholder="请选择车辆性质" @click="carPropertiesShow=true"></u-input>
+						</u-form-item>
+						<u-form-item :label-width="labelWidth" label="燃油类别">
+							<u-input type="select" :select-open="fuelCategoryShow" v-model="fuelCategoryLabel"
+								placeholder="请选择燃油类别" @click="fuelCategoryShow=true"></u-input>
+						</u-form-item>
+					</u-form>
+				</view>
 			</view>
-			<view class="card">
-				<u-form :model="model"  ref="uForm" >
-					<u-form-item :required="true"  :label-width="labelWidth"   label="车牌号码" >
-						<u-input  type="text"  v-model="model.number" disabled @click="openKeyBoard"  placeholder="请填写车牌号码" ></u-input>
-					</u-form-item>
-					<u-form-item   :label-width="labelWidth"   label="车辆类型" >
-						<u-input  type="select" :select-open="carTypeShow" v-model="carTypeLabel"  placeholder="请选择车辆类型" @click="carTypeShow=true"></u-input>
-					</u-form-item>
-					<u-form-item   :label-width="labelWidth"   label="车辆性质" >
-						<u-input  type="select" :select-open="carPropertiesShow" v-model="carPropertiesLabel" placeholder="请选择车辆性质" @click="carPropertiesShow=true"></u-input>
-					</u-form-item>
-					<u-form-item   :label-width="labelWidth"   label="燃油类别" >
-						<u-input  type="select" :select-open="fuelCategoryShow" v-model="fuelCategoryLabel" placeholder="请选择燃油类别" @click="fuelCategoryShow=true"></u-input>
-					</u-form-item>
-				</u-form>
+			<view class="form">
+				<view class="flex">
+					<image style="width: 35rpx;height: 35rpx;display: block;padding-top: 6rpx;padding-right: 10rpx;"
+						src="/static/myCar/tag1.png" mode=""></image>
+					<text class="text-lg text-bold">请选择车位信息</text>
+				</view>
+				<view class="card">
+					<u-form :model="model" ref="uForm">
+						<u-form-item :required="true" :label-width="labelWidth" label="所属车场">
+							<u-input type="select" :select-open="parkingLotShow" v-model="parkingLotLabel"
+								placeholder="请选择车场区域" @click="parkingLotShow=true"></u-input>
+						</u-form-item>
+						<u-form-item :required="true" :label-width="labelWidth" label="车场区域">
+							<u-input type="select" :select-open="parkingAreaShow" v-model="parkingAreaLabel"
+								placeholder="请选择车场区域" @click="parkingAreaShow=true"></u-input>
+						</u-form-item>
+						<u-form-item :required="true" :label-width="labelWidth" label="所属车位">
+							<u-input type="select" :select-open="parkingSpaceShow" v-model="parkingSpaceLabel"
+								placeholder="请选择所属车位" @click="parkingSpaceShow=true"></u-input>
+						</u-form-item>
+					</u-form>
+				</view>
 			</view>
 		</view>
-		<view class="form">
-			<view class="flex">
-				<image style="width: 35rpx;height: 35rpx;display: block;padding-top: 6rpx;padding-right: 10rpx;" src="/static/myCar/tag1.png" mode=""></image>
-				<text class="text-lg text-bold">请上传车辆照片</text>
-				<text class="text-sm text-gray margin-top-10">(必填)</text>
-			</view>
-			<view class="card">
-				<view style="padding: 20rpx 0;" @click="chooseImage(1)"  class="flex justify-center ">
-					<view class=" ">
-						<upload-img
-						   :width="width"
-						   :height="height"
-						  :currentImage="model.carImg"
-						  bgsrc="https://szsq.nxzhsq.cn/community/miniofile/app/upload.png"
-						  >
-						</upload-img>
-						<view class="text-center  padding-top-20 base-color" >
-						 <text class="cuIcon-camera padding-right-sm" style="font-size: 30rpx;"></text>
-						 <text v-if="$isEmpty(model.carImg)">点击上传车辆照片</text>
-						 <text style="margin-top: 40rpx;display: inline-block;" v-else>点击重新上传</text>
+
+		<view v-show="step==2" style="margin-top: 20rpx;">
+			<view class="form">
+				<view class="flex">
+					<image style="width: 35rpx;height: 35rpx;display: block;padding-top: 6rpx;padding-right: 10rpx;"
+						src="/static/myCar/tag1.png" mode=""></image>
+					<text class="text-lg text-bold">请上传车辆照片</text>
+					<text class="text-sm text-gray margin-top-10">(必填)</text>
+				</view>
+				<view class="card">
+					<view style="padding: 20rpx 0;" @click="chooseImage(1)" class="flex justify-center ">
+						<view class=" ">
+							<upload-img :width="width" :height="height" :currentImage="model.carImg"
+								bgsrc="https://szsq.nxzhsq.cn/community/miniofile/app/upload.png">
+							</upload-img>
+							<view class="text-center  padding-top-20 base-color">
+								<text class="cuIcon-camera padding-right-sm" style="font-size: 30rpx;"></text>
+								<text v-if="$isEmpty(model.carImg)">点击上传车辆照片</text>
+								<text style="margin-top: 40rpx;display: inline-block;" v-else>点击重新上传</text>
+							</view>
 						</view>
 					</view>
 				</view>
 			</view>
-		</view>
-		<view class="form">
-			<view class="flex">
-				<image style="width: 35rpx;height: 35rpx;display: block;padding-top: 6rpx;padding-right: 10rpx;" src="/static/myCar/tag1.png" mode=""></image>
-				<text class="text-lg text-bold">请上传行驶证正面</text>
-				<text class="text-sm text-gray margin-top-10">(选填)</text>
-			</view>
-			<view class="card">
-				<view style="padding: 20rpx 0;" @click="chooseImage(2)"  class="flex justify-center ">
-					<view class=" ">
-						<upload-img
-						   :width="width"
-						   :height="height"
-						  :currentImage="model.vehicleDrivingLicense1"
-						  bgsrc="https://szsq.nxzhsq.cn/community/miniofile/app/zm.png"
-						  >
-						</upload-img>
-						<view class="text-center  padding-top-20 base-color" >
-						 <text class="cuIcon-camera padding-right-sm" style="font-size: 30rpx;"></text>
-						 <text v-if="$isEmpty(model.carImg)">点击上传行驶证正面</text>
-						 <text style="margin-top: 40rpx;display: inline-block;" v-else>点击重新上传</text>
+			<view class="form">
+				<view class="flex">
+					<image style="width: 35rpx;height: 35rpx;display: block;padding-top: 6rpx;padding-right: 10rpx;"
+						src="/static/myCar/tag1.png" mode=""></image>
+					<text class="text-lg text-bold">请上传行驶证正面</text>
+					<text class="text-sm text-gray margin-top-10">(选填)</text>
+				</view>
+				<view class="card">
+					<view style="padding: 20rpx 0;" @click="chooseImage(2)" class="flex justify-center ">
+						<view class=" ">
+							<upload-img :width="width" :height="height" :currentImage="model.vehicleDrivingLicense1"
+								bgsrc="https://szsq.nxzhsq.cn/community/miniofile/app/zm.png">
+							</upload-img>
+							<view class="text-center  padding-top-20 base-color">
+								<text class="cuIcon-camera padding-right-sm" style="font-size: 30rpx;"></text>
+								<text v-if="$isEmpty(model.carImg)">点击上传行驶证正面</text>
+								<text style="margin-top: 40rpx;display: inline-block;" v-else>点击重新上传</text>
+							</view>
 						</view>
 					</view>
 				</view>
 			</view>
-		</view>
-		<view class="form">
-			<view class="flex">
-				<image style="width: 35rpx;height: 35rpx;display: block;padding-top: 6rpx;padding-right: 10rpx;" src="/static/myCar/tag1.png" mode=""></image>
-				<text class="text-lg text-bold">请上传行驶证反面</text>
-				<text class="text-sm text-gray margin-top-10">(选填)</text>
-			</view>
-			<view class="card">
-				<view style="padding: 20rpx 0;" @click="chooseImage(3)"  class="flex justify-center ">
-					<view class=" ">
-						<upload-img
-						   :width="width"
-						   :height="height"
-						  :currentImage="model.vehicleDrivingLicense2"
-						  bgsrc="https://szsq.nxzhsq.cn/community/miniofile/app/fm.png"
-						  >
-						</upload-img>
-						<view class="text-center  padding-top-20 base-color" >
-						 <text class="cuIcon-camera padding-right-sm" style="font-size: 30rpx;"></text>
-						 <text v-if="$isEmpty(model.carImg)">点击上传行驶证反面</text>
-						 <text style="margin-top: 40rpx;display: inline-block;" v-else>点击重新上传</text>
+			<view class="form">
+				<view class="flex">
+					<image style="width: 35rpx;height: 35rpx;display: block;padding-top: 6rpx;padding-right: 10rpx;"
+						src="/static/myCar/tag1.png" mode=""></image>
+					<text class="text-lg text-bold">请上传行驶证反面</text>
+					<text class="text-sm text-gray margin-top-10">(选填)</text>
+				</view>
+				<view class="card">
+					<view style="padding: 20rpx 0;" @click="chooseImage(3)" class="flex justify-center ">
+						<view class=" ">
+							<upload-img :width="width" :height="height" :currentImage="model.vehicleDrivingLicense2"
+								bgsrc="https://szsq.nxzhsq.cn/community/miniofile/app/fm.png">
+							</upload-img>
+							<view class="text-center  padding-top-20 base-color">
+								<text class="cuIcon-camera padding-right-sm" style="font-size: 30rpx;"></text>
+								<text v-if="$isEmpty(model.carImg)">点击上传行驶证反面</text>
+								<text style="margin-top: 40rpx;display: inline-block;" v-else>点击重新上传</text>
+							</view>
 						</view>
 					</view>
 				</view>
 			</view>
 		</view>
-		
-		<view >
+
+		<view>
 			<view class="bg-white" style="height: 80rpx;"></view>
-			<view class="" @click="submit" style="width: 90%;margin: 0 auto ;margin-bottom: 10%;">
-				<view  class="cu-btn round base-bg-color" style="padding: 40rpx;width: 100%;" >
-					<text class="cuIcon-add"></text>
-					<text >确认添加</text>
+			<view v-if="step==1" class="" @click="next" style="width: 90%;margin: 0 auto ;margin-bottom: 10%;">
+				<view class="cu-btn round base-bg-color" style="padding: 40rpx;width: 100%;">
+					<text>下一步</text>
+				</view>
+			</view>
+
+			<view v-if="step==2" class="" @click="submit" style="width: 90%;margin: 0 auto ;margin-bottom: 10%;">
+				<view class="cu-btn round base-bg-color" style="padding: 40rpx;width: 100%;">
+					<text :class="isAdd?'cuIcon-add':'cuIcon-edit'" class="margin-right-10"></text>
+					<text v-text="isAdd?'确认添加':'确定修改'"></text>
 				</view>
 			</view>
+
+
 		</view>
+
+
 		<u-select @confirm="carTypeConfirm" v-model="carTypeShow" :list="carTypeList"></u-select>
 		<u-select @confirm="carPropertiesConfirm" v-model="carPropertiesShow" :list="carPropertiesList"></u-select>
 		<u-select @confirm="fuelCategoryConfirm" v-model="fuelCategoryShow" :list="fuelCategoryList"></u-select>
-		<keyboard-package z-index="999" ref="plateNumber" type="plateNumber"  @onInput="onInput" @onDelete="onDelete" @onConfirm="onConfirm"/>
+
+		<u-select @confirm="parkingLotConfirm" v-model="parkingLotShow" :list="parkingLotList" label-name="parkName"
+			value-name="id"></u-select>
+		<u-select @confirm="parkingAreaConfirm" v-model="parkingAreaShow" :list="parkingAreaList" label-name="name"
+			value-name="id"></u-select>
+		<u-select @confirm="parkingSpaceConfirm" v-model="parkingSpaceShow" :list="parkingSpaceList" label-name="number"
+			value-name="id"></u-select>
 	</view>
 </template>
 
 <script>
-	import keyboardPackage from "@/comps/keyboard-package/keyboard-package.vue"
 	import uploadImg from '@/comps/uploadimg/uploadImg.vue'
 	var that;
 	var app = getApp();
 	export default {
 		components: {
-			uploadImg, keyboardPackage
+			uploadImg
 		},
 		data() {
 			return {
-				labelWidth:'200',
-				width:480,
-				height:320,
-				
+				isAdd: true,
+				step: 1,
+
+				labelWidth: '200',
+				width: 480,
+				height: 320,
+				//车场
+				parkingLotLabel: '',
+				parkingLotValue: "",
+				parkingLotList: [],
+				parkingLotShow: false,
+				//车场区域
+				parkingAreaLabel: '',
+				parkingAreaValue: "",
+				parkingAreaList: [],
+				parkingAreaShow: false,
+				//车位
+				parkingSpaceLabel: '',
+				parkingSpaceValue: "",
+				parkingSpaceList: [],
+				parkingSpaceShow: false,
+
 				//车牌号
-				carNoInputList:[],
-				
+				carNoInputList: [],
+
 				//车辆类型
-				carTypeList:[],
-				carTypeShow:false,
-				carTypeLabel:'',
-				
+				carTypeList: [],
+				carTypeShow: false,
+				carTypeLabel: '',
+
 				//车辆性质
-				carPropertiesList:[],
-				carPropertiesShow:false,
-				carPropertiesLabel:'',
-				
+				carPropertiesList: [],
+				carPropertiesShow: false,
+				carPropertiesLabel: '',
+
 				//燃油类别
-				fuelCategoryList:[],
-				fuelCategoryShow:false,
-				fuelCategoryLabel:'',
-				
-				model:{
-					type:'',//车辆类型的key
-					number:'',//车牌号
-					properties:'',//车辆性质的key,
-					fuelCategory:'',//燃油类别的key
-					carImg:'',//车辆照片
-					vehicleDrivingLicense1:'',//行驶证正面
-					vehicleDrivingLicense2:'',//行驶证反面
-					personId:'',
-					residentialId:'',
-					tenantType:0
+				fuelCategoryList: [],
+				fuelCategoryShow: false,
+				fuelCategoryLabel: '',
+
+				model: {
+					type: '', //车辆类型的key
+					number: '', //车牌号
+					properties: '', //车辆性质的key,
+					fuelCategory: '', //燃油类别的key
+					carImg: '', //车辆照片
+					vehicleDrivingLicense1: '', //行驶证正面
+					vehicleDrivingLicense2: '', //行驶证反面
+					personId: '',
+					residentialId: '',
+					tenantType: 0
 				},
 			}
 		},
@@ -168,67 +228,157 @@
 			this.model.memberId = this.vuex_member.id;
 			this.model.idCard = this.vuex_member.idcard;
 			this.model.personName = this.vuex_member.name;
+			//获取车位数量
+			this.getParkingSpaceCount()
+
 			//获取字典
 			this.getDict()
+			//获取车场
+			this.initParkingLot()
+
 			this.parseParams(options)
 		},
-		computed: {
-			plateNumberStr() {
-				let str = '';
-				this.carNoInputList.forEach(item=>{
-					str += item.toString();
-				})
-				this.model.number=str
-				return str;
-			}
-		},
 		methods: {
-			parseParams(options){
+			next() {
+				if (this.$isEmpty(this.model.number)) {
+					this.$u.toast('请填写车牌号')
+					return
+				}
+				if (this.$isEmpty(this.parkingLotValue)) {
+					this.$u.toast('请选择车场')
+					return
+				}
+				if (this.$isEmpty(this.parkingAreaValue)) {
+					this.$u.toast('请选择车场区域')
+					return
+				}
+				if (this.$isEmpty(this.parkingSpaceValue)) {
+					this.$u.toast('请选择车场')
+					return
+				}
+				let data = this.parkingSpaceList.find(item => item.id == this.parkingSpaceValue)
+				if (data.isUsed) {
+					this.$dialog.showModal('该车位已被占用,请联系物业负责人', false)
+					return
+				}
+				this.model.parkingSpaceId = this.parkingSpaceValue
+				this.step++
+			},
+			//车位 begin
+			initParkingLot() {
+				let params = {
+					residentialId: this.model.residentialId
+				}
+				this.$http.parking.parkingLotList(params).then(res => {
+					this.parkingLotList = res.data.data
+				})
+			},
+			initParkingArea() {
+				let params = {
+					parkingLotId: this.parkingLotValue
+				}
+				this.$http.parking.parkingAreaList(params).then(res => {
+					this.parkingAreaList = res.data.data
+				})
+			},
+			initParkingSpace() {
+				let params = {
+					parkingAreaId: this.parkingAreaValue
+				}
+				this.$http.parking.parkingSpaceList(params).then(res => {
+					this.parkingSpaceList = res.data.data
+				})
+			},
+			getParkingSpaceCount() {
+				let params = {
+					residentialId: this.model.residentialId
+				}
+				this.$http.parking.parkingSpaceCount(params).then(res => {
+					if (this.$isEmpty(res.data.data)) {
+						this.$dialog.showModalAndBack('该小区暂未创建车位,请联系小区负责人创建!', false)
+					}
+				})
+			},
+			parkingLotConfirm(e) {
+				this.parkingLotLabel = e[0].label
+				this.parkingLotValue = e[0].value
+				this.initParkingArea()
+			},
+			parkingAreaConfirm(e) {
+				this.parkingAreaLabel = e[0].label
+				this.parkingAreaValue = e[0].value
+				this.initParkingSpace()
+			},
+			parkingSpaceConfirm(e) {
+				this.parkingSpaceLabel = e[0].label
+				this.parkingSpaceValue = e[0].value
+			},
+			//车位 end
+			parseParams(options) {
+				console.log(options);
 				if (this.$isEmpty(options)) {
 					return
 				}
-				this.model=options
-				this.carNoInputList=options.number.split('')
-				this.carTypeList.forEach(item=>{
-					if (item.value==options.type) {
-						this.carTypeLabel=item.label
+				this.isAdd = false
+				//获取车位
+				this.fetchParkingSpace(options.id)
+				this.model = options
+				this.carTypeList.forEach(item => {
+					if (item.value == options.type) {
+						this.carTypeLabel = item.label
 					}
 				})
-				this.carPropertiesList.forEach(item=>{
-					if (item.value==options.properties) {
-						this.carPropertiesLabel=item.label
+				this.carPropertiesList.forEach(item => {
+					if (item.value == options.properties) {
+						this.carPropertiesLabel = item.label
 					}
 				})
-				this.fuelCategoryList.forEach(item=>{
-					if (item.value==options.fuelCategory) {
-						this.fuelCategoryLabel=item.label
+				this.fuelCategoryList.forEach(item => {
+					if (item.value == options.fuelCategory) {
+						this.fuelCategoryLabel = item.label
 					}
 				})
 			},
-			submit(){
-				if (this.$isEmpty(this.model.number)) {
-					this.$u.toast('请填写车牌号')
-					return
+			fetchParkingSpace(carId) {
+				let params = {
+					carId
 				}
+				this.$http.parking.parkingSpaceList(params).then(res => {
+					let records = res.data.data
+					let data = records[0]
+					if (this.$isNotEmpty(data)) {
+						this.parkingLotLabel = data.parkingLotName
+						this.parkingLotValue = data.parkingLotId
+						this.parkingAreaLabel = data.parkingAreaName
+						this.parkingAreaValue = data.parkingAreaId
+						this.parkingSpaceLabel = data.number
+						this.parkingSpaceValue = data.id
+						data.isUsed = 0
+						this.parkingSpaceList = records
+					}
+				})
+			},
+			submit() {
 				if (this.$isEmpty(this.model.carImg)) {
 					this.$u.toast('请上传车辆照片')
 					return
 				}
 				let that = this;
 				this.model.residentialId = uni.getStorageSync('residentialId')
-				this.model.personId=this.vuex_member.id
-				this.model.personName=this.vuex_member.name
-				this.model.personPhone=this.vuex_member.phone
-				this.model.userIdCard=this.vuex_member.idcard
-				that.$http.saveOrUpdateCar(this.model).then (res=>{
+				this.model.personId = this.vuex_member.id
+				this.model.personName = this.vuex_member.name
+				this.model.personPhone = this.vuex_member.phone
+				this.model.userIdCard = this.vuex_member.idcard
+
+				that.$http.saveOrUpdateCar(this.model).then(res => {
 					if (res.data.result) {
-						that.$util.showModal('操作成功!',false).then(res=>{
+						that.$util.showModal('操作成功!', false).then(res => {
 							that.$util.isReloadAndBack()
 						})
 					} else {
-						that.$util.showModal("提交失败",false);
+						that.$util.showModal("提交失败", false);
 					}
-					
+
 				})
 			},
 			getDict() {
@@ -241,18 +391,18 @@
 					this.fuelCategoryList = fuelCategory;
 					return;
 				}
-				
+
 				// let operation = 'permissions/dict/getByCode?code=car_type';
 				let that = this;
 				let params = {};
 				//车辆类型
-				that.$http.getDictByCode("car_type").then (res=>{
+				that.$http.getDictByCode("car_type").then(res => {
 					if (res.data.code != 200) {
-						app.globalData.oneFailHint(res.data.msg, function () {
-					    uni.switchTab({
-					    	url:"../index/index"
-					    })
-					  });
+						app.globalData.oneFailHint(res.data.msg, function() {
+							uni.switchTab({
+								url: "../index/index"
+							})
+						});
 					}
 					res.data.data.forEach((item) => {
 						let tmp = {
@@ -261,73 +411,73 @@
 						}
 						that.carTypeList.push(tmp)
 					})
-					
+
 				});
-				
+
 				//车辆性质
 				// operation = "permissions/dict/getByCode?code=car_properties"
-				that.$http.getDictByCode("car_properties").then (res=>{
+				that.$http.getDictByCode("car_properties").then(res => {
 					if (res.data.code != 200) {
-						app.globalData.oneFailHint(res.data.msg, function () {
-					    uni.switchTab({
-					    	url:"../index/index"
-					    })
-					  });
+						app.globalData.oneFailHint(res.data.msg, function() {
+							uni.switchTab({
+								url: "../index/index"
+							})
+						});
 					}
 					res.data.data.forEach((item) => {
 						let tmp = {
-							value:item.dictKey,
-							label:item.dictValue
+							value: item.dictKey,
+							label: item.dictValue
 						}
 						that.carPropertiesList.push(tmp)
 					})
-					
+
 				});
-				
+
 				//燃油类别
 				// operation = "permissions/dict/getByCode?code=fuel_category"
-				that.$http.getDictByCode("fuel_category").then (res=>{
+				that.$http.getDictByCode("fuel_category").then(res => {
 					if (res.data.code != 200) {
-						app.globalData.oneFailHint(res.data.msg, function () {
-					    uni.switchTab({
-					    	url:"../index/index"
-					    })
-					  });
+						app.globalData.oneFailHint(res.data.msg, function() {
+							uni.switchTab({
+								url: "../index/index"
+							})
+						});
 					}
-					res.data.data.forEach((item)=>{
+					res.data.data.forEach((item) => {
 						let tmp = {
-							value:item.dictKey,
-							label:item.dictValue
+							value: item.dictKey,
+							label: item.dictValue
 						}
 						that.fuelCategoryList.push(tmp);
 					})
-					
+
 				});
 			},
-			carTypeConfirm(e){
-				this.model.type=e[0].value
-				this.carTypeLabel=e[0].label
+			carTypeConfirm(e) {
+				this.model.type = e[0].value
+				this.carTypeLabel = e[0].label
 			},
-			carPropertiesConfirm(e){
-				this.model.properties=e[0].value
-				this.carPropertiesLabel=e[0].label
+			carPropertiesConfirm(e) {
+				this.model.properties = e[0].value
+				this.carPropertiesLabel = e[0].label
 			},
-			fuelCategoryConfirm(e){
-				this.model.fuelCategory=e[0].value
-				this.fuelCategoryLabel=e[0].label
+			fuelCategoryConfirm(e) {
+				this.model.fuelCategory = e[0].value
+				this.fuelCategoryLabel = e[0].label
 			},
 			//上传图片
 			chooseImage(type) {
-			  uni.chooseImage({
-			    count: 1,
-			    //最多可以选择的图片张数,默认9
-			    sourceType: ['album'],
-			    sizeType: ['compressed'],
-			    //可选择原图或压缩后的图片
-			    success: res => {
-					this.uploadImage(res.tempFilePaths[0], type);
-			    }
-			  });
+				uni.chooseImage({
+					count: 1,
+					//最多可以选择的图片张数,默认9
+					sourceType: ['album'],
+					sizeType: ['compressed'],
+					//可选择原图或压缩后的图片
+					success: res => {
+						this.uploadImage(res.tempFilePaths[0], type);
+					}
+				});
 			},
 			/**上传图片
 			 * @param {Object} imgUrl 图片url
@@ -336,36 +486,23 @@
 				var that = this;
 				//是否需要md5加密上传人脸照
 				let is_need_md5 = false;
-				 this.$http.uploadFile(imgUrl).then(res =>{
-					 if (type == 1) {
-					 	that.model.carImg = res.data.data.link;
-					 } else if (type == 2) {
-					 	that.model.vehicleDrivingLicense1 =  res.data.data.link;
-					 } else if (type == 3) {
-					 	that.model.vehicleDrivingLicense2 =  res.data.data.link;
-					 }
-				 })
-				
-			},
-			//车牌号键盘
-			onInput(val){
-				this.carNoInputList.push(val)
-			},
-			onDelete(){
-				this.carNoInputList.pop();
-			},
-			onConfirm(){
-				this.model.number=this.plateNumberStr
-			},
-			openKeyBoard() {
-				this.$refs.plateNumber.open();
+				this.$http.uploadFile(imgUrl).then(res => {
+					if (type == 1) {
+						that.model.carImg = res.data.data.link;
+					} else if (type == 2) {
+						that.model.vehicleDrivingLicense1 = res.data.data.link;
+					} else if (type == 3) {
+						that.model.vehicleDrivingLicense2 = res.data.data.link;
+					}
+				})
+
 			},
 		}
 	}
 </script>
 
 <style>
-	page{
+	page {
 		background-color: #FFFFFF;
 	}
 </style>
@@ -373,14 +510,16 @@
 <style lang="scss" scoped>
 	.form {
 		padding: 40rpx 30rpx;
+
 		.card {
 			margin-top: 20rpx;
 			padding: 0 30rpx;
 			box-sizing: border-box;
 			border-radius: 12rpx;
-			box-shadow: 0 -10rpx rgba(248, 248, 248,.9) ,0 10rpx rgba(248, 248, 248,.9) , -10rpx 0rpx rgba(248, 248, 248,.9) ,10rpx 0rpx rgba(248, 248, 248,.9);
+			box-shadow: 0 -10rpx rgba(248, 248, 248, .9), 0 10rpx rgba(248, 248, 248, .9), -10rpx 0rpx rgba(248, 248, 248, .9), 10rpx 0rpx rgba(248, 248, 248, .9);
+
 			.item {
-				padding:30rpx 0;
+				padding: 30rpx 0;
 				display: flex;
 				justify-content: space-between;
 			}

+ 2 - 2
pages/myCar/myCar.vue

@@ -26,8 +26,8 @@
 						</view>
 						<view class="content">
 							<text class="padding-bottom-10">车主姓名:{{item.personName}}</text>
-							<text class="padding-bottom-10">车主电话:{{item.personPhone}}</text>
-							<view class="padding-bottom-10">
+							<text class="padding-top-10">车主电话:{{item.personPhone}}</text>
+							<view class="padding-bottom-10" v-if="false">
 								审核状态:
 								<text style="color: #008f69;" v-if="item.auditStatus==1">已通过</text>
 								<text style="color: #ea7500;" v-if="item.auditStatus==0">待审核</text>

+ 1 - 1
pages/myhome/myhome.vue

@@ -32,7 +32,7 @@
 				</view>
 			</view>
 		</mescroll-body>
-		<view @tap="choosePlot" class="footer-fixed " >
+		<view @tap="choosePlot" class="footer-fixed "  :style="{marginBottom:safeAreaBottom+ 'rpx'}">
 			<view class="cu-btn  flex  text-lg bg-red-btn" style="padding: 46rpx 0;">
 				添加房屋认证
 			</view>

+ 3 - 3
store/index.js

@@ -12,7 +12,7 @@ try{
 }
 
 // 需要永久存储,且下次APP启动需要取出的,在state中的变量名
-let saveStateKeys = ['vuex_isAuth','vuex_member'];
+let saveStateKeys = ['vuex_isAuth','vuex_member','vuex_residentialList','vuex_tenantId'];
 
 // 保存变量到本地存储中
 const saveLifeData = function(key, value){
@@ -32,8 +32,8 @@ const store = new Vuex.Store({
 	state: {
 		// 如果上面从本地获取的lifeData对象下有对应的属性,就赋值给state中对应的变量
 		// 加上vuex_前缀,是防止变量名冲突,也让人一目了然
-		
-		//自己与房屋的关系 在 pages/myFamily/myFamily中定义
+		vuex_tenantId: lifeData.vuex_tenantId ? lifeData.vuex_tenantId : null,
+		vuex_residentialList: lifeData.vuex_residentialList ? lifeData.vuex_residentialList : null,
 		//0-业主;1-成员;2-租户
 		vuex_relationshipType: lifeData.vuex_relationshipType ? lifeData.vuex_relationshipType : -1,
 		//用户信息