listContent.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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">
  8. 更多{{main.value.total}}
  9. <van-icon name="arrow" @click="goList" />
  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. msg:""
  33. };
  34. },
  35. created() {
  36. console.log(("哈哈哈"))
  37. console.log(this.main,'主要的 ')
  38. // this
  39. },
  40. props: ['main'],
  41. methods: {
  42. goList() {
  43. console.log(this)
  44. // this.$router.("/pages/list/list")
  45. uni.showLoading({
  46. title: '加载中',
  47. })
  48. console.log(this.main.value.subject_collection,'传入')
  49. setTimeout(() => {
  50. uni.navigateTo({
  51. url: `/pages/list/list?params=${this.main.value.subject_collection.id}`
  52. })
  53. uni.hideLoading();
  54. }, 1500)
  55. }
  56. }
  57. }
  58. </script>
  59. <style lang="scss">
  60. ::v-deep .custom-class {
  61. font-size: 14px;
  62. /* 调整星星大小 */
  63. }
  64. .content {
  65. margin-top: 20rpx;
  66. margin-bottom: 30rpx;
  67. .list-header {
  68. display: flex;
  69. justify-content: space-between;
  70. margin-bottom: 20rpx;
  71. .left {
  72. font-weight: 500;
  73. color: #111;
  74. font-size: 40rpx;
  75. }
  76. .right {
  77. color: #111;
  78. font-size: 30rpx;
  79. display: flex;
  80. align-items: center;
  81. }
  82. }
  83. .scroll-view_H {
  84. white-space: nowrap;
  85. width: 100%;
  86. }
  87. .scroll-view-item {
  88. height: 300rpx;
  89. line-height: 300rpx;
  90. text-align: center;
  91. font-size: 36rpx;
  92. }
  93. .list-bar {
  94. display: flex;
  95. .list-item {
  96. width: 260rpx;
  97. text-align: center;
  98. margin-left: 20rpx;
  99. border-radius: 16rpx;
  100. &:first-child {
  101. margin-left: 0;
  102. }
  103. .list-img {
  104. width: 100%;
  105. border-radius: 16rpx;
  106. }
  107. .list-name {
  108. width: 100%;
  109. color: #111;
  110. font-size: 35rpx;
  111. text-overflow: ellipsis;
  112. white-space: nowrap;
  113. overflow: hidden;
  114. }
  115. .list-rate {
  116. ::v-deep .van-rate__icon{
  117. font-size: 10rpx;
  118. }
  119. }
  120. }
  121. }
  122. }
  123. </style>