cloudroam
2025-06-12 b0bfc153bf3c9aa430ee6a86588648cdd1c27132
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
<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">
            <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>
  </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: 260rpx;
  }
  
  .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: 24rpx;
    background-color: #121212;
  }
  
  .title {
    font-size: 16px;
    color: #ffffff;
    font-weight: 500;
    margin-bottom: 12rpx;
    line-height: 1.4;
  }
  
  .subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 20rpx;
  }
  
  .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;
  }
  </style>