工作台图标
This commit is contained in:
+26
-8
@@ -57,7 +57,7 @@
|
||||
</view>
|
||||
<text v-else>{{ m.text }}</text>
|
||||
</view>
|
||||
<text v-if="m.mine" class="tm" :class="{ read: m.read || readLabel(m) === '已读' }" @click="showRead(m)">{{ readLabel(m) }}</text>
|
||||
<text v-if="m.mine" class="tm" :class="{ read: readDone(m) }" @click="showRead(m)">{{ readLabel(m) }}</text>
|
||||
</view>
|
||||
<view v-if="m.mine" class="av self">
|
||||
<image v-if="myAvatar" :src="myAvatar" mode="aspectFill" />
|
||||
@@ -241,12 +241,14 @@ export default {
|
||||
try {
|
||||
this.safeBottom = Number(uni.getSystemInfoSync().safeAreaInsets && uni.getSystemInfoSync().safeAreaInsets.bottom) || 0
|
||||
} catch (_) {}
|
||||
this._rec = uni.getRecorderManager()
|
||||
this._rec.onStop((res) => this.afterRecord(res))
|
||||
this._rec.onError(() => {
|
||||
this.recording = false
|
||||
toast('录音失败,请检查麦克风权限')
|
||||
})
|
||||
if (typeof uni.getRecorderManager === 'function') {
|
||||
this._rec = uni.getRecorderManager()
|
||||
this._rec.onStop((res) => this.afterRecord(res))
|
||||
this._rec.onError(() => {
|
||||
this.recording = false
|
||||
toast('录音失败,请检查麦克风权限')
|
||||
})
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.bindKb()
|
||||
@@ -289,7 +291,7 @@ export default {
|
||||
}
|
||||
this.scrollEnd()
|
||||
}
|
||||
uni.onKeyboardHeightChange(this._kb)
|
||||
if (typeof uni.onKeyboardHeightChange === 'function') uni.onKeyboardHeightChange(this._kb)
|
||||
},
|
||||
unbindKb() {
|
||||
if (this._kb) {
|
||||
@@ -338,10 +340,21 @@ export default {
|
||||
if (this.isGroup && m.readReceipt) {
|
||||
const r = (m.readReceipt.read || []).length
|
||||
const u = (m.readReceipt.unread || []).length
|
||||
if (!r && !u) return m.read ? '已读' : '未读'
|
||||
return '已读 ' + r + '/' + (r + u)
|
||||
}
|
||||
return m.read ? '已读' : '未读'
|
||||
},
|
||||
readDone(m) {
|
||||
if (!m || !m.mine || m.recalled) return false
|
||||
if (this.isGroup && m.readReceipt) {
|
||||
const r = (m.readReceipt.read || []).length
|
||||
const u = (m.readReceipt.unread || []).length
|
||||
if (!r && !u) return !!m.read
|
||||
return u === 0
|
||||
}
|
||||
return !!m.read
|
||||
},
|
||||
showRead(m) {
|
||||
if (!this.isGroup || !m || !m.readReceipt) return
|
||||
const r = (m.readReceipt.read || []).map((p) => p.name || p).join('、') || '暂无'
|
||||
@@ -434,6 +447,11 @@ export default {
|
||||
this.recSec = Math.floor((Date.now() - this._recAt) / 1000)
|
||||
}, 300)
|
||||
this.bindRecDoc()
|
||||
if (!this._rec) {
|
||||
this.unbindRecDoc()
|
||||
this.recording = false
|
||||
return
|
||||
}
|
||||
try {
|
||||
this._rec.start({ format: 'mp3', duration: 60000, sampleRate: 16000 })
|
||||
} catch (_) {
|
||||
|
||||
Reference in New Issue
Block a user