index.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. // index.js
  2. import {
  3. ajax
  4. } from "../../utils/util";
  5. Page({
  6. data: {
  7. ori: {},
  8. video_height: 0,
  9. },
  10. toNext(e) {
  11. const item = e.currentTarget.dataset.item || {};
  12. if (item.type === 'gzh') {
  13. wx.navigateTo({
  14. url: "/pages/webview/index?url=" + item.url
  15. })
  16. return
  17. }
  18. if (item.type === 'sph') {
  19. wx.openChannelsActivity({
  20. finderUserName: item.sph_id,
  21. feedId: item.sp_id,
  22. })
  23. return
  24. }
  25. },
  26. onLoad(options) {
  27. ajax({
  28. urlType: "fileurl",
  29. api: "/topic/tool/img/%E5%B0%91%E5%84%BF%E4%B9%A6%E7%94%BB%E5%A4%A7%E8%B5%9B/home.json?data=" +
  30. Date.now()
  31. }).then(res => {
  32. this.setData({
  33. ori: res || {}
  34. })
  35. })
  36. },
  37. /**
  38. * 生命周期函数--监听页面初次渲染完成
  39. */
  40. onReady() {
  41. },
  42. /**
  43. * 生命周期函数--监听页面显示
  44. */
  45. onShow() {
  46. },
  47. /**
  48. * 生命周期函数--监听页面隐藏
  49. */
  50. onHide() {
  51. },
  52. /**
  53. * 生命周期函数--监听页面卸载
  54. */
  55. onUnload() {
  56. },
  57. /**
  58. * 页面相关事件处理函数--监听用户下拉动作
  59. */
  60. onPullDownRefresh() {
  61. },
  62. /**
  63. * 页面上拉触底事件的处理函数
  64. */
  65. onReachBottom() {
  66. },
  67. /**
  68. * 用户点击右上角分享
  69. */
  70. onShareAppMessage() {
  71. }
  72. })