Spaces:
Sleeping
Sleeping
Trae Assistant commited on
Commit ·
f62f528
1
Parent(s): 7897a78
style: optimize H5 layout and update README
Browse files- README.md +13 -7
- src/App.vue +25 -17
README.md
CHANGED
|
@@ -1,17 +1,23 @@
|
|
| 1 |
---
|
| 2 |
-
title: UniApp多平台小程序
|
| 3 |
-
emoji:
|
| 4 |
colorFrom: blue
|
| 5 |
-
colorTo:
|
| 6 |
sdk: docker
|
| 7 |
app_port: 7860
|
| 8 |
-
short_description: UniApp多平台小程序
|
| 9 |
---
|
| 10 |
|
| 11 |
-
# UniApp 多平台小程序
|
| 12 |
|
| 13 |
-
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
## 功能特性
|
| 17 |
- 🚀 **一套代码,多端运行**:支持微信、支付宝、百度、抖音、QQ、H5 等平台。
|
|
|
|
| 1 |
---
|
| 2 |
+
title: UniApp 多平台小程序通用模版
|
| 3 |
+
emoji: 📱
|
| 4 |
colorFrom: blue
|
| 5 |
+
colorTo: indigo
|
| 6 |
sdk: docker
|
| 7 |
app_port: 7860
|
| 8 |
+
short_description: UniApp 多平台小程序通用模版
|
| 9 |
---
|
| 10 |
|
| 11 |
+
# 🚀 UniApp 多平台小程序通用模版
|
| 12 |
|
| 13 |
+
基于 **UniApp + Vue3 + TypeScript** 构建的多平台小程序开发模版。一套代码实现全端覆盖,支持微信、支付宝、百度、抖音、QQ、H5 等主流平台。
|
| 14 |
+
|
| 15 |
+
## ✨ 项目特色
|
| 16 |
+
- 🌈 **全端覆盖**:极致的代码复用率,一套代码发布到所有小程序平台及 H5。
|
| 17 |
+
- 🎨 **精美 UI**:内置现代化卡片式布局,适配多种屏幕尺寸,提供丝滑的用户交互体验。
|
| 18 |
+
- 🌍 **全中文支持**:项目界面、系统提示、代码注释全部汉化,零门槛快速上手。
|
| 19 |
+
- 🛠️ **工程化实践**:采用 Vue3 Composition API + TS,支持 SCSS 预处理,代码结构严谨、易于维护。
|
| 20 |
+
- 🐳 **云端就绪**:预置 Docker 镜像配置,支持在 Hugging Face Spaces 等云平台一键部署。
|
| 21 |
|
| 22 |
## 功能特性
|
| 23 |
- 🚀 **一套代码,多端运行**:支持微信、支付宝、百度、抖音、QQ、H5 等平台。
|
src/App.vue
CHANGED
|
@@ -11,37 +11,45 @@ onHide(() => {
|
|
| 11 |
});
|
| 12 |
</script>
|
| 13 |
<style lang="scss">
|
| 14 |
-
/* H5 网页限制最大宽度并居中 */
|
| 15 |
/* #ifdef H5 */
|
| 16 |
-
uni-page-body,
|
| 17 |
body {
|
| 18 |
-
|
| 19 |
-
justify-content: center;
|
| 20 |
-
background-color: #f0f0f0 !important; /* 背景灰色,突出手机显示区域 */
|
| 21 |
}
|
| 22 |
|
| 23 |
-
|
| 24 |
-
|
|
|
|
| 25 |
margin: 0 auto !important;
|
| 26 |
box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
|
| 27 |
background-color: #fff;
|
| 28 |
min-height: 100vh;
|
|
|
|
|
|
|
| 29 |
}
|
| 30 |
|
| 31 |
-
/*
|
| 32 |
uni-page-head {
|
| 33 |
-
max-width:
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
right: 0 !important;
|
| 37 |
}
|
| 38 |
|
| 39 |
-
/*
|
| 40 |
uni-tabbar {
|
| 41 |
-
max-width:
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
}
|
| 46 |
/* #endif */
|
| 47 |
</style>
|
|
|
|
| 11 |
});
|
| 12 |
</script>
|
| 13 |
<style lang="scss">
|
| 14 |
+
/* H5 网页全局布局优化:限制最大宽度并居中 */
|
| 15 |
/* #ifdef H5 */
|
|
|
|
| 16 |
body {
|
| 17 |
+
background-color: #f5f5f5 !important; /* 外部背景色 */
|
|
|
|
|
|
|
| 18 |
}
|
| 19 |
|
| 20 |
+
/* 限制应用根容器宽度 */
|
| 21 |
+
uni-app {
|
| 22 |
+
max-width: 450px !important;
|
| 23 |
margin: 0 auto !important;
|
| 24 |
box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
|
| 25 |
background-color: #fff;
|
| 26 |
min-height: 100vh;
|
| 27 |
+
position: relative;
|
| 28 |
+
overflow-x: hidden;
|
| 29 |
}
|
| 30 |
|
| 31 |
+
/* 头部导航栏居中限制宽度 */
|
| 32 |
uni-page-head {
|
| 33 |
+
max-width: 450px !important;
|
| 34 |
+
left: 50% !important;
|
| 35 |
+
transform: translateX(-50%) !important;
|
|
|
|
| 36 |
}
|
| 37 |
|
| 38 |
+
/* 底部 TabBar 居中限制宽度 */
|
| 39 |
uni-tabbar {
|
| 40 |
+
max-width: 450px !important;
|
| 41 |
+
left: 50% !important;
|
| 42 |
+
transform: translateX(-50%) !important;
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
/* 内容区域背景色 */
|
| 46 |
+
uni-page-wrapper {
|
| 47 |
+
background-color: #fff !important;
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
/* 解决某些浏览器可能出现的滚动条溢出问题 */
|
| 51 |
+
html {
|
| 52 |
+
overflow-x: hidden;
|
| 53 |
}
|
| 54 |
/* #endif */
|
| 55 |
</style>
|