leaderInfo.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. // pages/publics/leaderInfo/leaderInfo.js
  2. import {
  3. imgUrl
  4. } from "../../api/request"
  5. Page({
  6. /**
  7. * 页面的初始数据
  8. */
  9. data: {
  10. imgUrl: imgUrl,
  11. leaderInfo: ''
  12. },
  13. /**
  14. * 生命周期函数--监听页面加载
  15. */
  16. onLoad(options) {
  17. let item = JSON.parse(decodeURIComponent(options.item));
  18. item.LDLL = item.LDLL.replace(/\<span/gi, '<span class="fontSize"');
  19. item.LDFG = item.LDFG.replace(/\<span/gi, '<span class="fontSize"');
  20. this.setData({
  21. leaderInfo: item
  22. })
  23. },
  24. /**
  25. * 生命周期函数--监听页面初次渲染完成
  26. */
  27. onReady() {
  28. },
  29. /**
  30. * 生命周期函数--监听页面显示
  31. */
  32. onShow() {
  33. },
  34. /**
  35. * 生命周期函数--监听页面隐藏
  36. */
  37. onHide() {
  38. },
  39. /**
  40. * 生命周期函数--监听页面卸载
  41. */
  42. onUnload() {
  43. },
  44. /**
  45. * 页面相关事件处理函数--监听用户下拉动作
  46. */
  47. onPullDownRefresh() {
  48. },
  49. /**
  50. * 页面上拉触底事件的处理函数
  51. */
  52. onReachBottom() {
  53. },
  54. /**
  55. * 用户点击右上角分享
  56. */
  57. onShareAppMessage() {
  58. let pages = getCurrentPages();
  59. let currentPage = pages[pages.length - 1];
  60. let url = currentPage.route;
  61. let path = url + '?item=' + encodeURIComponent(JSON.stringify(this.data.leaderInfo));
  62. return {
  63. title: this.data.leaderInfo.CHANNELNAME,
  64. path: path
  65. }
  66. }
  67. })