post.js 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. import Vue from 'vue'
  2. import lib from 'lib'
  3. import ext from 'extSdk'
  4. import _ from 'underscore'
  5. var postId = lib.getParam("postId");
  6. export default {
  7. data() {
  8. return {
  9. post : {},
  10. postUser : {}, //帖子详情
  11. postPics : [],
  12. postExtend : {},
  13. user : {},
  14. comments: [], //回复列表
  15. picList : [], //图片列表
  16. downloadUrl : lib.downloadUrl //app下载地址
  17. }
  18. },
  19. mounted() {
  20. this.getPost();
  21. },
  22. activated() {
  23. $("title").text(`${lib.appName}-动态详情`);
  24. },
  25. methods: {
  26. previewImage(picIndex){
  27. lib.setPreviewImage(this.picList,picIndex)
  28. },
  29. //分享动态
  30. getPost(){
  31. let self = this;
  32. let url = lib.apiUrl+"/share/post.do";
  33. let param = {
  34. postId : postId,
  35. channel : "LuciferChannel",
  36. ver : 1,
  37. os : 1,
  38. uid : 1,
  39. token : "lucifer_test_token"
  40. }
  41. $.ajax({
  42. type: "get",
  43. url: url,
  44. data: param,
  45. dataType: "jsonp",
  46. success: function (ret) {
  47. var ret = lib.formatHttpProtocol(ret);
  48. if (ret.result == 1){
  49. let data = ret.data;
  50. self.post = data.post;
  51. self.postUser = data.post.user;
  52. self.postExtend = data.post.extend;
  53. self.postPics = data.post.extend.pics;
  54. self.comments = data.comments ? data.comments : [];
  55. self.picList = data.post.extend.pics;
  56. self.user = data.post.user;
  57. lib.setTitle("微剧院-"+data.post.user.nick+"的动态");
  58. lib.setWxShare({
  59. title: `【${data.post.user.nick}】${data.post.extend.text}`,
  60. desc: `搜片源、看解说,快上5分钟看剧平台-微剧院`,
  61. link: `${location.href}`,
  62. imgUrl: `${data.post.user.head}`
  63. });
  64. }
  65. }
  66. });
  67. }
  68. },
  69. filters : {
  70. parseTime(value){
  71. return lib.handleTime(value).substring(5,17)
  72. }
  73. }
  74. }