articleDetails.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <template>
  2. <layoutBack :isGoBack='false'>
  3. <layout title='福利社区文章' :isRouterBack="true">
  4. <div :class="isShowApp?'article':'article article-white'">
  5. <div class="article-title" v-if="isShowApp">
  6. 福利社区文章
  7. </div>
  8. <div class="article-title2">
  9. {{ title }}
  10. </div>
  11. <div class="article-content" v-html="content">
  12. </div>
  13. </div>
  14. </layout>
  15. </layoutBack>
  16. </template>
  17. <script>
  18. import layout from './components/layout';
  19. import layoutBack from '@/components/layout';
  20. export default {
  21. auth: false,
  22. name: 'articleDetails',
  23. head: {
  24. title: '福利社区文章',
  25. },
  26. data() {
  27. return {
  28. title: '',
  29. content: '',
  30. };
  31. },
  32. components: { layout, layoutBack },
  33. created() {
  34. if (this.$route.query.id) {
  35. this.evantDetails(this.$route.query.id)
  36. }
  37. },
  38. computed: {
  39. isShowApp() {
  40. // 是否是APP
  41. const isApp = this.$userAgent.isSzx || this.$userAgent.isSzxBrowser;
  42. const isAndroid = this.$userAgent.isAndroid;
  43. const isIos = this.$userAgent.isIos;
  44. const isWx = this.$userAgent.isWx;
  45. // 如果是App并且是安卓,就不显示头部, ios显示
  46. // 如果微信小程序环境的,也不显示头部
  47. // 如果是h5 就显示头部
  48. let bool = false;
  49. bool = isApp && (isAndroid || isIos) ? true : false;
  50. return bool;
  51. },
  52. },
  53. methods: {
  54. async evantDetails(id) {
  55. await this.$axios.$get('/activity/v1/evant/information/get/evantDetails/' + id).then((res) => {
  56. // console.log(res)
  57. this.title = res.data.title;
  58. this.content = res.data.content;
  59. });
  60. }
  61. },
  62. };
  63. </script>
  64. <style lang="less" scoped>
  65. .article {
  66. height: 100%;
  67. box-sizing: border-box;
  68. .article-title {
  69. margin-left: 10px;
  70. font-family: PingFangSC, PingFang SC;
  71. font-weight: 500;
  72. font-size: 18px;
  73. color: #cfd1d4;
  74. line-height: 25px;
  75. text-align: left;
  76. font-style: normal;
  77. margin-bottom: 24px;
  78. }
  79. .article-title2 {
  80. font-family: PingFangSC, PingFang SC;
  81. font-weight: 500;
  82. font-size: 20px;
  83. color: #ffffff;
  84. line-height: 30px;
  85. text-align: left;
  86. font-style: normal;
  87. }
  88. .article-content {
  89. margin-top: 24px;
  90. color: #ffffff;
  91. }
  92. }
  93. .article-white {
  94. .article-title {
  95. color: #0a132b;
  96. }
  97. .article-title2 {
  98. color: #0a132b;
  99. }
  100. .article-content {
  101. color: #0a132b;
  102. }
  103. }
  104. </style>