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
| <template>
| <view class="timeline-container">
| <view
| v-for="(item, index) in timeline"
| :key="index"
| class="timeline-item"
| >
| <view class="timeline-time">{{ item.time }}</view>
| <view class="timeline-content">
| <view class="info">
| <text class="title">{{ item.title }}</text>
| <text class="desc">{{ item.subtitle }}</text>
| <text class="desc">{{ item.location }}</text>
| <text class="desc">{{ item.description }}</text>
| </view>
| <up-image
| :src="item.image"
| class="thumbnail"
| mode="aspectFill"
| width="240rpx"
| height="140rpx"
| radius="8rpx"
| />
| </view>
| </view>
| </view>
| </template>
|
| <script setup lang="ts">
| import { ref } from "vue";
|
| interface TimelineItem {
| time: string;
| title: string;
| subtitle: string;
| location: string;
| description: string;
| image: string;
| }
|
| const timeline = ref<TimelineItem[]>([
| {
| time: "01:21",
| title: "万国殡仪馆",
| subtitle: "International Funeral Parlour",
| location: "中国香港",
| description: "万国殡仪馆",
| image: "https://dummyimage.com/120x70/cccccc/000000&text=Image1",
| },
| {
| time: "03:11",
| title: "锦记粥粉面饭",
| subtitle: "Kum Kee Restaurant",
| location: "中国香港",
| description: "道生见明叔的地方",
| image: "https://dummyimage.com/120x70/cccccc/000000&text=Image2",
| },
| {
| time: "08:57",
| title: "康乐茶居",
| subtitle: "Hong Lok Tea House",
| location: "中国香港",
| description: "Hello文道生吃宵夜",
| image: "https://dummyimage.com/120x70/cccccc/000000&text=Image3",
| },
| {
| time: "10:45",
| title: "阳光洗衣便利店 金巴…",
| subtitle: "Sunshine Laundry (Kimberly St…",
| location: "中国香港",
| description: "洗衣店",
| image: "https://dummyimage.com/120x70/cccccc/000000&text=Image4",
| },
| ]);
| </script>
|
| <style lang="scss" scoped>
| .timeline-container {
| padding: 20rpx;
| background-color: #fff;
| }
|
| .timeline-item {
| display: flex;
| margin-bottom: 40rpx;
| }
|
| .timeline-time {
| color: #c1a14e;
| font-size: 30rpx;
| width: 100rpx;
| flex-shrink: 0;
| line-height: 140rpx; // 和图片高度一致,垂直居中
| text-align: center;
| }
|
| .timeline-content {
| border-left: 2rpx solid #f0f0f0;
| padding-left: 20rpx;
| flex: 1;
| display: flex;
| justify-content: space-between;
| align-items: center;
| }
|
| .info {
| flex: 1;
| }
|
| .title {
| font-size: 30rpx;
| font-weight: bold;
| display: block;
| }
|
| .desc {
| font-size: 24rpx;
| color: #666;
| display: block;
| margin-top: 6rpx;
| }
|
| .thumbnail {
| margin-left: 20rpx;
| border-radius: 8rpx;
| }
| </style>
|
|
|