前人工作区变更归档(元审计遗留处置·冰朔授权'交给你来处理'·不否定过去原则):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,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;
}