articleDetails.vue 2.3 KB

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