works.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. import httpRequestApi from '../../../utils/APIClient';
  2. Page({
  3. data: {
  4. fullScreenBtn: false,
  5. playBtn: false,
  6. gesture: true,
  7. user: [{
  8. nickName: '萝莉小猫咪',
  9. image: '../../../static/image/timg.jpg',
  10. },
  11. {
  12. nickName: '萝莉小猫咪',
  13. image: '../../../static/image/timg.jpg',
  14. },
  15. {
  16. nickName: '萝莉小猫咪',
  17. image: '../../../static/image/timg.jpg',
  18. },
  19. {
  20. nickName: '萝莉小猫咪',
  21. image: '../../../static/image/timg.jpg',
  22. },
  23. {
  24. nickName: '萝莉小猫咪',
  25. image: '../../../static/image/timg.jpg',
  26. },
  27. {
  28. nickName: '萝莉小猫咪',
  29. image: '../../../static/image/timg.jpg',
  30. },
  31. {
  32. nickName: '萝莉小猫咪',
  33. image: '../../../static/image/timg.jpg',
  34. },
  35. {
  36. nickName: '萝莉小猫咪',
  37. image: '../../../static/image/timg.jpg',
  38. },
  39. {
  40. nickName: '萝莉小猫咪',
  41. image: '../../../static/image/timg.jpg',
  42. },
  43. {
  44. nickName: '萝莉小猫咪',
  45. image: '../../../static/image/timg.jpg',
  46. },
  47. {
  48. nickName: '萝莉小猫咪',
  49. image: '../../../static/image/timg.jpg',
  50. },
  51. {
  52. nickName: '萝莉小猫咪',
  53. image: '../../../static/image/timg.jpg',
  54. }
  55. ],
  56. text: '总有一天我将实质性操作死去而你我的\xa0\xa0\xa0\xa0\xa0\xa0\xa0儿子自行车在啊实打实大苏打撒旦将加冕为王'
  57. },
  58. onLoad: function (option) {
  59. if (option.title) {
  60. wx.setNavigationBarTitle({
  61. title: option.title //页面标题为路由参数
  62. })
  63. this.setData({
  64. title: option.title,
  65. id: option.id
  66. })
  67. }
  68. let uid = 1;
  69. httpRequestApi.getWorksDetail(uid,option.uid).success((res)=>{
  70. console.log(res);
  71. });
  72. },
  73. goToReading: function () {
  74. let id = this.data.id;
  75. let title = this.data.title;
  76. wx.navigateTo({
  77. url: `../../main/reading/reading?id=${id}&title=${title}`
  78. })
  79. },
  80. onShareAppMessage: function (res) {
  81. if (res.from === 'button') {
  82. // 来自页面内转发按钮
  83. console.log(res.target)
  84. }
  85. return {
  86. title: '测试',
  87. path: '/pages/social/works/works'
  88. }
  89. },
  90. follow: function(){
  91. let uid = 1;
  92. let followUid = 2;
  93. httpRequestApi.followUser(uid,followUid).success((res)=>{
  94. console.log(res)
  95. });
  96. },
  97. // 去其他用户的作品页
  98. goToOthers: function (e){
  99. wx.navigateTo({
  100. url: `../../main/reading/reading?id=${id}&title=${title}`
  101. })
  102. }
  103. })