82 lines
1.8 KiB
Vue
82 lines
1.8 KiB
Vue
<template>
|
||
<view class="backgroundContainer">
|
||
<view v-for="(item,index) in menuArray" :key="index">
|
||
<view class="menuCard" @click="jumpTo(item.url)">
|
||
{{item.name}}
|
||
</view>
|
||
</view>
|
||
</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
|
||
}
|
||
const menuArray = [
|
||
{
|
||
name: "护理单元",
|
||
url: "/pages/Nursing/index"
|
||
},
|
||
{
|
||
name: "仓库",
|
||
url: "/pages/Warehousing/index"
|
||
},
|
||
]
|
||
const jumpTo = (url:string) =>{
|
||
uni.navigateTo({
|
||
url: url
|
||
});
|
||
}
|
||
// 生命周期钩子
|
||
onLoad((options : darkFanstype) => {
|
||
// 为uni.navigateBack()啥这么写,因为options给我返回的是字符串这个`false`,只能这么写,前端中`false`是true
|
||
// uni.navigateBack()
|
||
});
|
||
|
||
// 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;
|
||
justify-content: center;
|
||
align-items: center;
|
||
}
|
||
.menuCard{
|
||
width: 600rpx;
|
||
margin: 0 100rpx;
|
||
height: 400rpx;
|
||
background: linear-gradient(to bottom, #04BCED, #0160CE);
|
||
color: #fff;
|
||
font-size: 50rpx;
|
||
border-radius: 10%;
|
||
display: flex;
|
||
justify-content: center;
|
||
align-items: center;
|
||
}
|
||
// //暗黑模式
|
||
// .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> |