articleDetails.vue 2.8 KB

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