detail.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <view>
  3. <view class="echo-article-title bg-white">
  4. {{question.title}}
  5. </view>
  6. <view class="echo-article-meta bg-white">
  7. <view class="echo-article-meta-left">
  8. <text>{{question.createtime_text}}</text>
  9. <text>{{question.questionCate.title}}</text>
  10. </view>
  11. <view class="echo-article-meta-right">
  12. <text>浏览 {{question.volume}}</text>
  13. </view>
  14. </view>
  15. <view class="echo-article-details bg-white">
  16. <u-parse :content="question.details" noData="详情内容..." @navigate="navigate"></u-parse>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. import uParse from '@/components/gaoyia-parse/parse.vue';
  22. var _this;
  23. export default {
  24. components: {
  25. uParse
  26. },
  27. data() {
  28. return {
  29. question: {}
  30. }
  31. },
  32. onLoad: function(option) {
  33. _this = this;
  34. var questionid = option.questionid || 0;
  35. _this.$req.ajax({
  36. path: "question/getquestion",
  37. data: {
  38. questionid: questionid
  39. }
  40. }).then((data) => {
  41. _this.question = data.question;
  42. }).catch((err) => {
  43. uni.showModal({
  44. title: '信息提示',
  45. content: err,
  46. showCancel: false
  47. });
  48. });
  49. },
  50. onShareAppMessage: function(res) {
  51. return {
  52. title: _this.question.title,
  53. path: "/pages/question/detail?questionid="+_this.question.id
  54. }
  55. },
  56. methods: {
  57. navigate: function(href, e) {
  58. // #ifdef H5
  59. location.href = href;
  60. // #endif
  61. // #ifndef H5
  62. uni.navigateTo({
  63. url: '/pages/tool/webview?pagesrc=' + encodeURIComponent(href)
  64. });
  65. // #endif
  66. }
  67. }
  68. }
  69. </script>
  70. <style lang="scss">
  71. </style>