You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
< template >
< view class = "background" >
<!-- human 图片 , 带有渐变效果 -- >
< image
class = "human"
: class = "{ 'fade-in': isHumanVisible }"
src = "/static/information/sex/pictures/human.png"
> < / image >
<!-- 男生按钮 -- >
< image
class = "boy_image"
@click ="clickBoyImage"
v-if ="!isBoySelected"
:class="{ 'slide-in-left': !isBoySelected }"
src="/static/information/sex/pictures/boy.png"
></image>
<image
class="boy_image"
@click="clickBoyImage"
v-else
:class="{ 'slide-in-left': !isBoySelected }"
src="/static/information/sex/pictures/shift_boy.png"
></image>
<!-- 女生按钮 -->
<image
class="girl_image"
@click="clickGirlImage"
v-if="!isGirlSelected"
:class="{ 'slide-in-right': !isGirlSelected }"
src="/static/information/sex/pictures/girl.png"
></image>
<image
class="girl_image"
@click="clickGirlImage"
v-else
:class="{ 'slide-in-right': !isGirlSelected }"
src="/static/information/sex/pictures/shift_girl.png"
></image>
<!-- 底部下一步按钮 -->
<image
class="button"
@click="goToNextPage"
src="/static/information/sex/pictures/button.png"
></image>
</view>
</template>
<script>
export default {
data() {
return {
isBoySelected: false,
isGirlSelected: false,
isHumanVisible: false, // 控制 human 图片显示
};
},
mounted() {
// 页面加载时延时显示 human 图片
setTimeout(() => {
this.isHumanVisible = true;
}, 100); // 延迟 100ms 开始渐变,可以根据需求调整
},
methods: {
goToNextPage() {
const targetPage = this.isBoySelected
? "/pages/information/boy_weight_start/boy_weight_start"
: "/pages/information/girl_weight_start/girl_weight_start";
uni.navigateTo({
url: targetPage,
});
},
clickBoyImage() {
this.isBoySelected = true;
this.isGirlSelected = false;
},
clickGirlImage() {
this.isGirlSelected = true;
this.isBoySelected = false;
},
},
};
</script>
<style lang="scss" >
@ import " @ / static / information / sex / css / sex.css " ;
/ * 渐 变 效 果 样 式 * /
.human {
opacity : 0 ; / * 初 始 透 明 * /
transition : opacity 1.5s ease -in -out ; / * 渐 变 持 续 时 间 和 效 果 * /
}
.fade -in {
opacity : 1 ; / * 最 终 完 全 显 示 * /
}
< / style >