| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234 | 
							- <template>
 
- <!-- #ifdef APP -->
 
-  <scroll-view style="flex:1">
 
-  <!-- #endif -->
 
-   <view class="my-page">
 
-     <!-- 标题栏 -->
 
- 	<view class=" uni-section">
 
- 		<view class=" uni-section-header">
 
- 		<view class=" uni-section-header__decoration line"/>	
 
- 			<view class=" uni-section-header__content">
 
- 			  <text style="font-size:14px;color:#333" class="distraction">用户管理</text>
 
- 			</view>
 
- 		</view>
 
- 	</view>
 
- 	<view>
 
- 		<view class = "name-label">
 
- 			您好:{{currentName}}
 
- 		</view>
 
- 	</view>
 
- 	<!-- 宫格 -->
 
-     <view class="grid-body">
 
- 	  <view class="grid uni-row">
 
-           <view class="grid-item" v-for="(item: Item, index: number) in items" :key="index" @click="enterItem(item)" >
 
- 	          <!-- 您的网格项内容 -->
 
- 	          <uni-icons class="my-icon" :type="item.iconType" size="40" :color="item.colorClass" ></uni-icons>
 
- 	          <text class="text">{{ item.text }}</text> 
 
- 	        </view>
 
- 	      </view>
 
-     </view>
 
-   </view>
 
-   <!-- #ifdef APP -->
 
-     </scroll-view>
 
-   <!-- #endif -->
 
- </template>
 
- <script lang="uts">
 
-   import {state} from '@/store'; 	
 
-   import { getCurrentUserSync } from '@/utils/auth.uts'
 
-   
 
-   type ImageItem={
 
-   	 image:string
 
-   }
 
-   type Item={
 
-   	  colorClass:string,
 
-   	  iconType:string,
 
-   	  path:string,		   
 
-   	  text:string
 
-   }	
 
-   export default {
 
-     data() { 
 
- 	   let basic = [
 
- 		     ,{colorClass: 'green', iconType: "wallet-filled", text: "修改用户信息",path:"/pages/mine/pwd/index" }
 
- 		] as Item[];
 
- 		let isAdmin = state.roles.includes('admin') ? true : false;
 
- 		let adminItem =  [ {colorClass: 'blue', iconType: "personadd-filled", text: "注册用户",path:"/pages/register" },
 
- 		{colorClass: 'blue', iconType: "staff-filled", text: "用户列表",path:"/pages/mine/person/PersonList" }] as Item [];
 
- 		
 
- 		let items = isAdmin ? basic.concat(adminItem) : basic;
 
- 		
 
-       return {
 
- 		items: items as Item[],
 
- 		currentName: getCurrentUserSync(),
 
-       }
 
-     },
 
- 	onBackPress() {
 
- 		// 覆盖系统默认的返回行为,返回到指定页面
 
- 		uni.reLaunch({
 
- 		  url: `/pages/work/index`,
 
- 		})
 
- 		// 返回true表示拦截默认返回行为
 
- 		return true
 
- 	},
 
-     methods: {
 
-      
 
-       enterItem(e:Item) {
 
- 		  if (e.path != null && e.path != "") {
 
- 		  	uni.navigateTo({
 
- 		  		url: e.path as string
 
- 		  	});
 
- 		  } else {
 
- 		  uni.showToast({
 
- 		        title: '模块建设中~',
 
- 		        icon: 'none'
 
- 		      });
 
- 		}	  
 
-       }
 
-     }
 
-   }
 
- </script>
 
- <style lang="scss" scope>
 
-   /* #ifndef APP-NVUE */
 
-   .my-page {
 
-     display: flex;
 
-     flex-direction: column;
 
-     box-sizing: border-box;
 
-     background-color: #fff;
 
- 	/* #ifndef APP-ANDROID */
 
- 	min-height: 100%;
 
- 	/* #endif */
 
-     height: 100%;
 
-   }
 
- 	/* #ifndef APP-ANDROID */
 
- 	  view {
 
- 		font-size: 14px;
 
- 		line-height: inherit;
 
- 	  }
 
- 	/* #endif */
 
-   /* #endif */
 
-   .text {
 
-     text-align: center;
 
-     font-size: 26rpx;
 
-     margin-top: 10rpx;
 
-   }
 
-  
 
-   .swiper {
 
-     height: 300rpx;
 
-   }
 
-   .swiper-box {
 
-     height: 150px;
 
-   }
 
-   .swiper-item {
 
-     /* #ifndef APP-NVUE */
 
-     display: flex;
 
-     /* #endif */
 
-     flex-direction: column;
 
-     justify-content: center;
 
-     align-items: center;
 
-     color: #fff;
 
-     height: 300rpx;
 
-     line-height: 300rpx;
 
-   }
 
-   @media screen and (min-width: 500px) {
 
-     .my-image {
 
-       width: 100%;
 
-     }
 
-   }
 
-   .grid-body {
 
- 	/* #ifndef APP-NVUE */  
 
-   	 display: flex;
 
- 	/* #endif */
 
-   	flex-wrap: wrap;
 
-   	justify-content: space-between;
 
-   	margin-top: 40rpx;
 
-   }
 
-   
 
-   .grid-item {
 
-     width: 32%;
 
-     padding: 18px 15px;
 
- 	margin-bottom: 40rpx;
 
- 	border-radius: 20rpx;
 
- 	box-shadow: 0 8rpx 20rpx rgba(24, 144, 255, 0.15);
 
- 	display: flex;
 
- 	flex-direction: column;
 
- 	.my-icon{
 
- 		text-align: center;
 
- 		border-radius: 20rpx;
 
- 	}
 
-   }
 
-   .purple {color:#6366f1;}
 
-   .blue {color:#2563eb; }
 
-   .orange {color:#d97706;}
 
-   .green {color:#059669;}
 
-   .yellow {color:yellow;}
 
-   
 
-   $uni-primary: #2979ff !default;
 
-   
 
-   .uni-section {
 
-   	background-color: #fff;
 
-   .uni-section-header {
 
-     position: relative;
 
-     /* #ifndef APP-NVUE */
 
-     display: flex;
 
-     /* #endif */
 
-     flex-direction: row;
 
-     align-items: center;
 
-     padding: 12px 10px;
 
-     font-weight: normal;
 
-   
 
-     &__decoration{
 
-       margin-right: 6px;
 
-       background-color: $uni-primary;
 
-       &.line {
 
-         width: 4px;
 
-         height: 12px;
 
-         border-radius: 10px;
 
-       }
 
-   
 
-       &.circle {
 
-         width: 8px;
 
-         height: 8px;
 
-         border-top-right-radius: 50px;
 
-         border-top-left-radius: 50px;
 
-         border-bottom-left-radius: 50px;
 
-         border-bottom-right-radius: 50px;
 
-       }
 
-   
 
-       &.square {
 
-         width: 8px;
 
-         height: 8px;
 
-       }
 
-     }
 
-   
 
-     &__content {
 
-       /* #ifndef APP-NVUE */
 
-       display: flex;
 
-       /* #endif */
 
-       flex-direction: column;
 
-       flex: 1;
 
-       color: #333;
 
-   
 
-       .distraction {
 
-         flex-direction: row;
 
-         align-items: center;
 
-       }
 
-       &-sub {
 
-         margin-top: 2px;
 
-       }
 
-     }
 
-   }
 
-   }
 
-   
 
-   .name-label {
 
- 	  margin-right: 20rpx;
 
- 	  margin-left: auto;
 
-   }
 
- </style>
 
 
  |