index.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <view>
  3. <view class="home-head">
  4. <view class="homeTab">
  5. <u-tabs :list="tabList" :current="current" @change="change" :show-bar="false" active-color="#333" inactive-color="#c4c0c0"></u-tabs>
  6. </view>
  7. </view>
  8. <view class="homeWrap">
  9. <u-swiper :list="wrapList" height="300" border-radius="24"></u-swiper>
  10. </view>
  11. <view class="newsList">
  12. <view class="newsList-item">
  13. <view class="newsList-text">
  14. <h4 class="u-line-2">还真别说,我幻想过,假如我脑子里有个大容量硬盘,我把维我把维我把维我把维</h4>
  15. <p>2021-12-01</p>
  16. </view>
  17. <u-image class="newsList-img" src="/static/img/user1.jpg" height="150" width="200" border-radius="10"></u-image>
  18. </view>
  19. <view class="newsList-item">
  20. <view class="newsList-text">
  21. <h4 class="u-line-2">还真别说,我幻想过,假如我脑子里有个大容量硬盘,我把维我把维我把维我把维</h4>
  22. <p>2021-12-01</p>
  23. </view>
  24. <u-image class="newsList-img" src="/static/img/user1.jpg" height="150" width="200" border-radius="10"></u-image>
  25. </view>
  26. <u-divider color="#B6BDC3" style="margin-top:20px;">已经到底了</u-divider>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. export default {
  32. data() {
  33. return {
  34. tabList: [{
  35. name: '通知公告'
  36. }, {
  37. name: '活动报道'
  38. },{
  39. name: '婚恋课堂'
  40. },{
  41. name: '问题解答'
  42. }],
  43. current: 0,
  44. wrapList: [{
  45. image: '/static/img/banner.png',
  46. },
  47. {
  48. image: '/static/img/banner.png',
  49. },
  50. {
  51. image: '/static/img/banner.png',
  52. }
  53. ],
  54. }
  55. },
  56. methods: {
  57. change(index) {
  58. this.current = index;
  59. }
  60. }
  61. }
  62. </script>
  63. <style lang="scss" scoped>
  64. .home-head{
  65. display: flex;
  66. justify-content: space-between;
  67. align-items: center;
  68. padding-right: 15px;
  69. .homeAdd{
  70. color: #FF5E5E;
  71. span{
  72. margin-left: 3px;
  73. }
  74. }
  75. }
  76. .homeWrap{
  77. padding:0 15px;
  78. }
  79. .newsList{
  80. padding: 15px;
  81. .newsList-item{
  82. display: flex;
  83. margin-bottom: 24px;
  84. .newsList-text{
  85. flex: 1;
  86. min-width: 0;
  87. margin-right: 10px;
  88. display: flex;
  89. flex-direction: column;
  90. justify-content: space-between;
  91. h4{
  92. font-weight: normal;
  93. }
  94. p{
  95. color: #999;
  96. font-size: 12px;
  97. }
  98. }
  99. }
  100. }
  101. </style>