active.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <template>
  2. <view class="notice_content">
  3. <block v-if="showLoading">
  4. <view class="loading_view tc mt100">
  5. <icon class="weui-loading f14"></icon>
  6. <text class="pl10">加载中...</text>
  7. </view>
  8. </block>
  9. <block v-else>
  10. <view class="notcie_title fw8 tc">{{article.title}}</view>
  11. <view class="push_time f12 grey tr">{{article.create_time}}</view>
  12. <view class="mt10">
  13. <uParse :content="article.describe" noData="加载中..."></uParse>
  14. </view>
  15. </block>
  16. </view>
  17. </template>
  18. <script>
  19. import uParse from '@/components/gaoyia-parse/parse.vue'
  20. export default {
  21. data() {
  22. return {
  23. article: {},
  24. showLoading: true,
  25. }
  26. },
  27. components: {
  28. uParse
  29. },
  30. onLoad(option) {
  31. var id = option.id;
  32. if (!id) {
  33. uni.showToast({
  34. icon: 'none',
  35. title: '缺少必有参数',
  36. success() {
  37. setTimeout(() => {
  38. uni.navigateBack({
  39. delta: 1
  40. })
  41. }, 1500)
  42. }
  43. })
  44. }
  45. this.getAdetail(id);
  46. },
  47. onShareAppMessage(res) {
  48. if (res.from === 'button') { // 来自页面内分享按钮
  49. console.log(res.target)
  50. }
  51. return {
  52. title: this.$config.appShareTitle
  53. }
  54. },
  55. methods: {
  56. getAdetail(id) {
  57. var that = this;
  58. that.$api.getAction(id, res => {
  59. if (res.code == 0) {
  60. that.showLoading = false;
  61. that.article = res.data;
  62. console.log(that.article)
  63. }
  64. })
  65. },
  66. //预览图片
  67. preview(src, e) {
  68. uni.previewImage({
  69. urls: src,
  70. })
  71. },
  72. navigate(href, e) {}
  73. }
  74. }
  75. </script>
  76. <style scoped>
  77. .notice_content {
  78. padding: 10rpx 20rpx;
  79. }
  80. @import url("@/components/u-parse/u-parse.css");
  81. .tc {
  82. text-align: center;
  83. }
  84. .mt100 {
  85. margin-top: 100rpx;
  86. }
  87. .fw8 {
  88. font-weight: 800;
  89. }
  90. .tr {
  91. text-align: right;
  92. }
  93. </style>