From 00836ac209f5cff8f7fc746a8b1acb93352f5458 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=94=90=E6=98=8E=E6=98=8E?= <970899069@qq.com> Date: Wed, 23 Feb 2022 15:54:27 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 2 +- manifest.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/App.vue b/App.vue index 7055846..0aaec26 100644 --- a/App.vue +++ b/App.vue @@ -7,7 +7,7 @@ export default { onLaunch: function() { im.initIm('lmxuhwaglu76d') - return + // return //#ifdef APP-PLUS // 获取系统版本号 getVersions({ diff --git a/manifest.json b/manifest.json index a3dbfea..165af56 100644 --- a/manifest.json +++ b/manifest.json @@ -2,8 +2,8 @@ "name" : "ZH-HEALTH", "appid" : "__UNI__C29473D", "description" : "ZH-HEALTH,您手上的健康管理专家", - "versionName" : "1.0.11", - "versionCode" : 111, + "versionName" : "1.0.2", + "versionCode" : 112, "transformPx" : false, /* 5+App特有相关 */ "app-plus" : { From da78a3ac117beac4a7c8e55f655fb8b190b04a33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=94=90=E6=98=8E=E6=98=8E?= <970899069@qq.com> Date: Thu, 24 Feb 2022 11:19:02 +0800 Subject: [PATCH 2/7] merge --- pages/im/components/sentText.vue | 3 +- pages/im/components/sentVoice.vue | 124 +++++++++++++++++++++++------- 2 files changed, 99 insertions(+), 28 deletions(-) diff --git a/pages/im/components/sentText.vue b/pages/im/components/sentText.vue index efa4034..d6259a8 100644 --- a/pages/im/components/sentText.vue +++ b/pages/im/components/sentText.vue @@ -71,11 +71,10 @@ display: flex; flex-direction: row; justify-content: space-between; - .input { background: #F3F6FB; height: 70rpx; - width: 500rpx; + width: 460rpx; border-radius: 10rpx; margin-right: 15rpx; padding: 0 20rpx; diff --git a/pages/im/components/sentVoice.vue b/pages/im/components/sentVoice.vue index a7b4abb..80ac3aa 100644 --- a/pages/im/components/sentVoice.vue +++ b/pages/im/components/sentVoice.vue @@ -1,14 +1,18 @@ @@ -30,11 +34,14 @@ }, data() { return { - showRecordTip: false, + showRecordTip: false, + showConfirm: false, recordTime: 60, interval: 0, maxRecordTime: 60, - recorderManager: null + recorderManager: null, + mp3AudioSrc: null, + isBetaPlay: false } }, computed: { @@ -89,21 +96,63 @@ }, // 结束录音 stopRecord(e) { - if (!this.showRecordTip) return - this.recorderManager.stop() - clearInterval(this.interval) - // 监听录音结束 - this.recorderManager.onStop(res => { - im.sentVoice(this.conversationType, this.targetId, res.tempFilePath, (this.maxRecordTime - - this.recordTime), this.sender, () => { - setTimeout(() => { - this.$emit('success') - }, 500) - }) - this.recordTime = this.maxRecordTime - this.showRecordTip = false - }) - }, + if (!this.showRecordTip) return + // 延迟500毫秒结束录音 + setTimeout(()=> { + this.recorderManager.stop() + clearInterval(this.interval) + // 监听录音结束 + this.recorderManager.onStop(res => { + console.log(res) + this.mp3AudioSrc = res.tempFilePath + this.showConfirm = true + this.showRecordTip = false + }) + },500) + }, + // 发送语音消息 + senVoice(){ + if(this.mp3AudioSrc === null) { + uni.showToast({ + title: '发送失败, 暂无音频信息', + icon : 'none' + }) + return + } + im.sentVoice(this.conversationType, this.targetId, this.mp3AudioSrc, (this.maxRecordTime - + this.recordTime), this.sender, () => { + this.recordTime = this.maxRecordTime + this.mp3AudioSrc = null + this.showConfirm = false + setTimeout(() => { + this.$emit('success') + }, 500) + }) + }, + // 试听语音 + startPlay() { + let betaAudio = uni.createInnerAudioContext() + betaAudio.src = this.mp3AudioSrc; + // 在播放中 + if(this.isBetaPlay){ + betaAudio.stop() + betaAudio.onStop(() => { + this.isBetaPlay = false; + betaAudio.destroy() + }) + return + } + // 监听音频播放中 + betaAudio.play() + betaAudio.onPlay(() => { + this.isBetaPlay = true; + }) + // 监听音频结束 + betaAudio.onEnded(() => { + this.isBetaPlay = false; + betaAudio.destroy() + }) + } } } @@ -126,13 +175,36 @@ } } - .voice--lay{ + .lay{ position: absolute; left: 0; bottom: 0; - background: rgba($color: #000000, $alpha: .2); + z-index: 9; + background: rgba($color: #000000, $alpha: .5); height: 100vh; width: 100vw; + padding: 20vh 30rpx; + box-sizing: border-box; + display: flex; + justify-content: space-around; + align-items: flex-end; + flex-direction: row; + .item{ + height: 140rpx; + width: 140rpx; + text-align: center; + line-height: 140rpx; + border-radius: 50%; + background-color: white; + &.red{ + background: #e6576b; + color: white; + } + &.greed{ + background: #34CE98; + color: white; + } + } } .modal { From 54cf21f21157d676557b3e437eaaeb2e66cd2235 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=94=90=E6=98=8E=E6=98=8E?= <970899069@qq.com> Date: Thu, 24 Feb 2022 11:21:00 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E8=AF=AD=E9=9F=B3=E6=92=AD=E6=94=BE?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E6=96=B0=E5=A2=9E=E5=8F=96=E6=B6=88=E5=8F=91?= =?UTF-8?q?=E9=80=81=EF=BC=8C=E8=AF=95=E5=90=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .DS_Store | Bin 14340 -> 14340 bytes pages/.DS_Store | Bin 10244 -> 10244 bytes pages/im/components/sentVoice.vue | 1 - 3 files changed, 1 deletion(-) diff --git a/.DS_Store b/.DS_Store index 6a740ac20f36d933833be08eea6e868378331ec8..66075bea20988570f3980b4f7ec1236ca1a82999 100644 GIT binary patch delta 82 zcmZoEXepTB<HeV7EM@!Db!>PgZeOh608}hIEEhhT^i|qP(2^ymSTz2FA@ns@It| NJ8KB>;!!b!2>{Ik7Ha?i delta 39 tcmZoEXepTB&ls^WV7EM@{$?HpPu9)(s#lmcYf9W>-^^~{2jZ@00stF04TJyy diff --git a/pages/.DS_Store b/pages/.DS_Store index 2c2ce98012af140ebbd8049f9c2ae39e641fad60..5b898c6064960bc7061a6471ba215f2a04eeac2b 100644 GIT binary patch delta 900 zcmZn(XbG6$FPg%@z`)4BAi%(o%23Qu?3t6FoRqV%a2or>2Hwr=94s9AAQkKki3}+~ zScI%9KM5!U)X3ln#Cre1fPrB$kH8#hh%s;l>yZ>po-Ht4234L>7D=9A@-jiW$wq>^ z&=qx~DEcEPG5L+)3>7q!ej+OZvY8k%8FD9o66)tLH8assFf}ol+$rohxn3y43M^F? zT$GoSpO+3)3Je7XR-p1cpg&U?Do_n(0;z!car0xLE=DxxFc zQ-aum2_luD1PDQal8zQ2ApgRY1DOmgK-HNH=?rOhHukq_qWAL8w3)-nLSjgT*p z=tq+Wc^e`BL82F39_Vd^e1RlJumHV{kbfcBh^8OpZMgjA2&ovx&Fl)lST_F?%BOi0 GD+2(Qw>Jp@ delta 162 zcmZn(XbG6$FY3p@z`)4BAi%(o%23QuoRe-CoSeV0a2or>2Hwr=94s7+ev_>P=1l%4 z&^7sx;I7FVgl0_k6iMFvN~Dc(@(i(>$qwRelRt>pOr9iBG1)@0Z}KO}uF0#U8YeeO zH&51+X_$ONrfzbbY}sTfxw6fB@&dGC4v#51UR77NA2i8PXX51Q0tu diff --git a/pages/im/components/sentVoice.vue b/pages/im/components/sentVoice.vue index 80ac3aa..685e615 100644 --- a/pages/im/components/sentVoice.vue +++ b/pages/im/components/sentVoice.vue @@ -174,7 +174,6 @@ color: #333; } } - .lay{ position: absolute; left: 0; From f77a91eafe180e978110a2b87eff54d9b4e622b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=94=90=E6=98=8E=E6=98=8E?= Date: Thu, 24 Feb 2022 11:26:14 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E5=88=A0=E9=99=A4=20'pages/im/.DS=5FStore'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/im/.DS_Store | Bin 6148 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 pages/im/.DS_Store diff --git a/pages/im/.DS_Store b/pages/im/.DS_Store deleted file mode 100644 index b089d3f3f513685888d5d777a8b4f3d1c8f327d3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKOH0E*5Z<+|O({YSiXH=A3$|K(;3dTR2aM=Jr6#1*V9b_0%%K!=)j#Av@%K2h zyMY$tRm9G~?l(J+-OLBs2V;yoc`#tiWQ-Zm5IHI}g63M+h7LyLa*ml_q%%Jfe$6z0 z(}dsNVpEnd!E(0z{U81;3e&9L|KuBuW^1!;w2iLu;691M&Acp69WS}V(X|kfU+JEI z6Hbb;xqTtx%nRd5A``-30wMReVH}9U5qTV>GS^iOqhoZ&=I(qx81}5;>B*vJ&Cd?| zpdTGC79C?}|KR*;{2aZ+;!W|$fp95X8Y_4QWvQT7H;E$=Pr+JcRFQtaU USO09+4B-T(jq From 056224881e9a49f4aecc61b11b057c3302035755 Mon Sep 17 00:00:00 2001 From: Jason Date: Thu, 24 Feb 2022 11:27:06 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E6=88=90=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apis/interfaces/im.js | 5 +++-- utils/im/listeners.js | 11 ++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/apis/interfaces/im.js b/apis/interfaces/im.js index 11c75be..47dee85 100644 --- a/apis/interfaces/im.js +++ b/apis/interfaces/im.js @@ -315,14 +315,15 @@ export { getGroupAnnouncement, createGroupAnnouncement, deleteGroupAnnouncement, - topGroupAnnouncement, + topGroupAnnouncement, searchGroup, joinGroupPre, joinGroup, quitGroup, dismissGroup, inviteGroupUser, - removeGroupUser, + removeGroupUser, + transferGroupOwner, setGroupAdmin, removeGroupAdmin, groupMakeSure, // 通过审核 diff --git a/utils/im/listeners.js b/utils/im/listeners.js index ab0260a..0555ba7 100644 --- a/utils/im/listeners.js +++ b/utils/im/listeners.js @@ -55,8 +55,7 @@ const notifyMsgTypes = [ IMLib.ObjectName.Location, IMLib.ObjectName.Voice, IMLib.ObjectName.HQVoice, - IMLib.ObjectName.Sight, - IMLib.ObjectName.GroupNotification + IMLib.ObjectName.Sight ] const imLibListeners = () => { @@ -68,7 +67,7 @@ const imLibListeners = () => { // 添加消息监听函数 IMLib.addReceiveMessageListener((res) => { const message = res.data.message - console.error('[收到消息]', message) + console.error('[收到消息]',IMLib.ObjectName.GroupNotification, message) checkContactExists(message) if (utils.inArray(message.objectName, notifyMsgTypes)) { onReceiveMessage(message) @@ -83,7 +82,8 @@ const imLibListeners = () => { uni.$emit('onNewContactConversation', message) uni.$emit('onNewContactFriends', message) uni.$emit('onNewContactPendings', message) - } else if (message.objectName === IMLib.ObjectName.GroupNotification) { + } else if (message.objectName === IMLib.ObjectName.GroupNotification) { + console.log('踢出用户',message); // 解散群 if (message.content.operation === 'Dismiss') { IMLib.cleanHistoryMessages(message.conversationType, message.targetId, message.sentTime, @@ -93,7 +93,8 @@ const imLibListeners = () => { // 发布群解散的消息 uni.$emit('onGroupDismiss') uni.$emit('onGroupDismiss_' + message.targetId) - } else if (message.content.operation === 'REMOVE') { + } else if (message.content.operation === 'REMOVE') { + console.log('踢出', message.content); // 要判断是否当前用户,然后把当前用户踢出到主页去, 删除聊天记录,会话列表 if (message.content.extra == store.getters.sender.userId) { IMLib.cleanHistoryMessages(message.conversationType, message.targetId, message.sentTime, From 5c5445d630be6a69265362cbc18c510fd2fc160f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=94=90=E6=98=8E=E6=98=8E?= <970899069@qq.com> Date: Thu, 24 Feb 2022 11:27:20 +0800 Subject: [PATCH 6/7] merge --- .DS_Store | Bin 14340 -> 12292 bytes pages/.DS_Store | Bin 10244 -> 12292 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/.DS_Store b/.DS_Store index 66075bea20988570f3980b4f7ec1236ca1a82999..e68dfc96e9c10f15b5b868c3036523e65f60279f 100644 GIT binary patch delta 212 zcmZoEXh~3DU|?W$DortDV9)?EIe-{M3-ADmHUs1pcSA(RF;kak73dgI0S%#-;|0(pQ|fE>mEqzxwL Qm`t49tzLv_9t+4k04^6Od;kCd delta 229 zcmZokXem%&U|?W$DortDU@!nOIe-{M3-ADmHUUBv2A>y$SBDQF~EQuNV_6CY2(HB%#-U(oSdUGaq|OJ1vK;a0RYeHGj9L@ diff --git a/pages/.DS_Store b/pages/.DS_Store index 5b898c6064960bc7061a6471ba215f2a04eeac2b..dc297849cba0a97cf08f441eb8ca696046f8b661 100644 GIT binary patch delta 835 zcmb_azi$&U6n;)F$sI{Kw+VrQfQSn!5<*I6K(wh4iV#Xft14BY&HZrFQ?K^r?$XjS zgds4oL^m<;2QWsFnAw?GSy+)^WaPQMp{kfrEq#7J{QN!pvq!B_rvd<^K5!NR?x3q8 zq@@L%-T_qdHG3)ZSrQ6CC0QsA1XuF-uLBpWPWS;o*PEB+INylE17Ig)h^@fV5DQ$5@f2Mt^BR>1aMcF>O4t7z3d!lk)08=f;~ zD@hHJWbM$$qSBe7Cjn!8vlqBdv)c_>)IQ~Jyf|(avAqWG3Tz-7HvPyIJX~i%h<3va z0+aVx{qUt{TFh(mx`-mN*LLxU@>s`ot3%(kUEVVu{YKevXvUJ%9R~&D#K9ybYg}-K zi>;HKvGg=qRN*$~4 z1trAQgeoy)ak^Zprfzj)oJC}$ga09q)8o^BV$%PWj`iw2O;UY9K>VO^O~FWwcd8$T X=O@#Dsk8;>CKF!m-zsH0^4i(I&dR)} delta 156 zcmZokXbF&DU|?W$DortDU{C-uIe-{M3-C-V6q~3gIoUvmMH0woNC9F-pg03VDnl_t zv1d+xa#GIbgA!is6CXrwX6InxU`*M}qhQOj`H`v&)5M8doB0JQI0czOdVxlA0|{4< nu^TUbXP(Tjqsz!J*@Q=#g9&1##^e;8nVV;+r7%KtmNEhWDCr<{ From b8291a4222a942ebd0c90c0cc658effbbfccc73f Mon Sep 17 00:00:00 2001 From: Jason Date: Thu, 24 Feb 2022 11:34:28 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E9=95=BF=E6=8C=89=E7=BE=A4=E4=B8=BB?= =?UTF-8?q?=EF=BC=8C=E4=B8=8D=E5=B1=95=E7=A4=BA=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/im/components/groupUserList.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pages/im/components/groupUserList.vue b/pages/im/components/groupUserList.vue index 281b643..a4009aa 100644 --- a/pages/im/components/groupUserList.vue +++ b/pages/im/components/groupUserList.vue @@ -104,7 +104,10 @@ hideAction(item) { this.actionShow = false }, - showAction(item) { + showAction(item) { + if (item.is_admin == 2) { + return + } this.currentUser = item this.actionTitle = item.name // 只有管理员以上才会弹窗