cloudroam
2025-07-17 f3ea52bf97e61f6917ccaab904817d74d9d4860c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<template>
    <view class="card">
      <view class="image-wrapper">
        <image class="image" :src="imageUrl" mode="aspectFill" />
        <view class="tag">{{ tag }}</view>
      </view>
      <view class="content">
        <view class="title">{{ title }}</view>
        <view class="subtitle">{{ subtitle }}</view>
        <view class="footer">
          <view class="rating-more">
            <view class="rating-group"> <!-- 新增包裹层 -->
              <up-icon class="star" name="star-fill" size="14" color="#FFD700" />
              <text class="score">{{ score }}</text>
            </view>
            <view class="more" @click="goToDetail">
              查看详情 ->
            </view>
          </view>
        </view>
      </view>
    </view>
  </template>
  
  <script setup lang="ts">
 
  interface Props {
    tag?: string;
    title?: string;
    subtitle?: string;
    score?: string | number;
    imageUrl: string;
    detailUrl: string;
  }
  
  const props = defineProps<Props>();
  
  function goToDetail() {
    uni.navigateTo({
      url: props.detailUrl,
    });
  }
  </script>
  
  <style scoped lang="scss">
  .card {
    margin-top: 20rpx;
    border-radius: 24rpx;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05);
  }
  
  .image-wrapper {
    position: relative;
    width: 100%;
    height: 400rpx;  // 从260rpx增加到360rpx
  }
  
  .image {
    width: 100%;
    height: 100%;
  }
  
  .tag {
    position: absolute;
    bottom: 20rpx;
    left: 20rpx;
    padding: 6rpx 16rpx;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 6rpx;
    color: #ffffff;
    font-size: 12px;
  }
  
  .content {
    padding: 10rpx; // 上下padding从24rpx减到20rpx
    background-color: #121212;
  }
  
  .title {
    font-size: 15px; // 从16px减小
    color: #ffffff;
    font-weight: 500;
    margin-bottom: 8rpx;  // 从12rpx减小
    line-height: 1.4;
  }
  
  .subtitle {
    font-size: 13px; // 从14px减小
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 16rpx;  // 从20rpx减小
    line-height: 1.3; // 添加行高控制
  }
  
  .footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .rating {
    display: flex;
    align-items: center;
  }
  
  .star {
    margin-right: 8rpx;
  }
  
  .score {
    color: #ffffff;
    font-size: 14px;
  }
  
  .more {
    color: #ffffff;
    font-size: 14px;
    user-select: none;
    cursor: pointer;
  }
  .rating-more {
    display: flex;
    align-items: center;
    width: 100%; // 添加宽度
    justify-content: space-between; // 改为两端对齐
  }
  .rating-group { /* 新增样式 */
    display: flex;
    align-items: center;
    gap: 8rpx; /* 图标和分数之间的间距 */
  }
  </style>