2025-03-05 17:29:32 +08:00
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<view :class="darkFans?`darkbackgroundContainer`:`backgroundContainer`" @click="goback">
|
|
|
|
|
1111111
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { ref, onMounted, onBeforeUnmount, computed, nextTick } from 'vue';
|
|
|
|
|
import { onLoad } from '@dcloudio/uni-app';
|
|
|
|
|
// 暗黑模式
|
|
|
|
|
const darkFans = ref(false);
|
|
|
|
|
|
|
|
|
|
type darkFanstype = {
|
|
|
|
|
darkFans:boolean
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 生命周期钩子
|
|
|
|
|
onLoad((options:darkFanstype) => {
|
2025-03-11 17:27:40 +08:00
|
|
|
|
// 为啥这么写,因为options给我返回的是字符串这个`false`,只能这么写,前端中`false`是true
|
2025-03-05 17:29:32 +08:00
|
|
|
|
if(options.darkFans === `false`){
|
|
|
|
|
darkFans.value = false
|
|
|
|
|
}else{
|
|
|
|
|
darkFans.value = true
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const goback = () =>{
|
|
|
|
|
uni.navigateBack()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="less">
|
|
|
|
|
.backgroundContainer {
|
|
|
|
|
display: flex;
|
|
|
|
|
position: relative;
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100vh;
|
|
|
|
|
background-image: url('/static/index/lightbgcnew.png');
|
|
|
|
|
background-size: cover;
|
|
|
|
|
background-position: center center;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//暗黑模式
|
|
|
|
|
.darkbackgroundContainer {
|
|
|
|
|
display: flex;
|
|
|
|
|
position: relative;
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100vh;
|
|
|
|
|
background-image: url('/static/index/background.png');
|
|
|
|
|
background-size: cover;
|
|
|
|
|
background-position: center center;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
|
|
|
|
</style>
|