tj
2025-05-21 7abdb24968bcb88f177851a30e41f282b9189a98
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
<template>
    <view :class="['app', theme]">
        <top-tab-bar></top-tab-bar>
        <view class="main-content">
            <!-- 主要内容展示 -->
            <HomeMain></HomeMain>
            <!--     
            <section-title-btn title="内容精选" optitle="查看全部" goUrl="/pages/home/home-more" /> -->
            <view class="section">
                <u-row>
                    <u-col span="6">
                        <view class="row">
                            <!-- <u-icon v-if="iconName" :name="iconName" :size="iconSize" :color="iconColor" /> -->
                            <text class="theme-text left-text">内容精选</text>
                        </view>
                    </u-col>
                    <u-col span="3"></u-col>
                    <u-col span="3">
                        <view class="row-right">
                            <u-icon name="/static/common/left-arrow-dark.png" size="80" @click="prevPage" />
                            <u-icon name="/static/common/right-arrow-dark.png" size="80" @click="nextPage" />
                        </view>
                    </u-col>
                </u-row>
            </view>
 
            <view class="trip-card-swiper">
                <swiper :current="currentPage" @change="onSwiperChange" circular style="min-height: 1500rpx;">
                    <swiper-item v-for="(group, pageIndex) in pagedTripCards" :key="pageIndex">
                        <trip-card v-for="(item, index) in group" :key="index" :tag="item.tag" :title="item.title"
                            :subtitle="item.subtitle" :score="item.score" :imageUrl="item.imageUrl"
                            :detailUrl="item.detailUrl" />
                    </swiper-item>
                </swiper>
            </view>
 
            <!-- <trip-card v-for="(item, index) in visibleTripCards" :key="index" :tag="item.tag" :title="item.title"
                :subtitle="item.subtitle" :score="item.score" :imageUrl="item.imageUrl" :detailUrl="item.detailUrl" /> -->
 
            <section-title title="全球影视地标" optitle="查看全部" goUrl="/pages/home/home-more" />
            <global-geo />
 
            <section-title title="场景博物馆" optitle="查看全部" goUrl="/pages/home/home-more" />
            <scene-museum-card v-for="(item, index) in cardList" :key="index" :image="item.image" :title="item.title"
                :subtitle="item.subtitle" :readTime="item.readTime" />
 
            <section-title title="光影社区" optitle="加入社区" goUrl="/pages/home/home-more" />
 
            <community v-for="(item, index) in communitys" :key="index" :avatar="item.avatar" :nickname="item.nickname"
                :time="item.time" :image="item.image" :content="item.content" :likeCount="item.likeCount"
                :commentCount="item.commentCount" />
 
            <view style="height: 300rpx;"></view>
        </view>
 
        <common-footer flg="0"></common-footer>
    </view>
</template>
 
<script>
import {
    mapState
} from 'vuex'
 
import HomeMain from './home-main.vue'
import TripCard from './trip-card.vue'
import GlobalGeo from './global-geo.vue'
import SceneMuseumCard from './scene-museum-card.vue'
import Community from './community.vue'
 
export default {
    computed: {
        ...mapState({
            address: state => {
                return state.defaultaddress || {}
            },
            currentInfo: state => {
                return state.currentInfo || {}
            },
        }),
        visibleTripCards() {
            const start = this.currentPage * this.pageSize;
            const end = start + this.pageSize;
            return this.tripCardList.slice(start, end);
        },
        totalPages() {
            return Math.ceil(this.tripCardList.length / this.pageSize);
        },
        pagedTripCards() {
            const pageSize = 3;
            const pages = [];
            for (let i = 0; i < this.tripCardList.length; i += pageSize) {
                pages.push(this.tripCardList.slice(i, i + pageSize));
            }
            return pages;
        },
    },
    components: {
        HomeMain,
        TripCard,
        GlobalGeo,
        SceneMuseumCard,
        Community,
    },
    data() {
        return {
            theme: 'light', // 默认 light,可切换为 dark
            search_flow: '',
            CustomBar: uni.getStorageSync('CustomBar'),
            StatusBar: uni.getStorageSync('StatusBar'),
            tripCardList: [
                {
                    tag: '史诗邮轮',
                    title: '《权力的游戏》君临城朝圣之旅',
                    subtitle: '克罗地亚杜布罗夫尼克5日深度游',
                    score: 4.9,
                    imageUrl: 'https://ai-public.mastergo.com/ai/img_res/6a226f9e9652c51cd535c3490535dfeb.jpg',
                    detailUrl: '/pages/detail?id=123'
                },
                {
                    tag: '经典路线',
                    title: '冰岛极光探索之旅',
                    subtitle: '冬季极地风光6日深度体验',
                    score: 4.8,
                    imageUrl: 'https://ai-public.mastergo.com/ai/img_res/1a65e5ff6452efb1e6db001fcefd0b42.jpg',
                    detailUrl: '/pages/detail?id=124'
                },
                {
                    tag: '文化探秘',
                    title: '日本京都文化巡游',
                    subtitle: '探访古都名刹5日行程',
                    score: 4.7,
                    imageUrl: 'https://ai-public.mastergo.com/ai/img_res/f2262cda01488f5f44f6eabf63e5dc5a.jpg',
                    detailUrl: '/pages/detail?id=125'
                },
                {
                    tag: '史诗邮轮2',
                    title: '《权力的游戏》君临城朝圣之旅',
                    subtitle: '克罗地亚杜布罗夫尼克5日深度游',
                    score: 4.9,
                    imageUrl: 'https://ai-public.mastergo.com/ai/img_res/6a226f9e9652c51cd535c3490535dfeb.jpg',
                    detailUrl: '/pages/detail?id=123'
                },
                {
                    tag: '经典路线2',
                    title: '冰岛极光探索之旅',
                    subtitle: '冬季极地风光6日深度体验',
                    score: 4.8,
                    imageUrl: 'https://ai-public.mastergo.com/ai/img_res/1a65e5ff6452efb1e6db001fcefd0b42.jpg',
                    detailUrl: '/pages/detail?id=124'
                },
                {
                    tag: '文化探秘2',
                    title: '日本京都文化巡游',
                    subtitle: '探访古都名刹5日行程',
                    score: 4.7,
                    imageUrl: 'https://ai-public.mastergo.com/ai/img_res/f2262cda01488f5f44f6eabf63e5dc5a.jpg',
                    detailUrl: '/pages/detail?id=125'
                }
            ],
            currentPage: 0,
            pageSize: 3,
            cardList: [
                {
                    image: 'https://ai-public.mastergo.com/ai/img_res/6a226f9e9652c51cd535c3490535dfeb.jpg',
                    title: '《盗梦空间》巴黎咖啡馆',
                    subtitle: '拷素诺兰如何创造这个标志性场景',
                    readTime: '12分钟阅读'
                },
                {
                    image: 'https://img.yzcdn.cn/vant/cat.jpeg',
                    title: '《星际穿越》玉米田',
                    subtitle: '诺兰如何还原地球末日场景',
                    readTime: '8分钟阅读'
                },
                {
                    image: 'https://img.yzcdn.cn/vant/cat.jpeg',
                    title: '《星球大战》塔图因星球',
                    subtitle: '经典科幻电影中的沙漠设定',
                    readTime: '10分钟阅读'
                }
            ],
            communitys: [
                {
                    avatar: 'https://cdn.uviewui.com/uview/common/logo.png',
                    nickname: '电影探索者',
                    time: '2天前',
                    image: 'https://ai-public.mastergo.com/ai/img_res/6a226f9e9652c51cd535c3490535dfeb.jpg',
                    content: '终于站在了《权游》中君临城的台阶上!这里的每一块石头都仿佛在讲述故事...',
                    likeCount: 128,
                    commentCount: 24
                },
                {
                    avatar: 'https://cdn.uviewui.com/uview/common/logo.png',
                    nickname: '美食家',
                    time: '1天前',
                    image: 'https://ai-public.mastergo.com/ai/img_res/6a226f9e9652c51cd535c3490535dfeb.jpg',
                    content: '这家巴黎咖啡馆的氛围真是太棒了,感觉回到了电影里的场景。',
                    likeCount: 76,
                    commentCount: 12
                },
                // 你可以继续添加更多帖子数据
            ]
        };
    },
    onShareAppMessage() {
 
    },
    onShareTimeline() {
 
    },
    onLoad(options) {
        // 尝试读取缓存设置的主题
        console.log("theme", uni.getStorageSync('theme'))
        const theme = uni.getStorageSync('theme') || 'light'
        this.theme = theme
    },
    methods: {
        nextPage() {
            if (this.currentPage < this.totalPages - 1) {
                this.currentPage++;
            }
            // else{
            //     this.currentPage = 0;
            // }
        },
        prevPage() {
            if (this.currentPage > 0) {
                this.currentPage--;
            }
        },
        onSwiperChange(e) {
            this.currentPage = e.detail.current;
        },
 
    }
}
</script>
 
<style scoped>
.main-content {
    margin: 30rpx;
}
 
.row {
    display: flex;
    align-items: center;
    margin-top: 20rpx;
    margin-bottom: 20rpx;
}
</style>
 
<style scoped lang="scss">
.section {
    // margin-top: 30rpx;
 
    .space-between {
        justify-content: space-between;
    }
 
    .row {
        display: flex;
        align-items: center;
        padding: 20rpx 0;
    }
 
    .row-right {
        display: flex;
        align-items: center;
        padding: 20rpx 0;
        // justify-content: end;
        justify-content: space-between;
    }
 
    .left-text {
        font-size: 40rpx;
        font-weight: bold;
        color: var(--icon-color);
        letter-spacing: 5rpx;
    }
 
    .right-text {
        font-size: 25rpx;
        margin-right: 10rpx;
    }
 
    .theme-text {
        margin-left: 10rpx;
    }
}
</style>