replyDetail.js 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. import httpRequestApi from '../../../utils/APIClient';
  2. Page({
  3. data: {
  4. class1: 'commentItem commentItemFirst',
  5. classNormal: 'commentItem',
  6. comment:[
  7. {
  8. name: '阿尔萨斯',
  9. text: '总有一天我将死去而你我儿子啊将加冕为王加冕为王加冕为王加冕为王加冕为王加冕为王加冕为王',
  10. time: '10-18 09:56',
  11. likes: '165',
  12. avatar: '../../../static/image/timg.jpg'
  13. },
  14. {
  15. name: '古尔丹',
  16. text: '你读的是个求',
  17. time: '10-18 09:56',
  18. likes: '165',
  19. avatar: '../../../static/image/timg.jpg'
  20. },
  21. {
  22. name: '阿尔萨斯',
  23. text: '圣光将照耀我',
  24. time: '10-18 09:56',
  25. likes: '165',
  26. avatar: '../../../static/image/timg.jpg'
  27. },
  28. ]
  29. },
  30. onLoad: function (option) {
  31. console.log(option)
  32. wx.setNavigationBarTitle({
  33. title: option.num + '条回复'//页面标题为路由参数
  34. })
  35. },
  36. goToReading: function () {
  37. let id = this.data.id;
  38. let title = this.data.title;
  39. wx.navigateTo({
  40. url: `../../main/reading/reading?id=${id}&title=${title}`
  41. })
  42. },
  43. onShareAppMessage: function (res) {
  44. if (res.from === 'button') {
  45. // 来自页面内转发按钮
  46. console.log(res.target)
  47. }
  48. return {
  49. title: '测试',
  50. path: '/pages/social/works/works'
  51. }
  52. },
  53. follow: function () {
  54. let uid = 1;
  55. let followUid = 2;
  56. httpRequestApi.followUser(uid, followUid).success((res) => {
  57. console.log(res)
  58. });
  59. },
  60. // 去其他用户的作品页
  61. goToOthers: function (e) {
  62. wx.navigateTo({
  63. url: `../../main/reading/reading?id=${id}&title=${title}`
  64. })
  65. },
  66. // 查询回复
  67. getReply: function () {
  68. let uid = 1;
  69. let columnId = 1001;
  70. let pageNo = 1;
  71. let pageSize = 10;
  72. httpRequestApi.getReply(uid, columnId, pageNo, pageSize).success((res) => {
  73. console.log(res);
  74. });
  75. },
  76. // 打开回复详情页
  77. goToDetail: function (e) {
  78. let id = e.currentTarget.dataset.id;
  79. let num = e.currentTarget.dataset.num;
  80. console.log(e);
  81. wx.navigateTo({
  82. url: `../../social/replyDetail/replyDetail?id=${id}&num=${num}`
  83. })
  84. }
  85. })