oa_app仓库初始化

This commit is contained in:
2026-09-23 16:52:48 +08:00
commit 65c5e9f66f
82 changed files with 6490 additions and 0 deletions
+124
View File
@@ -0,0 +1,124 @@
<template>
<view class="page">
<fy-header title="群聊设置" back />
<view class="card head">
<view class="grid">
<view v-for="p in members.slice(0, 4)" :key="p.id" class="cell">{{ (p.name || '?').slice(0, 1) }}</view>
</view>
<view class="meta">
<text class="gn">{{ title }}</text>
<text class="gc">{{ members.length }} · 协同进行中</text>
</view>
</view>
<view class="card">
<view class="cap">
<text>群成员 ({{ members.length }})</text>
</view>
<view class="mems">
<view v-for="p in members" :key="p.id" class="mem" @click="open(p)">
<view class="mav">{{ (p.name || '?').slice(0, 1) }}</view>
<text class="mn">{{ p.name }}</text>
</view>
</view>
</view>
<view class="card">
<view class="row" @click="goHistory">
<text>查找聊天记录</text>
<text class="val"></text>
</view>
</view>
<view class="card">
<view class="row">
<text>群名称</text>
<text class="val">{{ title }}</text>
</view>
<view class="row" @click="toggle('pinned')">
<text>置顶聊天</text>
<text class="sw" :class="{ on: pinned }">{{ pinned ? '开' : '关' }}</text>
</view>
<view class="row" @click="toggle('muted')">
<text>消息免打扰</text>
<text class="sw" :class="{ on: muted }">{{ muted ? '开' : '关' }}</text>
</view>
</view>
<view class="card">
<view class="row danger" @click="clear">清空聊天记录</view>
</view>
</view>
</template>
<script>
import FyHeader from '../../components/fy-header.vue'
import { store } from '../../utils/store.js'
export default {
components: { FyHeader },
data() {
return { sid: '', title: '群聊', members: [], pinned: false, muted: false }
},
onLoad(q) {
this.sid = decodeURIComponent(q.sid || '')
},
onShow() {
this.pull()
},
methods: {
pull() {
const c = store.findConv(this.sid)
this.title = (c && c.name) || '群聊'
this.pinned = !!(c && c.pinned)
this.muted = !!(c && c.muted)
const ids = (c && c.memberIds) || []
this.members = ids.map((id) => store.person(id) || { id, name: id, title: '', department: '' })
},
open(p) {
uni.navigateTo({ url: '/pages/contact/detail?id=' + encodeURIComponent(p.id) })
},
toggle(field) {
const c = store.findConv(this.sid)
if (!c) return
store.setSession(c, { [field]: !c[field] })
this.pull()
},
goHistory() {
uni.navigateTo({ url: '/pages/chat/history?sid=' + encodeURIComponent(this.sid) })
},
clear() {
const c = store.findConv(this.sid)
if (!c) return
uni.showModal({
title: '清空聊天记录',
content: '将清空本机该群的聊天记录。',
success: (r) => {
if (!r.confirm) return
store.clearHistory(c)
}
})
}
}
}
</script>
<style scoped>
.head { margin: 24rpx; padding: 28rpx; display: flex; align-items: center; }
.grid { width: 96rpx; height: 96rpx; background: #eaedff; border-radius: 16rpx; display: flex; flex-wrap: wrap; padding: 8rpx; }
.cell { width: 36rpx; height: 36rpx; margin: 2rpx; background: #dbe1ff; color: #004ac6; font-size: 18rpx; font-weight: 700; display: flex; align-items: center; justify-content: center; border-radius: 6rpx; }
.meta { margin-left: 20rpx; }
.gn { font-size: 32rpx; font-weight: 700; display: block; }
.gc { font-size: 22rpx; color: #737686; }
.card { margin: 0 24rpx 24rpx; overflow: hidden; }
.cap { padding: 20rpx 24rpx 8rpx; font-size: 26rpx; font-weight: 700; }
.mems { display: flex; flex-wrap: wrap; padding: 8rpx 16rpx 24rpx; }
.mem { width: 20%; display: flex; flex-direction: column; align-items: center; margin-bottom: 16rpx; }
.mav { width: 80rpx; height: 80rpx; border-radius: 16rpx; background: #dbe1ff; color: #00174b; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.mn { font-size: 20rpx; margin-top: 8rpx; }
.row { display: flex; justify-content: space-between; padding: 28rpx 24rpx; font-size: 28rpx; border-bottom: 1rpx solid #eaedff; }
.val { color: #737686; }
.sw { color: #737686; }
.sw.on { color: #07c160; font-weight: 600; }
.danger { color: #fa5151; justify-content: center; border-bottom: none; }
</style>