From 1e5a475195d45375d37284bd601c35ee9d9fe728 Mon Sep 17 00:00:00 2001 From: wangxia <779219182@qq.com> Date: Wed, 20 Aug 2025 14:45:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/customTabbar.vue | 57 +++++++++++----------- main.js | 43 +++++++++++++++- .../conversation-list/conversation-item.vue | 13 ++--- .../pages/Conversation/conversation-list/index.vue | 2 + pages/home/order.vue | 2 +- pages/message/index.vue | 7 +-- root/person/avatar.vue | 4 +- .../vk-uview-ui/components/u-icon/u-icon.vue | 7 +-- 8 files changed, 88 insertions(+), 47 deletions(-) diff --git a/components/customTabbar.vue b/components/customTabbar.vue index 86f23e7..614a860 100644 --- a/components/customTabbar.vue +++ b/components/customTabbar.vue @@ -57,14 +57,12 @@ export default { text: "首页", iconSize: 48, }, - { - iconPath: "icon-message g_c_9", - selectedIconPath: "icon-message g_c_main", - pagePath: "/pages/message/index", - text: "消息", - iconSize: 78, - iconType: "custom", + iconPath: "icon-fadanhao-32 g_c_9", + selectedIconPath: "icon-fadanhao-32 g_c_main", + pagePath: "/pages/home/order", + text: "发单号", + iconSize: 48, }, { @@ -76,11 +74,12 @@ export default { count: 0, }, { - iconPath: "icon-fadanhao-32 g_c_9", - selectedIconPath: "icon-fadanhao-32 g_c_main", - pagePath: "/pages/home/order", - text: "发单号", - iconSize: 48, + iconPath: "icon-message g_c_9", + selectedIconPath: "icon-message g_c_main", + pagePath: "/pages/message/index", + text: "消息", + iconSize: 78, + iconType: "custom", }, { iconPath: "icon-user g_c_9", @@ -99,14 +98,7 @@ export default { text: "首页", iconSize: 48, }, - { - iconPath: "icon-message g_c_9", - selectedIconPath: "icon-message g_c_main", - pagePath: "/pages/message/index", - text: "消息", - iconSize: 78, - iconType: "custom", - }, + { iconPath: "icon-order_active g_c_9", selectedIconPath: "icon-order_active g_c_main", @@ -115,6 +107,14 @@ export default { iconSize: 48, count: 0, }, + { + iconPath: "icon-message g_c_9", + selectedIconPath: "icon-message g_c_main", + pagePath: "/pages/message/index", + text: "消息", + iconSize: 78, + iconType: "custom", + }, { iconPath: "icon-user g_c_9", selectedIconPath: "icon-user g_c_main", @@ -187,14 +187,7 @@ export default { text: "发单号", iconSize: 48, }, - { - iconPath: "icon-message g_c_9", - selectedIconPath: "icon-message g_c_main", - pagePath: "/pages/message/index", - text: "消息", - iconSize: 78, - iconType: "custom", - }, + { iconPath: "icon-order_active g_c_9", selectedIconPath: "icon-order_active g_c_main", @@ -203,6 +196,14 @@ export default { iconSize: 48, count: 0, }, + { + iconPath: "icon-message g_c_9", + selectedIconPath: "icon-message g_c_main", + pagePath: "/pages/message/index", + text: "消息", + iconSize: 78, + iconType: "custom", + }, { iconPath: "icon-user g_c_9", selectedIconPath: "icon-user g_c_main", diff --git a/main.js b/main.js index 0858c0e..ef63ec3 100644 --- a/main.js +++ b/main.js @@ -167,16 +167,55 @@ export function createApp () { }); }, $sourceType); }, + // 新增方法:生成 UUID + getUUID () { + return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) { + const r = (Math.random() * 16) | 0; + const v = c === "x" ? r : (r & 0x3) | 0x8; + return v.toString(16); + }); + }, /** * 上传到oss */ uploadImgToOss (callback = () => { }, type = 'default', $num = 1, $sourceType = ['album', 'camera']) { + var that = this; G.uploadImage($num, (imgRes) => { uni.showLoading({ title: '上传中...', }) - G.Get(apiInfo.getOssInfo, {}, (res) => { - console.log('uploadImgToOssresresresres', res); + G.Get(apiInfo.getOssInfo, {}, ({ data }) => { + console.log('uploadImgToOssresresresres', data); + const { policy, signature, accessid, dir, host } = data; + + const dataObj = { + policy, + signature, + ossaccessKeyId: accessid, + key: dir + that.getUUID() + "_${filename}", + dir, + host, + }; + const formData = new FormData(); + formData.append("key", dataObj.key); + formData.append("OSSAccessKeyId", dataObj.ossaccessKeyId); + formData.append("policy", dataObj.policy); + formData.append("Signature", dataObj.signature); + formData.append("success_action_status", "200"); + uni.uploadFile({ + url: dataObj.host, + method: "post", + filePath: JSON.parse(imgRes)[0], + name: "uploadFile", + header: Object.assign({ + Authorization: 'Bearer ' + uni.getStorageSync("apply-token") + }, Ajax.setPublicParams()), + formData: formData, + success: function (res) { + console.log('resresresresresresres', res); + }, + fail: function (res) { }, + }); }) }) }, diff --git a/pages/NEUIKit/pages/Conversation/conversation-list/conversation-item.vue b/pages/NEUIKit/pages/Conversation/conversation-list/conversation-item.vue index e9425f5..1d28ccf 100644 --- a/pages/NEUIKit/pages/Conversation/conversation-list/conversation-item.vue +++ b/pages/NEUIKit/pages/Conversation/conversation-list/conversation-item.vue @@ -9,7 +9,6 @@ props.heihei, ]" class="u-skeleton" - @touchstart="handleTouchStart" @touchmove="handleTouchMove" @click="handleConversationItemClick()" @@ -23,7 +22,6 @@
-
@@ -66,7 +64,7 @@ const props = withDefaults( conversation: V2NIMConversationForUI; showMoreActions?: boolean; loading: boolean; - heihei:"" + heihei: ""; }>(), { showMoreActions: false } ); @@ -178,10 +176,7 @@ const date = computed(() => { const now = dayjs(); // console.log(dayjs(props.conversation.lastMessage?.messageRefer.createTime).format('YYYY-MM-DD HH:mm') +"最后一条消息时间 "); // console.log(dayjs(props.conversation.updateTime).format('YYYY-MM-DD HH:mm') +"更新时间 "); - - - - + const time = props.conversation.lastMessage?.messageRefer.createTime || props.conversation.updateTime; // const time = props.conversation.updateTime; if (!time) { @@ -297,6 +292,7 @@ $cellHeight: 72px; position: relative; transition: transform 0.3s; background-color: #fff; + padding: 0 10px; &.show-action-list { transform: translateX(-200px); } @@ -347,6 +343,7 @@ $cellHeight: 72px; padding: 10px 16px; height: $cellHeight; box-sizing: border-box; + // background-color: #fff; } .conversation-item-left { @@ -375,7 +372,7 @@ $cellHeight: 72px; right: 0; } } -.mmp0 .conversation-item-right::after{ +.mmp0 .conversation-item-right::after { height: 0; } .conversation-item-top { diff --git a/pages/NEUIKit/pages/Conversation/conversation-list/index.vue b/pages/NEUIKit/pages/Conversation/conversation-list/index.vue index e2af095..e416349 100644 --- a/pages/NEUIKit/pages/Conversation/conversation-list/index.vue +++ b/pages/NEUIKit/pages/Conversation/conversation-list/index.vue @@ -278,6 +278,8 @@ onUnmounted(() => { width: 100%; overflow-y: auto; overflow-x: hidden; + + } .logo-box { diff --git a/pages/home/order.vue b/pages/home/order.vue index 665aa0e..fbf24af 100644 --- a/pages/home/order.vue +++ b/pages/home/order.vue @@ -59,7 +59,7 @@
- + diff --git a/pages/message/index.vue b/pages/message/index.vue index 6fb394b..167b8c5 100644 --- a/pages/message/index.vue +++ b/pages/message/index.vue @@ -4,10 +4,11 @@ - - - + + + + diff --git a/root/person/avatar.vue b/root/person/avatar.vue index 9e168d1..d964e1d 100644 --- a/root/person/avatar.vue +++ b/root/person/avatar.vue @@ -73,8 +73,8 @@ export default { }, setAvatar($type) { let that = this; - // that.G.uploadImgToOss() - // return + that.G.uploadImgToOss() + return that.G.uploadImg( (res) => { console.log("获取数据", res); diff --git a/uni_modules/vk-uview-ui/components/u-icon/u-icon.vue b/uni_modules/vk-uview-ui/components/u-icon/u-icon.vue index 0f1a3b5..f79050d 100644 --- a/uni_modules/vk-uview-ui/components/u-icon/u-icon.vue +++ b/uni_modules/vk-uview-ui/components/u-icon/u-icon.vue @@ -291,10 +291,11 @@ export default { @import "../../iconfont.css"; @font-face { font-family: "iconfont"; /* Project id 4374774 */ - src: url('//at.alicdn.com/t/c/font_4374774_zuuyrxlecbi.woff2?t=1755592111683') format('woff2'), - url('//at.alicdn.com/t/c/font_4374774_zuuyrxlecbi.woff?t=1755592111683') format('woff'), - url('//at.alicdn.com/t/c/font_4374774_zuuyrxlecbi.ttf?t=1755592111683') format('truetype'); + src: url('//at.alicdn.com/t/c/font_4374774_pm01bomgppe.woff2?t=1755661995542') format('woff2'), + url('//at.alicdn.com/t/c/font_4374774_pm01bomgppe.woff?t=1755661995542') format('woff'), + url('//at.alicdn.com/t/c/font_4374774_pm01bomgppe.ttf?t=1755661995542') format('truetype'); } + .iconfont { font-family: "iconfont" !important; font-size: 24px;