listContent.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <view class="content">
  3. <view class="list-header">
  4. <view class="left">
  5. {{main.value.subject_collection.name}}
  6. </view>
  7. <view class="right" @click="goList">
  8. 更多{{main.value.total}}
  9. <van-icon name="arrow" />
  10. </view>
  11. </view>
  12. <view class="list-content">
  13. <scroll-view class="scroll-view_H" scroll-x="true" scroll-left="120">
  14. <view class="list-bar">
  15. <view class="list-item" v-for="(item,index) in main.value.subject_collection_items" :key="index">
  16. <image class="list-img" :src="item.pic.normal" mode="widthFix"></image>
  17. <view class="list-name">{{item.title}}</view>
  18. <view class="list-rate">
  19. <van-rate color="#ffd21e" void-color='#c7c7c7' :value="item.rating.star_count" />{{item.rating.value}}
  20. </view>
  21. </view>
  22. </view>
  23. </scroll-view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. export default {
  29. name: "listContent",
  30. data() {
  31. return {
  32. };
  33. },
  34. props: ['main'],
  35. created() {
  36. console.log(this.main,'main',this.main.value.subject_collection.id)
  37. },
  38. methods: {
  39. goList() {
  40. uni.showLoading({
  41. title: '加载中'
  42. });
  43. setTimeout(() => {
  44. uni.navigateTo({
  45. url:`/pages/list/index?ids=${this.main.value.subject_collection.id}`
  46. })
  47. uni.hideLoading();
  48. }, 2000);
  49. }
  50. }
  51. }
  52. </script>
  53. <style lang="scss">
  54. ::v-deep .custom-class {
  55. font-size: 14px;
  56. /* 调整星星大小 */
  57. }
  58. .content {
  59. padding: 10px;
  60. margin-top: 20rpx;
  61. margin-bottom: 30rpx;
  62. .list-header {
  63. display: flex;
  64. justify-content: space-between;
  65. margin-bottom: 20rpx;
  66. .left {
  67. font-weight: 500;
  68. color: #111;
  69. font-size: 40rpx;
  70. }
  71. .right {
  72. color: #111;
  73. font-size: 30rpx;
  74. display: flex;
  75. align-items: center;
  76. }
  77. }
  78. .scroll-view_H {
  79. white-space: nowrap;
  80. width: 100%;
  81. }
  82. .scroll-view-item {
  83. height: 300rpx;
  84. line-height: 300rpx;
  85. text-align: center;
  86. font-size: 36rpx;
  87. }
  88. .list-bar {
  89. display: flex;
  90. .list-item {
  91. width: 260rpx;
  92. text-align: center;
  93. margin-left: 20rpx;
  94. border-radius: 16rpx;
  95. &:first-child {
  96. margin-left: 0;
  97. }
  98. .list-img {
  99. width: 100%;
  100. border-radius: 16rpx;
  101. }
  102. .list-name {
  103. width: 100%;
  104. color: #111;
  105. font-size: 35rpx;
  106. text-overflow: ellipsis;
  107. white-space: nowrap;
  108. overflow: hidden;
  109. }
  110. .list-rate {
  111. ::v-deep .van-rate__icon{
  112. font-size: 10rpx;
  113. }
  114. }
  115. }
  116. }
  117. }
  118. </style>