feat(helpCenter): 帮助中心列表接入内容接口、问题详情页富文本渲染

This commit is contained in:
17792275749
2026-08-20 17:13:57 +08:00
parent f53f11e6e9
commit fce9701254
6 changed files with 117 additions and 96 deletions
@@ -1,19 +1,34 @@
// pages/questionDetails/questionDetails.ts
import { get } from '../../utils/request/index'
/** 内容详情 */
interface ContentDetail {
id: string
title: string
content: string
}
Page({
data: {
title: '如何连接蓝牙设备',
steps: [
'进入"设备"页面,点击设备的"成员管理"按钮;',
'点击"添加新成员"进入添加页面;',
'选择用户类型(员工/家庭成员);',
'填写成员信息后保存;',
'在设备连接状态下,点击"同步成员至设备"将用户信息同步到设备。'
]
content: '',
},
onLoad(options: { title?: string }) {
if (options.title) {
this.setData({ title: options.title })
onLoad(options: { id?: string }) {
if (options.id) {
this.loadDetail(options.id)
}
}
},
async loadDetail(id: string) {
try {
const res = await get<ContentDetail>('weighingScale/v6/content/detail', { id })
wx.setNavigationBarTitle({
title: res.result.title
})
this.setData({
content: res.result.content,
})
} catch {
// 请求失败已由 request 层统一 toast
}
},
})