前人工作区变更归档(元审计遗留处置·冰朔授权'交给你来处理'·不否定过去原则):hololake-phase-b-staging删除组/WORK区/submodule指针/0826壳源/neural-chain/skills-mirror/codex恢复帧/.zcode本地配置等140项原样冻结入库——不删除不修改不评判,作为历史一环保留;WX-SECRETS回执经查仅含公开AppID无AppSecret,安全

This commit is contained in:
冰朔 2026-09-01 22:18:31 +08:00
commit a40f29c12e
2442 changed files with 596545 additions and 6601 deletions

View file

@ -0,0 +1,41 @@
// app.js — 光湖知识库原型(假数据阶段,未接后端)
App({
onLaunch() {
// 微信登录、后端接入在联调阶段接入
},
globalData: {
// 假数据池:详情/编辑页从这取
notes: [
{
id: 'n1',
title: '湖边读书笔记 · 《人类简史》第3章',
content: '## 核心观点\n智人胜出的关键不是更强壮,而是**虚构故事的能力**——货币、国家、公司都是集体想象。\n\n## 我的想法\n这和语言塑造现实是一个道理:先有共同的叙事,才有协作的世界。\n\n## 待查\n- 认知革命的时间线\n- 尼安德特人灭绝的争议',
summary: '虚构故事能力是智人胜出关键;联想到语言塑造现实。',
tags: ['读书', '人类简史', '思维'],
visibility: 'public', // public=公开 | private=私密
aiReadable: true, // AI 可读
updatedAt: '08-27 21:40'
},
{
id: 'n2',
title: '广式老火汤底配比记录',
content: '## 材料\n- 猪骨 500g 焯水\n- 蜜枣 2 颗\n- 玉米 1 根切段\n- 胡萝卜 1 根\n\n## 火候\n大火烧开转小火 2.5 小时,盐最后放。',
summary: '猪骨焯水+蜜枣玉米胡萝卜,小火2.5小时,盐最后放。',
tags: ['生活', '菜谱'],
visibility: 'private',
aiReadable: true,
updatedAt: '08-26 18:12'
},
{
id: 'n3',
title: '项目灵感:给光湖做的迷你星历',
content: '## 想法\n每天自动算当天行星位置,配一段温柔的星象播报。\n\n## 依据\nSwiss Ephemeris 精度到角秒级,服务器端跑。',
summary: '每日行星位置+星象播报,Swiss Ephemeris 实现。',
tags: ['灵感', '星象'],
visibility: 'public',
aiReadable: false, // 公开但不想让 AI 读的例子
updatedAt: '08-25 09:03'
}
]
}
})

View file

@ -0,0 +1,17 @@
{
"pages": [
"pages/index/index",
"pages/detail/detail",
"pages/editor/editor"
],
"window": {
"navigationBarBackgroundColor": "#0a1628",
"navigationBarTextStyle": "white",
"navigationBarTitleText": "光湖知识库",
"backgroundColor": "#0a1628",
"backgroundTextStyle": "dark"
},
"sitemapLocation": "sitemap.json",
"style": "v2",
"lazyCodeLoading": "requiredComponents"
}

View file

@ -0,0 +1,33 @@
/* app.wxss — 光湖暗色主题 */
page {
background: #0a1628;
color: #e2e8f0;
font-size: 30rpx;
line-height: 1.6;
font-family: -apple-system, "PingFang SC", "Helvetica Neue", sans-serif;
}
.card {
background: #101f36;
border-radius: 20rpx;
padding: 28rpx;
margin: 20rpx 24rpx;
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.25);
}
.tag {
display: inline-block;
font-size: 22rpx;
color: #5eead4;
background: rgba(94, 234, 212, 0.12);
border-radius: 8rpx;
padding: 4rpx 14rpx;
margin-right: 12rpx;
}
.btn-primary {
background: linear-gradient(135deg, #14b8a6, #0d9488);
color: #04121f;
font-weight: 600;
border-radius: 44rpx;
}

View file

@ -0,0 +1,33 @@
// 详情页:人视图(渲染阅读)/ AI 视图(结构化数据)
Page({
data: {
note: null,
view: 'human', // human | ai
rendered: [] // 人视图的轻量 Markdown 渲染结果
},
onLoad(query) {
const note = getApp().globalData.notes.find(n => n.id === query.id)
if (!note) return
this.setData({ note, rendered: this.renderMd(note.content) })
wx.setNavigationBarTitle({ title: note.title.slice(0, 12) })
},
// 轻量 Markdown 解析(原型够用;正式版换 towxml 完整渲染)
renderMd(md) {
return md.split('\n').filter(l => l.trim()).map(line => {
if (line.startsWith('## ')) return { type: 'h2', text: line.slice(3) }
if (line.startsWith('- ')) return { type: 'li', text: line.slice(2) }
const bold = line.startsWith('**') && line.endsWith('**')
return { type: bold ? 'bold' : 'p', text: bold ? line.slice(2, -2) : line }
})
},
onSwitchView(e) {
this.setData({ view: e.currentTarget.dataset.v })
},
onEdit() {
wx.navigateTo({ url: '/pages/editor/editor?id=' + this.data.note.id })
}
})

View file

@ -0,0 +1,3 @@
{
"navigationBarTitleText": "条目详情"
}

View file

@ -0,0 +1,58 @@
<!-- 详情页:人视图 / AI 视图 -->
<view class="page" wx:if="{{note}}">
<!-- 视图切换 -->
<view class="seg">
<view class="seg-item {{view === 'human' ? 'seg-on' : ''}}" data-v="human" bindtap="onSwitchView">👤 人看的</view>
<view class="seg-item {{view === 'ai' ? 'seg-on' : ''}}" data-v="ai" bindtap="onSwitchView">🤖 AI 看的</view>
</view>
<!-- 人视图:渲染阅读 -->
<view wx:if="{{view === 'human'}}" class="card">
<view class="d-title">{{note.title}}</view>
<view class="d-tags">
<text wx:for="{{note.tags}}" wx:key="*this" class="tag">{{item}}</text>
</view>
<view class="d-body">
<block wx:for="{{rendered}}" wx:key="index">
<view wx:if="{{item.type === 'h2'}}" class="md-h2">{{item.text}}</view>
<view wx:elif="{{item.type === 'li'}}" class="md-li">· {{item.text}}</view>
<view wx:elif="{{item.type === 'bold'}}" class="md-bold">{{item.text}}</view>
<view wx:else class="md-p">{{item.text}}</view>
</block>
</view>
<view class="d-meta">{{note.updatedAt}} · {{note.visibility === 'private' ? '私密' : '公开'}}{{note.aiReadable ? ' · AI 可读' : ' · AI 不可读'}}</view>
</view>
<!-- AI 视图:结构化数据 -->
<view wx:if="{{view === 'ai'}}" class="card">
<view class="ai-head">本条目以结构化形式供给 AI 检索</view>
<view class="ai-row">
<view class="ai-label">摘要</view>
<view class="ai-val">{{note.summary}}</view>
</view>
<view class="ai-row">
<view class="ai-label">标签</view>
<view class="ai-val">{{note.tags}}</view>
</view>
<view class="ai-row">
<view class="ai-label">检索权限</view>
<view class="ai-val {{note.aiReadable ? 'ok' : 'deny'}}">
{{note.aiReadable ? 'ALLOWED — 可进入 AI 问答语料池' : 'DENIED — AI 问答不会读取本条目'}}
</view>
</view>
<view class="ai-row">
<view class="ai-label">原文长度</view>
<view class="ai-val">{{note.content.length}} 字符</view>
</view>
<view class="ai-row">
<view class="ai-label">配额</view>
<view class="ai-val">今日剩余 AI 调用:10 / 10(原型展示)</view>
</view>
<view class="ai-tip">正式版:AI 问答时按“公开 + AI 可读”过滤语料,答案附引用条目。私密日记永不进入此池。</view>
</view>
<view class="edit-fab" bindtap="onEdit">✎</view>
</view>

View file

@ -0,0 +1,90 @@
/* 详情页样式 */
.page { padding-bottom: 160rpx; }
.seg {
display: flex;
background: #101f36;
border-radius: 44rpx;
margin: 24rpx;
padding: 8rpx;
}
.seg-item {
flex: 1;
text-align: center;
font-size: 28rpx;
color: #94a3b8;
border-radius: 40rpx;
padding: 16rpx 0;
}
.seg-on {
background: #5eead4;
color: #04121f;
font-weight: 600;
}
.d-title {
font-size: 38rpx;
font-weight: 700;
color: #f1f5f9;
line-height: 1.4;
}
.d-tags { margin: 20rpx 0 8rpx; }
.d-body { margin-top: 24rpx; }
.md-h2 {
font-size: 32rpx;
font-weight: 700;
color: #5eead4;
margin: 28rpx 0 12rpx;
}
.md-bold { font-weight: 700; color: #f1f5f9; }
.md-li { color: #cbd5e1; padding-left: 24rpx; margin: 8rpx 0; }
.md-p { color: #cbd5e1; margin: 12rpx 0; }
.d-meta {
margin-top: 32rpx;
font-size: 22rpx;
color: #475569;
border-top: 1rpx solid #1e293b;
padding-top: 20rpx;
}
.ai-head {
font-size: 24rpx;
color: #5eead4;
letter-spacing: 2rpx;
margin-bottom: 24rpx;
}
.ai-row { margin-bottom: 26rpx; }
.ai-label {
font-size: 22rpx;
color: #64748b;
text-transform: uppercase;
letter-spacing: 2rpx;
margin-bottom: 8rpx;
}
.ai-val { font-size: 28rpx; color: #cbd5e1; }
.ai-val.ok { color: #5eead4; }
.ai-val.deny { color: #f87171; }
.ai-tip {
font-size: 23rpx;
color: #64748b;
background: rgba(94, 234, 212, 0.06);
border-radius: 12rpx;
padding: 20rpx;
line-height: 1.7;
}
.edit-fab {
position: fixed;
right: 40rpx;
bottom: 60rpx;
width: 100rpx;
height: 100rpx;
border-radius: 50rpx;
background: #101f36;
border: 2rpx solid #5eead4;
color: #5eead4;
font-size: 44rpx;
display: flex;
align-items: center;
justify-content: center;
}

View file

@ -0,0 +1,60 @@
// 编辑页:新建/编辑条目(原型:写回本地假数据)
Page({
data: {
id: null,
title: '',
content: '',
tagStr: '',
visibility: 'private',
aiReadable: true
},
onLoad(query) {
if (query.id) {
const n = getApp().globalData.notes.find(x => x.id === query.id)
if (n) {
this.setData({
id: n.id, title: n.title, content: n.content,
tagStr: n.tags.join(','),
visibility: n.visibility, aiReadable: n.aiReadable
})
wx.setNavigationBarTitle({ title: '编辑条目' })
}
}
},
onTitle(e) { this.setData({ title: e.detail.value }) },
onContent(e) { this.setData({ content: e.detail.value }) },
onTags(e) { this.setData({ tagStr: e.detail.value }) },
onVis(e) { this.setData({ visibility: e.detail.value ? 'public' : 'private' }) },
onAI(e) { this.setData({ aiReadable: e.detail.value }) },
onSave() {
if (!this.data.title.trim()) {
wx.showToast({ title: '标题不能为空', icon: 'none' })
return
}
const app = getApp()
const tags = this.data.tagStr.split(/[,,]/).map(t => t.trim()).filter(Boolean)
const now = new Date()
const stamp = `${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')} ${String(now.getHours()).padStart(2, '0')}:${String(now.getMinutes()).padStart(2, '0')}`
if (this.data.id) {
const n = app.globalData.notes.find(x => x.id === this.data.id)
Object.assign(n, {
title: this.data.title, content: this.data.content, tags,
visibility: this.data.visibility, aiReadable: this.data.aiReadable, updatedAt: stamp
})
} else {
app.globalData.notes.unshift({
id: 'n' + Date.now(),
title: this.data.title, content: this.data.content, tags,
summary: this.data.content.replace(/[#*\-\n]/g, ' ').slice(0, 40),
visibility: this.data.visibility, aiReadable: this.data.aiReadable,
updatedAt: stamp
})
}
wx.showToast({ title: '已保存(原型)' })
setTimeout(() => wx.navigateBack(), 600)
}
})

View file

@ -0,0 +1,3 @@
{
"navigationBarTitleText": "新建条目"
}

View file

@ -0,0 +1,34 @@
<!-- 编辑页 -->
<view class="page">
<view class="card">
<input class="e-title" placeholder="标题" placeholder-class="ph"
value="{{title}}" bindinput="onTitle" />
<textarea class="e-content" placeholder="内容(支持简单 Markdown:## 小标题、- 列表、**加粗**)"
placeholder-class="ph" value="{{content}}" bindinput="onContent"
maxlength="5000" auto-height />
<input class="e-tags" placeholder="标签,用逗号分隔(如:读书, 思维)"
placeholder-class="ph" value="{{tagStr}}" bindinput="onTags" />
</view>
<view class="card">
<view class="row">
<view>
<view class="row-title">🌐 公开</view>
<view class="row-desc">公开条目可被其他访问者浏览</view>
</view>
<switch checked="{{visibility === 'public'}}" bindchange="onVis" color="#14b8a6" />
</view>
<view class="row">
<view>
<view class="row-title">🤖 AI 可读</view>
<view class="row-desc">允许 AI 问答把本条目作为语料;关闭后 AI 永不读取</view>
</view>
<switch checked="{{aiReadable}}" bindchange="onAI" color="#14b8a6" />
</view>
</view>
<view class="save-wrap">
<button class="btn-primary save" bindtap="onSave">保存</button>
</view>
</view>

View file

@ -0,0 +1,34 @@
/* 编辑页样式 */
.e-title {
font-size: 34rpx;
font-weight: 700;
color: #f1f5f9;
margin-bottom: 20rpx;
}
.e-content {
width: 100%;
min-height: 380rpx;
font-size: 28rpx;
color: #cbd5e1;
line-height: 1.7;
}
.e-tags {
margin-top: 24rpx;
font-size: 26rpx;
color: #5eead4;
border-top: 1rpx solid #1e293b;
padding-top: 24rpx;
}
.ph { color: #475569; }
.row {
display: flex;
justify-content: space-between;
align-items: center;
padding: 14rpx 0;
}
.row-title { font-size: 30rpx; color: #f1f5f9; font-weight: 600; }
.row-desc { font-size: 23rpx; color: #64748b; margin-top: 6rpx; max-width: 520rpx; }
.save-wrap { padding: 30rpx 24rpx 60rpx; }
.save { width: 100%; }

View file

@ -0,0 +1,54 @@
// 知识库首页:搜索 + 标签筛选 + 卡片流
Page({
data: {
keyword: '',
activeTag: '全部',
tags: ['全部', '读书', '生活', '灵感', '星象'],
notes: []
},
onShow() {
this.refresh()
},
refresh() {
const all = getApp().globalData.notes
const kw = this.data.keyword.trim()
let list = all
if (this.data.activeTag !== '全部') {
list = list.filter(n => n.tags.includes(this.data.activeTag))
}
if (kw) {
list = list.filter(n =>
n.title.includes(kw) || n.summary.includes(kw) || n.tags.join('').includes(kw)
)
}
this.setData({ notes: list })
},
onSearchInput(e) {
this.setData({ keyword: e.detail.value })
this.refresh()
},
onTapTag(e) {
this.setData({ activeTag: e.currentTarget.dataset.tag })
this.refresh()
},
onTapNote(e) {
wx.navigateTo({ url: '/pages/detail/detail?id=' + e.currentTarget.dataset.id })
},
onTapAdd() {
wx.navigateTo({ url: '/pages/editor/editor' })
},
onAskAI() {
wx.showModal({
title: 'AI 问答(原型占位)',
content: '正式版接 DeepSeek:对“公开且 AI 可读”的条目做检索问答,每人每天 10 次。',
showCancel: false
})
}
})

View file

@ -0,0 +1,3 @@
{
"navigationBarTitleText": "光湖知识库"
}

View file

@ -0,0 +1,43 @@
<!-- 知识库首页 -->
<view class="page">
<!-- 顶部:搜索 + AI 问答入口 -->
<view class="topbar">
<view class="search-wrap">
<input class="search" placeholder="搜知识库…" placeholder-class="ph"
value="{{keyword}}" bindinput="onSearchInput" confirm-type="search" />
</view>
<view class="ai-btn" bindtap="onAskAI">问 AI</view>
</view>
<!-- 标签筛选 -->
<scroll-view class="tags" scroll-x enable-flex>
<view wx:for="{{tags}}" wx:key="*this"
class="tag-chip {{item === activeTag ? 'tag-active' : ''}}"
data-tag="{{item}}" bindtap="onTapTag">{{item}}</view>
</scroll-view>
<!-- 卡片流 -->
<view wx:for="{{notes}}" wx:key="id" class="card note-card"
data-id="{{item.id}}" bindtap="onTapNote">
<view class="note-head">
<text class="note-title">{{item.title}}</text>
<text class="lock">{{item.visibility === 'private' ? '🔒' : '🌐'}}</text>
</view>
<view class="note-summary">{{item.summary}}</view>
<view class="note-foot">
<view class="note-tags">
<text wx:for="{{item.tags}}" wx:for-item="t" wx:key="*this" class="tag">{{t}}</text>
</view>
<view class="note-meta">
<text wx:if="{{item.aiReadable}}" class="ai-eye">AI👁</text>
<text class="time">{{item.updatedAt}}</text>
</view>
</view>
</view>
<view wx:if="{{!notes.length}}" class="empty">湖面平静,还没有条目</view>
<!-- 新建按钮 -->
<view class="fab" bindtap="onTapAdd">+</view>
</view>

View file

@ -0,0 +1,102 @@
/* 知识库首页样式 */
.page { padding-bottom: 140rpx; }
.topbar {
display: flex;
align-items: center;
padding: 24rpx;
gap: 20rpx;
}
.search-wrap {
flex: 1;
background: #101f36;
border-radius: 44rpx;
padding: 16rpx 30rpx;
}
.search { font-size: 28rpx; color: #e2e8f0; }
.ph { color: #475569; }
.ai-btn {
background: rgba(94, 234, 212, 0.15);
color: #5eead4;
font-size: 26rpx;
border-radius: 44rpx;
padding: 18rpx 28rpx;
font-weight: 600;
}
.tags {
white-space: nowrap;
padding: 0 24rpx 8rpx;
}
.tag-chip {
display: inline-block;
font-size: 26rpx;
color: #94a3b8;
background: #101f36;
border-radius: 32rpx;
padding: 10rpx 28rpx;
margin-right: 16rpx;
}
.tag-active {
color: #04121f;
background: #5eead4;
font-weight: 600;
}
.note-card { display: block; }
.note-head {
display: flex;
justify-content: space-between;
align-items: flex-start;
gap: 12rpx;
}
.note-title {
font-size: 32rpx;
font-weight: 600;
color: #f1f5f9;
}
.lock { flex-shrink: 0; }
.note-summary {
color: #94a3b8;
font-size: 27rpx;
margin: 14rpx 0 18rpx;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.note-foot {
display: flex;
justify-content: space-between;
align-items: center;
}
.note-meta {
display: flex;
align-items: center;
gap: 14rpx;
}
.ai-eye { font-size: 22rpx; color: #5eead4; }
.time { font-size: 22rpx; color: #475569; }
.empty {
text-align: center;
color: #475569;
padding: 120rpx 0;
}
.fab {
position: fixed;
right: 40rpx;
bottom: 60rpx;
width: 108rpx;
height: 108rpx;
border-radius: 54rpx;
background: linear-gradient(135deg, #14b8a6, #0d9488);
color: #04121f;
font-size: 56rpx;
font-weight: 300;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 10rpx 30rpx rgba(20, 184, 166, 0.4);
}

View file

@ -0,0 +1,15 @@
{
"description": "光湖知识库小程序",
"appid": "wx174a349830857527",
"compileType": "miniprogram",
"libVersion": "3.8.12",
"setting": {
"es6": true,
"enhance": true,
"postcss": true,
"minified": true,
"urlCheck": true
},
"projectname": "guanghulab-miniapp",
"condition": {}
}

View file

@ -0,0 +1,7 @@
{
"desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
"rules": [{
"action": "allow",
"page": "*"
}]
}