hmp 5 年 前
コミット
917a416de1

+ 81 - 26
App.vue

@@ -1,34 +1,89 @@
 <script>
 	export default {
 		onLaunch: function() {
+			this.updateApp()
+			this.cacheDict()
+		},
+		methods:{
 			//更新版本
-			const updateManager = uni.getUpdateManager();
-			updateManager.onCheckForUpdate(function (res) {
-			  // 请求完新版本信息的回调
-			  console.log("是否有新版本:",res.hasUpdate);
-			});
-			updateManager.onUpdateReady(function (res) {
-			  uni.showModal({
-			    title: '更新提示',
-			    content: '新版本已经准备好,是否重启应用?',
-			    success(res) {
-			      if (res.confirm) {
-			        // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
-			        updateManager.applyUpdate();
-			      }
-			    }
-			  });
+			updateApp(){
+				//更新版本
+				const updateManager = uni.getUpdateManager();
+				updateManager.onCheckForUpdate(function (res) {
+				  // 请求完新版本信息的回调
+				  console.log("是否有新版本:",res.hasUpdate);
+				});
+				updateManager.onUpdateReady(function (res) {
+				  uni.showModal({
+				    title: '更新提示',
+				    content: '新版本已经准备好,是否重启应用?',
+				    success(res) {
+				      if (res.confirm) {
+				        // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
+				        updateManager.applyUpdate();
+				      }
+				    }
+				  });
+				
+				});
+				updateManager.onUpdateFailed(function (res) {
+				  // 新的版本下载失败
+				});
+			},
+			//缓存字典的值
+			async cacheDict(){
+				let dictCacheData=this.$cache.get('dict')
+				if (!this.$isEmpty(dictCacheData)) {
+					return
+				}
+				//有效时间
+				let validTime=1*24*60*60*3
+				
+				//车辆类型
+				let carTypeList=[]
+				//车辆性质
+				let carPropertiesList=[]
+				//燃油类别
+				let fuelCategoryList=[]
+				
+				// 请求字典begin
+				let res1=await this.$api.dict('car_type')
+				res1.list.forEach((item)=>{
+					let tmp={
+						value:item.dictKey,
+						label:item.dictValue
+					}
+					carTypeList.push(tmp)
+				})
+				
+				let res2=await this.$api.dict('car_properties')
+				res2.list.forEach((item)=>{
+					let tmp={
+						value:item.dictKey,
+						label:item.dictValue
+					}
+					carPropertiesList.push(tmp)
+				})
 			
-			});
-			updateManager.onUpdateFailed(function (res) {
-			  // 新的版本下载失败
-			});
-		},
-		onShow: function() {
-			console.log('App Show')
-		},
-		onHide: function() {
-			console.log('App Hide')
+				let res3=await this.$api.dict('fuel_category')
+				res3.list.forEach((item)=>{
+					let tmp={
+						value:item.dictKey,
+						label:item.dictValue
+					}
+					fuelCategoryList.push(tmp)
+				})
+				// 请求字典end
+				
+				//缓存字典的值begin
+				let dict={
+					carTypeList,
+					carPropertiesList,
+					fuelCategoryList
+				}
+				this.$cache.put('dict',dict,validTime)
+				//缓存字典的值end
+			},
 		}
 	}
 </script>

+ 37 - 7
assets/http/api.js

@@ -1,6 +1,8 @@
 import {http} from './service.js'
 
 
+const uploadBase64=p => http.post('common/file/uploadBase64', p)
+
 // 权限管理
 let permissionsUrl={
 	login:'/permissions/authentication/login',
@@ -21,6 +23,10 @@ const permissions = {
 	getSubListByPid:(params)=>http.get(permissionsUrl.subList,{params:params,header:header})
 }
 
+
+//字典
+const dict=(params,header) => http.get('/permissions/dict/getByCode/'+params,{params:{},header})
+
 //获取当前登录用户的身份
 const getCurrentAccount=(params,header) => http.get('/permissions/authentication/getCurrentAccount',{params,header})
 //修改密码
@@ -28,11 +34,8 @@ const updatePsw= (params,header) => http.post('/permissions/account/modifyPasswo
 
 
 //机构列表
-let agencyUrl={
-	page:"/estate/agency/showAgencyList"
-}
 const agency={
-	page:(params,header) => http.get(agencyUrl.page,{params:params,header:header})
+	page:(params,header) => http.get("/estate/agency/showAgencyList",{params:params,header:header})
 }
 
 //数据统计
@@ -125,6 +128,7 @@ let user={
 	del: (params,header) => http.post(userUrl.del,params,{header: {"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}}),
 	add: (params,header) => http.post(userUrl.add,params,{header: {"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}}),
 	update: (params,header) => http.post(userUrl.update,params,{header: {"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}}),
+	detail:(params,header) => http.get('/estate/user/getUserById/'+params,{params:{},header: header}),
 }
 
 //住户审核
@@ -170,15 +174,37 @@ let carManageUrl={
 	del:"/community/car/remove"
 }
 const carManage={
-	page:(params,header) => http.get(carManageUrl.page,{params:params,header: header}),
+	page:(params,header) => http.get('/estate/car/page',{params:params,header: header}),
 	pageBycondition:(params,header) => http.get(carManageUrl.pageBycondition,{params:params,header:header}),
 	submit:(params,header) => http.post(carManageUrl.submit,params,{header:header}),
-	del:(params,header) => http.post(carManage.del,params,{header: {"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}})
+	del:(params,header) => http.post(carManage.del,params,{header: {"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}}),
+	update:(params,header) => http.post('/estate/car/edit',params,{header: {"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}})
 }
 
+//服务人员管理
+const serverUser={
+	page:(params,header) => http.get('estate/serverUser/showServerUserList',{params,header}),
+	submit:(params,header) => http.post('estate/serverUser/addOrEditServerUser',params,{header: {"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}}),
+	addOrEditOpenPermission:(params,header) => http.post('estate/serverUser/addOrEditOpenPermission',params,{header: {"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}}),
+	accessDevicesManualPush:(params,header) => http.post('estate/serverUser/accessDevicesManualPush',params,{header: {"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}}),
+	deleteServerUser:(params,header) => http.post('estate/serverUser/deleteServerUser/'+params,{},{header: {"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}}),
+}
+
+//公告管理
+const notice={
+	page:(params,header) => http.get('estate/notice/showServerUserList',{params,header}),
+	submit:(params,header) => http.post('estate/notice/addOrEditNotice',params,{header: {"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}}),
+	remove:(params,header) => http.post('estate/notice/deleteNotice/'+params,{},{header: {"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}}),
+}
+
+
 export const api={
+	//上传base64文件
+	uploadBase64,
 	//权限管理
 	permissions,
+	//字典
+	dict,
 	//获取当前用户的身份信息
 	getCurrentAccount,
 	//修改密码
@@ -204,5 +230,9 @@ export const api={
 	//物业报修
 	estateRepair,
 	//车辆管理
-	carManage
+	carManage,
+	//服务人员管理
+	serverUser,
+	//公告管理
+	notice
 }

+ 1 - 0
assets/http/service.js

@@ -1,5 +1,6 @@
 import Request from 'luch-request'
 // let baseURL='http://139.9.103.171:9091/'
+// let baseURL='http://192.168.1.33:9091/'
 let baseURL='https://wuye.58fo.com/api/'
 const http = new Request()
 http.setConfig((config) => { /* 设置全局配置 */

+ 0 - 176
components/g-upload.md

@@ -1,176 +0,0 @@
-## 注意事项:mode属性是从服务端获取图片回填的时候使用的,如果该数组长度大于0,则优先显示该数组的图片到控件上,否则显示临时路径。
-## 上传的时候如果控件上显示的图片不是临时路径,而是服务返回的图片,则无论是上传图片还是删除图片,触发完成后都需要更新一下mode的值,组件内部已做了更新监听
-
-本组件是对uni-app上传组件进行封装,上传控件支持在内部和外部(支持在父组件中调用上传方法),上传图片支持一行3个和4个,支持上传的图片预览,运用非常灵活。
-当前是第一版:后面有时间继续完善更多的功能,尽请期待。
-大家觉得不够完善,欢迎提出,写插件不易,好用的话请5星好评,打赏一杯奶茶也可以。
-本组件目前兼容小程序、H5、APP。
-
-### 有问题请加群询问,第一时间解决问题,邮件不经常看。
-### QQ交流群(学习干货多多) 811956471
-
-### 或者在页面script中引入组件,并注册组件
-```
-  import gUpload from "@/components/g-upload/g-upload.vue"
-export default {
-   gUpload
-}
-```
-
-### 下面是一个完整示例
-```
-<template>
-  <view class="content">
-    <g-upload ref='gUpload' :mode="imgList" @chooseFile='chooseFile' @imgDelete='imgDelete' :control='control' :columnNum="columnNum"></g-upload>
-    <view class="imglistItem" @click="uploadImg" v-if="!control">
-      <view class="uploadControl">外部控件</view>
-    </view>
-    <view>
-      <view>
-        <label>上传控件内部外部切换:</label>
-        <switch @change="switch1Change"></switch>
-        <label>{{control?'内部':'外部控件'}}</label>
-      </view>
-      <view>
-        <label>图片行个数:</label>
-        <switch @change="switch2Change"></switch>
-        <label>{{columnNum}}</label>
-      </view>
-    </view>
-
-  </view>
-</template>
-
-<script>
-  import gUpload from "@/components/g-upload/g-upload.vue"
-  export default {
-    components: {
-      gUpload
-    },
-    data() {
-      return {
-        title: 'Hello',
-        control: true,
-        columnNum: 4,
-        imgList: []
-        // imgList: ['/static/logo.png']
-      }
-    },
-    onLoad() {
-      /*
-      mode:
-      需要回填的图片数组,
-      上传的时候渲染临时路径,二次进入时可以选择渲染服务返回的图片,
-      此时删除图片完成后需要及时更新mode(imgList)的值
-      */
-    },
-    methods: {
-      //点击上传控件上传
-      uploadImg() {
-        this.$refs.gUpload.uploadImg()
-      },
-
-
-      /*
-      上传后返回的值:
-      list:上传后图片数组
-      v:返回当前上传图片的临时路径
-      */
-      chooseFile(list, v) {
-        console.log("上传图片_list:", list)
-        console.log("上传图片_v:", v);
-        this.uploadFileToServe(v)
-      },
-
-
-      /*
-      删除图片:
-      list:删除返回删除后剩余的图片数组
-      eq:返回删除的数组
-      */
-      imgDelete(list, eq) {
-        console.log("删除图片_list:", list)
-        console.log("删除图片_eq:", eq)
-      },
-
-
-      //控件内外部切换
-      switch1Change(e) {
-        this.control = !this.control
-      },
-
-
-      //图片行个数切换
-      switch2Change(e) {
-        this.columnNum = this.columnNum == 3 ? '4' : '3'
-      },
-
-      /*
-      执行上传服务:
-      urlList:要上传的图片:数组类型
-      */
-      uploadFileToServe(urlList) {
-        if (!urlList || urlList.length <= 0) {
-          return
-        };
-        for (let i = 0; i < urlList.length; i++) {
-          uni.uploadFile({
-            url: 'https://www.example.com/upload', //仅为示例,非真实的接口地址
-            filePath: urlList[i],
-            name: 'file',
-            formData: {
-              'user': 'test'
-            },
-            success: (uploadFileRes) => {
-              console.log(uploadFileRes.data);
-            }
-          });
-        }
-      }
-    }
-  }
-</script>
-
-<style scoped>
-  .content {
-    padding: 40rpx;
-  }
-
-  /* 上传控件 */
-  .uploadControl {
-    border: 1rpx solid #eee;
-    border-radius: 10rpx;
-    width: 130rpx;
-    display: block;
-    height: 130rpx;
-    text-align: center;
-    line-height: 130rpx;
-    font-size: 30rpx;
-    color: #888;
-    background-color: #EEEEEE;
-  }
-</style>
-
-
-
-```
-
-
-
-### 属性介绍
-| 名称                         | 类型            | 默认值                        | 描述                                               |
-| ----------------------------|---------------  | -------
-| control                     |Boolean          | true                          |是否显示上传控件|
-| deleteBtn                   |Boolean          | true                          |是否显示删除按钮|
-| columnNum                   |Number, String   |4                              | 行数量,可选值:3、4|
-| mode                        |Array            | []                            |服务返回回调的图片数组---图片回填 时候使用|
-| maxCount                    |Number           |4                              | 上传最大数量|
-
-### 事件介绍
-| 名称               | 说明            
-| -----------------  |------------------
-| chooseFile         | 选择图片后返回的值:第一个值是当前已选择图片临时路径路径集合,第二个参数是当前图片的临时路径
-| imgDelete         | 删除图片后返回的值:第一个值是当前剩余图片临时路径路径集合,第二个参数是所图片删除的图片下标
-
-
-

+ 4 - 1
components/mescroll-body/mescroll-mixins.js

@@ -10,7 +10,10 @@ const MescrollMixin = {
 	// },
 	data() {
 		return {
-			mescroll: null //mescroll实例对象
+			mescroll: null, //mescroll实例对象
+			downOption:{
+				auto:false
+			}
 		}
 	},
 	// 注册系统自带的下拉刷新 (配置down.native为true时生效, 还需在pages配置enablePullDownRefresh:true;详请参考mescroll-native的案例)

+ 11 - 0
main.js

@@ -40,6 +40,10 @@ Vue.prototype.$dialog = dialog
 import util from 'utils/util.js'
 Vue.prototype.$util = util
 
+// 微信函数封装
+import Mpi from './utils/mpi'
+Vue.prototype.$mpi = Mpi
+
 
 //uview 封装提示框
 Vue.prototype.$showToast=function(title,type,position){
@@ -66,6 +70,13 @@ Vue.prototype.$showModel = (content,isShowCancel=true,title='提示',)=>{
     })
 }
 
+Vue.prototype.$navigateBack=(delta=1)=>{
+	uni.navigateBack({
+		delta
+	})
+}
+
+
 /**封装判空函数
  * @param {Object} value
  */

+ 44 - 0
pages.json

@@ -226,6 +226,50 @@
             }
             
         }
+        ,{
+            "path" : "pages/service-staff/service-staff",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "服务人员管理",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/user/edit",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "编辑用户",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/notice/notice",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "公告管理",
+                "enablePullDownRefresh": false
+            }
+            
+        },{
+            "path" : "pages/notice/detail",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "公告详情",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/test/test",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "",
+                "enablePullDownRefresh": false
+            }
+            
+        }
     ],
 	"globalStyle": {
 		"navigationBarTextStyle": "black",

+ 425 - 139
pages/car/add.vue

@@ -1,33 +1,150 @@
 <template>
-	<view class="" >
-		<u-toast ref="uToast"/>
-		<view class="bg-white" style="padding: 10rpx 30rpx;margin: 20rpx;border-radius: 12rpx;">
-			<u-form :label-style="labelStyle" label-width="150" :model="form" ref="uForm">
-				<u-form-item label="车主姓名" :required="true"><u-input v-model="form.userName" placeholder="车主姓名"/></u-form-item>
-				<u-form-item v-if="!$isEmpty(form.id)" label="手机号码" :required="true"><u-input type="number" v-model="form.userMobile" placeholder="请输入手机号码"/></u-form-item>
-				<u-form-item label="所属小区" :required="true">
-					<u-input type="select" :select-open="residentialShow" v-model="residentialName"  placeholder="请选择小区" @click="residentialShow=true"></u-input>
-					<!-- <u-input v-else   disabled v-model="form.xqName" ></u-input> -->
-				</u-form-item>
-				<u-form-item label="车牌号" :required="true">
-					<u-input v-model="form.loginName" placeholder="请填写车牌号"></u-input>
-				</u-form-item>
-				<u-form-item label="车辆型号">
-					<u-input v-model="form.loginPwd"  placeholder="请填写车辆型号"></u-input>
-				</u-form-item>
-<!-- 				<u-form-item label="燃油类别">
-					<u-input v-model="form.fuelCategory"  placeholder="请填写燃油类别"></u-input>
-				</u-form-item> -->
-				<u-form-item label="车身颜色">
-					<u-input v-model="form.remark"  placeholder="请填写车身颜色"></u-input>
-				</u-form-item>
-<!-- 				<u-form-item label="车辆照片">
-					<u-input v-model="form.carImg"  placeholder="车辆照片"></u-input>
-				</u-form-item> -->
-			</u-form>
+	<view>
+		
+		<view class="form">
+			<view class="flex">
+				<image style="width: 35rpx;height: 35rpx;display: block;padding-top: 6rpx;padding-right: 10rpx;" src="../../static/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="agencyShow" @click="agencyShow=true"  v-model="agencyName"   placeholder="请选择所属社区" ></u-input>
+					</u-form-item>
+					<u-form-item :required="true"  :label-width="labelWidth"   label="所属小区" >
+						<u-input  type="select" :select-open="carTypeShow" @click="showResidential" v-model="residentialName"  placeholder="请选择所属小区" ></u-input>
+					</u-form-item>
+					<u-form-item :required="true"  :label-width="labelWidth"   label="车主姓名" >
+						<u-input  type="text"  v-model="model.personName" placeholder="请填写车主姓名"></u-input>
+					</u-form-item>
+					<u-form-item :required="true"  :label-width="labelWidth"   label="手机号" >
+						<u-input  type="number"   v-model="model.personPhone" placeholder="请填写手机号" ></u-input>
+					</u-form-item>
+				</u-form>
+			</view>
+		</view>
+		
+		<view class="form">
+			<view class="flex">
+				<image style="width: 35rpx;height: 35rpx;display: block;padding-top: 6rpx;padding-right: 10rpx;" src="../../static/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" disabled @click="openKeyBoard"  placeholder="请填写车牌号码" ></u-input>
+					</u-form-item>
+					<u-form-item :required="true"  :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 :required="true"  :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 :required="true"  :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="form">
+			<view class="flex">
+				<image style="width: 35rpx;height: 35rpx;display: block;padding-top: 6rpx;padding-right: 10rpx;" src="../../static/tag1.png" mode=""></image>
+				<text class="text-lg text-bold">请上传车辆照片</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="http://139.9.103.171:1888/miniofile/xlyq/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 class="form">
+			<view class="flex">
+				<image style="width: 35rpx;height: 35rpx;display: block;padding-top: 6rpx;padding-right: 10rpx;" src="../../static/tag1.png" mode=""></image>
+				<text class="text-lg text-bold">请上传行驶证正面</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="http://139.9.103.171:1888/miniofile/xlyq/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 class="form">
+			<view class="flex">
+				<image style="width: 35rpx;height: 35rpx;display: block;padding-top: 6rpx;padding-right: 10rpx;" src="../../static/tag1.png" mode=""></image>
+				<text class="text-lg text-bold">请上传行驶证反面</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="http://139.9.103.171:1888/miniofile/xlyq/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 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" style="padding: 40rpx;width: 100%;background-color: #5064eb;color: #FFFFFF;" >
+					<text class="cuIcon-add"></text>
+					<text v-text="model.id?'重新审核':'确认添加'"></text>
+				</view>
+			</view>
+		</view>
+		
+		<u-popup  border-radius="60" height="60%"  mode="bottom" v-model="agencyShow">
+			<view class="fixed cu-bar search bg-white">
+				<view class="search-form round">
+					<text class="cuIcon-search"></text>
+					<u-input style="width: 90%;" v-model="agencyKeyword" type="text" :adjust-position="false" placeholder="请输入关键字搜索" confirm-type="search"/>
+				</view>
+			</view>
+			<scroll-view v-if="!$isEmpty(agencyList)"  style="padding-top: 110rpx;height: 100%;" :scroll-y="true" >
+				<view @click="agencyConfirm(item)" hover-class="hoverClass" class="text-center padding-30 solid-bottom"  v-for="(item,index) in agencyList" :key="index">
+					<text>{{item.agencyName}}</text>
+				</view>
+				<u-divider v-if="agencyList.length>=10" height="80">只显示十条数据</u-divider>
+			</scroll-view>
+			<u-empty v-else name="search"></u-empty>
+		</u-popup>
+		
 		<u-popup  border-radius="60" height="60%"  mode="bottom" v-model="residentialShow">
 			<view class="fixed cu-bar search bg-white">
 				<view class="search-form round">
@@ -44,137 +161,306 @@
 			<u-empty v-else name="search"></u-empty>
 		</u-popup>
 		
-		<view @click="confirm" class="bottom-bar" >
-			<view class="cu-btn bg-blue radius" style="width: 70%;height: 84rpx;">
-				提交
-			</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"/>
 	</view>
 </template>
 
 <script>
-export default {
-	name: '',
-	data() {
-		return {
-			labelStyle:{
-				"fontWeight":"600"
-			},
-			form:{
-				userName:'',
-				xqName:'',
-				userMobile:'',
-				fuelCategory:'',
-				loginName:'',
-				loginPwd:'',
-				xqId:'',
-				// carImg:'',
-				remark:''
-			},
-			//小区
-			residentialName:'',
-			residentialShow:false,
-			residentialKeyword:'',
-			residentialList:[],
-		};
-	},
-	onLoad(options) {
-		//加载小区数据
-		this.fetchResidentialList()
-		if (!this.$isEmpty(options.id)) {
-			this.form.id=options.id
-			this.fetchDataDetail()
-			uni.setNavigationBarTitle({
-				title:"修改车辆信息"
-			})
-		}
-	},
-	watch:{
-		//小区
-		residentialKeyword(){
-			let that=this
-			if (this.timer){
-				clearTimeout(this.timer)
-			}
-			this.timer = setTimeout(() => {
-				that.residentialList=[]
-				that.getResidentailList()
-			}, 500)
-		},
-	},
-	methods:{
-		fetchDataDetail(){
-			console.log(this.form.id)
-			this.$api.carManage.page({id:this.form.id}).then(res=>{
-				console.log(res.data.records[0])
-				this.form=res.data.records[0]
-			})
+	import keyboardPackage from "@/components/keyboard-package/keyboard-package.vue"
+	import uploadImg from '@/components/uploadimg/uploadImg.vue'
+	var that;
+	export default {
+		components:{
+			uploadImg,keyboardPackage
 		},
-		
-		/**
-		 * 获取小区数据列表
-		 */
-		fetchResidentialList(){
-			let params={
-				isSelect: true,
-				name:this.residentialKeyword
+		data() {
+			return {
+				labelWidth:'200',
+				width:480,
+				height:320,
+				
+				
+				//社区
+				agencyName:'',
+				agencyShow:false,
+				agencyKeyword:'',
+				agencyList:[],
+				//小区
+				residentialShow:false,
+				residentialName:'',
+				residentialKeyword:'',
+				residentialList:[],
+				
+				//车牌号
+				carNoInputList:[],
+				
+				//车辆类型
+				carTypeList:[],
+				carTypeShow:false,
+				carTypeLabel:'',
+				
+				//车辆性质
+				carPropertiesList:[],
+				carPropertiesShow:false,
+				carPropertiesLabel:'',
+				
+				//燃油类别
+				fuelCategoryList:[],
+				fuelCategoryShow:false,
+				fuelCategoryLabel:'',
+				
+				model:{
+					type:'',//车辆类型的key
+					number:'',//车牌号
+					properties:'',//车辆性质的key,
+					fuelCategory:'',//燃油类别的key
+					carImg:'',//车辆照片
+					vehicleDrivingLicense1:'',//行驶证正面
+					vehicleDrivingLicense2:'',//行驶证反面
+					
+					//车主信息
+					agencyId:'',//社区id
+					residentialId:'',//小区id
+					personName:'',//车主姓名
+					personPhone:''//车主手机号
+					
+				},
 			}
-			this.$api.residential.page(params).then(res=>{
-				this.residentialList = res.list
-			})
 		},
-		//点击选择小区时
-		residentialConfirm(item){
-			//赋值给提交的数据
-			this.form.residentialId=item.id
-			//赋值给回显的名称
-			this.residentialName=item.name
-			this.residentialShow=false
+		onLoad(options ) {
+			that=this
+			//获取字典
+			this.getDict()
+			//获取社区列表
+			this.fetchAgencyList()
+			
 		},
-		confirm(){
-			if (this.$isEmpty(this.form.userName)) {
-				this.$u.toast('请输入车主姓名')
-				return
+		computed:{
+			plateNumberStr(){
+				let str='';
+				this.carNoInputList.forEach(item=>{
+					str+=item.toString();
+				})
+				this.model.number=str
+				return str;
 			}
-			if (this.$isEmpty(this.form.residentialId)) {
-				this.$u.toast("请选择小区")
-				return
+		},
+		watch:{
+			agencyKeyword(){
+				let that=this
+				//节流函数
+				if (this.timer){
+					clearTimeout(this.timer)//阻止setTimeout函数的执行
+				}
+				this.timer = setTimeout(() => {
+					that.agencyList=[]
+					this.fetchAgencyList()
+				}, 500)
+			},
+			residentialKeyword(){
+				let that=this
+				//节流函数
+				if (this.timer){
+					clearTimeout(this.timer)//阻止setTimeout函数的执行
+				}
+				this.timer = setTimeout(() => {
+					that.residentialList=[]
+					this.fetchResidentialList()()
+				}, 500)
 			}
-			console.log(this.form);
-			if (this.$isEmpty(this.form.id)) {
-				return
-				this.$api.carManage.submit(this.form).then(res=>{
-					if (res.data) {
-						this.$dialog.showModal('操作成功',false).then(res=>{
-							uni.navigateBack()
-						})
-					}else{
-						this.$u.toast('操作失败')
-					}
+		},
+		methods: {
+			//社区
+			fetchAgencyList(){
+				this.$api.agency.page({agencyName:this.agencyKeyword}).then(res=>{
+					this.agencyList=res.data.records
 				})
-				//新增
-			}else{
-				let {oldId,orgPosition,...params}=this.form
-				//修改
-				this.$api.carManage.submit(params).then(res=>{
-					if (res.data==true) {
-						this.$dialog.showModal('操作成功',false).then(res=>{
-							uni.navigateBack()
+			},
+			agencyConfirm(e){
+				this.model.agencyId=e.id
+				this.agencyName=e.agencyName
+				this.agencyShow=false
+				this.fetchResidentialList()
+			},
+			//小区
+			showResidential(){
+				if (this.$isEmpty(this.model.agencyId)) {
+					this.$u.toast('请选择社区')
+					return
+				}
+				this.residentialShow=true
+			},
+			fetchResidentialList(){
+				let params={
+					name:this.residentialKeyword,
+					agencyId:this.model.agencyId
+				}
+				this.$api.residential.pageBycondition(params).then(res=>{
+					this.residentialList=res.data.records
+				})
+			},
+			residentialConfirm(e){
+				this.residentialName=e.name
+				this.model.residentialId=e.id
+				this.residentialShow=false
+			},
+			submit(){
+				if (this.$isEmpty(this.model.agencyId)) {
+					this.$u.toast('请选择社区')
+					return
+				}
+				if (this.$isEmpty(this.model.residentialId)) {
+					this.$u.toast('请选择小区')
+					return
+				}
+				if (this.$isEmpty(this.model.number)) {
+					this.$u.toast('请填写车牌号')
+					return
+				}
+				if (this.$isEmpty(this.model.type)) {
+					this.$u.toast('请选择车辆类型')
+					return
+				}
+				if (this.$isEmpty(this.model.properties)) {
+					this.$u.toast('请选择车辆性质')
+					return
+				}
+				if (this.$isEmpty(this.model.fuelCategory)) {
+					this.$u.toast('请选择燃油类型')
+					return
+				}
+				if (this.$isEmpty(this.model.carImg)) {
+					this.$u.toast('请上传车辆照片')
+					return
+				}
+				if (this.$isEmpty(this.model.vehicleDrivingLicense1)) {
+					this.$u.toast('请上传行驶证正面')
+					return
+				}
+				if (this.$isEmpty(this.model.vehicleDrivingLicense2)) {
+					this.$u.toast('请上传行驶证反面')
+					return
+				}
+				this.$api.car.carAdd(this.model).then(res=>{
+					if (res.success==true) {
+						this.$dialog.showModal('操作成功!',false).then(res=>{
+							this.$util.isReloadAndBack()
 						})
 					}else{
-						this.$u.toast('操作失败')
+						this.$dialog.showModal(res.msg,false)
 					}
 				})
-			}
+			},
+			getDict(){
+				let dict=this.$cache.get('dict')
+				if (dict) {
+					//缓存中有字典值
+					this.carTypeList=dict.carTypeList
+					this.carPropertiesList=dict.carPropertiesList
+					this.fuelCategoryList=dict.fuelCategoryList
+					return
+				}
+				//车辆类型
+				this.$api.dict({code:'car_type'}).then(res=>{
+					res.data.forEach((item)=>{
+						let tmp={
+							value:item.dictKey,
+							label:item.dictValue
+						}
+						this.carTypeList.push(tmp)
+					})
+				})
+				//车辆性质
+				this.$api.dict({code:'car_properties'}).then(res=>{
+					res.data.forEach((item)=>{
+						let tmp={
+							value:item.dictKey,
+							label:item.dictValue
+						}
+						this.carPropertiesList.push(tmp)
+					})
+				})
+				//燃油类别
+				this.$api.dict({code:'fuel_category'}).then(res=>{
+					res.data.forEach((item)=>{
+						let tmp={
+							value:item.dictKey,
+							label:item.dictValue
+						}
+						this.fuelCategoryList.push(tmp)
+					})
+				})
+			},
+			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
+			},
+			fuelCategoryConfirm(e){
+				this.model.fuelCategory=e[0].value
+				this.fuelCategoryLabel=e[0].label
+			},
+			//上传图片
+			chooseImage(type) {
+			  this.$mpi.chooseImage().then(res=>{
+				  this.$api.uploadFile.submit(res[0]).then(res=>{
+				  	if (type==1) {
+				  		//车辆照片
+				  		that.model.carImg=res.data
+				  	}else if (type==2) {
+				  		that.model.vehicleDrivingLicense1=res.data//行驶证正面
+				  	}else if (type==3) {
+				  		that.model.vehicleDrivingLicense2=res.data//行驶证反面
+				  	}
+				  })
+			  })
+			},
+			//车牌号键盘
+			onInput(val){
+				console.log(val);
+				this.carNoInputList.push(val)
+			},
+			onDelete(){
+				this.carNoInputList.pop();
+			},
+			onConfirm(){
+				this.model.number=this.plateNumberStr
+				console.log(this.model.number);
+			},
+			openKeyBoard() {
+				this.$refs.plateNumber.open();
+			},
 		}
-		
-
 	}
-};
 </script>
 
-<style lang="scss" scoped>
+<style>
 	page{
 		background-color: #FFFFFF;
 	}
-</style>
+</style>
+
+<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);
+			.item{
+				padding:30rpx 0;
+				display: flex;
+				justify-content: space-between;
+			}
+		}
+	}
+</style>

+ 174 - 275
pages/car/car.vue

@@ -1,332 +1,231 @@
 <template>
 	<view>
-		<!-- 详情 -->
-		<u-popup v-model="popupShow" mode="center" width="650" :closeable="true" border-radius="10">
-			<view style="padding: 60rpx 40rpx 10rpx;">
-				<u-form label-width="150" :model="form">
-					<u-form-item label="所属小区" :required="true">
-						<u-input type="select" disabled @click="operaType=1;residentialShow=true" v-model="form.residentialName" />
-					</u-form-item>
-					<u-form-item label="车主姓名" ><u-input v-model="form.personName" /></u-form-item>
-					<u-form-item label="车主电话" ><u-input v-model="form.personTel" /></u-form-item>
+		<u-modal :show-cancel-button="true" confirmColor="#5064eb"  @confirm="opinionConfirm" title="审核意见" :mask-close-able="true" v-model="opinionShow" >
+			<view class="slot-content" style="margin: 20rpx;">
+				<u-form label-width="150"  ref="uForm">
+					<u-form-item :border-bottom="false"><u-input height="150"  placeholder="请输入审核意见(选填)" v-model="auditOpinion" /></u-form-item>
 				</u-form>
-				<view @click="submit" class="flex cu-btn bg-blue" style="margin: 60rpx 0 10rpx;padding: 40rpx;">
-					提交
-				</view>
-			</view>
-		</u-popup>
-		
-		<!-- 筛选标签条 -->
-		<view class="cu-bar bg-white flex justify-around" style="z-index: 100;width: 100%;position: fixed;top: -2rpx;">
-			<view class="u-line-1" @click="showDown(index)" v-for="(item,index) in filterMenu" :key="index"  style="width: 24%;text-align: center;height: 100%;">
-				{{data[index]==""? item:data[index]}}
-				<u-icon  name="arrow-down-fill" size="20" style="padding-left: 10rpx;"></u-icon>
-			</view>
-			
-			<view class="u-line-1" @click="filterShow=true"   style="width: 26%;position: relative;text-align: center;height: 100%;">
-				筛选
-				<text class="cuIcon-filter padding-left-10" ></text>
-				<u-badge  :offset="[2, 20]"  size="mini" type="error" :count="filterCount"></u-badge>
 			</view>
+		</u-modal>
+		<view class="bg-white">
+			<u-dropdown ref="uDropdown" @open="open" @close="close" active-color="#5064eb" duration="20">
+				<u-dropdown-item @change="filterChange" v-model="auditFilterValue" title="审核状态" :options="auditFilterList"></u-dropdown-item>
+				<u-dropdown-item @change="filterChange" v-model="carTypeFilterValue" title="车辆类型" :options="carTypeFilterList"></u-dropdown-item>
+				<u-dropdown-item title="其他筛选">
+					<view class="bg-white" style="padding: 20rpx 30rpx;">
+						<u-form  label-width="200" :model="params" ref="uForm">
+							<u-form-item label="车牌号码"><u-input placeholder="请输入车牌号码" v-model="params.number" /></u-form-item>
+							<u-form-item label="车主姓名"><u-input placeholder="请输入车主姓名" v-model="params.personName" /></u-form-item>
+							<u-form-item label="手机号码"><u-input placeholder="请输入手机号码" type="number" maxlength="11" v-model="params.personPhone" /></u-form-item>
+						</u-form>
+						<view class="flex justify-around " style="margin: 30rpx 0;">
+							<view class="cu-btn bg-red radius" @click="reset" style="width: 42%;padding: 37rpx;">
+								重置
+							</view>
+							<view class="cu-btn bg-blue radius" @click="filterChange();closeDropdown()" style="width: 42%;padding: 37rpx;">
+								筛选
+							</view>
+						</view>
+					</view>
+				</u-dropdown-item>	
+			</u-dropdown>
 		</view>
 		
+		
 		<mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption">
-			<view style="margin-top: 110rpx;">
-				<card @delItem="delItem" @edit="edit" :list="list"></card>
-			</view>
+			<car-manager-card  @pass="pass" @fail="fail" :list="list"></car-manager-card>
 		</mescroll-body>
 		
-		<!-- 地区选择器 -->
-		<u-picker  @confirm="regionConfirm"  mode="region" v-model="regionShow"></u-picker>
-		<!-- 小区 -->
-		<u-popup  border-radius="60" height="60%"  mode="bottom" v-model="residentialShow">
-			<view class="fixed cu-bar search bg-white">
-				<view class="search-form round">
-					<text class="cuIcon-search"></text>
-					<u-input style="width: 90%;" v-model="keyword" type="text" :adjust-position="false" placeholder="请输入关键字搜索" confirm-type="search"/>
-				</view>
-			</view>
-			<scroll-view v-if="!$isEmpty(residentialList)"  style="padding-top: 110rpx;height: 100%;" :scroll-y="true" >
-				<view @click="residentailConfirm(item)" hover-class="hoverClass" class="text-center padding-30 solid-bottom"  v-for="(item,index) in residentialList" :key="index">
-					<text>{{item.label}}</text>
-				</view>
-				<u-divider v-if="residentialList.length>=10" height="80">只显示十条数据</u-divider>
-			</scroll-view>
-			<u-empty v-else name="search"></u-empty>
-		</u-popup>
-		
-		<!-- 筛选 -->
-		<u-modal :show-cancel-button="true" cancel-text="重置"   @cancel="reset" @confirm="filterConfirm" title="筛选" :mask-close-able="true" v-model="filterShow" >
-			<view class="slot-content" style="margin: 20rpx;">
-				<u-form label-width="150" :model="params" ref="uForm">
-					<u-form-item :border-bottom="false" label="车主姓名"><u-input placeholder="请输入车主姓名" v-model="params.personName" /></u-form-item>
-					<u-form-item :border-bottom="false" label="车主号码"><u-input placeholder="请输入车主号码" v-model="params.personPhone" /></u-form-item>
-				</u-form>
-			</view>
-		</u-modal>
-		<!-- 添加按钮 -->
-		<add-btn @click.native="add"></add-btn>
-		<!-- 通知alert -->
-		<u-toast ref="uToast" />
+		<!-- <wm-list-add bgColor="#7fc6ac"  ref="add" @clickAdd="add"/> -->
 	</view>
 </template>
 
 <script>
-	import card from "./comps/card.vue"
+	import wmListAdd from '@/components/wm-list-add/wm-list-add';
 	import MescrollMixin from "@/components/mescroll-body/mescroll-mixins.js";
-	let that;
+	import carManagerCard from "./comps/car-manager-card.vue"
+	var that;
 	export default {
+		mixins: [MescrollMixin], // 使用mixin
 		components:{
-			card
+			carManagerCard,wmListAdd
 		},
-		mixins:[MescrollMixin],
 		data() {
 			return {
-				//新增修改详情弹窗
-				popupShow:false,
-				form:{},
-				operaType:0,
-				
-				//顶部菜单栏
-				filterMenu: ["所属地区","所属小区"],
-				data:['','',''],
+				list:[],
+				loginType:'',
 				
-				//地区
-				regionShow:false,
-				areaValue:'',
-				
-				//小区
-				residentialShow:false,
-				residentialList:[],
+				//审核意见
+				operaId:'',//操作id
+				opinionShow:false,
+				auditOpinion:'',
 				
 				//筛选
-				filterShow:false,
-				filterCount:0,
-				
-				//参数
-				params:{},
-				//小区关键字
-				keyword:'',
-				
-				list: [],
-				downOption: { 
-					use: true,
-					auto: false
+				auditFilterValue: -2,
+				carTypeFilterValue: -1,
+				params:{
+					number:'',
+					personName:'',
+					personPhone:''
 				},
-				upOption: {
-					page: {
-						page: 0,
-						size: 10
+				
+				auditFilterList: [{
+						label: '全部',
+						value: -2,
 					},
-					noMoreSize: 5, 
-					empty: {
-						tip: '暂无相关数据'
+					{
+						label: '待审核',
+						value: 0,
+					},
+					{
+						label: '审核通过',
+						value: 1,
+					},
+					{
+						label: '审核不通过',
+						value: -1,
 					}
-				},
-				
+				],
+				carTypeFilterList: [],
+				other:[]
+			
 			}
 		},
-		onLoad(){
+		onLoad() {
 			that=this
-			this.getResidentailList({isSelect:true})
+			this.getCarTypeFilterList()
 		},
-		watch:{
-			keyword(){
-				let that=this
-				//节流函数
-				if (this.timer){
-					clearTimeout(this.timer)//阻止setTimeout函数的执行
-				}
-				this.timer = setTimeout(() => {
-					that.residentialList=[]
-					let params = {
-						isSelect: true,
-						regionArea: that.areaValue,
-						name: that.keyword
-					}
-					this.getResidentailList(params)
-				}, 500)
-			}
-			
+		onShow() {
+			//刷新mescroll数据
+			// this.$util.reload(this.mescroll)
 		},
 		methods: {
-			//添加车辆
+			async getCarTypeFilterList(){
+				let dict=this.$cache.get('dict')
+				if (dict) {
+					//缓存中有字典值
+					this.carTypeFilterList=dict.carTypeList
+					this.carTypeFilterList.unshift({
+						label:'全部',
+						value:'-1'
+					})
+					return
+				}
+				//车辆类型
+				let res=await this.$api.dict('car_type')
+				res.list.forEach((item)=>{
+					let tmp={
+						value:item.dictKey,
+						label:item.dictValue
+					}
+					this.carTypeFilterList.push(tmp)
+				})
+				this.carTypeFilterList.unshift({
+					label:'全部',
+					value:'-1'
+				})
+				
+			},
 			add(){
 				uni.navigateTo({
 					url:"./add"
 				})
 			},
-			edit(item){
-				let {orgId,orgPosition,...form}=item
-				this.form=form
-				this.popupShow=true
-				console.log(this.form);
-			},
-			delItem(item){
-				this.$dialog.showModal('确定要删除此记录吗?').then(res=>{
-					this.$api.carManage.del({id:item.id}).then(res=>{
+			pass(item){
+				let params={
+					id:item.id,
+					auditStatus:1
+				}
+				this.$dialog.showModal('确定要审核通过此记录吗?').then(res=>{
+					this.$api.carManage.update(params).then(res=>{
 						if (res.data==true) {
-							this.$u.toast('删除成功')
-							this.mescroll.resetUpScroll()
-						}else{
-							this.$u.toast('删除失败')
+							this.$u.toast('操作成功')
+							this.mescroll.resetUpScroll();
 						}
 					})
 				})
 			},
-			/**
-			 * 获取筛选的条件数
-			 */
-			getFilterCount(){
-				let n=0
-				console.log(this.areaValue);
-				if (!this.$isEmpty(this.areaValue)) {
-					//地区
-					n++
-				}
-				if (!this.$isEmpty(this.params.name)) {
-					//楼栋
-					n++
+			opinionConfirm(){
+				let params={
+					id:this.operaId,
+					auditOpinion:this.auditOpinion|| '',
+					auditStatus:-1
 				}
-				this.filterCount=n
+				this.$api.carManage.update(params).then(res=>{
+					if (res.data==true) {
+						this.$u.toast('操作成功')
+						this.mescroll.resetUpScroll();
+					}
+				})
 			},
-			
-			/**
-			 * 下拉回调
-			 */
-			downCallback(){
-				setTimeout(()=>{
-					this.mescroll.resetUpScroll()
-				},1500)
+			fail(item){
+				this.operaId=item.id
+				this.opinionShow=true
 			},
-			/**
-			 * 上拉回调
-			 * @param {Object} mescroll
-			 */
-			upCallback(mescroll) {
-				let params=this.params
-				params.current=mescroll.num
-				params.size=mescroll.size
-				this.getFilterCount()
-				try{
-					if(params.personName == null || params.personPhone == null){
-						console.log(params)
-						this.$api.carManage.page(params).then(res=>{
-							let data=res.data.records
-							let length=data.length
-							let total=res.data.total
-							mescroll.endBySize(length, total);
-							if(mescroll.num == 1) this.list = []; 
-							this.list=this.list.concat(data); 
-						})						
-					}else{
-						console.log(222)
-						this.$api.carManage.page(params).then(res=>{
-							let data=res.data.records
-							let length=data.length
-							let total=res.data.total
-							mescroll.endBySize(length, total);
-							if(mescroll.num == 1) this.list = []; 
-							this.list=this.list.concat(data); 
-						})		
-					}
-				}catch(e){
-					mescroll.endErr();
-				}
+			//筛选
+			open(index) {
+				this.$refs.uDropdown.highlight();
 			},
-			/**
-			 * 重置
-			 */
-			reset(){
-				//查询数据列表的参数
-				this.params={}
-				this.data=['','']
-				//地区
-				this.areaValue=''
-				//小区列表
-				this.residentialList=[]
-				//小区关键字
-				this.keyword=''
-				//数据列表
-				this.list=[],
-				this.getResidentailList()
-				this.mescroll.resetUpScroll()
+			close(index) {
+				this.$refs.uDropdown.highlight(index);
 			},
-			/**
-			 * 顶部菜单选择
-			 * @param {Object} index 菜单下标
-			 */
-			showDown(index){
-				if (index==0) {
-					//地区
-					this.regionShow=true
-					return
-				}
-				if(index==1){
-					//小区
-					this.residentialShow = true;
-					return;
-				}
+			closeDropdown() {
+				this.$refs.uDropdown.close();
 			},
-			/**
-			 * 确认筛选
-			 */
-			filterConfirm(){
-				this.mescroll.resetUpScroll()
+			filterChange(e){
+				this.mescroll.resetUpScroll();
 			},
-			/**
-			 * 地区确认回调
-			 * @param {Object} object
-			 */
-			regionConfirm(object){
-				this.data[0]= object.area.label;
-				this.areaValue = object.area.value;
-				let params = {
-					isSelect: true,
-					regionArea: this.areaValue
-				};
-				// this.getFilterCount()
-				this.getResidentailList(params);
+			reset(){
+				this.params={}
+				this.mescroll.resetUpScroll();
+				this.closeDropdown()
 			},
-			/**
-			 * 获取小区列表
-			 * @param {Object} params
-			 */
-			getResidentailList(params){
-				console.log(params)
-				let list = [];
-				this.$api.residential.page(params).then(res=>{
-					console.log(res)
-					let list=[]
-					res.list.forEach(item=>{
-						let obj={
-							label:item.name,
-							value:item.id
-						}
-						list.push(obj)
-					})
-					this.residentialList =  list;
-					console.log(list)
-				})
+			downCallback(){
+				setTimeout(()=>{
+					this.mescroll.resetUpScroll();
+				},1200)
 			},
-			/**
-			 * 点击选择小区刷新列表
-			 */
-			residentailConfirm(res){
-				//筛选标题
-				this.params.residentialId =res.value
-				this.data[1] = res.label
-				this.residentialShow = false
-				//获取楼栋列表
+			upCallback(mescroll){
 				let params={
-					residentialId:this.params.residentialId
+					current:mescroll.num,
+					size:mescroll.size
 				}
-				this.mescroll.resetUpScroll()
-			},
+				if (this.auditFilterValue!=-2) {
+					//不是筛选全部审核状态
+					params.auditStatus=this.auditFilterValue
+				}
+				if (this.carTypeFilterValue!=-1) {
+					//不是筛选全部车辆类型
+					params.type=this.carTypeFilterValue
+				}
+				if (!this.$isEmpty(this.params.number)) {
+					//车牌号
+					params.number=this.params.number
+				}
+				if (!this.$isEmpty(this.params.personName)) {
+					//姓名
+					params.personName=this.params.personName
+				}
+				if (!this.$isEmpty(this.params.personPhone)) {
+					//手机号
+					params.personPhone=this.params.personPhone
+				}
+				try{
+					this.$api.carManage.page(params).then(res=>{
+						let data=res.data.records
+						let total=res.data.total
+						mescroll.endBySize(data.length,total);
+						if(mescroll.num == 1) that.list = []; //如果是第一页需手动制空列表
+						that.list=that.list.concat(data); //追加新数据
+					})
+				}catch(e){
+					this.mescroll.endErr()
+				}
+			}
 		}
 	}
 </script>
 
-<style>
-
+<style lang="scss" scoped>
+	
 </style>

+ 0 - 130
pages/car/comps/card.vue

@@ -1,130 +0,0 @@
-<!-- 删除,单元,修改,添加,管理功能皆未实现 -->
-<template>
-	<view class="">
-		<view  class="data" v-for="(item, index) in list" :key="index">
-			<view class="top">
-				<view class="left">
-					<view class="title">
-						<u-icon name="xingming" custom-prefix="custom-icon" size="40" color="#51c75b"></u-icon>
-						<text class="padding-left-20">车主姓名:{{item.userName}}</text>
-						<text @click.stop="this.$util.copy(item.userName)" style="text-decoration: underline;" class="text-blue padding-left-20">复制</text>
-					</view>
-				</view>
-			</view>
-			<view class="item">
-				<view class="left">
-					<view style="padding: 0 30rpx;">
-						<view class="content flex">
-							<u-icon name="chepaihao" custom-prefix="custom-icon" size="40" color="#1296db"></u-icon>
-							<text class="text-bold  padding-left-10">车牌号:</text>
-							<text>{{item.loginName}}</text>
-						</view>
-						<view  class="content flex">
-							<u-icon name="cheliang" custom-prefix="custom-icon" size="40" color="#fdba4e"></u-icon>
-							<text class="text-bold padding-left-10">车辆类型:</text>
-							<text class="text-bold" v-text="item.loginPwd?item.loginPwd:'未知'" ></text>
-						</view>
-						<view  class="content flex">
-							<u-icon name="color" custom-prefix="custom-icon" size="40" color="#7fc6ac"></u-icon>
-							<text class="text-bold padding-left-10">车身颜色:</text>
-							<text  v-text="item.remark?item.remark:'未知'"></text>
-						</view>
-						<view  class="content flex">
-							<u-icon name="shoujihaoma" custom-prefix="custom-icon" size="40" color="#5ca8f0"></u-icon>
-							<text class="text-bold padding-left-10">手机号码:</text>
-							<text class="text-bold" v-text="item.userMobile" ></text>
-						</view>
-					</view>
-				</view>
-			</view>
-			<view class="bottom flex" >
-				<view @click="edit(item)" class="cu-btn  sm round line-blue" style="margin: 0 10rpx;">
-					修改车辆
-				</view>
-<!-- 				<view @click="delItem(item)" class="cu-btn  sm round bg-red" style="margin: 0 10rpx;">
-					删除车辆
-				</view> -->
-			</view>
-		</view>
-	</view>
-</template>
-
-<script>
-export default {
-	name: 'card',
-	props:{
-		list:{
-			type:Array,
-			default:()=>{
-				[]
-			}
-		}
-	},
-	data() {
-		return {
-			loading:false
-		};
-	},
-	created() {
-		
-	},
-	methods:{
-		copy(data){
-			uni.setClipboardData({
-				data:data
-			})
-		},
-		edit(item){
-			getApp().globalData.carData=item
-			uni.navigateTo({
-				url:"/pages/car/add?id="+item.id
-			})
-		},
-		delItem(item){
-			this.$emit('delItem',item)
-		}
-	}
-};
-</script>
-
-<style lang="scss">
-.data {
-	width: 710rpx;
-	background-color: #ffffff;
-	margin: 20rpx auto;
-	border-radius: 6rpx;
-	box-sizing: border-box;
-	padding: 20rpx 10rpx;
-	font-size: 28rpx;
-	.top {
-		display: flex;
-		justify-content: space-between;
-		padding-bottom: 20rpx;
-		border-bottom: 1rpx solid #dedede;
-		.left {
-			display: flex;
-			align-items: center;
-			.title {
-				margin: 0 10rpx;
-				font-size: 30rpx;
-			}
-		}
-		.right{
-			margin-right: 10rpx;
-		}
-	}
-	.item {
-		margin: 5rpx 0 20rpx 0;
-		.content {
-			border-bottom: 1rpx dashed #DDDDDD;
-			padding: 30rpx 0;
-		}
-	}
-	.bottom {
-		display: flex;
-		margin-top: 30rpx;
-		justify-content: flex-end;
-		align-items: center;
-	}
-}
-</style>

+ 83 - 67
pages/index/index.vue

@@ -10,15 +10,31 @@
 				<text>社区管理</text>
 			</view>
 		</view>
-		<view style="padding: 30rpx 10rpx 0rpx;" class="cu-list grid col-4 no-border" >
-			<view class="cu-item "  @click="jump(item.title)" v-for="(item,index) in gridList" :key="index">
-				<view class="grid-icon" >
-					<u-icon :name="item.name" custom-prefix="custom-icon" size="80" :color="item.color"></u-icon>
+		
+		<swiper style="height: 400rpx;background-color: #FFFFFF;" :indicator-dots="true"  indicator-active-color="#7fc6ac">
+			<swiper-item style="height:100%">
+				<view  class="cu-list grid col-4 no-border" >
+					<view class="cu-item "  @click="jump(item.url)" v-for="(item,index) in gridList1" :key="index">
+						<view class="grid-icon" >
+							<u-icon :name="item.name" custom-prefix="custom-icon" size="80" :color="item.color"></u-icon>
+						</view>
+						<text  style="color: #333333;font-size: 26rpx;padding-top: 6rpx;padding-bottom: 20rpx;" >{{item.title}}</text>
+						<view class="cu-tag  bg-red badge" v-if="item.badge>0">{{item.badge}}</view>
+					</view>
 				</view>
-				<text  style="color: #333333;font-size: 26rpx;padding-top: 6rpx;padding-bottom: 20rpx;" >{{item.title}}</text>
-				<view class="cu-tag  bg-red badge" v-if="item.badge>0">{{item.badge}}</view>
-			</view>
-		</view>
+			</swiper-item>
+			<swiper-item style="height:100%">
+				<view  class="cu-list grid col-4 no-border" >
+					<view class="cu-item "  @click="jump(item.url)" v-for="(item,index) in gridList2" :key="index">
+						<view class="grid-icon" >
+							<u-icon :name="item.name" custom-prefix="custom-icon" size="80" :color="item.color"></u-icon>
+						</view>
+						<text  style="color: #333333;font-size: 26rpx;padding-top: 6rpx;padding-bottom: 20rpx;" >{{item.title}}</text>
+						<view class="cu-tag  bg-red badge" v-if="item.badge>0">{{item.badge}}</view>
+					</view>
+				</view>
+			</swiper-item>
+		</swiper>
 		
 		<!-- 物业服务 -->
 		<view style="padding: 20rpx 0  20rpx 40rpx;"  class="  flex bg-white">
@@ -44,31 +60,31 @@
 		
 		
 		<!-- 详情 -->
-				<u-popup v-model="popupShow" mode="center" width="650" :closeable="true" border-radius="10">
-					<view style="padding: 60rpx 40rpx 10rpx;">
-						<u-form label-width="150" :model="form" label-position="top">
-							<u-form-item label="照片上传" >
-								<view class="cu-form-group">
-									<view class="grid col-4 grid-square flex-sub">
-										<view class="bg-img" v-for="(item,index) in imgList" :key="index" @tap="ViewImage" :data-url="imgList[index]">
-											<image :src="imgList[index]" mode="aspectFill"></image>
-											<view class="cu-tag bg-red" @tap.stop="DelImg" :data-index="index">
-												<text class='cuIcon-close'></text>
-											</view>
-										</view>
-										<view class="solids" @tap="ChooseImage" v-if="imgList.length<4">
-											<text class='cuIcon-cameraadd'></text>
-										</view>
+		<u-popup v-model="popupShow" mode="center" width="650" :closeable="true" border-radius="10">
+			<view style="padding: 60rpx 40rpx 10rpx;">
+				<u-form label-width="150" :model="form" label-position="top">
+					<u-form-item label="照片上传" >
+						<view class="cu-form-group">
+							<view class="grid col-4 grid-square flex-sub">
+								<view class="bg-img" v-for="(item,index) in imgList" :key="index" @tap="ViewImage" :data-url="imgList[index]">
+									<image :src="imgList[index]" mode="aspectFill"></image>
+									<view class="cu-tag bg-red" @tap.stop="DelImg" :data-index="index">
+										<text class='cuIcon-close'></text>
 									</view>
 								</view>
-							</u-form-item>
-							<u-form-item label="处理情况" required=true><u-input v-model="detail"/></u-form-item>
-						</u-form>
-						<view @click="submit()" class="flex cu-btn bg-blue" style="margin: 60rpx 0 10rpx;padding: 40rpx;">
-							确定
+								<view class="solids" @tap="ChooseImage" v-if="imgList.length<4">
+									<text class='cuIcon-cameraadd'></text>
+								</view>
+							</view>
 						</view>
-					</view>
-				</u-popup>
+					</u-form-item>
+					<u-form-item label="处理情况" required=true><u-input v-model="detail"/></u-form-item>
+				</u-form>
+				<view @click="submit()" class="flex cu-btn bg-blue" style="margin: 60rpx 0 10rpx;padding: 40rpx;">
+					确定
+				</view>
+			</view>
+		</u-popup>
 	</view>
 </template>
 
@@ -103,49 +119,74 @@
 				],
 				subsectionCurrent:0,
 				
-				gridList:[
+				gridList1:[
 					{
 						color:'#9cc7c7',
 						title:"小区管理",
 						badge:0,
-						name:'shequ'
+						name:'shequ',
+						url:'/pages/residential/residential'
 					},
 					{
 						color:'#3dc159',
 						title:"楼栋管理",
 						badge:0,
-						name:'loudong1'
+						name:'loudong1',
+						url:'/pages/building/building'
+
 					},
 					{
 						color:'#3dc159',
 						title:"单元管理",
 						badge:0,
-						name:'tesecanyin'
+						name:'tesecanyin',
+						url:'/pages/unit/unit'
 					},
 					{
 						color:'#77b0cb',
 						title:"房间管理",
 						badge:0,
-						name:'fangjianxinxi-'
+						name:'fangjianxinxi-',
+						url:'/pages/room/room'
+
 					},
 					{
 						color:'#de9964',
 						title:"住户管理",
 						badge:0,
-						name:'zhuhu'
+						name:'zhuhu',
+						url:'/pages/user/user'
 					},
 					{
 						color:'#d2837d',
 						title:"住户审核",
 						badge:0,
-						name:'zheng'
+						name:'zheng',
+						url:'/pages/user-auth/user-auth'
+					},
+					{
+						color:'#1296db',
+						title:"服务人员",
+						badge:0,
+						name:'qunfengfuwushang',
+						url:'/pages/service-staff/service-staff'
 					},
 					{
 						color:'#7156bf',
 						title:"车辆管理",
 						badge:0,
-						name:'cheliang1'
+						name:'cheliang1',
+						url:'/pages/car/car'
 					},
+				],
+				gridList2:[
+					{
+						color:'#5064eb',
+						title:"公告管理",
+						badge:0,
+						name:'qunfengtongzhigonggao',
+						url:'/pages/notice/notice'
+					}
 				]
 			}
 		},
@@ -160,7 +201,7 @@
 		methods: {
 			getApplyUserReadyCheckCount(){
 				this.$api.dataStatistics.getApplyUserAccountWithCheckState().then(res=>{
-					this.gridList[5].badge=res.data.applyUserReadyCheckCount
+					this.gridList1[5].badge=res.data.applyUserReadyCheckCount
 				})
 			},
 			/**
@@ -270,44 +311,19 @@
 				}
 			},
 			fetchUserFeedback(){
-				let params={
-					current:1,
-					size:5
-				}
-				this.$api.userFeedBack.page(params).then(res=>{
+				this.$api.userFeedBack.page().then(res=>{
 					this.feedbackList=res.data.records
 				})
 			},
 			fetchRepairList(){
-				let params={
-					current:1,
-					size:20
-				}
-				this.$api.estateRepair.page(params).then(res=>{
+				this.$api.estateRepair.page().then(res=>{
 					this.repairList=res.data.records
 				})
 			},
 			subsectionChange(index){
 				this.subsectionCurrent=index
 			},
-			jump(title){
-				let url=''
-				if (title=='小区管理') {
-					url='/pages/residential/residential'
-				}else if(title=='楼栋管理'){
-					url='/pages/building/building'
-				}else if (title=='单元管理') {
-					url='/pages/unit/unit'
-				}else if (title=='房间管理') {
-					url='/pages/room/room'
-				}else if (title=='住户管理') {
-					url='/pages/user/user'
-				}else if (title=='住户审核') {
-					url='/pages/user-auth/user-auth'
-				}else if (title=='车辆管理') {
-					url='/pages/car/car'
-				}
-				
+			jump(url){
 				if (!this.$isEmpty(url)) {
 					uni.navigateTo({
 						url:url,

+ 6 - 5
pages/user-auth/comps/card.vue

@@ -5,9 +5,9 @@
 			<view class="top">
 				<view class="left">
 					<view class="title flex align-center justify-center">
-						<image v-if="item.imageUri!=null" style="width: 60rpx;height: 60rpx; border-radius: calc(8rpx);" :src="'http://139.9.103.171:8888/'+item.imageUri"></image>
+						<image @click.stop="preview(item)" v-if="item.imageUri" style="width: 60rpx;height: 60rpx; border-radius: calc(8rpx);" :src="$global.getImgBaseUrl()+item.imageUri"></image>
 						<u-icon v-else name="man-add-fill"  size="34" color="#50baca"></u-icon>
-						<text class="padding-left-10">姓名:{{item.name}}</text>
+						<text class="padding-left-10" >姓名:{{item.name}}</text>
 					</view>
 				</view>
 				<view class="right">
@@ -41,7 +41,7 @@
 							<text class="cuIcon-mobile" style="color: #007AFF;font-size: 32rpx;"></text>
 							<text class="text-bold padding-left-10">联系方式:</text>
 							<text class="text-bold" style="padding-top: 6rpx;" v-text="item.tel" ></text>
-							<text @click="call(item.tel)" class="padding-left-10 text-blue" style="text-decoration: underline;">拨打</text>
+							<text @click="$util.call(item.tel)" class="padding-left-10 text-blue" style="text-decoration: underline;">拨打</text>
 						</view>
 					</view>
 				</view>
@@ -79,8 +79,9 @@ export default {
 		
 	},
 	methods:{
-		call(phone){
-			this.$util.callPhone(phone)
+		preview(item){
+			let img=this.$global.getImgBaseUrl()+item.imageUri
+			this.$util.preview(img)
 		},
 		goDetail(item){
 			getApp().globalData.userAuthData=item

+ 10 - 13
pages/user-auth/detail.vue

@@ -1,7 +1,6 @@
 <template>
 	<view class="">
 		<view class="card">
-			<scroll-view  style="margin: 40rpx;">
 				<u-form :label-style="labelStyle" label-width="180" :model="form" ref="uForm">
 					<u-form-item label="姓名"><u-input v-model="form.name" placeholder="暂无信息" disabled/></u-form-item>
 					<u-form-item label="性别">
@@ -44,17 +43,13 @@
 						<u-input v-model="form.operatorName"  placeholder="暂无信息" disabled></u-input>
 					</u-form-item>
 					<u-form-item v-if="!$isEmpty(form.imageUri)" label="人脸照片:" label-position="top">
-						<image  @click="previewImg()" style="width: 300rpx;height: 300rpx;" :src="'http://139.9.103.171:8888/'+form.imageUri" ></image>
+						<image  @click="$util.preview(faceImg)" style="width: 300rpx;height: 300rpx;" :src="faceImg" ></image>
 					</u-form-item>
 					<u-form-item v-else label="人脸照片" >
 						<text>暂无</text>
 					</u-form-item>
 				</u-form>
-			</scroll-view>
 		</view>
-		<navigator url="../index/index" open-type="switchTab"  class="cuIcon cu-btn round" style="background-color: rgba(0,0,0,.2);color: #FFFFFF;position: fixed;right: 3%;bottom: 20%;width: 70rpx;height: 70rpx;">
-			<text class="cuIcon-home" style="font-size: 40rpx;"></text>
-		</navigator>
 	</view>
 </template>
 
@@ -65,28 +60,30 @@
 				labelStyle:{
 					"fontWeight":"600"
 				},
-				form:{}
+				form:{},
+				faceImg:''
 			}
 		},
 		onShow() {
 			this.form=getApp().globalData.userAuthData
+			this.faceImg=this.$global.getImgBaseUrl()+this.form.imageUri
 		},
 		methods: {
 			previewImg(){
-				let url=this.$global.imgBaseUrl+this.form.imageUri
-				let imgArr=[url]
-				uni.previewImage({
-					urls:imgArr
-				})
+				let img=this.$global.imgBaseUrl+this.form.imageUri
+				this.$util.preview(img)
 			},
 		}
 	}
 </script>
 
 <style lang="scss">
+	page{
+		background-color: #FFFFFF;
+	}
 	.card{
 		background-color: #FFFFFF;
-		margin: 30rpx;
+		margin:10rpx 50rpx;
 		border-radius: 20rpx;
 	}
 </style>

+ 150 - 172
pages/user/add.vue

@@ -3,35 +3,28 @@
 		<u-toast ref="uToast"/>
 		<view class="bg-white" style="padding: 10rpx 30rpx;margin: 20rpx;border-radius: 12rpx;">
 			<u-form :label-style="labelStyle"  label-width="180" :model="form" ref="uForm">
-				<u-form-item  label="住户姓名"><u-input v-model="form.name" placeholder="请输入住户姓名"/></u-form-item>
-				<u-form-item  label="性别">
+				<u-form-item  label="住户姓名" :required="true"><u-input v-model="form.name" placeholder="请输入住户姓名"/></u-form-item>
+				<u-form-item  label="性别" :required="true">
 					<u-input  type="select" :select-open="sexShow" v-model="sexValue"  placeholder="请选择性别" @click="sexShow=true"></u-input>
 				</u-form-item>
 				
 				<u-form-item label="所属小区" :required="true">
-					<u-input v-if="$isEmpty(form.id)"  type="select" :select-open="residentialShow" v-model="residentialName"  placeholder="请选择小区" @click="residentialShow=true"></u-input>
-					<u-input v-else   disabled v-model="form.residentialName" ></u-input>
+					<u-input  type="select" :select-open="residentialShow" v-model="residentialName"  placeholder="请选择小区" @click="residentialShow=true"></u-input>
 				</u-form-item>
 				<u-form-item label="所属楼栋" :required="true">
 					<!-- 新增 -->
-					<u-input v-if="$isEmpty(form.id)"  type="select" :select-open="buildingShow" v-model="form.buildingName"  placeholder="请选择小区" @click="showBuilding"></u-input>
-					<!-- 修改 -->
-					<u-input v-else   disabled v-model="form.buildingName" ></u-input>
+					<u-input   type="select" :select-open="buildingShow" v-model="buildingName"  placeholder="请选择楼栋" @click="showBuilding"></u-input>
 				</u-form-item>
 				<u-form-item label="所属单元" :required="true">
-					<u-input v-if="$isEmpty(form.id)"  v-model="unitName" type="select" :select-open="unitShow"  placeholder="请选择单元" @click="showUnit"></u-input>
-					<u-input v-else v-model="form.unitName" disabled ></u-input>
+					<u-input  v-model="unitName" type="select" :select-open="unitShow"  placeholder="请选择单元" @click="showUnit"></u-input>
 				</u-form-item>
-				<u-form-item label="所属房间">
-						<!-- 新增 -->
-					<u-input v-if="$isEmpty(form.id)"  type="select" :select-open="roomShow" v-model="roomName"  placeholder="请选择房间" @click="tapRoomShow"></u-input>
-						<!-- 修改 -->
-					<u-input v-else v-model="form.roomName" disabled ></u-input>
+				<u-form-item label="所属房间" :required="true">
+					<u-input  type="select" :select-open="roomShow" v-model="roomName"  placeholder="请选择房间" @click="showRoom"></u-input>
 				</u-form-item>
-				<u-form-item label="住户类型">
+				<u-form-item label="住户类型" :required="true">
 					<u-input  type="select" :select-open="typeShow" v-model="typeName"  placeholder="请选择房间" @click="typeShow=true"></u-input>
 				</u-form-item>
-				<u-form-item label="手机号">
+				<u-form-item label="手机号" :required="true">
 					<u-input v-model="form.tel"  placeholder="请填写手机号"></u-input>
 				</u-form-item>
 				<u-form-item label="证件类型">
@@ -48,45 +41,48 @@
 				</u-form-item>
 			</u-form>
 		</view>
+		
+		
 		<!-- 性别 -->
 		<u-select @confirm="sexConfirm" v-model="sexShow" :list="sexList"></u-select>
 		
-		<!-- 选择小区 -->
-		<u-popup  border-radius="60" height="60%"  mode="bottom" v-model="searchShow">
+		
+		<!-- 小区 -->
+		<u-popup  border-radius="60" height="60%"  mode="bottom" v-model="residentialShow">
 			<view class="fixed cu-bar search bg-white">
 				<view class="search-form round">
 					<text class="cuIcon-search"></text>
-					<input v-model="keyword"  :adjust-position="false" type="text" placeholder="请输入搜索关键字" confirm-type="search"></input>
-				</view>
-				<view @click="search" class="action">
-					<button class="cu-btn bg-blue shadow-blur round">搜索</button>
+					<u-input style="width: 90%;" v-model="residentialKeyword" type="text" :adjust-position="false" placeholder="请输入关键字搜索" confirm-type="search"/>
 				</view>
 			</view>
-			<scroll-view @scrolltolower="scrolltolower" style="padding-top: 110rpx;height: 100%;" :scroll-y="true" >
-				<view @click="searchConfirm(item)" hover-class="hoverClass" class="text-center padding-30 solid-bottom"  v-for="(item,index) in searchList" :key="index">
-					<text>{{item.name}}</text>
+			<scroll-view v-if="!$isEmpty(residentialList)"  style="padding-top: 110rpx;height: 100%;" :scroll-y="true" >
+				<view @click="residentailConfirm(item)" hover-class="hoverClass" class="text-center padding-30 solid-bottom"  v-for="(item,index) in residentialList" :key="index">
+					<text>{{item.label}}</text>
 				</view>
+				<u-divider v-if="residentialList.length>=10" height="80">只显示十条数据</u-divider>
 			</scroll-view>
+			<u-empty v-else name="search"></u-empty>
 		</u-popup>
 		
-		<!-- 选择单元 -->
-		<u-popup  border-radius="60" height="60%"  mode="bottom" v-model="searchShow1">
+		<!-- 楼栋 -->
+		<u-popup  border-radius="60" height="60%"  mode="bottom" v-model="buildingShow">
 			<view class="fixed cu-bar search bg-white">
 				<view class="search-form round">
 					<text class="cuIcon-search"></text>
-					<input v-model="keyword1"  :adjust-position="false" type="text" placeholder="请输入搜索关键字" confirm-type="search"></input>
-				</view>
-				<view @click="search1" class="action">
-					<button class="cu-btn bg-blue shadow-blur round">搜索</button>
+					<u-input style="width: 90%;" v-model="buildingKeyWord" type="text" :adjust-position="false" placeholder="请输入关键字搜索" confirm-type="search"/>
 				</view>
 			</view>
-			<scroll-view @scrolltolower="scrolltolower1" style="padding-top: 110rpx;height: 100%;" :scroll-y="true" >
-				<view @click="searchConfirm1(item)" hover-class="hoverClass" class="text-center padding-30 solid-bottom"  v-for="(item,index) in searchList1" :key="index">
+			<scroll-view v-if="!$isEmpty(buildingList)"  style="padding-top: 110rpx;height: 100%;" :scroll-y="true" >
+				<view @click="buildingConfirm(item)" hover-class="hoverClass" class="text-center padding-30 solid-bottom"  v-for="(item,index) in buildingList" :key="index">
 					<text>{{item.name}}</text>
 				</view>
+				<u-divider v-if="buildingList.length>=10" height="80">只显示十条数据</u-divider>
 			</scroll-view>
+			<u-empty v-else name="search"></u-empty>
 		</u-popup>
 		
+		<!-- 单元 -->
+		<u-picker @confirm="unitConfirm" range-key="name" :range="unitList" v-model="unitShow" mode="selector"></u-picker>
 		<!-- 房间-->
 		<u-select @confirm="roomConfirm" v-model="roomShow" :list="roomList"></u-select>
 		
@@ -109,9 +105,7 @@ export default {
 			labelStyle:{
 				"fontWeight":"600"
 			},
-			form:{
-				type:-1
-			},
+			form:{},
 			// 性别
 			sexValue:'', //回显
 			sexShow:false,
@@ -125,16 +119,22 @@ export default {
 					label:'女'
 				},
 			],
+			
+			
 			//小区
 			residentialName:'',
 			residentialShow:false,
 			residentialKeyword:'',
 			residentialList:[],
+			
+			
 			//楼栋
 			buildingName:'',
 			buildingShow:false,
 			buildingKeyWord:'',
 			buildingList:'',
+			
+			
 			//单元
 			unitName:'',
 			unitList:[],
@@ -145,6 +145,9 @@ export default {
 			roomShow:false,
 			roomList:[],
 			
+			//筛选
+			searchList:[],
+			
 			//住户类型
 			typeName:'', //回显
 			typeShow:false,
@@ -166,32 +169,42 @@ export default {
 		};
 	},
 	onLoad(options) {
-		// this.fetchSearchList()
-		console.log(options.id);
-		if (!this.$isEmpty(options.id)) {
-			this.form.id=options.id
-			uni.setNavigationBarTitle({
-				title:"修改住户信息"
-			})
-		}
+		this.getResidentailList({isSelect:true})
 	},
-	onShow() {
-		if (!this.$isEmpty(this.form.id)) {
-			this.form=getApp().globalData.userDetail
-			console.log(this.form);
-			if (this.form.sex==1) {
-				this.sexValue="男"
-			}else if(this.form.sex==2) {
-				this.sexValue="女"
+	watch:{
+		residentialKeyword(){
+			let that=this
+			//节流函数
+			if (this.timer){
+				clearTimeout(this.timer)//阻止setTimeout函数的执行
 			}
-			if (this.form.type==0) {
-				this.typeName='业主'
-			}else if (this.form.type==1) {
-				this.typeName='住户'
-			}else if (this.form.type==2) {
-				this.typeName='租户'
+			this.timer = setTimeout(() => {
+				that.residentialList=[]
+				let params = {
+					isSelect: true,
+					name: that.residentialKeyword
+				}
+				this.getResidentailList(params)
+			}, 500)
+		},
+		buildingKeyWord(){
+			let that=this
+			//节流函数
+			if (this.timer){
+				clearTimeout(this.timer)//阻止setTimeout函数的执行
 			}
-		}
+			this.timer = setTimeout(() => {
+				that.buildingList=[]
+				let params={
+					residentialId:that.form.residentialId,
+					name:that.buildingKeyWord
+				}
+				that.fetchBuildingList(params)
+			}, 500)
+		},
+	},
+	onShow() {
+		
 	},
 	methods:{
 		// 性别
@@ -199,100 +212,90 @@ export default {
 			this.sexValue=e[0].label
 			this.form.sex=e[0].value
 		},
-		
-		// 小区
-		/**
-		 * 加载小区数据
-		 */
-		fetchSearchList(){
-			let params={
-				name:this.keyword,
-				current:this.searchCurrent
-			}
-			this.$api.residential.showResidentialList(params).then(res=>{
-				this.searchList = [...this.searchList,...res.data.records]
+		//获取小区列表
+		getResidentailList(params){
+			let list = [];
+			this.$api.residential.page(params).then(res=>{
+				let list=[]
+				res.list.forEach(item=>{
+					let obj={
+						label:item.name,
+						value:item.id
+					}
+					list.push(obj)
+				})
+				this.residentialList =  list;
 			})
 		},
-		/**
-		 * 下拉加载数据
-		 */
-		scrolltolower(e){
-			 if(this.searchList.length<this.searchCurrent*10){
-			   return
-			}else{
-				this.searchCurrent++
-				this.fetchSearchList()
+		//小区确认
+		residentailConfirm(res){
+			this.form.residentialId=res.value
+			this.residentialName=res.label
+			this.residentialShow=false
+			//获取楼栋列表
+			let params={
+				residentialId:res.value
 			}
+			this.fetchBuildingList(params)
+			
 		},
 		/**
-		 * 点击选择小区
+		 * 获取楼栋列表
+		 * @param {Object} 
 		 */
-		searchConfirm(item){
-			//赋值给提交的数据
-			this.form.residentialId=item.id
-			//赋值给回显的名称
-			this.residentialName=item.name
-			//加载单元数据
-			this.searchList1=[]
-			this.fetchSearchList1()
-			this.searchShow=false
+		fetchBuildingList(params){
+			this.$api.building.page(params).then(res=>{
+				this.buildingList=res.data.records
+			})
 		},
-		/**
-		 * 确定搜索小区数据
-		 */
-		search(){
-			this.searchList=[]
-			this.fetchSearchList()
+		//点击选择楼栋,获取单元列表
+		buildingConfirm(res){
+			this.form.buildingId=res.id
+			this.buildingName = res.name
+			this.buildingShow = false
+			let params={
+				residentialId:this.form.residentialId,
+				buildingId:res.id
+			}
+			this.getUnitByResidentialId(params)
 		},
-		
-		//单元
-		showUnit(){
+		//楼栋
+		showBuilding(){
 			if (this.$isEmpty(this.form.residentialId)) {
 				this.$showToast('请先选择小区','error')
 				return
 			}
-			this.searchShow1=true
+			this.buildingShow=true
 		},
-		scrolltolower1(e){
-			 if(this.searchList1.length<this.searchCurrent1*10){
-			   return
-			}else{
-				this.searchCurrent1++
-				this.fetchSearchList1()
-			}
+		//单元
+		getUnitByResidentialId(params){
+			this.$api.unit.page(params).then(res=>{
+				this.unitList=res.list
+			})
 		},
-		fetchSearchList1(){
-			let params={
-				name:this.keyword1,
-				current:this.searchCurrent1,
-				residentialId:this.form.residentialId
+		showUnit(){
+			if (this.$isEmpty(this.form.residentialId)) {
+				this.$showToast('请先选择小区','error')
+				return
 			}
-			this.$api.unit.showUnitList(params).then(res=>{
-				this.searchList1 = [...this.searchList1,...res.data.records]
-			})
+			if (this.$isEmpty(this.form.buildingId)) {
+				this.$showToast('请先选择楼栋','error')
+				return
+			}
+			this.unitShow=true
 		},
-		searchConfirm1(item){
-			//赋值给提交的数据
-			this.form.unitId=item.id
-			//赋值给回显的名称
-			this.unitName=item.name
-			//加载房间的数据
+		unitConfirm(index){
+			this.unitName=this.unitList[index].name
+			this.form.unitId=this.unitList[index].id
 			this.fetchRoomList()
-			this.searchShow1=false
-		},
-		search1(){
-			this.searchList1=[]
-			this.fetchSearchList1()
 		},
-		
 		//房间
 		fetchRoomList(){
 			let params={
-				residentialId:this.form.residentialId,
 				unitId:this.form.unitId,
 				isSelect:true
 			}
-			this.$api.room.getListByLikeName(params).then(res=>{
+			this.$api.room.pageBycondition(params).then(res=>{
 				this.roomList=[]
 				res.list.forEach(item=>{
 					let list={
@@ -307,7 +310,15 @@ export default {
 			this.roomName=e[0].label
 			this.form.roomId=e[0].value
 		},
-		tapRoomShow(){
+		showRoom(){
+			if (this.$isEmpty(this.form.residentialId)) {
+				this.$showToast('请先选择小区','error')
+				return
+			}
+			if (this.$isEmpty(this.form.buildingId)) {
+				this.$showToast('请先选择楼栋','error')
+				return
+			}
 			if (this.$isEmpty(this.form.unitId)) {
 				this.$showToast('请先选择单元','error')
 				return
@@ -341,7 +352,6 @@ export default {
 				return
 			}
 			if (this.form.type==-1) {
-				console.log(this.form.type);
 				this.$showToast('请选择住户类型','error')
 				return
 			}
@@ -359,48 +369,16 @@ export default {
 					return
 				}
 			}
-			
-			if (this.$isEmpty(this.form.id)) {
-				//添加住户
-				this.$api.user.add(this.form).then(res=>{
-					if (res.data==true) {
-						this.$dialog.showModal('操作成功',false).then(res=>{
-							uni.navigateBack({
-								delta:1
-							})
-						})
-					}else{
-						this.$showToast(res.msg,'error')
-					}
-				})
-			}else{
-				let params={
-					id:this.form.id,
-					name:this.form.name,
-					roomName:this.form.roomName,
-					roomId:this.form.roomId,
-					type:this.form.type,
-					tel:this.form.tel,
-					sex:this.form.sex,
-					idCard:this.form.idCard || '',
-					birthPlace:this.form.birthPlace || '',
-					remark:this.form.remark || ''
+			//添加住户
+			this.$api.user.add(this.form).then(res=>{
+				if (res.data==true) {
+					this.$dialog.showModal('操作成功',false).then(res=>{
+						this.$navigateBack()
+					})
+				}else{
+					this.$showToast(res.msg,'error')
 				}
-				//编辑住户信息
-				console.log(params);
-				this.$api.user.update(params).then(res=>{
-					if (res.data==true) {
-						console.log("1111");
-						this.$dialog.showModal('操作成功',false).then(res=>{
-							uni.navigateBack({
-								delta:1
-							})
-						})
-					}else{
-						this.$showToast('操作失败','error')
-					}
-				})
-			}
+			})
 			
 			
 		}

+ 2 - 4
pages/user/comps/card.vue

@@ -5,7 +5,7 @@
 			<view class="top">
 				<view class="left">
 					<view class="title flex justify-center align-center">
-						<image v-if="item.imageUri!=null" style="width: 60rpx;height: 60rpx;border-radius: calc(8rpx);" :src="item.fastDfsServer+item.imageUri"></image>
+						<image @click.stop="$util.preview(item.fastDfsServer+item.imageUri)" v-if="item.imageUri" style="width: 60rpx;height: 60rpx;border-radius: calc(8rpx);" :src="item.fastDfsServer+item.imageUri"></image>
 						<u-icon v-else name="man-add-fill"  size="34" color="#50baca"></u-icon>
 						<text class="padding-left-10">姓名:{{item.name}}</text>
 					</view>
@@ -88,13 +88,11 @@ export default {
 			this.$emit('deleteItem',item)
 		},
 		edit(item){
-			getApp().globalData.userDetail=item
 			uni.navigateTo({
-				url:"add?id="+item.id
+				url:"/pages/user/edit?id="+item.id
 			})
 		},
 		goDetail(item){
-			getApp().globalData.userDetail=item
 			uni.navigateTo({
 				url:"./detail?id="+item.id
 			})

+ 56 - 71
pages/user/detail.vue

@@ -1,72 +1,50 @@
 <template>
 	<view class="">
 		<view class="card">
-			<scroll-view  style="margin: 40rpx;">
-				<u-form :label-style="labelStyle" label-width="220" :model="form" ref="uForm">
-					<u-form-item label="姓名:"><u-input v-model="form.name" placeholder="暂无信息" disabled/></u-form-item>
-					<u-form-item label="性别:"><text v-text="form.sex==1?'男':'女'"></text></u-form-item>
-					<u-form-item label="联系方式:">
-						<u-input v-model="form.tel"  placeholder="暂无信息" disabled></u-input>
-					</u-form-item>
-					<u-form-item label="证件号码:">
-						<u-input v-model="form.idCard"  placeholder="暂无信息" disabled></u-input>
-					</u-form-item>
-					<u-form-item label="人脸审核状态:">
-						<view class='cu-tag radius bg-red' v-if="form.checkState==-1">
-							<text>待上传</text>
-						</view>
-						<view class='cu-tag radius bg-orange' v-if="form.checkState==0">
-							<text>待审核</text>
-						</view>
-						<view class='cu-tag radius bg-green' v-if="form.checkState==1">
-							<text>审核通过</text>
-						</view>
-						<view class='cu-tag radius bg-red' v-if="form.checkState==2">
-							<text>审核通过</text>
-						</view>
-					</u-form-item>
-					<u-form-item label="住户类型:">
-						<view class='cu-tag radius bg-blue' >
-							<text class="" v-if="form.type==0">业主</text>
-							<text class="" v-else-if="form.type==1">成员</text>
-							<text class="" v-else-if="form.type==2">租客</text>
-						</view>
-					</u-form-item>
-					<u-form-item label-width="160" label="房屋信息:">
-						<text >{{form.residentialName}}-{{form.buildingName}}-{{form.unitName}}-{{form.roomName}}</text>
-					</u-form-item>
-					<u-form-item label-width="160" label="创建时间:">
-						<u-input v-model="form.createDate"  placeholder="暂无信息" disabled></u-input>
-					</u-form-item>
-					<u-form-item v-if="!$isEmpty(form.imageUri)" label="人脸照片:" label-position="top">
-						<image  @click="previewImg" style="width: 300rpx;height: 300rpx;" :src="form.fastDfsServer+form.imageUri" ></image>
-					</u-form-item>
-					<u-form-item v-else label="人脸照片" >
-						<text>暂无</text>
-					</u-form-item>
-				</u-form>
-			</scroll-view>
+			<u-form :label-style="labelStyle" label-width="220" :model="form" ref="uForm">
+				<u-form-item label="姓名:"><u-input v-model="form.name" placeholder="暂无信息" disabled/></u-form-item>
+				<u-form-item label="性别:"><text v-text="form.sex==1?'男':'女'"></text></u-form-item>
+				<u-form-item label="联系方式:">
+					<u-input v-model="form.tel"  placeholder="暂无信息" disabled></u-input>
+				</u-form-item>
+				<u-form-item label="证件号码:">
+					<u-input v-model="form.idCard"  placeholder="暂无信息" disabled></u-input>
+				</u-form-item>
+				<u-form-item label="人脸审核状态:">
+					<view class='cu-tag radius bg-red' v-if="form.checkState==-1">
+						<text>待上传</text>
+					</view>
+					<view class='cu-tag radius bg-orange' v-if="form.checkState==0">
+						<text>待审核</text>
+					</view>
+					<view class='cu-tag radius bg-green' v-if="form.checkState==1">
+						<text>审核通过</text>
+					</view>
+					<view class='cu-tag radius bg-red' v-if="form.checkState==2">
+						<text>审核通过</text>
+					</view>
+				</u-form-item>
+				<u-form-item label="住户类型:">
+					<view class='cu-tag radius bg-blue' >
+						<text class="" v-if="form.type==0">业主</text>
+						<text class="" v-else-if="form.type==1">成员</text>
+						<text class="" v-else-if="form.type==2">租客</text>
+					</view>
+				</u-form-item>
+				<u-form-item label-width="160" label="房屋信息:">
+					<text >{{form.residentialName}}-{{form.buildingName}}-{{form.unitName}}-{{form.roomName}}</text>
+				</u-form-item>
+				<u-form-item label-width="160" label="创建时间:">
+					<u-input v-model="form.createDate"  placeholder="暂无信息" disabled></u-input>
+				</u-form-item>
+				<u-form-item v-if="form.imageUri" label="人脸照片:" label-position="top">
+					<image  @click="$util.preview(faceImg)" style="width: 300rpx;height: 300rpx;" :src="faceImg" ></image>
+				</u-form-item>
+				<u-form-item v-else label="人脸照片" >
+					<text>暂无</text>
+				</u-form-item>
+			</u-form>
 		</view>
-		<view class="" style="height: 150rpx;"></view>
-		<view class="footer-fixed">
-			<u-grid :col="3">
-				<u-grid-item @click="toItem(1)">
-					<u-icon name="plus-circle-fill" color='#19be6b' :size="50"></u-icon>
-					<view class="grid-text">新增</view>
-				</u-grid-item>
-				<u-grid-item @click="toItem(2)">
-					<u-icon name="edit-pen-fill" color="#2979ff" :size="50"></u-icon>
-					<view class="grid-text">修改</view>
-				</u-grid-item>
-				<u-grid-item @click="deleteRoom">
-					<u-icon name="trash-fill" color="#fa3534" :size="50"></u-icon>
-					<view class="grid-text">删除</view>
-				</u-grid-item>
-			</u-grid>
-		</view>
-		<navigator url="../index/index" open-type="switchTab"  class="cuIcon cu-btn round" style="background-color: rgba(0,0,0,.2);color: #FFFFFF;position: fixed;right: 3%;bottom: 20%;width: 80rpx;height: 80rpx;">
-			<text class="cuIcon-home" style="font-size: 40rpx;"></text>
-		</navigator>
 	</view>
 </template>
 
@@ -77,16 +55,20 @@
 				labelStyle:{
 					"fontWeight":"600"
 				},
-				form:{}
+				form:{},
+				faceImg:''
 			}
 		},
 		onLoad(options) {
-			
-		},
-		onShow() {
-			this.form=getApp().globalData.userDetail
+			this.fetchData(options.id)
 		},
 		methods: {
+			fetchData(id){
+				this.$api.user.detail(id).then(res=>{
+					this.form=res
+					this.faceImg=this.$global.imgBaseUrl+res.imageUri
+				})
+			},
 			previewImg(){
 				let url=this.form.fastDfsServer+this.form.imageUri
 				let imgArr=[url]
@@ -142,9 +124,12 @@
 </script>
 
 <style lang="scss">
+	page{
+		background-color: #FFFFFF;
+	}
 	.card{
 		background-color: #FFFFFF;
-		margin: 30rpx;
+		margin: 10rpx 50rpx;
 		border-radius: 20rpx;
 	}
 </style>

+ 3 - 1
pages/user/user.vue

@@ -64,6 +64,7 @@
 		
 		
 		<!-- 添加按钮 -->
+		<wm-list-add bgColor="#7fc6ac"  ref="add" @clickAdd="add"/>
 		<!-- <add-btn @click.native="add"></add-btn> -->
 		<!-- 通知alert -->
 		<u-toast ref="uToast" />
@@ -72,11 +73,12 @@
 
 <script>
 	import card from "./comps/card.vue"
+	import wmListAdd from '@/components/wm-list-add/wm-list-add';
 	import MescrollMixin from "@/components/mescroll-body/mescroll-mixins.js";
 	let that;
 	export default {
 		components:{
-			card
+			card,wmListAdd
 		},
 		mixins:[MescrollMixin],
 		data() {

ファイルの差分が大きいため隠しています
+ 0 - 1
static/iconfont.css


+ 6 - 2
utils/global.js

@@ -1,7 +1,11 @@
 let global = {
-
   imgBaseUrl:'http://139.9.103.171:8888/',
-
+  //不知道为啥,直接在html里用$global.imgBaseUrl的方式获取不了值
+  //只好写个方法兼容在html中获取
+  getImgBaseUrl:()=>{
+	  return 'http://139.9.103.171:8888/'
+  },
+  
   wxParams:{
 	  appid:'wxa05f3aff24dba698'
   },

+ 10 - 1
utils/util.js

@@ -7,12 +7,21 @@ util.copy=content=>{
 	uni.setClipboardData({ data: content });
 }
 
+util.preview=async (src)=> {
+	const urls = typeof src === 'string' ? [src] : src
+	const filePath = async src => src.match(/^http/) ? src : (await uni.compressImage({ src, quality: 100 }))[1].tempFilePath
+	for (let i = 0; i < urls.length; i++) {
+		urls[i] = await filePath(urls[i])
+	}
+	uni.previewImage({ urls })
+},
+
 
 // 图片缓存
 
 
 //拨打电话
-util.callPhone=phone=>{
+util.call=phone=>{
 	uni.showModal({
 	    title: '提示',
 	    content: `确定要拨打电话:${phone}吗?`,

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません