Files
shoot-miniprograms/src/pages/device-intro.vue

109 lines
2.6 KiB
Vue
Raw Normal View History

2025-05-31 14:17:56 +08:00
<script setup>
2025-09-04 13:54:39 +08:00
import { ref, onMounted } from "vue";
2025-05-31 14:17:56 +08:00
import SButton from "@/components/SButton.vue";
2025-09-04 13:54:39 +08:00
2026-01-12 15:03:20 +08:00
import { capsuleHeight } from "@/util";
2025-09-04 13:54:39 +08:00
const images = [
"https://static.shelingxingqiu.com/attachment/2025-09-04/dcjmxsmf6yitekatwe.jpg",
"https://static.shelingxingqiu.com/attachment/2025-09-04/dcjmxsmi475gqdtrvx.jpg",
"https://static.shelingxingqiu.com/attachment/2025-09-04/dcjmxsmgy8ej5wuap5.jpg",
"https://static.shelingxingqiu.com/attachment/2025-09-04/dcjmxsmg6y7nveaadv.jpg",
2025-12-05 15:24:14 +08:00
"https://static.shelingxingqiu.com/attachment/2025-12-04/depguhlqg9zxastyn3.jpg",
"https://static.shelingxingqiu.com/attachment/2025-12-04/depguhlfr041aedqmb.jpg",
"https://static.shelingxingqiu.com/attachment/2025-12-04/depguhlpnlyxndnor5.jpg",
2025-09-04 13:54:39 +08:00
"https://static.shelingxingqiu.com/attachment/2025-09-04/dcjmxsmg68a8mezgzx.jpg",
2025-10-14 13:57:21 +08:00
"https://static.shelingxingqiu.com/attachment/2025-10-14/ddht51a3hiyw7ueli4.jpg",
2025-09-04 13:54:39 +08:00
];
2026-01-12 15:03:20 +08:00
const addBg = ref(false);
2025-09-04 13:54:39 +08:00
const onScrollView = (e) => {
addBg.value = e.detail.scrollTop > 100;
};
2025-05-31 14:17:56 +08:00
</script>
<template>
2025-09-04 13:54:39 +08:00
<view class="container">
<view
class="header"
:style="{
paddingTop: capsuleHeight + 'px',
}"
>
2025-08-05 15:17:19 +08:00
<image
2026-01-12 15:03:20 +08:00
:style="{ opacity: addBg ? 1 : 0 }"
2025-09-04 13:54:39 +08:00
src="../static/app-bg.png"
2025-08-05 15:17:19 +08:00
mode="widthFix"
/>
2025-09-04 13:54:39 +08:00
<navigator open-type="navigateBack">
<image class="header-back" src="../static/back.png" mode="widthFix" />
</navigator>
2025-05-31 14:17:56 +08:00
<text
2025-09-04 13:54:39 +08:00
:style="{ opacity: addBg ? 1 : 0, color: '#fff', fontWeight: 'bold' }"
2025-05-31 14:17:56 +08:00
>
2025-09-04 13:54:39 +08:00
</text>
2025-05-31 14:17:56 +08:00
</view>
2025-09-04 13:54:39 +08:00
<scroll-view scroll-y @scroll="onScrollView" :style="{ height: '100vh' }">
<view class="images">
2026-01-12 15:03:20 +08:00
<image
v-for="src in images"
:key="src"
:src="src"
mode="widthFix"
show-menu-by-longpress
/>
2025-09-04 13:54:39 +08:00
</view>
</scroll-view>
</view>
2025-05-31 14:17:56 +08:00
</template>
<style scoped>
.container {
2025-09-04 13:54:39 +08:00
width: 100%;
}
.header-bg {
width: 100%;
}
.header {
width: 100%;
height: 50px;
2025-05-31 14:17:56 +08:00
display: flex;
align-items: center;
2025-09-04 13:54:39 +08:00
position: fixed;
top: 0;
z-index: 10;
overflow: hidden;
}
.header-back {
width: 22px;
height: 22px;
margin: 0px 15px;
margin-top: 5px;
position: relative;
2025-05-31 14:17:56 +08:00
}
2026-01-12 15:03:20 +08:00
.header > image:first-child {
2025-09-04 13:54:39 +08:00
width: 100vw;
height: 100vh;
position: absolute;
top: 0;
left: 0;
2026-01-12 15:03:20 +08:00
transition: all 0.5s ease;
}
.header > text {
color: #fff;
font-weight: bold;
transition: all 0.5s ease;
position: relative;
2025-05-31 14:17:56 +08:00
}
2025-09-04 13:54:39 +08:00
.images {
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-start;
2025-05-31 14:17:56 +08:00
}
2025-09-04 13:54:39 +08:00
.images > image {
width: 100vw;
2025-05-31 14:17:56 +08:00
}
</style>