feat(helpCenter): 帮助中心列表接入内容接口、问题详情页富文本渲染
This commit is contained in:
@@ -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
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user