wuhb 5 miesięcy temu
rodzic
commit
a2a38049b1
5 zmienionych plików z 110 dodań i 12 usunięć
  1. 18 0
      App.uvue
  2. 1 1
      api/auth/logout.uts
  3. 80 5
      pages/index/index.uvue
  4. 2 1
      pages/login/index.uvue
  5. 9 5
      pages/profile/index.uvue

+ 18 - 0
App.uvue

@@ -1,5 +1,7 @@
 <script lang="uts">
 <script lang="uts">
 	let firstBackTime = 0
 	let firstBackTime = 0
+	let timer = 0;
+	
 	export default {
 	export default {
 		onLaunch: function () {
 		onLaunch: function () {
 			console.log('App Launch')
 			console.log('App Launch')
@@ -9,6 +11,7 @@
 		},
 		},
 		onHide: function () {
 		onHide: function () {
 			console.log('App Hide')
 			console.log('App Hide')
+			// this.startTimer();
 		},
 		},
 		// #ifdef APP-ANDROID
 		// #ifdef APP-ANDROID
 		onLastPageBackPress: function () {
 		onLastPageBackPress: function () {
@@ -38,6 +41,21 @@
 		onExit: function () {
 		onExit: function () {
 			console.log('App Exit')
 			console.log('App Exit')
 		},
 		},
+		methods:{
+			startTimer() {
+			  console.log("==========")
+			  timer = setInterval(() => {
+				console.log('定时器运行');
+				// 这里写你的定时任务
+			  }, 10000); // 每1000毫秒运行一次
+			},
+			stopTimer() {
+			  if (timer > 0) {
+				clearInterval(timer);
+				timer = 0;
+			  }
+			}
+		}
 	}
 	}
 </script>
 </script>
 
 

+ 1 - 1
api/auth/logout.uts

@@ -8,7 +8,7 @@ import { request } from '../../utils/request'
  */
  */
 export const logout = (): Promise<boolean> => {
 export const logout = (): Promise<boolean> => {
     return request({
     return request({
-        url: '/sys/logout',
+        url: '/logout',
         method: 'GET'
         method: 'GET'
     }) as Promise<boolean>
     }) as Promise<boolean>
 }
 }

+ 80 - 5
pages/index/index.uvue

@@ -4,14 +4,41 @@
         <!-- 背景图 -->
         <!-- 背景图 -->
         <!-- <image class="bg-image" src="/static/images/index/1.png" mode="widthFix"></image> -->
         <!-- <image class="bg-image" src="/static/images/index/1.png" mode="widthFix"></image> -->
 
 
-        <view class="bg-color"></view>
-
+        <!-- <view class="bg-color"></view> -->
         <scroll-view class="page-content">
         <scroll-view class="page-content">
+			
+			<view class="db-view">
+				<view class="db-box">
+					<view class="db-block">
+						<view class="db-center-1">
+							<image class="db-image" src="/static/images/map/1.png"></image>
+						</view>
+					</view>
+					<text class="db-text">待处理工单</text>
+				</view>
+				<view class="db-box">
+					<view class="db-block">
+						<view class="db-center-2">
+							<image class="db-image" src="/static/images/map/2.png"></image>
+						</view>
+					</view>
+					<text class="db-text">评分工单</text>
+				</view>
+				<view class="db-box">
+					<view class="db-block">
+						<view class="db-center-3">
+							<image class="db-image" src="/static/images/map/2.png"></image>
+						</view>
+					</view>
+					<text class="db-text">超时工单</text>
+				</view>
+			</view>
+			
             <!-- 支流出库流量图表 -->
             <!-- 支流出库流量图表 -->
-            <view class="chart-section">
+           <!-- <view class="chart-section">
                 <text class="section-title">支流出库流量 (m³/s)</text>
                 <text class="section-title">支流出库流量 (m³/s)</text>
                 <flow-chart />
                 <flow-chart />
-            </view>
+            </view> -->
 			
 			
 			<view>
 			<view>
 				<button @click="handlePush">通知</button>
 				<button @click="handlePush">通知</button>
@@ -129,6 +156,7 @@
         position: relative;
         position: relative;
         flex: 1;
         flex: 1;
         padding-top: env(safe-area-inset-top);
         padding-top: env(safe-area-inset-top);
+		background-color: #e8f0f9;
     }
     }
 
 
     .bg-image {
     .bg-image {
@@ -154,7 +182,7 @@
         position: relative;
         position: relative;
         flex: 1;
         flex: 1;
         margin-bottom: 150rpx;
         margin-bottom: 150rpx;
-        padding: 30rpx;
+        padding: 20rpx;
         z-index: 10;
         z-index: 10;
     }
     }
 
 
@@ -190,4 +218,51 @@
         box-shadow: 0 0 16rpx 0 rgba(0, 0, 0, 0.1);
         box-shadow: 0 0 16rpx 0 rgba(0, 0, 0, 0.1);
         border-radius: 16rpx;
         border-radius: 16rpx;
     }
     }
+	
+	.db-view{
+		flex-direction: row;
+		justify-content: space-between;
+		margin-bottom: 5px;
+		
+		.db-box{
+			background-color: #fff;
+			width:80px;
+			height: 80px;
+			justify-content: center;
+			align-items: center;
+			margin-left: 3px;
+			border-radius: 5px;
+			.db-text{
+				font-size:10px;
+			}
+			.db-center-1{
+				justify-content: center;
+				align-items: center;
+				background-color: #DBEAFE;
+				border-radius: 100px;
+				width:50px;
+				height:50px;
+			}
+			.db-center-2{
+				justify-content: center;
+				align-items: center;
+				background-color: #DCFCE7;
+				border-radius: 100px;
+				width:50px;
+				height:50px;
+			}
+			.db-center-3{
+				justify-content: center;
+				align-items: center;
+				background-color: #F3E8FF;
+				border-radius: 100px;
+				width:50px;
+				height:50px;
+			}
+		}
+		.db-image{
+			width:20px;
+			height:20px;
+		}
+	}
 </style>
 </style>

+ 2 - 1
pages/login/index.uvue

@@ -142,7 +142,8 @@
                 userName: userInfo['userName'],
                 userName: userInfo['userName'],
 				nickName: userInfo['nickName'],
 				nickName: userInfo['nickName'],
 				phone: userInfo['phonenumber'],
 				phone: userInfo['phonenumber'],
-				deptName: deptInfo['deptName']
+				deptName: deptInfo['deptName'],
+				roleNames: userInfoObj['roleNames']
             })
             })
 
 
             // 保存或清除记住的账号密码
             // 保存或清除记住的账号密码

+ 9 - 5
pages/profile/index.uvue

@@ -6,7 +6,7 @@
         <scroll-view class="page-content" style="flex: 1">
         <scroll-view class="page-content" style="flex: 1">
             <!-- 用户信息头部 -->
             <!-- 用户信息头部 -->
             <view class="header">
             <view class="header">
-                <image class="avatar" src="" mode="aspectFill"></image>
+                <image class="avatar" src="/static/images/login/2.png" mode="aspectFill"></image>
                 <text class="user-name">{{ userName }}</text>
                 <text class="user-name">{{ userName }}</text>
             </view>
             </view>
 
 
@@ -28,10 +28,8 @@
             </view>
             </view>
 
 
             <!-- 通讯录 -->
             <!-- 通讯录 -->
-            <view class="contact-item" @click="handleContactClick">
-                <image class="contact-icon" src="/static/images/profile/4.png" mode="aspectFit"></image>
-                <text class="contact-text">通讯录</text>
-                <text class="contact-arrow">›</text>
+            <view class="contact-item">
+                <text class="contact-text">{{userRole}}</text>
             </view>
             </view>
 
 
             <!-- 功能菜单 -->
             <!-- 功能菜单 -->
@@ -66,6 +64,7 @@
     const userName = ref<string>('')
     const userName = ref<string>('')
     const userPhone = ref<string>('')
     const userPhone = ref<string>('')
     const userDept = ref<string>('')
     const userDept = ref<string>('')
+	const userRole = ref<string>('')
     
     
     // 版本信息
     // 版本信息
     const manifestVersion = manifest.versionName as string | null
     const manifestVersion = manifest.versionName as string | null
@@ -188,6 +187,11 @@
             if (deptName != null && deptName.length > 0) {
             if (deptName != null && deptName.length > 0) {
                 userDept.value = deptName
                 userDept.value = deptName
             }
             }
+			
+			const roleNames = userInfo['roleNames'] as string | null
+			if (roleNames != null && roleNames.length > 0) {
+			    userRole.value = roleNames
+			}
         }
         }
     })
     })
 </script>
 </script>