docs.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. import common from '../../utils/util';
  2. import main from '../../utils/main';
  3. import constant from '../../utils/constant';
  4. const app = getApp();
  5. Page({
  6. data: {
  7. ImagePath: app.globalData.uploadImageUrl,
  8. IsShow:-1,
  9. },
  10. onLoad: function (options) {
  11. var that = this;
  12. that.setData({
  13. ArticleList:app.globalData.ArticleList,
  14. IsShow:app.globalData.userInfo.IsShow,
  15. });
  16. var id=options.ID;
  17. var arr=[];
  18. var title="";
  19. for(var i=0;i<that.data.ArticleList.length;i++){
  20. if (id==that.data.ArticleList[i].ID){
  21. arr=that.data.ArticleList[i].Content;
  22. title=that.data.ArticleList[i].TitleShort;
  23. break;
  24. }
  25. }
  26. that.setData({
  27. Containnerheight: main.getWindowHeight(),
  28. ImageArr:arr,
  29. ArticleID:options.ID,
  30. Title:title,
  31. });
  32. },
  33. showImage: function (e) {
  34. var image = e.currentTarget.dataset.url;
  35. image=this.data.ImagePath+"web/_ScoreLine/"+image;
  36. wx.previewImage({
  37. current: image,
  38. urls: [image]
  39. });
  40. },
  41. goto: function (e) {
  42. var url=e.currentTarget.dataset.url;
  43. wx.navigateTo({
  44. url: url,
  45. });
  46. },
  47. redirectTo: function (e) {
  48. var url=e.currentTarget.dataset.url;
  49. wx.redirectTo({
  50. url: url,
  51. });
  52. },
  53. reLaunch: function (e) {
  54. wx.reLaunch({
  55. url: 'default',
  56. })
  57. },
  58. onShareTimeline: function () {
  59. return this.onShareAppMessage();
  60. },
  61. adLoad() {
  62. console.log('原生模板广告加载成功')
  63. },
  64. adError(err) {
  65. console.error('原生模板广告加载失败', err)
  66. },
  67. adClose() {
  68. console.log('原生模板广告关闭')
  69. },
  70. onShareAppMessage: function () {
  71. return {
  72. title: this.data.Title,
  73. path: app.globalData.SharePath + '?type=docs&ID='+this.data.ArticleID+'&UserID=' + app.globalData.userInfo.UserID,
  74. }
  75. },
  76. })