index.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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.navigateTo({
  20. url: "/pages/sph/index?sph_id=" + item.sph_id + "&sp_id=" + item.sp_id
  21. })
  22. // wx.openChannelsActivity({
  23. // finderUserName: item.sph_id,
  24. // feedId: item.sp_id,
  25. // })
  26. return
  27. }
  28. },
  29. onLoad(options) {
  30. // console.log(__wxConfig.accountInfo.icon) // 小程序icon
  31. ajax({
  32. urlType: "fileurl",
  33. 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=" +
  34. Date.now()
  35. }).then(res => {
  36. this.setData({
  37. ori: res || {}
  38. })
  39. })
  40. },
  41. /**
  42. * 生命周期函数--监听页面初次渲染完成
  43. */
  44. onReady() {
  45. },
  46. /**
  47. * 生命周期函数--监听页面显示
  48. */
  49. onShow() {
  50. },
  51. /**
  52. * 生命周期函数--监听页面隐藏
  53. */
  54. onHide() {
  55. },
  56. /**
  57. * 生命周期函数--监听页面卸载
  58. */
  59. onUnload() {
  60. },
  61. /**
  62. * 页面相关事件处理函数--监听用户下拉动作
  63. */
  64. onPullDownRefresh() {
  65. },
  66. /**
  67. * 页面上拉触底事件的处理函数
  68. */
  69. onReachBottom() {
  70. },
  71. /**
  72. * 用户点击右上角分享
  73. */
  74. onShareAppMessage() {
  75. }
  76. })