2026年3月14日14:37:06

This commit is contained in:
Alex-larget
2026-03-14 14:37:17 +08:00
parent db4b4b8b87
commit 8778a42429
452 changed files with 92375 additions and 1014 deletions

View File

@@ -230,7 +230,8 @@ Page({
const displayContent = accessManager.canAccessFullContent(accessState) ? (res.data?.content ?? res.content) : res.content
if (res && displayContent) {
const { lines, segments } = contentParser.parseContent(displayContent)
const previewCount = Math.ceil(lines.length * 0.2)
// 预览内容由后端统一截取比例,这里展示全部预览内容
const previewCount = lines.length
const updates = {
content: displayContent,
contentParagraphs: lines,
@@ -252,8 +253,9 @@ Page({
try {
const cached = wx.getStorageSync(cacheKey)
if (cached && cached.content) {
const { lines, segments } = contentParser.parseContent(cached.content)
const previewCount = Math.ceil(lines.length * 0.2)
const { lines, segments } = contentParser.parseContent(cached.content)
// 预览内容由后端统一截取比例,这里展示全部预览内容
const previewCount = lines.length
this.setData({
content: cached.content,
contentParagraphs: lines,
@@ -358,7 +360,8 @@ Page({
// 设置章节内容(兼容纯文本/Markdown 与 TipTap HTML
setChapterContent(res) {
const { lines, segments } = contentParser.parseContent(res.content)
const previewCount = Math.ceil(lines.length * 0.2)
// 预览内容由后端统一截取比例,这里展示全部预览内容
const previewCount = lines.length
const sectionPrice = this.data.sectionPrice ?? 1
const sectionTitle = (res.sectionTitle || res.title || '').trim()
@@ -476,7 +479,7 @@ Page({
const label = (e.currentTarget.dataset.label || '').trim()
let tagType = (e.currentTarget.dataset.tagType || '').trim()
let pagePath = (e.currentTarget.dataset.pagePath || '').trim()
let mpKey = (e.currentTarget.dataset.mpKey || '').trim() || (e.currentTarget.dataset.appId || '').trim()
let mpKey = (e.currentTarget.dataset.mpKey || '').trim()
// 旧格式(<a href>tagType 为空 → 按 label 从缓存 linkTags 补充类型信息
if (!tagType && label) {
@@ -500,9 +503,9 @@ Page({
if (tagType === 'miniprogram') {
if (!mpKey && label) {
const cached = (app.globalData.linkTagsConfig || []).find(t => t.label === label)
if (cached) mpKey = cached.mpKey || cached.appId || ''
if (cached) mpKey = cached.mpKey || ''
}
const linked = (app.globalData.linkedMiniprograms || []).find(m => (m.key || m.id) === mpKey)
const linked = (app.globalData.linkedMiniprograms || []).find(m => m.key === mpKey)
if (linked && linked.appId) {
wx.navigateToMiniProgram({
appId: linked.appId,