category.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <template>
  2. <view class="content">
  3. <view class="main">
  4. <view v-for="(item, index) in 10">
  5. <view class="first" v-if="index == 0" @click="navToList()">
  6. <view class="title">【鼎立足行】鼎立足行足垫走姿矫正器研发相关 纪录大揭秘</view>
  7. <view class="image"></view>
  8. <view class="time">更新时间:2021-12-06</view>
  9. </view>
  10. <view class="item flex" @click="navToList()" v-else>
  11. <view class="item-left"></view>
  12. <view class="item-right">
  13. <view class="item-font clamp">信愿行如三足鼎立,缺一不可</view>
  14. <view class="item-time">更新时间:2021-12-06</view>
  15. </view>
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. import { getCategoryList } from '@/api/product.js';
  23. export default {
  24. data() {
  25. return {
  26. list: []
  27. };
  28. },
  29. onLoad() {
  30. this.loadData();
  31. },
  32. methods: {
  33. // 载入数据
  34. async loadData() {
  35. let obj = this;
  36. },
  37. navToList() {
  38. uni.navigateTo({
  39. url: '/pages/category/detail'
  40. });
  41. }
  42. }
  43. };
  44. </script>
  45. <style lang="scss">
  46. page,
  47. .content {
  48. height: auto;
  49. min-height: 100%;
  50. background: #f5f5f5;
  51. }
  52. .main {
  53. margin-top: 20rpx;
  54. background: #ffffff;
  55. .first {
  56. padding: 50rpx 0 18rpx;
  57. margin: 0 22rpx;
  58. border-bottom: 1px solid #e0e0e0;
  59. .title {
  60. font-size: 32rpx;
  61. font-family: PingFang SC;
  62. font-weight: bold;
  63. color: #333333;
  64. }
  65. .image {
  66. width: 710rpx;
  67. height: 400rpx;
  68. background: #4cd964;
  69. margin-top: 20rpx;
  70. image {
  71. width: 100%;
  72. height: 100%;
  73. }
  74. }
  75. .time {
  76. margin-top: 20rpx;
  77. font-size: 26rpx;
  78. font-family: PingFang SC;
  79. font-weight: 500;
  80. color: #666666;
  81. }
  82. }
  83. .item {
  84. padding: 26rpx 0 18rpx;
  85. margin: 0 22rpx;
  86. justify-content: flex-start;
  87. align-items: flex-start;
  88. border-bottom: 1px solid #e0e0e0;
  89. .item-left {
  90. width: 224rpx;
  91. height: 160rpx;
  92. background: #DC4D46;
  93. image {
  94. width: 100%;
  95. height: 100%;
  96. }
  97. }
  98. .item-right {
  99. height: 160rpx;
  100. margin-left: 24rpx;
  101. padding: 18rpx 0;
  102. display: flex;
  103. flex-direction: column;
  104. justify-content: space-between;
  105. .item-font {
  106. font-size: 32rpx;
  107. font-family: PingFang SC;
  108. font-weight: bold;
  109. color: #333333;
  110. }
  111. .item-time {
  112. font-size: 28rpx;
  113. font-family: PingFang SC;
  114. font-weight: 500;
  115. color: #666666;
  116. }
  117. }
  118. }
  119. }
  120. </style>