2024-01-24 14:13:45 +08:00
|
|
|
|
<!-- 使用 type="home" 属性设置首页,其他页面不需要设置,默认为page;推荐使用json5,更强大,且允许注释 -->
|
|
|
|
|
<route lang="json5" type="home">
|
2024-01-04 09:53:17 +08:00
|
|
|
|
{
|
2024-05-11 09:41:33 +08:00
|
|
|
|
layout: 'tabbar',
|
2024-01-24 13:55:06 +08:00
|
|
|
|
style: {
|
2025-06-21 10:27:59 +08:00
|
|
|
|
// 'custom' 表示开启自定义导航栏,默认 'default'
|
2024-01-29 18:59:17 +08:00
|
|
|
|
navigationStyle: 'custom',
|
|
|
|
|
navigationBarTitleText: '首页',
|
2024-01-24 13:55:06 +08:00
|
|
|
|
},
|
2024-01-04 09:53:17 +08:00
|
|
|
|
}
|
|
|
|
|
</route>
|
2023-12-21 15:52:49 +08:00
|
|
|
|
|
2024-01-24 10:58:03 +08:00
|
|
|
|
<script lang="ts" setup>
|
2024-04-17 15:32:15 +08:00
|
|
|
|
import PLATFORM from '@/utils/platform'
|
2024-04-30 14:59:28 +08:00
|
|
|
|
|
|
|
|
|
defineOptions({
|
|
|
|
|
name: 'Home',
|
|
|
|
|
})
|
|
|
|
|
|
2024-01-29 18:53:57 +08:00
|
|
|
|
// 获取屏幕边界到安全区域距离
|
2025-06-03 17:26:32 +08:00
|
|
|
|
let safeAreaInsets
|
2025-06-13 18:33:25 +08:00
|
|
|
|
let systemInfo
|
|
|
|
|
|
2025-06-03 17:26:32 +08:00
|
|
|
|
// #ifdef MP-WEIXIN
|
|
|
|
|
// 微信小程序使用新的API
|
2025-06-13 18:33:25 +08:00
|
|
|
|
systemInfo = uni.getWindowInfo()
|
2025-06-03 17:26:32 +08:00
|
|
|
|
safeAreaInsets = systemInfo.safeArea
|
|
|
|
|
? {
|
|
|
|
|
top: systemInfo.safeArea.top,
|
|
|
|
|
right: systemInfo.windowWidth - systemInfo.safeArea.right,
|
|
|
|
|
bottom: systemInfo.windowHeight - systemInfo.safeArea.bottom,
|
|
|
|
|
left: systemInfo.safeArea.left,
|
|
|
|
|
}
|
|
|
|
|
: null
|
|
|
|
|
// #endif
|
|
|
|
|
|
|
|
|
|
// #ifndef MP-WEIXIN
|
|
|
|
|
// 其他平台继续使用uni API
|
2025-06-13 18:33:25 +08:00
|
|
|
|
systemInfo = uni.getSystemInfoSync()
|
2025-06-03 17:26:32 +08:00
|
|
|
|
safeAreaInsets = systemInfo.safeAreaInsets
|
|
|
|
|
// #endif
|
2024-01-30 09:55:42 +08:00
|
|
|
|
const author = ref('菲鸽')
|
2024-01-30 16:17:12 +00:00
|
|
|
|
const description = ref(
|
2025-06-21 15:56:51 +08:00
|
|
|
|
'unibest 是一个集成了多种工具和技术的 uniapp 开发模板,由 uniapp + Vue3 + Ts + Vite5 + UnoCss + VSCode 构建,模板具有代码提示、自动格式化、统一配置、代码片段等功能,并内置了许多常用的基本组件和基本功能,让你编写 uniapp 拥有 best 体验。',
|
2024-01-30 16:17:12 +00:00
|
|
|
|
)
|
2024-06-16 16:46:58 +08:00
|
|
|
|
// 测试 uni API 自动引入
|
2024-01-30 09:55:42 +08:00
|
|
|
|
onLoad(() => {
|
2025-05-19 15:57:30 +08:00
|
|
|
|
console.log('项目作者:', author.value)
|
2024-01-30 09:55:42 +08:00
|
|
|
|
})
|
2025-06-20 19:35:31 +08:00
|
|
|
|
|
|
|
|
|
console.log('index')
|
2024-01-24 10:58:03 +08:00
|
|
|
|
</script>
|
2025-06-21 16:56:24 +08:00
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<view class="bg-white px-4 pt-2" :style="{ marginTop: `${safeAreaInsets?.top}px` }">
|
|
|
|
|
<view class="mt-12">
|
|
|
|
|
<image src="/static/logo.svg" alt="" class="mx-auto block h-28 w-28" />
|
|
|
|
|
</view>
|
|
|
|
|
<view class="mt-4 text-center text-4xl text-[#d14328]">
|
|
|
|
|
unibest
|
|
|
|
|
</view>
|
|
|
|
|
<view class="mb-8 mt-2 text-center text-2xl">
|
|
|
|
|
最好用的 uniapp 开发模板
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view class="m-auto mb-2 max-w-100 text-justify indent text-4">
|
|
|
|
|
{{ description }}
|
|
|
|
|
</view>
|
|
|
|
|
<view class="mt-8 text-center">
|
|
|
|
|
当前平台是:
|
|
|
|
|
<text class="text-green-500">
|
|
|
|
|
{{ PLATFORM.platform }}
|
|
|
|
|
</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="mt-4 text-center">
|
|
|
|
|
模板分支是:
|
|
|
|
|
<text class="text-green-500">
|
|
|
|
|
base
|
|
|
|
|
</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|