Bläddra i källkod

初始化项目

19124812874 5 år sedan
förälder
incheckning
988d3716b6

+ 35 - 4
assets/http/api.js

@@ -21,14 +21,39 @@ const permissions = {
 	getSubListByPid:(params)=>http.get(permissionsUrl.subList,{params:params,header:header})
 }
 
+//获取当前登录用户的身份
+const getCurrentAccount=(params,header) => http.get('/permissions/authentication/getCurrentAccount',{params,header})
+//修改密码
+const updatePsw= (params,header) => http.post('/permissions/account/modifyPassword',params,{header})
+
+
 //机构列表
 let agencyUrl={
-	page:"/agency/agency/list"
+	page:"/estate/agency/showAgencyList"
 }
 const agency={
 	page:(params,header) => http.get(agencyUrl.page,{params:params,header:header})
 }
 
+//数据统计
+let dataStatisticsUrl={
+	//小区数
+	getResidentialAccount:"home/getResidentialAccount",
+	//单元数
+	getUnitAccount:"home/getUnitAccount",
+	//住户数
+	getUserAccount:"home/getUserAccount",
+	//住户待审核
+	getApplyUserAccountWithCheckState:"home/getApplyUserAccountWithCheckState"
+}
+const dataStatistics={
+	getResidentialAccount:(params,header) => http.get(dataStatisticsUrl.getResidentialAccount,{params:{'_':new Date().getTime()},header}),
+	getUnitAccount:(params,header) => http.get(dataStatisticsUrl.getUnitAccount,{params:{'_':new Date().getTime()},header}),
+	getUserAccount:(params,header) => http.get(dataStatisticsUrl.getUserAccount,{params:{'_':new Date().getTime()},header}),
+	getApplyUserAccountWithCheckState:(params,header) => http.get(dataStatisticsUrl.getApplyUserAccountWithCheckState,{params:{'_':new Date().getTime(),'checkState':'0'},header})
+}
+
+
 //小区管理
 let residentialUrl={
 	page:"estate/residential/getListByLikeName",
@@ -42,9 +67,9 @@ let residentialUrl={
 const residential={
 	page:(params,header) => http.get(residentialUrl.page,{params:params,header: header}),
 	pageBycondition:(params,header) => http.get(residentialUrl.pageBycondition,{params:params,header: header}),
-	add: (params,header) => http.post(residentialUrl.add,params,{header: header}),
-	update: (params,header) => http.post(residentialUrl.update,params,{header: header}),
-	del: (params,header) => http.post(residentialUrl.del,params,{header: header}),
+	add: (params,header) => http.post(residentialUrl.add,params,{header: {"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}}),
+	update: (params,header) => http.post(residentialUrl.update,params,{header: {"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}}),
+	del: (params,header) => http.post(residentialUrl.del,params,{header: {"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}}),
 	findListByPosition:(params,header) => http.get(residentialUrl.findListByPosition,{params:params,header: header}),
 	pageByconditionNew:(params,header) => http.get(residentialUrl.pageByconditionNew,{params:params,header:header})
 }
@@ -154,8 +179,14 @@ const carManage={
 export const api={
 	//权限管理
 	permissions,
+	//获取当前用户的身份信息
+	getCurrentAccount,
+	//修改密码
+	updatePsw,
 	//机构列表
 	agency,
+	//数据统计
+	dataStatistics,
 	//小区管理
 	residential,
 	//楼栋管理

+ 1 - 1
manifest.json

@@ -57,7 +57,7 @@
     "quickapp" : {},
     /* 小程序特有相关 */
     "mp-weixin" : {
-        "appid" : "wxe1ed7016c72509a7",
+        "appid" : "wxa05f3aff24dba698",
         "setting" : {
             "urlCheck" : false
         },

+ 9 - 19
pages.json

@@ -217,25 +217,15 @@
 		    }
 		    
 		}
-		,{
-		    "path" : "pages/setting/setting",
-		    "style" :                                                                                    
-		    {
-		        "navigationBarTitleText": "系统设置",
-		        "enablePullDownRefresh": false
-		    }
-		    
-		}
-		,{
-		    "path" : "pages/setting/agreement",
-		    "style" :                                                                                    
-		    {
-		        "navigationBarTitleText": "用户协议",
-		        "enablePullDownRefresh": false
-		    }
-		    
-		}
-		
+        ,{
+            "path" : "pages/login/changePsw",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "修改密码",
+                "enablePullDownRefresh": false
+            }
+            
+        }
     ],
 	"globalStyle": {
 		"navigationBarTextStyle": "black",

+ 1 - 1
pages/building/building.vue

@@ -31,7 +31,7 @@
 			</view>
 			
 			<view class="u-line-1"   style="text-align: center;height: 100%;">
-				<view @click="popupShow=true" class="cu-btn radius bg-base sm">
+				<view @click="form={};popupShow=true" class="cu-btn radius bg-base sm">
 					<text class="cuIcon-add"></text>
 					添加
 				</view>

+ 1 - 1
pages/building/card.vue

@@ -38,7 +38,7 @@
 				<view @click="edit(item)" class="cuIcon cu-btn round bg-blue light text-bold">
 					<text class="cuIcon-edit"></text>
 				</view>
-<!-- 				<view @click="delItem(item)" class="cuIcon cu-btn round bg-red light margin-left-20 text-bold">
+				<!-- <view @click="delItem(item)" class="cuIcon cu-btn round bg-red light margin-left-20 text-bold">
 					<text class="cuIcon-delete"></text>
 				</view> -->
 			</view>

+ 1 - 1
pages/car/car.vue

@@ -72,7 +72,7 @@
 </template>
 
 <script>
-	import card from "./card.vue"
+	import card from "./comps/card.vue"
 	import MescrollMixin from "@/components/mescroll-body/mescroll-mixins.js";
 	let that;
 	export default {

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


+ 24 - 26
pages/index/index.vue

@@ -1,8 +1,9 @@
 <template>
 	<view class="">
 		<view class="bg-white">
-			<image @error="imgError" style="width: 100%;height: 340rpx;" :src="imgUrl('banner',banner)" ></image>
+			<image  style="width: 100%;height: 340rpx;" src="/static/banner.jpg" ></image>
 		</view>
+		<!-- 社区管理 -->
 		<view style="padding:40rpx 40rpx 10px"  class="  flex bg-white">
 			<u-icon name="xiaoqu" custom-prefix="custom-icon" size="36" color="#7dc7ae"></u-icon>
 			<view style="font-size: 30rpx;" class="flex  justify-center align-center text-bold padding-left-10">
@@ -17,7 +18,9 @@
 				<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>	
+		</view>
+		
+		<!-- 物业服务 -->
 		<view style="padding: 20rpx 0  20rpx 40rpx;"  class="  flex bg-white">
 			<u-icon size="40" name="daibanshixiang1" custom-prefix="custom-icon"  color="#7dc7ae"></u-icon>
 			<view style="font-size: 30rpx;" class="flex  justify-center align-center text-bold padding-left-10">
@@ -27,14 +30,19 @@
 		<view class="bg-white " style="padding: 0rpx 0 20rpx 0">
 			<u-tabs  bar-height="8" bar-width="80" active-color="#7dc7ae" :list="list" :is-scroll="false" :current="subsectionCurrent" @change="subsectionChange"></u-tabs>
 		</view>
-		<!-- 住户认证 -->
-		<card v-if="subsectionCurrent==0" @handleRepair="handleRepair" :list="repairList"></card>
+		
+		
+		<!-- 物业报修 -->
+		<card v-if="subsectionCurrent==1" @handleRepair="handleRepair" :list="repairList"></card>
+		<!-- 用户反馈 -->
 		<feedback v-else :list="feedbackList"></feedback>
 		<view class="flex justify-center " style="padding:30rpx 0 ">
 			<view @click="more" class="cu-btn radius sm" style="border: 1rpx solid #7fc6ac;color: #7fc6ac;padding: 10rpx 40rpx;">
 				查看更多
 			</view>
 		</view>
+		
+		
 		<!-- 详情 -->
 				<u-popup v-model="popupShow" mode="center" width="650" :closeable="true" border-radius="10">
 					<view style="padding: 60rpx 40rpx 10rpx;">
@@ -82,25 +90,22 @@
 				
 				//弹出
 				popupShow:false,
-				
-				banner:'http://139.9.103.171:1888/miniofile/estate/banner.png',
-				isError:false,
-				
+	
 				feedbackList:[],
 				repairList:[],
 				list:[
-					{
-						name:'物业报修'
-					},
 					{
 						name:'用户反馈'
 					},
+					{
+						name:'物业报修'
+					}
 				],
 				subsectionCurrent:0,
 				
 				gridList:[
 					{
-						color:'#a1cece',
+						color:'#9cc7c7',
 						title:"小区管理",
 						badge:0,
 						name:'shequ'
@@ -150,20 +155,13 @@
 		onShow() {
 			this.fetchUserFeedback()
 			this.fetchRepairList()
-		},
-		computed:{
-			imgUrl(){
-				return (id,url)=>{
-					return 	this.$cache.cacheImg(id,url,this.isError)
-				}
-			}
+			this.getApplyUserReadyCheckCount()
 		},
 		methods: {
-			/**
-			 * 缓存的图片是否出现错误
-			 */
-			imgError(){
-				this.isError=true
+			getApplyUserReadyCheckCount(){
+				this.$api.dataStatistics.getApplyUserAccountWithCheckState().then(res=>{
+					this.gridList[5].badge=res.data.applyUserReadyCheckCount
+				})
 			},
 			/**
 			 * 处理工单
@@ -261,11 +259,11 @@
 			},
 			
 			more(){
-				if (this.subsectionCurrent==0) {
+				if (this.subsectionCurrent==1) {
 					uni.navigateTo({
 						url:'../repair/list'
 					})
-				}else if (this.subsectionCurrent==1) {
+				}else if (this.subsectionCurrent==0) {
 					uni.navigateTo({
 						url:'../feedback/list'
 					})

+ 55 - 0
pages/login/changePsw.vue

@@ -0,0 +1,55 @@
+<template>
+	<view>
+		<view class="bg-white padding-left-40 padding-right-40">
+			<u-form   ref="uForm" >
+				<u-form-item   label="旧密码"  :label-width="labelWidth">
+					<u-input maxlength="8" placeholder="请输入旧密码"   v-model="psw"  type="password"></u-input>
+				</u-form-item>
+				<u-form-item   label="新密码"  :label-width="labelWidth">
+					<u-input maxlength="8" placeholder="请输入新密码"   v-model="newPsw"  type="password"></u-input>
+				</u-form-item>
+				<u-form-item   label="确认新密码"  :label-width="labelWidth">
+					<u-input maxlength="8" placeholder="再次输入新密码"   v-model="confirmPsw"  type="password"></u-input>
+				</u-form-item>
+			</u-form>
+		</view>
+		<view @click="submit"  class="footer-fixed cu-btn  bg-color-base flex" style="padding: 45rpx;">
+			确认修改
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				labelWidth:180,
+				psw:'',
+				newPsw:'',
+				confirmPsw:''
+			}
+		},
+		onShow() {
+			
+		},
+		methods: {
+	
+			/**
+			 * 修改密码
+			 */
+			submit(){
+				
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	page{
+		background-color: #FFFFFF;
+	}
+	.bg-color-base {
+		background-color: #7dc7ae;
+		color: #FFFFFF;
+	}
+</style>

+ 81 - 12
pages/login/login.vue

@@ -2,6 +2,17 @@
 	<view class="container">
 		<view class="bg bg-color-base margin-b20"></view>
 
+		<u-modal v-model="tipShow" @confirm="pswShow=true" confirm-text="去修改" :show-cancel-button="true" cancel-text="暂不修改" content="检测到您的密码为初始密码,请修改密码后再登录!"></u-modal>
+
+		<u-modal   @confirm="changeConfirm" title="修改密码" confirm-text="提交" :mask-close-able="true" v-model="pswShow" >
+			<view class="slot-content" style="margin: 20rpx;">
+				<u-form label-width="180"  ref="uForm">
+					<u-form-item label="新密码"><u-input v-model="newPsw" type="password"/></u-form-item>
+					<u-form-item :border-bottom="false" label="确认新密码"><u-input type="password" v-model="confirmPsw" /></u-form-item>
+				</u-form>
+			</view>
+		</u-modal>
+
 		<view class="tab vs-row vs-align-center">
 			<image class="tab-bg" 
 			src="https://6e69-niew6-1302638010.tcb.qcloud.la/denglu/%E7%99%BB%E5%BD%955/banner-icon.png?sign=d63f6b91aed3733b261cc0127d2cf702&t=1604049324"
@@ -45,7 +56,13 @@
 				show: false,
 				content: "",
 				phone: '', //手机号码
-				pwd: '' //密码
+				pwd: '' ,//密码
+				
+				//修改密码
+				tipShow:false,
+				pswShow:false,
+				newPsw:'',//新密码
+				confirmPsw:''//确认新密码
 			}
 		},
 		onLoad() {
@@ -62,7 +79,60 @@
 			checkboxChange(e){
 				this.isSave=e.value
 			},
-			login() {
+			async handelLogin(){
+				let that=this
+				let resp=await this.$api.getCurrentAccount()
+				if (resp.data.hadUpdatePwd==1) {
+					if(this.isSave==true){
+						 uni.setStorageSync('account',{account:that.phone,pwd:that.pwd});					
+					}else{
+						uni.removeStorageSync("account");
+					}
+					uni.reLaunch({
+						url:"../index/index"
+					})
+				}else{
+					this.tipShow=true
+				}
+			},
+			changeConfirm(){
+				if (this.$isEmpty(this.newPsw)) {
+					this.$u.toast('新密码不能为空')
+					this.pswShow=true
+					return
+				}
+				if (this.$isEmpty(this.confirmPsw)) {
+					this.pswShow=true
+					this.$u.toast('确认密码不能为空')
+					return
+				}
+				if (this.pwd===this.newPsw) {
+					this.pswShow=true
+					this.$u.toast('新密码不能和旧密码一致')
+					return
+				}
+				if (this.newPsw!==this.confirmPsw) {
+					this.pswShow=true
+					this.$u.toast('两次输入的密码不一致')
+					return
+				}
+				let params={
+					oldPwd:this.pwd,
+					newPwd:this.newPsw,
+					confirmPwd:this.confirmPsw
+				}
+				this.$api.updatePsw(params).then(res=>{
+					if (res.msg=='success') {
+						uni.showToast({
+							title:"修改成功,请重新登录",
+							icon:"none",
+							duration:2000
+						})
+						this.pwd=""
+					}
+				})
+			},
+		    login() {
 				
 				var that = this;
 				if (!that.phone) {
@@ -76,25 +146,24 @@
 					that.show = true;
 					return;
 				}
+				
+				this.$dialog.showLoading('登录中...')
+				
 				this.$api.permissions.login({
 					loginName: that.phone,
 					loginPwd: that.pwd
 				},{"Content-Type":"application/x-www-form-urlencoded"}).then(res => {
 					if(res.code=="200"){
-						if(this.isSave==true){
-							 uni.setStorageSync('account',{account:that.phone,pwd:that.pwd});					
-						}else{
-							uni.removeStorageSync("account");
-						}
-						 uni.setStorageSync('access-token',res.data);			
-						uni.reLaunch({
-							url:"../index/index"
-						})
+						uni.setStorageSync('access-token',res.data);
+						this.handelLogin()
 					}else{
 						that.content=res.msg;
 						that.show = true;
 					}
-					console.log(res);
+					uni.hideLoading()
+					
+				}).catch(err=>{
+					uni.hideLoading()
 				});
 			}
 		}

+ 131 - 43
pages/mine/mine.vue

@@ -3,13 +3,30 @@
 		<view class="logo" >
 			<image class="logo-img" src="https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png"></image>
 			<view class="flex  margin-top-30" style="padding-left: 30rpx;">
-				<view class="user-name">超级管理员</view>
+				<view class="user-name">{{role}}</view>
+				<view @click="logout" style="position: absolute;right: 50rpx;top: 40rpx;">
+					<image style="width: 40rpx;height: 40rpx;" src="/static/mine/logout1.png" mode=""></image>
+				</view>
 			</view>
 		</view>
-		<view style="margin: 10rpx;" >
-			<u-cell-group :border="false">
-				<u-cell-item :border-top="false" @click="toServiceList(item)" v-for="(item,index) in menuList" :key="index"  :title="item"></u-cell-item>
-			</u-cell-group>
+		
+		<view @click="jump(item.path)" class="menu" v-for="(item,index) in menuList" :key="index">
+			<view class="left">
+				<u-icon :name="item.name" custom-prefix="custom-icon" size="90" :color="item.color"></u-icon>
+				<view class="content">
+					<text class="title">{{item.title}}</text>
+					<view class="sub_title flex">
+						<text class="">本月新增:{{item.monthCount}}</text>
+						<view v-if="index==2" class=" padding-left-20">
+							待审核:
+							<text class="text-red">{{item.applyUserReadyCheckCount}}</text>
+						</view>
+					</view>
+				</view>
+			</view>
+			<view class="right">
+				<text class="text-red">{{item.totalCount}}</text>
+			</view>
 		</view>
 	</view>
 </template>
@@ -18,54 +35,125 @@
 	export default {
 		data() {
 			return {
-				menuList:["社区管理","门禁管理","物业服务","服务人员管理","车辆管理","系统设置"],
+				role:'admin',
+				menuList:[
+					{
+						color:'#a1cece',
+						title:"小区",
+						name:'shequ',
+						path:'/pages/residential/residential',
+						monthCount:0,
+						totalCount:0
+					},
+					{
+						color:'#3dc159',
+						title:"单元",
+						name:'tesecanyin',
+						path:'/pages/unit/unit',
+						monthCount:0,
+						totalCount:0
+					},
+					{
+						color:'#de9964',
+						title:"住户",
+						name:'zhuhu',
+						path:'/pages/user/user',
+						monthCount:0,
+						totalCount:0,
+						applyUserReadyCheckCount:0
+					},
+				]
 			}
 		},
+		onLoad() {
+			this.role=this.$cache.get('account').account
+			this.getResidentialAccount()
+			this.getUnitAccount()
+			this.getUserAccount()
+		},
 		methods: {
-			toServiceList(item){
-				switch(item){
-					case "社区管理":
-						uni.navigateTo({
-							url: "../service-list/community-list"
-						})
-						break;
-					case "门禁管理":
-						this.$u.toast('即将开放');
-						break;
-					case "物业服务":
-						uni.navigateTo({
-							url:"../service-list/property-list"
-						})
-						break;
-					case "服务人员管理": 
-						// uni.navigateTo({
-						// 	url: "../fwry/fwry"
-						// })
-						this.$u.toast('即将开放');
-						break;
-					case "车辆管理":
-						uni.navigateTo({
-							url: "../car-manage/car-manage"
-						})
-						break;
-					case "系统设置":
-						uni.navigateTo({
-							url:"../setting/setting"
-						})
-						break;
-					default :
-						break;
-				}
+			getResidentialAccount(){
+				this.$api.dataStatistics.getResidentialAccount().then(res=>{
+					Object.assign(this.menuList[0],res.data)
+				})
+			},
+			getUnitAccount(){
+				this.$api.dataStatistics.getUnitAccount().then(res=>{
+					Object.assign(this.menuList[1],res.data)
+				})
+			},
+			getUserAccount(){
+				this.$api.dataStatistics.getUserAccount().then(res=>{
+					Object.assign(this.menuList[2],res.data)
+					this.getApplyUserReadyCheckCount()
+				})
+			},
+			getApplyUserReadyCheckCount(){
+				this.$api.dataStatistics.getApplyUserAccountWithCheckState().then(res=>{
+					this.menuList[2].applyUserReadyCheckCount=res.data.applyUserReadyCheckCount
+					 console.log(this.menuList[2]);
+				})
+			},
+			logout(){
+				this.$showModel('确定要退出系统?').then(res=>{
+					uni.clearStorage()
+					uni.reLaunch({
+						url:"../login/login"
+					})
+				})
+			},
+			jump(url){
+				uni.navigateTo({
+					url
+				})
 			}
 		}
 	}
 </script>
 
-<style>
+<style lang="scss">
 	page{
 		background-color: #FFFFFF;
 	}
 	
+	.menu{
+		display: flex;
+		justify-content: space-between;
+		padding: 20rpx 30rpx;
+		border-bottom: 1rpx solid #EEEEEE;
+		
+		.left{
+			display: flex;
+		}
+		
+		.right{
+			display: flex;
+			justify-content: center;
+			align-items: center;
+			
+			text{
+				font-size: 32rpx;
+			}
+		}
+		
+		.content{
+			padding-left: 20rpx;
+			display: flex;
+			flex-direction: column;
+			justify-content: center;
+			
+			.title{
+				font-size: 32rpx;
+			}
+			
+			.sub_title{
+				padding-top: 10rpx;
+				font-size: 24rpx;
+				color: #777;
+			}
+		}
+	}
+	
 	.cu-btn.sm {
 		padding: 0 20upx;
 		font-size: 20upx;
@@ -74,7 +162,7 @@
 	
 	.logo {
 		display: flex;
-		padding:0 20rpx 40rpx;
+		padding:0rpx 20rpx 40rpx;
 		background-color: #7dc7ae;
 		
 	}
@@ -84,7 +172,7 @@
 		border-radius: 150upx;
 	}
 	.user-name {
-		font-size: 38upx;
+		font-size: 40upx;
 		color: #FFFFFF;
 	}
 </style>

+ 0 - 0
pages/repair/item.vue → pages/repair/comps/item.vue


+ 1 - 1
pages/repair/list.vue

@@ -22,7 +22,7 @@
 	</view>
 </template>
 <script>
-	import item from "./item.vue"
+	import item from "./comps/item.vue"
 	export default {
 		components: {
 			item

+ 17 - 8
pages/residential/card.vue → pages/residential/comps/card.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="">
-		<view @click="goDetail(item)" class="data" v-for="(item, index) in list" :key="index">
+		<view  class="data" v-for="(item, index) in list" :key="index">
 			<view class="top">
 				<view class="left">
 					<view class="title">
@@ -17,7 +17,17 @@
 			</view>
 			<view class="item">
 				<view class="left">
-					<view class="cu-list grid col-3 no-border" >
+					<view  class=" flex" style="padding: 20rpx  40rpx;">
+						<u-icon name="xiaoqu" custom-prefix="custom-icon" size="30" color="#2fc500"></u-icon>
+						<text class="padding-left-10">所属社区:</text>
+						<text>{{item.agencyName}}</text>
+					</view>
+					<view  class=" flex" style="padding: 20rpx  35rpx;">
+						<u-icon name="map-fill"  size="40" color="#55aaff"></u-icon>
+						<text class="padding-left-10">详细地址:</text>
+						<text>{{item.address}}</text>
+					</view>
+					<view class="cu-list grid col-5 no-border" >
 						<view class="cu-item" >
 							<text  style="color:  #cb2d5d;font-size: 32rpx;">{{item.buildingNumber}}</text>
 							<text class="count">楼栋总数</text>
@@ -42,7 +52,7 @@
 				</view>
 			</view>
 			<view class="bottom">
-				<view @click="edit(item)" class="cuIcon cu-btn round bg-blue light text-bold">
+				<view @click.stop="edit(item)" class="cuIcon cu-btn round bg-blue light text-bold">
 					<text class="cuIcon-edit"></text>
 				</view>
 <!-- 				<view @click="delItem(item)" class="cuIcon cu-btn round bg-red light margin-left-20 text-bold">
@@ -81,15 +91,14 @@ export default {
 		goDetail(item){
 			console.log(item)
 			uni.navigateTo({
-				// url:"/pages/residential/detail?id="+item.id
 				url:"/pages/residential/detail?item="+JSON.stringify(item)
 			})
 		},
 		edit(item){
-			uni.navigateTo({
-				// url:"/pages/residential/add?id="+item.id
-				url:"/pages/residential/add?item="+JSON.stringify(item)
-			})
+			this.$emit('edit',item)
+			// uni.navigateTo({
+			// 	url:"/pages/residential/add?item="+JSON.stringify(item)
+			// })
 		},
 		delItem(item){
 			this.$emit('delItem',item)

+ 72 - 166
pages/residential/residential.vue

@@ -5,8 +5,9 @@
 			<view style="padding: 60rpx 40rpx 10rpx;">
 				<u-form label-width="150" :model="form">
 					<u-form-item label="小区名称" :required="true"><u-input v-model="form.name" /></u-form-item>
-					<u-form-item label="所属机构" :required="true">
-						<u-input type="select" disabled @click="operaType=1;agencypopupShow=true" v-model="form.agencyName" />
+					<u-form-item label="详细地址" ><u-input v-model="form.address" /></u-form-item>
+					<u-form-item label="所属社区" :required="true">
+						<u-input type="text" disabled  v-model="form.agencyName" />
 					</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>
@@ -17,20 +18,24 @@
 			</view>
 		</u-popup>
 		<!-- 筛选标签条 -->
-		<view class="cu-bar bg-white flex" 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: 20%;text-align: center;height: 100%;">
-				<text v-text="data[index]==''?item:data[index]" :class="data[index]==''?'':'text-red'"></text>
-				<u-icon v-if="index!=3" name="arrow-down-fill" size="20" style="padding-left: 10rpx;"></u-icon>
-				<text class="cuIcon-filter padding-left-10" v-else></text>
-				<u-badge :offset="[10, 8]" v-if="index==3" size="mini" type="error" :count="filterCount"></u-badge>
+		<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>
 		</view>
 		<mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption">
 			<view style="margin-top: 110rpx;">
-				<card @delItem="delItem" :list="list"></card>
+				<card @edit="edit" @delItem="delItem" :list="list"></card>
 			</view>
 		</mescroll-body>
-		<!-- 所属机构 -->
+		<!-- 所属社区 -->
 		<u-popup  border-radius="60" height="60%"  mode="bottom" v-model="agencypopupShow">
 			<view class="fixed cu-bar search bg-white">
 				<view class="search-form round">
@@ -40,23 +45,7 @@
 			</view>
 			<scroll-view v-if="!$isEmpty(searchList)"  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 searchList" :key="index">
-					<text>{{item.label}}</text>
-				</view>
-				<u-divider v-if="searchList.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="estateShow">
-			<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="estateKeyWord" type="text" :adjust-position="false" placeholder="请输入关键字搜索" confirm-type="search"/>
-				</view>
-			</view>
-			<scroll-view v-if="!$isEmpty(searchList)"  style="padding-top: 110rpx;height: 100%;" :scroll-y="true" >
-				<view @click="estateComfirm(item)" hover-class="hoverClass" class="text-center padding-30 solid-bottom"  v-for="(item,index) in searchList" :key="index">
-					<text>{{item.label}}</text>
+					<text>{{item.agencyName}}</text>
 				</view>
 				<u-divider v-if="searchList.length>=10" height="80">只显示十条数据</u-divider>
 			</scroll-view>
@@ -71,20 +60,16 @@
 			<view class="slot-content" style="margin: 20rpx;">
 				<u-form label-width="150" :model="params" ref="uForm">
 					<u-form-item label="小区名"><u-input v-model="params.name" /></u-form-item>
-					<!-- <u-form-item :border-bottom="false" label="门牌号"><u-input v-model="params.houseNumber" /></u-form-item> -->
 				</u-form>
 			</view>
 		</u-modal>
-		
-		<!-- 添加按钮 -->
-		<add-btn @click.native="add"></add-btn>
 		<!-- 通知alert -->
 		<u-toast ref="uToast" />
 	</view>
 </template>
 
 <script>
-	import card from "./card.vue"
+	import card from "./comps/card.vue"
 	import MescrollMixin from "@/components/mescroll-body/mescroll-mixins.js";
 	import util from "../../utils/util";
 	let that;
@@ -101,7 +86,7 @@
 				operaType:0,
 
 				//顶部菜单栏
-				filterMenu: ["地区","归属","物业名称","筛选"],
+				filterMenu: ["地区","所属社区"],
 				data:['','','',''],
 				
 				//地区
@@ -119,9 +104,6 @@
 				params:{},
 				agencyKeyword:'',
 				
-				//小区
-				estateShow:false,
-				estateKeyWord:'',
 				list: [],
 				downOption: { 
 					use: true,
@@ -160,28 +142,11 @@
 				this.timer = setTimeout(() => {
 					that.searchList=[]
 					let params = {
-						isSelect: true,
-						regionArea: that.areaValue,
 						agencyName: that.agencyKeyword
 					}
 					this.getAgencyList(params)
 				}, 500)
 			},
-			estateKeyWord(){
-				let that=this
-				//节流函数
-				if (this.timer){
-					clearTimeout(this.timer)//阻止setTimeout函数的执行
-				}
-				this.timer = setTimeout(() => {
-					that.residentialList=[]
-					let params={
-						agencyId:that.params.agencyId,
-						estatePidName:that.estateKeyWord
-					}
-					that.getResidentailList(params)
-				}, 500)
-			},
 		},
 		methods: {
 			/**
@@ -189,12 +154,12 @@
 			 */
 			getFilterCount(){
 				let n=0
-				if (!this.$isEmpty(this.params.agencyId)) {
-					//机构
+				if (!this.$isEmpty(this.params.regionArea)) {
+					//地区
 					n++
 				}
-				if (!this.$isEmpty(this.params.estatePid)) {
-					//物业
+				if (!this.$isEmpty(this.params.agencyId)) {
+					//所属社区
 					n++
 				}
 				if (!this.$isEmpty(this.params.name)) {
@@ -220,15 +185,12 @@
 				params.current=mescroll.num
 				params.size=mescroll.size
 				this.getFilterCount()
-				console.log(111)
 				try{
 					this.$api.residential.pageBycondition(params).then(res=>{
 						console.log(res)
 						let data=res.data.records
-						// let data=res.list
 						let length=data.length
 						let total=res.data.total
-						// let total = res.list.length
 						mescroll.endBySize(length, total);
 						if(mescroll.num == 1) this.list = []; 
 						this.list=this.list.concat(data); 
@@ -246,25 +208,9 @@
 				this.areaValue=''
 				this.searchList=[]
 				this.agencyKeyword=''
-				this.estateKeyWord='',
 				this.list=[],
 				this.mescroll.resetUpScroll()
 			},
-			/**
-			 * 获取小区列表
-			 * @param {Object} params
-			 */
-			getResidentailList(params){
-				console.log(params)
-				// this.$api.residential.page(params).then(res=>{
-				// 	console.log(122,res)
-				// 	this.list =  res.list;
-				// })
-				this.$api.residential.pageBycondition(params).then(res=>{
-					console.log(122,res)
-					this.list =  res.data.records;
-				})
-			},
 			/**
 			 * 顶部菜单选择
 			 * @param {Object} index 菜单下标
@@ -275,18 +221,11 @@
 					this.regionShow=true
 					return
 				}
-				if(index==1){
-					//归属
-					this.agencypopupShow = true;
-				 return;
-				}else if(index==2){
-					//物业名称
-					this.estateShow=true
-				}else if (index==3) {
-					//筛选
-					this.filterShow=true
+				if (index==1) {
+					//所属社区
+					this.agencypopupShow=true
+					return
 				}
-				
 			},
 			/**
 			 * 确认筛选
@@ -299,53 +238,15 @@
 			 * @param {Object} object
 			 */
 			regionConfirm(object){
+				console.log(object);
 				this.data[0]= object.area.label;
 				this.areaValue = object.area.value;
-				let params = {
-					regionArea: this.areaValue
-				};
-				this.getAgencyList(params)
-				this.getResidentailList(params)
-			},
-			/**
-			 * 获取物业列表
-			 * @param {Object} params
-			 */
-			getListByLikeName(params){
-				let list = [];
-				this.$api.permissions.orgList(params).then(res=>{
-					console.log(res)
-					let list = [];
-						for(let item of res.data.records){
-							let element = {
-								label: item.name,
-								value: item.id
-							}
-							list.splice(list.length,0,element);
-							// list.push(obj);
-						}
-						this.searchList = list;
-						// this.mescroll.resetUpScroll()
-				})
-			},
-			/**
-			 * 物业确认
-			 */
-			estateComfirm(res){
-				console.log("物业确认:",res)
-				this.params.estatePid =res.value
-				this.data[2] = res.label
-				this.estateShow = false
-				console.log(res)
-				//获取小区
-				let params={
-					agencyId:this.params.agencyId,
-					estatePid:this.params.estatePid
+				
+				this.params={
+					regionProvince:object.province.value+"0000",
+					regionCity:object.city.value+"00",
+					regionArea:object.area.value
 				}
-				this.$api.residential.pageBycondition(params).then(res=>{
-					console.log(333,res)
-					this.list =  res.data.records;
-				})
 				this.mescroll.resetUpScroll()
 			},
 			/**
@@ -353,28 +254,8 @@
 			 * @param {Object} params
 			 */
 			getAgencyList(params){
-				let list = [];
-				let param = {
-					// flag:1,
-					// orgType:1,
-					// isSelect:true
-					regionArea:this.params.regionArea,
-					current:1,
-					size:10
-				}
-				this.$api.permissions.orgList(param).then(res=>{
-					console.log("旧机构列表:",res)
-					let list = [];
-						for(let item of res.data.records){
-							let element = {
-								label: item.name,
-								value: item.id
-							}
-							list.splice(list.length,0,element);
-							// list.push(obj);
-						}
-						this.searchList = list;
-						// this.mescroll.resetUpScroll()
+				this.$api.agency.page(params).then(res=>{
+					this.searchList=res.data.records
 				})
 			},
 			/**
@@ -382,19 +263,9 @@
 			 */
 			agencyConfirm(res){
 				//筛选标题
-				this.params.agencyId =res.value
-				this.data[1] = res.label
+				this.params.agencyId =res.id
+				this.data[1] = res.agencyName
 				this.agencypopupShow = false
-				console.log(res)
-				//获取小区
-				let params={
-					regionArea:this.params.regionArea,
-					agencyId:this.params.agencyId
-				}
-				this.$api.residential.pageBycondition(params).then(res=>{
-					console.log(333,res)
-					this.list =  res.data.records;
-				})
 				this.mescroll.resetUpScroll()
 			},
 			/**
@@ -405,10 +276,45 @@
 					url:"./add"
 				})
 			},
+			edit(item){
+				this.popupShow=true
+				this.form={
+					id:item.id,
+					name:item.name,
+					address:item.address,
+					agencyName:item.agencyName,
+					personName:item.personName,
+					personTel:item.personTel,
+				}
+			},
+			submit(){
+				if (this.$isEmpty(this.form.id)) {
+					console.log(this.form);
+					//新增
+					return
+				}
+				for (let key in this.form) {
+					if (this.$isEmpty(this.form[key])) {
+						delete this.form[key]
+					}
+				}
+				//修改
+				this.$api.residential.update(this.form).then(res=>{
+					if (res.data==true) {
+						this.$u.toast('修改成功')
+						this.popupShow=false
+						that.mescroll.resetUpScroll()
+					}else{
+						this.popupShow=false
+						this.$u.toast('操作失败')
+					}
+				})
+				
+			},
 			delItem(item){
 				this.$dialog.showModal('确定要删除此项吗?').then(res=>{
 					this.$api.residential.del({id:item.id}).then(res=>{
-						if (res.data) {
+						if (res.data==true) {
 							this.$showToast('删除成功')
 							that.mescroll.resetUpScroll()
 						}

+ 1 - 2
pages/room/add.vue

@@ -11,7 +11,7 @@
 				</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-if="$isEmpty(form.id)"  type="select" :select-open="buildingShow" v-model="buildingName"  placeholder="请选择小区" @click="showBuilding"></u-input>
 					<!-- 修改 -->
 					<u-input v-else   disabled v-model="form.buildingName" ></u-input>
 				</u-form-item>
@@ -272,7 +272,6 @@ export default {
 			}
 			console.log(this.form);
 			if (this.$isEmpty(this.form.id)) {
-				return
 				this.$api.room.add(this.form).then(res=>{
 					if (res.data) {
 						this.$dialog.showModal('操作成功',false).then(res=>{

+ 1 - 2
pages/room/card.vue → pages/room/comps/card.vue

@@ -1,12 +1,11 @@
 <template>
 	<view class="">
-		<view @click="goDetail(item)"  class="data" v-for="(item, index) in list" :key="index">
+		<view  class="data" v-for="(item, index) in list" :key="index">
 			<view class="top">
 				<view class="left">
 					<view class="title">
 						<u-icon name="fangjian" custom-prefix="custom-icon" size="30" color="#50baca"></u-icon>
 						<text class="padding-left-20">房间名称:{{item.name}}</text>
-						<!-- <text @click.stop="copy(item.name)" style="text-decoration: underline;" class="text-blue padding-left-20">复制</text> -->
 					</view>
 				</view>
 			</view>

+ 2 - 2
pages/room/room.vue

@@ -66,14 +66,14 @@
 		<u-picker @confirm="unitConfirm" range-key="name" :range="unitList" v-model="unitShow" mode="selector"></u-picker>
 		
 		<!-- 添加按钮 -->
-		<add-btn @click.native="add"></add-btn>
+		<!-- <add-btn @click.native="add"></add-btn> -->
 		<!-- 通知alert -->
 		<u-toast ref="uToast" />
 	</view>
 </template>
 
 <script>
-	import card from "./card.vue"
+	import card from "./comps/card.vue"
 	import MescrollMixin from "@/components/mescroll-body/mescroll-mixins.js";
 	let that;
 	export default {

+ 1 - 1
pages/service-list/property-list.vue

@@ -12,7 +12,7 @@
 	export default {
 		data() {
 			return {
-				PropertyMenuList:["物业报修","公告管理","用户反馈"],
+				PropertyMenuList:["物业报修","用户反馈"],
 			}
 		},
 		methods: {

+ 0 - 42
pages/setting/agreement.vue

@@ -1,42 +0,0 @@
-<template>
-	<view>
-		<view>
-			
-		</view>
-	</view>
-</template>
-
-<script>
-	export default {
-		data() {
-			return {
-				
-			}
-		},
-			onLoad(){
-				 uni.showModal({
-				
-				     title: '提示',
-				
-				     content: '暂无协议',
-				
-				     success: function (res) {
-				
-				       if (res.confirm) {//这里是点击了确定以后
-				
-				         uni.navigateTo({
-				         	url:'./setting'
-				         })
-				
-				       } else {//这里是点击了取消以后
-				
-				       }
-				     }
-				   })
-			
-		}
-	}
-</script>
-
-<style>
-</style>

+ 0 - 77
pages/setting/setting.vue

@@ -1,77 +0,0 @@
-<template>
-	<view>
-		<view @click="toagreement" style="width: 100%;height: 100rpx;align-items: center; justify-content: space-between; display: flex;flex-direction: row;background-color: white; margin-top: 25rpx;">
-			<view style="margin-left: 30rpx;font-size: small;">用户协议</view>
-			<view class="right-arrow"></view>
-		</view>
-		<view style="width: 100%;height: 100rpx;align-items: center; justify-content: space-between; display: flex;flex-direction: row;background-color: white; margin-top: 25rpx;">
-			<view style="margin-left: 30rpx;font-size: small;">技术支持</view>
-			<view style="font-size: small;color: #9da1a7;margin-right: 30rpx;">广州吉米特科技有限公司</view>
-		</view>
-		<view v-if="isLogin">
-		  <button @click="logout" class="btn-logout" hover-class="button-hover-scale">退出系统</button>
-		</view>
-	</view>
-</template>
-
-<script>
-	export default {
-		data() {
-			return {
-				isLogin:true,
-			}
-		},
-		methods: {
-			//用户协议
-			toagreement(){
-				uni.navigateTo({
-					url:'./agreement'
-				})
-			},
-			//退出登录
-			logout(){
-				this.$showModel('确定要退出系统?').then(res=>{
-					uni.clearStorage()
-					uni.reLaunch({
-						url:"../login/login"
-					})
-				})
-			},
-		}
-	}
-</script>
-
-<style >
-	.right-arrow {
-	    display :inline-block;
-	    position: relative;
-	    width: 36rpx;
-	    height: 36rpx;
-	    margin-right: 20rpx;
-	}
-	
-	.right-arrow::after {
-	    display: inline-block;
-	    content: " ";
-	    height: 18rpx;
-	    width: 18rpx;
-	    border-width: 4rpx 4rpx 0 0;
-	    border-color: #c7c7cc;
-	    border-style: solid;
-	    transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
-	    position: absolute;
-	    top: 50%;
-	    right: 6rpx;
-	    margin-top: -9rpx;
-	}
-  .btn-logout {
-    margin:60upx auto;
-    width:690upx;
-    height: 90upx;
-    line-height: 90upx;
-    border-radius:10upx;
-	color: white;
-	font-size: medium;
-    background-color:#ba3934;
-  }
-</style>

+ 1 - 1
pages/unit/card.vue → pages/unit/comps/card.vue

@@ -38,7 +38,7 @@
 				<view @click="edit(item)" class="cuIcon cu-btn round bg-blue light text-bold">
 					<text class="cuIcon-edit"></text>
 				</view>
-<!-- 				<view @click="delItem(item)" class="cuIcon cu-btn round bg-red light margin-left-20 text-bold">
+				<!-- <view @click="delItem(item)" class="cuIcon cu-btn round bg-red light margin-left-20 text-bold">
 					<text class="cuIcon-delete"></text>
 				</view> -->
 			</view>

+ 2 - 2
pages/unit/unit.vue

@@ -31,7 +31,7 @@
 			</view>
 			
 			<view class="u-line-1"   style="text-align: center;height: 100%;">
-				<view @click="popupShow=true" class="cu-btn radius bg-base sm">
+				<view @click="form={};popupShow=true" class="cu-btn radius bg-base sm">
 					<text class="cuIcon-add"></text>
 					添加
 				</view>
@@ -93,7 +93,7 @@
 </template>
 
 <script>
-	import card from "./card.vue"
+	import card from "./comps/card.vue"
 	import MescrollMixin from "@/components/mescroll-body/mescroll-mixins.js";
 	let that;
 	export default {

+ 0 - 0
pages/user-auth/card.vue → pages/user-auth/comps/card.vue


+ 1 - 1
pages/user-auth/user-auth.vue

@@ -76,7 +76,7 @@
 </template>
 
 <script>
-	import card from "./card.vue"
+	import card from "./comps/card.vue"
 	import MescrollMixin from "@/components/mescroll-body/mescroll-mixins.js";
 	let that;
 	export default {

+ 0 - 0
pages/user/card.vue → pages/user/comps/card.vue


+ 1 - 1
pages/user/user.vue

@@ -71,7 +71,7 @@
 </template>
 
 <script>
-	import card from "./card.vue"
+	import card from "./comps/card.vue"
 	import MescrollMixin from "@/components/mescroll-body/mescroll-mixins.js";
 	let that;
 	export default {

BIN
static/banner.jpg


BIN
static/mine/logout1.png


+ 6 - 0
utils/dialog.js

@@ -17,4 +17,10 @@ dialog.showModal = (content,isShowCancel=true,title='提示')=>{
 	})
 }
 
+dialog.showLoading=(title="加载中")=>{
+	uni.showLoading({
+		title
+	})
+}
+
 export default dialog