33 lines
1.2 KiB
TypeScript
33 lines
1.2 KiB
TypeScript
// pages/helpCenter/helpCenter.ts
|
|
Page({
|
|
data: {
|
|
tabs: [
|
|
{ name: '全部', active: true },
|
|
{ name: '连接配对', active: false },
|
|
{ name: '使用测量', active: false },
|
|
{ name: '数据管理', active: false }
|
|
],
|
|
questions: [
|
|
{ id: 1, title: '如何连接蓝牙设备?' },
|
|
{ id: 2, title: '设备无法连接WiFi怎么办?' },
|
|
{ id: 3, title: '如何添加和管理成员?' },
|
|
{ id: 4, title: '测量数据不准确如何校准?' },
|
|
{ id: 5, title: '数据补传功能如何使用?' },
|
|
{ id: 6, title: '设备电量消耗过快?' }
|
|
]
|
|
},
|
|
|
|
onTapTab(e: WechatMiniprogram.TouchEvent) {
|
|
const index = e.currentTarget.dataset.index as number
|
|
const tabs = this.data.tabs.map((t, i) => ({ ...t, active: i === index }))
|
|
this.setData({ tabs })
|
|
},
|
|
|
|
onTapQuestion(e: WechatMiniprogram.TouchEvent) {
|
|
const title = e.currentTarget.dataset.title as string
|
|
wx.navigateTo({
|
|
url: '/pages/questionDetails/questionDetails?title=' + encodeURIComponent(title)
|
|
})
|
|
}
|
|
})
|