// pages/previousEditions/index.js import { ajax, ele_height } from "../../utils/util"; const { globalData: { systemInfo } } = getApp(); Page({ /** * 页面的初始数据 */ data: { line_height: 0, list: [] }, toNext(e) { const item = this.data.list[e.currentTarget.dataset.index] if (item.type === 'gzh') { wx.navigateTo({ url: "/pages/webview/index?url=" + item.url }) return } if (item.type === 'sph') { // wx.openChannelsActivity({ // finderUserName: item.sph_id, // feedId: item.sp_id, // }) wx.navigateTo({ url: "/pages/sph/index?sph_id=" + item.sph_id + "&sp_id=" + item.sp_id }) return } }, loadimge(e) { this.setData({ line_height: ele_height(e, systemInfo.screenWidth * 0.68) }) }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { ajax({ urlType: "fileurl", api: "/topic/tool/img/%E5%B0%91%E5%84%BF%E4%B9%A6%E7%94%BB%E5%A4%A7%E8%B5%9B/previousEditions.json?data=" + Date.now() }).then(r => { this.setData({ list: r || [] }) }) }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady() { }, /** * 生命周期函数--监听页面显示 */ onShow() { }, /** * 生命周期函数--监听页面隐藏 */ onHide() { }, /** * 生命周期函数--监听页面卸载 */ onUnload() { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh() { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom() { }, /** * 用户点击右上角分享 */ onShareAppMessage() { } })