Selaa lähdekoodia

个人中心列表、设置、单元card数据纠正

slowslo 5 vuotta sitten
vanhempi
commit
fb1ac6bc77
6 muutettua tiedostoa jossa 244 lisäystä ja 8 poistoa
  1. 16 0
      main.js
  2. 19 0
      pages.json
  3. 88 6
      pages/mine/mine.vue
  4. 42 0
      pages/setting/agreement.vue
  5. 77 0
      pages/setting/setting.vue
  6. 2 2
      pages/unit/card.vue

+ 16 - 0
main.js

@@ -50,6 +50,22 @@ Vue.prototype.$showToast=function(title,type,position){
 	})
 }
 
+//封装提示框
+Vue.prototype.$showModel = (content,isShowCancel=true,title='提示',)=>{
+    return new Promise((resolve,reject)=>{
+        uni.showModal({
+            title: title,
+            content: content,
+			showCancel:isShowCancel,
+            success: (res)=>{
+				if (res.confirm) {
+					resolve(res)
+				} 
+            }
+        });
+    })
+}
+
 /**封装判空函数
  * @param {Object} value
  */

+ 19 - 0
pages.json

@@ -145,6 +145,25 @@
             }
             
         }
+		,{
+		    "path" : "pages/setting/setting",
+		    "style" :                                                                                    
+		    {
+		        "navigationBarTitleText": "系统设置",
+		        "enablePullDownRefresh": false
+		    }
+		    
+		}
+		,{
+		    "path" : "pages/setting/agreement",
+		    "style" :                                                                                    
+		    {
+		        "navigationBarTitleText": "用户协议",
+		        "enablePullDownRefresh": false
+		    }
+		    
+		}
+		
     ],
 	"globalStyle": {
 		"navigationBarTextStyle": "black",

+ 88 - 6
pages/mine/mine.vue

@@ -1,6 +1,17 @@
 <template>
-	<view>
-		
+	<view class="center">
+		<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>
+		</view>
+		<view style="margin: 10rpx;" >
+			<u-cell-group :border="false">
+				<u-cell-item :border-top="false" @click="toService(item)" v-for="(item,index) in menuList1" :key="index"  :title="item.name"></u-cell-item>
+				<u-cell-item  :border-bottom="false" @click="toSetting" v-for="(item,index) of menuList2" :key="index" :title="item"></u-cell-item>
+			</u-cell-group>
+		</view>
 	</view>
 </template>
 
@@ -8,15 +19,86 @@
 	export default {
 		data() {
 			return {
-				
+				menuList1:	[],
+				menuList2: ["系统设置"]
 			}
 		},
+		onLoad() {
+			this.getMenu();
+		},
+		onPullDownRefresh(){
+			this.getMenu();
+		},
 		methods: {
-			
+			toSetting(){
+				uni.navigateTo({
+					url: "../setting/setting"
+				})
+			},
+			getMenu(){
+				this.$api.permissions.menuList().then(res=>{
+					console.log(res);
+					for(let item of res.list){
+						if(item.name=="物业管理"){
+							this.menuList1= item.subList;
+						}
+					}
+				});
+			},
+			toService(item){
+				switch(item.name){
+					case "服务人员管理": 
+						// uni.navigateTo({
+						// 	url: "../fwry/fwry"
+						// })
+						this.$u.toast('即将开放');
+						break;
+					case "车辆管理":
+						uni.navigateTo({
+							url: "../car-manage/car-manage"
+						})
+						break;
+					case "门禁管理":
+						this.$u.toast('即将开放');
+						break;
+					default :
+						let list= [];
+						for(let element of item.subList){
+							list.splice(list.length,0,element.name);
+						}
+						uni.navigateTo({
+							url: "../service/service?list="+JSON.stringify(list)
+						})
+				}
+			}
 		}
 	}
 </script>
 
 <style>
-
-</style>
+	page{
+		background-color: #FFFFFF;
+	}
+	
+	.cu-btn.sm {
+		padding: 0 20upx;
+		font-size: 20upx;
+		height: 42upx;
+	}
+	
+	.logo {
+		display: flex;
+		padding:0 20rpx 40rpx;
+		background-color: #7dc7ae;
+		
+	}
+	.logo-img {
+		width: 120upx;
+		height: 120upx;
+		border-radius: 150upx;
+	}
+	.user-name {
+		font-size: 38upx;
+		color: #FFFFFF;
+	}
+</style>

+ 42 - 0
pages/setting/agreement.vue

@@ -0,0 +1,42 @@
+<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>

+ 77 - 0
pages/setting/setting.vue

@@ -0,0 +1,77 @@
+<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>

+ 2 - 2
pages/unit/card.vue

@@ -18,7 +18,7 @@
 				<view class="left">
 					<view class="cu-list grid col-3 no-border" >
 						<view class="cu-item" >
-							<text  style="color:  #cb2d5d;font-size: 32rpx;">{{item.buildingName}}</text>
+							<text  style="color:  #cb2d5d;font-size: 32rpx;">{{item.name}}</text>
 							<text class="count ">所属楼栋</text>
 						</view>
 						
@@ -28,7 +28,7 @@
 						</view>
 						
 						<view class="cu-item" >
-							<text style="color:  #cb2d5d;font-size: 32rpx;">{{item.userNumber}}</text>
+							<text style="color:  #cb2d5d;font-size: 32rpx;">{{item.personNumber}}</text>
 							<text class="count">住户总数</text>
 						</view>
 					</view>