工作台图标

This commit is contained in:
2026-09-24 09:54:39 +08:00
parent e899b30562
commit 2078923deb
5 changed files with 157 additions and 52 deletions
+26 -8
View File
@@ -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 (_) {
+18 -13
View File
@@ -40,7 +40,9 @@
<view v-if="!flows.length" class="empty">暂无可用审批流请确认账号已开通申请权限</view>
<view class="grid">
<view v-for="a in flows" :key="a.key" class="app" @click="openFlow(a)">
<view class="icon"><text class="mark">{{ mark(a.label) }}</text></view>
<view class="icon" :style="{ background: tileOf(a).bg }">
<wd-icon :name="tileOf(a).name" size="44rpx" :color="tileOf(a).color" />
</view>
<text class="al">{{ a.label }}</text>
</view>
</view>
@@ -52,8 +54,8 @@
<view v-if="apps.length" class="card apps">
<view class="grid">
<view v-for="a in apps" :key="a.id" class="app" @click="open(a)">
<view class="icon">
<text class="mark">{{ mark(a.title) }}</text>
<view class="icon" :style="{ background: tileOf(a).bg }">
<wd-icon :name="tileOf(a).name" size="44rpx" :color="tileOf(a).color" />
<text v-if="a.badge === 'todo' && todoCount" class="badge abs">{{ todoCount }}</text>
</view>
<text class="al">{{ a.title }}</text>
@@ -66,7 +68,9 @@
</view>
<view v-if="erp.length" class="card mods">
<view v-for="m in erp" :key="m.id" class="mod" @click="open(m)">
<view class="mi"><text>{{ mark(m.title) }}</text></view>
<view class="mi" :style="{ background: tileOf(m).bg }">
<wd-icon :name="tileOf(m).name" size="36rpx" :color="tileOf(m).color" />
</view>
<text class="mt">{{ m.title }}</text>
<text class="arr"></text>
</view>
@@ -101,7 +105,7 @@ import { store } from '../../utils/store.js'
import { toast } from '../../utils/format.js'
import { oaPost } from '../../utils/api.js'
import { visibleApplyKinds } from '../../utils/apply.js'
import { openHref, tileEmoji } from '../../utils/nav.js'
import { openHref, tileVisual } from '../../utils/nav.js'
export default {
components: { FyHeader, FyScroll },
@@ -121,7 +125,7 @@ export default {
label: s.label || s.title || '入口',
desc: s.desc || '',
to: s.to || s.path || s.url || '',
emoji: tileEmoji(s)
emoji: tileVisual(s).name
})).filter((s) => s.to)
if (fromApi.length) return fromApi
const me = store.me || {}
@@ -135,7 +139,7 @@ export default {
label: k.title,
desc: k.hint,
to: '/pages/apply/form?kind=' + k.kind,
emoji: tileEmoji({ id: k.kind, title: k.title })
emoji: tileVisual({ id: k.kind, title: k.title }).name
}))
},
pending() {
@@ -189,7 +193,9 @@ export default {
else toast('没有发起申请权限')
},
goTodo() { uni.navigateTo({ url: '/pages/todo/list' }) },
mark(s) { return String(s || '应').replace(/\s/g, '').slice(0, 1) },
tileOf(item) {
return tileVisual(item || {})
},
pendKey(t) { return t.no || t.id || t.to || t.title },
openPending(t) {
if (t.source === 'work' || t.taskId) {
@@ -239,19 +245,18 @@ export default {
.grid { display: flex; flex-wrap: wrap; }
.app { width: 25%; display: flex; flex-direction: column; align-items: center; padding: 16rpx 4rpx; box-sizing: border-box; }
.icon {
width: 88rpx; height: 88rpx; border-radius: 24rpx; background: #F3F6FB;
width: 88rpx; height: 88rpx; border-radius: 24rpx; background: #E8F1FF;
display: flex; align-items: center; justify-content: center;
position: relative; margin-bottom: 10rpx;
}
.mark { font-size: 30rpx; font-weight: 650; color: #1677FF; }
.abs { position: absolute; top: -8rpx; right: -8rpx; }
.al { font-size: 24rpx; text-align: center; color: #111827; line-height: 1.35; }
.mod { display: flex; align-items: center; padding: 22rpx 16rpx; }
.mod + .mod { border-top: 1rpx solid #F0F2F5; }
.mi {
width: 64rpx; height: 64rpx; border-radius: 16rpx; background: #F3F6FB;
color: #1677FF; display: flex; align-items: center; justify-content: center;
font-weight: 650; margin-right: 16rpx;
width: 64rpx; height: 64rpx; border-radius: 16rpx; background: #E8F1FF;
display: flex; align-items: center; justify-content: center;
margin-right: 16rpx;
}
.mt { flex: 1; font-size: 28rpx; }
.todo { display: flex; align-items: center; padding: 24rpx 24rpx; margin-bottom: 16rpx; }