Jelajahi Sumber

refactor(pages):修改数字角标最大显示99+
refactor(setting,edit)修改设置页面,个人信息修改页面样式

HMY 1 tahun lalu
induk
melakukan
d77565f6b5

+ 1 - 1
pages/contacts/index.vue

@@ -75,7 +75,7 @@ function showTarBarBadge(){
 				}else{
 					uni.setTabBarBadge({
 					  index: 0,
-					  text: String(unReadMsgNum)
+					  text: unReadMsgNum>99?'99+':String(unReadMsgNum)
 					})
 				}
 			})

+ 1 - 1
pages/message/index.vue

@@ -216,7 +216,7 @@ function handleToMessageDetail({ messageid, universalid}) {
 				}else{
 					uni.setTabBarBadge({
 					  index: 0,
-					  text: String(unReadMsgNum.value)
+					  text: unReadMsgNum.value>99?'99+':String(unReadMsgNum.value)
 					})
 				}
 			})

+ 7 - 10
pages/mine/checkIn/checkIn.vue

@@ -269,6 +269,7 @@
 	//日考勤历史记录
 	const clockRecords = ref([])
 
+	const totalPage = ref(0)
 	//获取日考勤历史
 	function getDayAttHistory() {
 		const params = {
@@ -280,6 +281,7 @@
 			p: 1
 		}
 		getMyQDQtAttendance(params).then(({returnParams}) => {
+			totalPage.value = Math.ceil(returnParams.total / pSize.value)
 			const list = returnParams.list.map(item => {
 				return {
 					date: item.att_date.substring(0, 10),
@@ -288,6 +290,7 @@
 				}
 			});
 			clockRecords.value = list;
+			
 			complete(clockRecords.value, returnParams.total, returnParams.current)
 		})
 	}
@@ -326,18 +329,12 @@
 					evening: item.time.split(',')[item.type.split(',').indexOf("2")],
 				}
 			});
-			// console.log('list', list);
-
 			// clockRecords.value.push(...list);
 			// complete(list,returnParams.total,pageNo)
-		
-			// 去重逻辑
-			const existingDates = new Set(clockRecords.value.map(record => record.date));
-			const newRecords = list.filter(item => !existingDates.has(item.date));
-			// 更新 clockRecords
-			clockRecords.value.push(...newRecords);
-			// 调用 complete 函数,传入新记录和总数
-			complete(newRecords, returnParams.total, pageNo);
+			if(pageNo<=totalPage.value){
+				clockRecords.value.push(...list);
+			}
+			complete(list,returnParams.total,pageNo)
 
 		})
 	}

+ 2 - 2
pages/mine/edit/edit.vue

@@ -136,13 +136,13 @@
 
 	.input-group input,
 	.sexLabel {
-		padding-left: 20rpx;
+		padding: 10rpx 20rpx;
 		margin: 20rpx auto;
 		height: 70rpx;
 	}
 
 	.input-group input {
-		border: 1rpx solid gainsboro; /* 修改边框样式 */
+		border: 1px solid gainsboro; /* 修改边框样式 */
 		background-color: white;
 	}
 

+ 2 - 2
pages/mine/index.vue

@@ -115,7 +115,7 @@
 				}else{
 					uni.setTabBarBadge({
 					  index: 0,
-					  text: String(unReadMsgNum)
+					  text: unReadMsgNum>99?'99+':String(unReadMsgNum)
 					})
 				}
 			})
@@ -214,7 +214,7 @@
 		align-items: center;
 		justify-content: space-between;
 		padding: 0.75rem;
-		background-color: white;
+		background-color: #ffffff;
 		border-radius: 10rpx;
 		margin-bottom: 0.75rem;
 		border-bottom: 1px solid gainsboro;

+ 10 - 4
pages/mine/setting/setting.vue

@@ -24,7 +24,7 @@
 			<text>></text>
 		</view>
 		<!-- 退出登录按钮 -->
-		<view class="uni-padding-wrap uni-common-mt">
+		<view class="logOut">
 			<button type="warn" @click="logOut">退出登录</button>
 		</view>
 
@@ -121,11 +121,17 @@
 		display: flex;
 		align-items: center;
 		justify-content: space-between;
-		height: 50px;
-		border-bottom: 1px solid #eee;
-		font-size: 16px;
+		font-size: 1rem;
+		padding: 0.75rem;
+		background-color: #ffffff;
+		border-radius: 10rpx;
+		margin-bottom: 0.75rem;
+		border-bottom: 1px solid gainsboro;
 		uni-icons{
 			margin-right: 6px;
 		}
 	}
+	.logOut{
+		margin-top: 2rem;
+	}
 </style>

+ 1 - 1
pages/process/index.vue

@@ -68,7 +68,7 @@ function showTarBarBadge(){
 				}else{
 					uni.setTabBarBadge({
 					  index: 0,
-					  text: String(unReadMsgNum)
+					  text: unReadMsgNum>99?'99+':String(unReadMsgNum)
 					})
 				}
 			})

+ 1 - 1
pages/work/index.vue

@@ -146,7 +146,7 @@ function showTarBarBadge(){
 				}else{
 					uni.setTabBarBadge({
 					  index: 0,
-					  text: String(unReadMsgNum)
+					  text: unReadMsgNum>99?'99+':String(unReadMsgNum)
 					})
 				}
 			})