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

102 lines
2.5 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
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",
"https://static.shelingxingqiu.com/attachment/2025-09-04/dcjmxsmfhqew0xhy6i.jpg",
"https://static.shelingxingqiu.com/attachment/2025-09-04/dcjmxsmhs38abrqfyp.jpg",
"https://static.shelingxingqiu.com/attachment/2025-09-04/dcjmxsmgnj4rttovk3.jpg",
"https://static.shelingxingqiu.com/attachment/2025-09-04/dcjmxsmg68a8mezgzx.jpg",
2025-09-04 18:18:29 +08:00
"https://static.shelingxingqiu.com/attachment/2025-09-04/dcjxso9mmiacpmhgrc.jpg",
2025-09-04 13:54:39 +08:00
];
const addBg = ref("");
const capsuleHeight = ref(0);
onMounted(async () => {
const menuBtnInfo = uni.getMenuButtonBoundingClientRect();
capsuleHeight.value = menuBtnInfo.top - 9;
});
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
2025-09-04 13:54:39 +08:00
v-if="addBg"
class="bg-image"
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">
<image v-for="src in images" :key="src" :src="src" mode="widthFix" />
</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;
transition: all 0.3s ease;
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
}
2025-09-04 13:54:39 +08:00
.bg-image {
width: 100vw;
height: 100vh;
position: absolute;
top: 0;
left: 0;
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>