index.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. // pages/yuezhan/html_detail/index.js.js
  2. const WxParse = require('../../../common/component/wxParse/wxParse.js');
  3. const { recordAccess } = require('../../../utils/util.js');
  4. const { serverName, request } = require('../../../utils/services');
  5. const {
  6. newRequestFns,
  7. newServerName
  8. } = require('../../../utils/newServices.js');
  9. const app = getApp();
  10. Page({
  11. /**
  12. * 页面的初始数据
  13. */
  14. data: {
  15. forwardImg: 'https://4dscene.4dage.com/cgaii/images/join/forwardImg.jpg'
  16. },
  17. /**
  18. * 生命周期函数--监听页面加载
  19. */
  20. onLoad: function (options) {
  21. recordAccess(options)
  22. console.log(options)
  23. let { imageUrl, relayUrl, id: sceneId, isShare } = options;
  24. this.setData({
  25. imageUrl,
  26. relayUrl,
  27. sceneId
  28. })
  29. let {
  30. bannerHtml
  31. } = app.globalData
  32. // if (isShare){
  33. this.getHtml()
  34. // }else{
  35. // WxParse.wxParse('description', 'html', bannerHtml, this, 5);
  36. // }
  37. },
  38. getHtml:function(){
  39. let {sceneId} = this.data
  40. newRequestFns["getBannerDetail"]({
  41. bannerId: sceneId
  42. }, "", res => {
  43. let { url: description} = res.data.data
  44. console.log(description,56555)
  45. WxParse.wxParse('description', 'html', description, this, 5);
  46. })
  47. },
  48. /**
  49. * 生命周期函数--监听页面初次渲染完成
  50. */
  51. onReady: function () {
  52. },
  53. /**
  54. * 生命周期函数--监听页面显示
  55. */
  56. onShow: function () {
  57. },
  58. /**
  59. * 生命周期函数--监听页面隐藏
  60. */
  61. onHide: function () {
  62. },
  63. /**
  64. * 生命周期函数--监听页面卸载
  65. */
  66. onUnload: function () {
  67. },
  68. /**
  69. * 页面相关事件处理函数--监听用户下拉动作
  70. */
  71. onPullDownRefresh: function () {
  72. },
  73. /**
  74. * 页面上拉触底事件的处理函数
  75. */
  76. onReachBottom: function () {
  77. },
  78. /**
  79. * 用户点击右上角分享
  80. */
  81. onShareAppMessage: function () {
  82. let { sceneId, imageUrl, relayUrl, forwardImg } = this.data;
  83. return {
  84. path: `/pages/yuezhan/html_detail/index?id=${sceneId}&isShare=1&imageUrl=${imageUrl}&relayUrl=${relayUrl}`,
  85. imageUrl: relayUrl || imageUrl || forwardImg
  86. }
  87. }
  88. })