3
tj
2025-05-22 14764dd7679369a650ad1d60be62aacc863755a1
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
135
<template>
    <view class="card">
        <view class="image-wrapper">
            <image class="image" src="https://ai-public.mastergo.com/ai/img_res/6a226f9e9652c51cd535c3490535dfeb.jpg"
                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">
                    <uni-icons class="star" type="star-filled" size="14" color="#FFD700" />
                    <text class="score">{{ score }}</text>
                </view>
                <view class="more" @click="goToDetail">
                    查看详情 ->
                </view>
            </view>
        </view>
    </view>
</template>
<script>
export default {
    name: 'TripCard',
    props: {
        tag: String,
        title: String,
        subtitle: String,
        score: {
            type: [String, Number],
            default: '5.0'
        },
        imageUrl: {
            type: String,
            required: true
        },
        detailUrl: {
            type: String,
            required: true
        }
    },
    methods: {
        goToDetail() {
            uni.navigateTo({
                url: this.detailUrl
            });
        },
        startExplore() {
            uni.showToast({ title: '开始探索', icon: 'none' })
        },
        hotRoute() {
            uni.showToast({ title: '热门路线', icon: 'none' })
        }
    }
}
</script>
 
<style scoped>
.card {
    /* margin: 30rpx; */
    margin-top: 30rpx;
    border-radius: 50rpx;
    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: linear-gradient(180deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.9) 100%); */
    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;
}
</style>