h5-list.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <template>
  2. <view>
  3. <headContent statusBarBg="#191A2E" bgColor="#191A2E">
  4. <template #left>
  5. <reverse-back iconColor="#fff" />
  6. </template>
  7. <template #content>
  8. <view class="haed-title">
  9. {{ title }}
  10. </view>
  11. </template>
  12. <template #right>
  13. <closeIocn iconColor="#fff" />
  14. </template>
  15. </headContent>
  16. <view class="new-content">
  17. <template v-for="(item , index) in ContentList">
  18. <view class="content-item" @click.syop="readArticle(item.id)">
  19. <text class="item-lable hide_1">{{ item.title }}</text>
  20. <text class="item-icon iconfont">&#xe88e;</text>
  21. </view>
  22. </template>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. import {
  28. Api_getNewDetail,
  29. Api_getNewsList
  30. } from "@/api/index.js"
  31. export default {
  32. name: 'article-details',
  33. data() {
  34. return {
  35. cids: [
  36. 0,
  37. 19,
  38. 102
  39. ],
  40. title: '',
  41. cidIndex: 0,
  42. ContentList: [],
  43. };
  44. },
  45. onLoad(opt) {
  46. this.cidIndex = opt?.id;
  47. switch (this.cidIndex) {
  48. case '1':
  49. case 1:
  50. this.title = "关于我们";
  51. break;
  52. case '2':
  53. case 2:
  54. this.title = "活动中心";
  55. break;
  56. default:
  57. this.title = "";
  58. }
  59. this.getNewDetail()
  60. },
  61. mounted() {
  62. },
  63. methods: {
  64. getNewDetail() {
  65. if (this.cidIndex) {
  66. Api_getNewsList({
  67. c_id: this.cids[this.cidIndex],
  68. limit: 1000
  69. }).then(res => {
  70. this.ContentList = res.list || [];
  71. })
  72. }
  73. },
  74. readArticle(id) {
  75. uni.navigateTo({
  76. url: this.$path.articleDetails + `${id}`
  77. })
  78. }
  79. }
  80. }
  81. </script>
  82. <style lang="scss" scoped>
  83. .haed-title {
  84. color: #fff !important;
  85. }
  86. .new-content {
  87. .content-item {
  88. width: 100%;
  89. height: 100rpx;
  90. padding: 0 40rpx;
  91. border-bottom: 1rpx solid $border-color;
  92. display: flex;
  93. justify-content: space-between;
  94. align-items: center;
  95. .item-lable {
  96. width: 1px;
  97. flex: 1;
  98. font-size: 34rpx;
  99. font-weight: 600;
  100. }
  101. .item-icon {
  102. flex-shrink: 0;
  103. font-size: 40rpx;
  104. color: $btnBgColor;
  105. font-weight: bold;
  106. }
  107. // <view class="content-item">
  108. // <text class="item-lable">{{ item.title }}</text>
  109. // <text class="item-icon iconfont">&#xe88e;</text>
  110. // </view>
  111. }
  112. }
  113. </style>