hldy_app/pages/index/index.vue

82 lines
1.8 KiB
Vue
Raw Normal View History

2025-02-18 17:11:31 +08:00
<template>
2025-04-01 17:27:15 +08:00
<view class="backgroundContainer">
<view v-for="(item,index) in menuArray" :key="index">
<view class="menuCard" @click="jumpTo(item.url)">
{{item.name}}
2025-03-21 17:36:27 +08:00
</view>
</view>
2025-02-18 17:11:31 +08:00
</view>
</template>
<script setup lang="ts">
2025-04-01 17:27:15 +08:00
import { ref, onMounted, onBeforeUnmount, computed, nextTick } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
2025-02-18 17:11:31 +08:00
// 暗黑模式
2025-04-01 17:27:15 +08:00
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
2025-03-11 17:27:40 +08:00
});
2025-03-21 17:36:27 +08:00
}
2025-02-18 17:11:31 +08:00
// 生命周期钩子
2025-04-01 17:27:15 +08:00
onLoad((options : darkFanstype) => {
// 为uni.navigateBack()啥这么写因为options给我返回的是字符串这个`false`,只能这么写,前端中`false`是true
// uni.navigateBack()
2025-02-18 17:11:31 +08:00
});
2025-04-01 17:27:15 +08:00
// const goback = () =>{
// uni.navigateBack()
// }
2025-02-18 17:11:31 +08:00
</script>
2025-04-01 17:27:15 +08:00
<style scoped lang="less">
2025-02-18 17:11:31 +08:00
.backgroundContainer {
display: flex;
position: relative;
width: 100%;
height: 100vh;
2025-02-27 17:15:17 +08:00
background-image: url('/static/index/lightbgcnew.png');
2025-02-18 17:11:31 +08:00
background-size: cover;
background-position: center center;
overflow: hidden;
2025-03-14 17:30:56 +08:00
justify-content: center;
align-items: center;
2025-02-18 17:11:31 +08:00
}
2025-04-01 17:27:15 +08:00
.menuCard{
width: 600rpx;
margin: 0 100rpx;
height: 400rpx;
background: linear-gradient(to bottom, #04BCED, #0160CE);
color: #fff;
font-size: 50rpx;
border-radius: 10%;
2025-03-21 17:36:27 +08:00
display: flex;
justify-content: center;
align-items: center;
}
2025-04-01 17:27:15 +08:00
// //暗黑模式
// .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;
// }
2025-02-18 17:11:31 +08:00
</style>