Browse Source

V1.1.4 备注

liuq 13 hours ago
parent
commit
2fc5c930bb
5 changed files with 50 additions and 32 deletions
  1. 1 0
      composables/useContacts.js
  2. 9 2
      manifest.json
  3. 21 24
      pages/chat/index.vue
  4. 15 2
      pages/index/index.vue
  5. 4 4
      update_log/latest.json

+ 1 - 0
composables/useContacts.js

@@ -28,6 +28,7 @@ export async function fetchContactsList(opts = {}) {
 					id,
 					user_id: c.user_id ?? c.userId ?? c.id,
 					title: c.full_name ?? c.name ?? c.title ?? '未知',
+					remarks: c.remarks ?? c.remark ?? '',
 					lastMessage: typeof c.last_message === 'string'
 						? c.last_message
 						: (c.last_message && (c.last_message.content || c.last_message.text)) ?? c.last_message_preview ?? '',

+ 9 - 2
manifest.json

@@ -3,7 +3,7 @@
     "appid" : "__UNI__6801EE3",
     "description" : "",
     "versionName" : "1.1.3",
-    "versionCode" : 112,
+    "versionCode" : 113,
     "transformPx" : false,
     /* 5+App特有相关 */
     "app-plus" : {
@@ -137,5 +137,12 @@
     "uniStatistics" : {
         "enable" : false
     },
-    "vueVersion" : "3"
+    "vueVersion" : "3",
+    "app-harmony" : {
+        "distribute" : {
+            "modules" : {
+                "uni-push" : {}
+            }
+        }
+    }
 }

+ 21 - 24
pages/chat/index.vue

@@ -8,11 +8,7 @@
 				<view class="chat-title-wrap" @click="onTitleClick">
 					<view class="chat-title-texts">
 						<text class="chat-title">{{ contactTitle }}</text>
-					</view>
-				</view>
-				<view class="header-actions">
-					<view class="header-icon" @click="onMore">
-						<image class="header-icon-img" src="/static/icons/more.svg" mode="aspectFit" />
+						<text v-if="contactRemarks" class="chat-remarks">@{{ contactRemarks }}</text>
 					</view>
 				</view>
 			</view>
@@ -113,6 +109,7 @@ import { fetchUnreadCountAndUpdateTabBar } from '../../composables/useUnreadBadg
 
 const otherUserId = ref('')
 const contactTitle = ref('会话')
+const contactRemarks = ref('')
 const fallbackContactName = ref('')
 const inputValue = ref('')
 const scrollIntoView = ref('')
@@ -131,10 +128,12 @@ function syncContactTitle() {
 	const contact = (chatStore.contacts || []).find((c) => String(c.user_id || c.id) === String(otherUserId.value))
 	if (contact) {
 		contactTitle.value = (contact.app_name || contact.title || '会话')
+		contactRemarks.value = contact.remarks || ''
 		return
 	}
 	// 若会话列表未命中(例如从联系人详情进入,此时 chatStore.contacts 未包含该用户)
 	contactTitle.value = fallbackContactName.value || '会话'
+	contactRemarks.value = ''
 }
 
 const messageList = computed(() => {
@@ -356,13 +355,6 @@ function onTitleClick() {
 	// 可扩展:进入联系人详情或下拉菜单
 }
 
-function onMore() {
-	uni.showActionSheet({
-		itemList: ['聊天信息', '查找聊天内容', '清空聊天记录'],
-		success: (res) => {}
-	})
-}
-
 function onInputFocus() {
 	showPlusPanel.value = false
 }
@@ -478,25 +470,30 @@ function onPlus() {
 }
 .chat-title-texts {
 	display: flex;
-	flex-direction: column;
+	flex-direction: row;
+	align-items: center;
 	justify-content: center;
+	max-width: 60vw;
 }
 .chat-title {
 	font-size: 34rpx;
 	font-weight: 600;
 	color: #111827;
+	overflow: hidden;
+	text-overflow: ellipsis;
+	white-space: nowrap;
+	flex-shrink: 1;
+	min-width: 0;
 }
-.header-actions {
-	display: flex;
-	align-items: center;
-	gap: 16rpx;
-}
-.header-icon {
-	width: 56rpx;
-	height: 56rpx;
-	display: flex;
-	align-items: center;
-	justify-content: center;
+.chat-remarks {
+	font-size: 26rpx;
+	color: #d97706;
+	margin-left: 8rpx;
+	flex-shrink: 0;
+	overflow: hidden;
+	text-overflow: ellipsis;
+	white-space: nowrap;
+	max-width: 40vw;
 }
 .message-list {
 	flex: 1;

+ 15 - 2
pages/index/index.vue

@@ -60,6 +60,7 @@
 					<view class="item-content">
 						<view class="item-row">
 							<text class="item-title">{{ item.app_name || item.title }}</text>
+							<text v-if="item.remarks" class="item-remarks">@{{ item.remarks }}</text>
 							<text class="item-time">{{ item.time }}</text>
 						</view>
 						<text class="item-desc">{{ item.lastMessage }}</text>
@@ -322,16 +323,28 @@
 	.item-title {
 		font-size: 30rpx;
 		color: #333;
-		flex: 1;
+		flex: 0 1 auto;
+		min-width: 0;
+		overflow: hidden;
+		text-overflow: ellipsis;
+		white-space: nowrap;
+	}
+	.item-remarks {
+		font-size: 26rpx;
+		color: #d97706;
+		margin-left: 8rpx;
+		flex-shrink: 0;
 		overflow: hidden;
 		text-overflow: ellipsis;
 		white-space: nowrap;
+		max-width: 40%;
 	}
 	.item-time {
 		font-size: 24rpx;
 		color: #999;
 		flex-shrink: 0;
-		margin-left: 16rpx;
+		margin-left: auto;
+		padding-left: 16rpx;
 	}
 	.item-desc {
 		font-size: 26rpx;

+ 4 - 4
update_log/latest.json

@@ -1,7 +1,7 @@
 {
-  "versionCode": 112,
-  "versionName": "1.1.2",
-  "apkUrl": "https://api.hnyunzhu.com:9004/app-updates/1773848909/android/update/yunzhuim112.apk",
+  "versionCode": 113,
+  "versionName": "1.1.3",
+  "apkUrl": "https://api.hnyunzhu.com:9004/app-updates/1773848909/android/update/yunzhuim113.apk",
   "forceUpdate": false,
-  "changelog": "1.兼容低内存手机配置优化"
+  "changelog": "1.新增切换账号。2.修复应用背景颜色问题。"
 }