/** * 智能咨询查询结果列表组件 */ Component({ options: { addGlobalClass: true, }, /** * 组件的属性列表 */ properties: { //查询结果 results: { type: Array, value: [] }, scrollable: { type: Boolean, value: true }, loading: { type: Boolean, value: false }, needLoadMore: { type: Boolean, value: false }, }, /** * 组件的初始数据 */ data: { }, /** * 组件的方法列表 */ methods: { /** * 跳转法规文件、条目、案例、问答的详情界面 */ gotoDetail(e) { const {index, type} = e.currentTarget.dataset const id = this.data.results[index].id let url = '' switch (type) { case 1: url = '/pages/m_consult/consultdetail/consultdetail' break; case 2: url = '/pages/m_consult/consultdetailitem/consultdetailitem' break; case 3: url = '/pages/m_consult/consultdetailcase/consultdetailcase' break; case 4: url = '/pages/m_consult/consultdetailqa/consultdetailqa' break; default: break; } if (url != '') { wx.navigateTo({ url: url, success: (res) => { res.eventChannel.emit('acceptDataFromOpenerPage', { id: id }) }, }) } else { console.log('b_search: gotoDetail, url为空'); } }, gotoMore() { this.triggerEvent('gotoMore') } } })