index.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. // pages/previousEditions/index.js
  2. import {
  3. ajax,
  4. ele_height
  5. } from "../../utils/util";
  6. const {
  7. globalData: {
  8. systemInfo
  9. }
  10. } = getApp();
  11. Page({
  12. /**
  13. * 页面的初始数据
  14. */
  15. data: {
  16. line_height: 0,
  17. list: []
  18. },
  19. toNext(e) {
  20. const item = this.data.list[e.currentTarget.dataset.index]
  21. if (item.type === 'gzh') {
  22. wx.navigateTo({
  23. url: "/pages/webview/index?url=" + item.url
  24. })
  25. return
  26. }
  27. if (item.type === 'sph') {
  28. // wx.openChannelsActivity({
  29. // finderUserName: item.sph_id,
  30. // feedId: item.sp_id,
  31. // })
  32. wx.navigateTo({
  33. url: "/pages/sph/index?sph_id=" + item.sph_id + "&sp_id=" + item.sp_id
  34. })
  35. return
  36. }
  37. },
  38. loadimge(e) {
  39. this.setData({
  40. line_height: ele_height(e, systemInfo.screenWidth * 0.68)
  41. })
  42. },
  43. /**
  44. * 生命周期函数--监听页面加载
  45. */
  46. onLoad(options) {
  47. ajax({
  48. urlType: "fileurl",
  49. 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=" +
  50. Date.now()
  51. }).then(r => {
  52. this.setData({
  53. list: r || []
  54. })
  55. })
  56. },
  57. /**
  58. * 生命周期函数--监听页面初次渲染完成
  59. */
  60. onReady() {
  61. },
  62. /**
  63. * 生命周期函数--监听页面显示
  64. */
  65. onShow() {
  66. },
  67. /**
  68. * 生命周期函数--监听页面隐藏
  69. */
  70. onHide() {
  71. },
  72. /**
  73. * 生命周期函数--监听页面卸载
  74. */
  75. onUnload() {
  76. },
  77. /**
  78. * 页面相关事件处理函数--监听用户下拉动作
  79. */
  80. onPullDownRefresh() {
  81. },
  82. /**
  83. * 页面上拉触底事件的处理函数
  84. */
  85. onReachBottom() {
  86. },
  87. /**
  88. * 用户点击右上角分享
  89. */
  90. onShareAppMessage() {
  91. }
  92. })