9.19 上传需求规格说明书

majiayan_branch
psnci6hgk 4 months ago
parent d8636acc98
commit 71866729b1

@ -0,0 +1 @@
VITE_ZHIPU_API_KEY=bfde4da145ae42449f0c5bf86d271555.1U5SaZQNaOOPl0kT

@ -8,6 +8,7 @@
"name": "oc-community-frontend",
"version": "0.0.0",
"dependencies": {
"axios": "^1.12.2",
"element-plus": "^2.11.2",
"vue": "^3.5.18",
"vue-router": "^4.5.1"
@ -1111,6 +1112,48 @@
"integrity": "sha512-7HhHjtERjqlNbZtqNqy2rckN/SpOOlmDliet+lP7k+eKZEjPk3DgyeU9lIXLdeLz0uBbbVp+9Qdow9wJWgwwfg==",
"license": "MIT"
},
"node_modules/asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==",
"license": "MIT"
},
"node_modules/axios": {
"version": "1.12.2",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.12.2.tgz",
"integrity": "sha512-vMJzPewAlRyOgxV2dU0Cuz2O8zzzx9VYtbJOaBgXFeLc4IV/Eg50n4LowmehOOR61S8ZMpc2K5Sa7g6A4jfkUw==",
"license": "MIT",
"dependencies": {
"follow-redirects": "^1.15.6",
"form-data": "^4.0.4",
"proxy-from-env": "^1.1.0"
}
},
"node_modules/call-bind-apply-helpers": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
"integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
"license": "MIT",
"dependencies": {
"es-errors": "^1.3.0",
"function-bind": "^1.1.2"
},
"engines": {
"node": ">= 0.4"
}
},
"node_modules/combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
"license": "MIT",
"dependencies": {
"delayed-stream": "~1.0.0"
},
"engines": {
"node": ">= 0.8"
}
},
"node_modules/csstype": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz",
@ -1123,6 +1166,29 @@
"integrity": "sha512-zFBQ7WFRvVRhKcWoUh+ZA1g2HVgUbsZm9sbddh8EC5iv93sui8DVVz1Npvz+r6meo9VKfa8NyLWBsQK1VvIKPA==",
"license": "MIT"
},
"node_modules/delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
"license": "MIT",
"engines": {
"node": ">=0.4.0"
}
},
"node_modules/dunder-proto": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
"integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
"license": "MIT",
"dependencies": {
"call-bind-apply-helpers": "^1.0.1",
"es-errors": "^1.3.0",
"gopd": "^1.2.0"
},
"engines": {
"node": ">= 0.4"
}
},
"node_modules/element-plus": {
"version": "2.11.2",
"resolved": "https://registry.npmjs.org/element-plus/-/element-plus-2.11.2.tgz",
@ -1161,6 +1227,51 @@
"url": "https://github.com/fb55/entities?sponsor=1"
}
},
"node_modules/es-define-property": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
"integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
"license": "MIT",
"engines": {
"node": ">= 0.4"
}
},
"node_modules/es-errors": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
"integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
"license": "MIT",
"engines": {
"node": ">= 0.4"
}
},
"node_modules/es-object-atoms": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz",
"integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==",
"license": "MIT",
"dependencies": {
"es-errors": "^1.3.0"
},
"engines": {
"node": ">= 0.4"
}
},
"node_modules/es-set-tostringtag": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz",
"integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==",
"license": "MIT",
"dependencies": {
"es-errors": "^1.3.0",
"get-intrinsic": "^1.2.6",
"has-tostringtag": "^1.0.2",
"hasown": "^2.0.2"
},
"engines": {
"node": ">= 0.4"
}
},
"node_modules/esbuild": {
"version": "0.25.9",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.9.tgz",
@ -1233,6 +1344,42 @@
}
}
},
"node_modules/follow-redirects": {
"version": "1.15.11",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz",
"integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==",
"funding": [
{
"type": "individual",
"url": "https://github.com/sponsors/RubenVerborgh"
}
],
"license": "MIT",
"engines": {
"node": ">=4.0"
},
"peerDependenciesMeta": {
"debug": {
"optional": true
}
}
},
"node_modules/form-data": {
"version": "4.0.4",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.4.tgz",
"integrity": "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==",
"license": "MIT",
"dependencies": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.8",
"es-set-tostringtag": "^2.1.0",
"hasown": "^2.0.2",
"mime-types": "^2.1.12"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/fsevents": {
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
@ -1248,6 +1395,103 @@
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
}
},
"node_modules/function-bind": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
"integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
"license": "MIT",
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/get-intrinsic": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
"integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
"license": "MIT",
"dependencies": {
"call-bind-apply-helpers": "^1.0.2",
"es-define-property": "^1.0.1",
"es-errors": "^1.3.0",
"es-object-atoms": "^1.1.1",
"function-bind": "^1.1.2",
"get-proto": "^1.0.1",
"gopd": "^1.2.0",
"has-symbols": "^1.1.0",
"hasown": "^2.0.2",
"math-intrinsics": "^1.1.0"
},
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/get-proto": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",
"integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
"license": "MIT",
"dependencies": {
"dunder-proto": "^1.0.1",
"es-object-atoms": "^1.0.0"
},
"engines": {
"node": ">= 0.4"
}
},
"node_modules/gopd": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
"integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
"license": "MIT",
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/has-symbols": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
"integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
"license": "MIT",
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/has-tostringtag": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz",
"integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==",
"license": "MIT",
"dependencies": {
"has-symbols": "^1.0.3"
},
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/hasown": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
"integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
"license": "MIT",
"dependencies": {
"function-bind": "^1.1.2"
},
"engines": {
"node": ">= 0.4"
}
},
"node_modules/lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
@ -1280,12 +1524,42 @@
"@jridgewell/sourcemap-codec": "^1.5.5"
}
},
"node_modules/math-intrinsics": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
"integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
"license": "MIT",
"engines": {
"node": ">= 0.4"
}
},
"node_modules/memoize-one": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-6.0.0.tgz",
"integrity": "sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw==",
"license": "MIT"
},
"node_modules/mime-db": {
"version": "1.52.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
"license": "MIT",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/mime-types": {
"version": "2.1.35",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
"license": "MIT",
"dependencies": {
"mime-db": "1.52.0"
},
"engines": {
"node": ">= 0.6"
}
},
"node_modules/nanoid": {
"version": "3.3.11",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz",
@ -1357,6 +1631,12 @@
"node": "^10 || ^12 || >=14"
}
},
"node_modules/proxy-from-env": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==",
"license": "MIT"
},
"node_modules/rollup": {
"version": "4.50.1",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-4.50.1.tgz",

@ -9,6 +9,7 @@
"preview": "vite preview"
},
"dependencies": {
"axios": "^1.12.2",
"element-plus": "^2.11.2",
"vue": "^3.5.18",
"vue-router": "^4.5.1"

@ -43,6 +43,7 @@
<script setup>
import { onMounted, onUpdated, ref, watch, nextTick, computed } from 'vue'
import { Message, Phone, VideoCamera } from '@element-plus/icons-vue'
import axios from 'axios'
const props = defineProps({
activeContact: {
@ -87,16 +88,59 @@ watch(messages, scrollToBottom, { deep: true })
const handleSend = () => {
if (!canSend.value) return
const newMsg = {
const userMsg = {
senderId: props.selfId,
text: draft.value.trim(),
timestamp: Date.now()
}
const nextMessages = [...messages.value, newMsg]
let nextMessages = [...messages.value, userMsg]
messages.value = nextMessages
emit('update:modelValue', nextMessages)
emit('send', { contact: props.activeContact, message: newMsg })
emit('send', { contact: props.activeContact, message: userMsg })
const userText = draft.value.trim()
draft.value = ''
// AI
const API_KEY = import.meta.env.VITE_ZHIPU_API_KEY
// idAI/AI
const aiMsg = {
senderId: props.activeContact?.id || 'ai',
text: 'AI思考中...',
timestamp: Date.now() + 1
}
nextMessages = [...messages.value, aiMsg]
messages.value = nextMessages
emit('update:modelValue', nextMessages)
try {
axios.post(
'https://open.bigmodel.cn/api/paas/v4/chat/completions',
{
model: 'glm-4.5-air',
messages: [{ role: 'user', content: userText }]
},
{
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json'
}
}
).then(res => {
const reply = res.data.choices?.[0]?.message?.content || 'AI无回复'
aiMsg.text = reply
aiMsg.timestamp = Date.now()
// AI
messages.value = [...messages.value.slice(0, -1), aiMsg]
emit('update:modelValue', messages.value)
}).catch(() => {
aiMsg.text = 'AI接口调用失败'
messages.value = [...messages.value.slice(0, -1), aiMsg]
emit('update:modelValue', messages.value)
})
} catch {
aiMsg.text = 'AI接口调用失败'
messages.value = [...messages.value.slice(0, -1), aiMsg]
emit('update:modelValue', messages.value)
}
}
</script>

@ -14,10 +14,10 @@
<img class="avatar" :src="c.avatar" alt="avatar" />
<div class="meta">
<div class="name">{{ c.name }}</div>
<div class="last">{{ c.lastMessage || '...' }}</div>
<div v-if="!simpleMode" class="last">{{ c.lastMessage || '...' }}</div>
</div>
<div class="time" v-if="c.lastTime">{{ formatTime(c.lastTime) }}</div>
<el-badge v-if="c.unread" :value="c.unread" class="unread" />
<div v-if="!simpleMode && c.lastTime" class="time">{{ formatTime(c.lastTime) }}</div>
<el-badge v-if="!simpleMode && c.unread" :value="c.unread" class="unread" />
</div>
<div v-if="filtered.length === 0" class="empty"></div>
</el-scrollbar>
@ -35,6 +35,10 @@ const props = defineProps({
contacts: {
type: Array,
default: () => []
},
simpleMode: {
type: Boolean,
default: false
}
})

@ -1,7 +1,7 @@
<template>
<el-dialog
v-model="modelValueLocal"
title="聊天"
title="手机通信"
width="900px"
destroy-on-close
append-to-body
@ -19,7 +19,7 @@
<el-tab-pane label="聊天" name="chat" />
<el-tab-pane label="联系人" name="contacts" />
</el-tabs>
<ContactsList v-model="activeContactId" :contacts="contacts" v-show="leftTab === 'contacts'" />
<ContactsList v-model="activeContactId" :contacts="contacts" :simple-mode="true" v-show="leftTab === 'contacts'" />
<div v-show="leftTab === 'chat'" class="chat-list">
<div
v-for="c in contacts"

@ -11,9 +11,39 @@
回到用户列表此时列表中会显示出刚创建的o头像及名称集成卡片点击卡片会出现oc的信息界面包含oc头像oc名称oc生日oc喜好oc职业oc日程表oc的社交圈oc的成就等等用户可以点击日程表进行修改点击社交圈可以添加好友点击成就可以查看自己或好友的成就。
功能详细介绍:
登录注册 保存用户数据
社区界面 公寓
功能概述:
已有功能(补充一句话描述)
注册:用户可通过注册页面创建新账号。
登录:用户输入账号密码后进入社区平台。
修改个人信息:用户可随时编辑自己的昵称、头像、生日等资料。
修改个人日程表:用户可自定义或调整自己的日常活动安排。
退出登录:用户可安全退出当前账号,返回登录页。
创建OC用户可通过问卷或AI生成方式创建属于自己的OC角色。
修改OC信息用户可编辑已创建OC的详细资料。
删除OC用户可移除不再需要的OC角色。
修改OC日程表用户可为每个OC单独设定或调整日程安排。
AI通信用户可与OC或NPC通过AI进行智能对话。
可补充的功能及描述
好友系统:用户可添加其他用户为好友,建立社交关系。
社区动态/广场用户和OC可在社区内发布动态、评论和点赞。
成就系统用户和OC可通过完成特定任务获得成就徽章。
消息通知:系统可推送好友请求、活动提醒等通知。
多社区/多世界切换:用户可创建或加入不同主题的社区世界。
社区活动/事件:定期举办线上活动或社区事件,丰富互动体验。
自定义社区场景:用户可自定义社区的外观、布局和活动场所。
虚拟经济系统:引入虚拟货币,用于购买装饰、道具等。
商城系统:用户可在商城购买服饰、家具等虚拟物品。
排行榜/活跃榜展示用户或OC的活跃度、成就排名。
数据备份与恢复:支持用户数据的云端备份与恢复。
多端同步支持PC端、移动端数据实时同步。
黑名单/举报功能:用户可屏蔽或举报不良行为。
多语言支持:平台支持多种语言切换,适应不同用户群体。
夜间模式:支持界面夜间/白天主题切换。
API开放/插件扩展为开发者提供API或插件接口便于二次开发。
新手引导/帮助中心:为新用户提供操作指引和常见问题解答。
数据统计与分析为用户提供社区活跃度、OC成长等数据可视化。
拓展构想:
@ -32,28 +62,28 @@
版本问题
1.0
0.0.1
按钮没有对其
oc创建后没有显示在列表中
用户注册完成后应当回到登录界面进行登录,而不是直接进入社区界面
已注册的用户再次登录时,个人信息出现错误
1.1
0.0.2
按钮仍没有对齐 用户中心按钮稍微考前了一点
用户登陆后的信息仍旧没有储存 每个用户创建的oc信息应当不是共享的 而是独立的
登录另一个用户后前一个用户的注册信息竟然变成了oc信息 没有注册的用户应当不可以登录
1.2
0.0.3
创建oc填写oc信息界面需要增加取消创建按钮 按下后可以返回oc列表界面
手机界面中点击导航栏的“联系人按钮”后应当跳转到一个类似微信的联系人列表,在列表中选择联系人后,右侧出现和所选联系人的聊天界面
已注册过的账号退出登录后再注册出现问题 显示用户不存在
1.3
0.0.4
用户的个人信息应当与注册信息一致,只有在修改并保存后变化,再次登录后个人信息也应当和原来保持一致
要求用户注册后的信息可以正常登录并保存在用户中心中,可以随时修改或查看
联系人列表只要有联系人头像名称就好,不显示最近一次聊天内容和时间
0.1.0--直至完成了整整意义上的平台雏形

Loading…
Cancel
Save