const api = require("../../../../utils/home") import util from "../../../../utils/util" Page({ data: { noticeObj: {}, noticeObjContent: "", noticeCategory: '', preloadVisible: true }, onLoad (options) { this.setData({ noticeCategory: options.code }) this.getNoticeDetail(options.id) // this.browseNotice(options.id) if (options.code == 'notice_navigation_hot'){ wx.setNavigationBarTitle({ title: '政策详情' }) } else { wx.setNavigationBarTitle({ title: '通知详情' }) } }, getNoticeDetail (id) { let that = this api.getNoticeDetail(id).then(res => { that.setData({ noticeObj: res.data, noticeObjContent: util.formatRichText(res.data.noticeContent), preloadVisible: false }) }).catch(err => { console.log(err) }) }, mobile (e) { wx.showModal({ title: '拨打电话', content: `您确定拨打${e.currentTarget.dataset.mobile}`, cancelColor: '#29B9A5', confirmColor: '#29B9A5', success: (res) => { if (res.confirm) { console.log('用户点击确定') wx.makePhoneCall({ phoneNumber: e.currentTarget.dataset.mobile }) } else if (res.cancel) { console.log('用户点击取消') } } }) } // browseNotice (id) { // let para = { // noticeId: id // } // api.browseNotice(para).then(res => { // }).catch(err => { // console.log(err) // }) // } })