From 90c6eb32f9c3abdf2d1c91dc7c255a55c95b8ca7 Mon Sep 17 00:00:00 2001 From: xuyonghao <898441624@qq.com> Date: 星期二, 11 二月 2025 17:27:21 +0800 Subject: [PATCH] 适配微信小程序 --- static/index/u3.jpg | 0 manifest.json | 11 ++++- pages.json | 10 ++-- .hbuilderx/launch.json | 32 +++++++++------- pages/index/index.vue | 63 ++++++++++++++++++++++++++++--- 5 files changed, 88 insertions(+), 28 deletions(-) diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json index 07c1d5f..731ff07 100644 --- a/.hbuilderx/launch.json +++ b/.hbuilderx/launch.json @@ -1,16 +1,20 @@ -{ // launch.json 閰嶇疆浜嗗惎鍔ㄨ皟璇曟椂鐩稿叧璁剧疆锛宑onfigurations涓嬭妭鐐瑰悕绉板彲涓� app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/ - // launchtype椤瑰彲閰嶇疆鍊间负local鎴杛emote, local浠h〃鍓嶇杩炴湰鍦颁簯鍑芥暟锛宺emote浠h〃鍓嶇杩炰簯绔簯鍑芥暟 - "version": "0.0", - "configurations": [{ - "default" : - { - "launchtype" : "local" - }, - "h5" : - { - "launchtype" : "local" - }, - "type" : "uniCloud" - } +{ + // launch.json 閰嶇疆浜嗗惎鍔ㄨ皟璇曟椂鐩稿叧璁剧疆锛宑onfigurations涓嬭妭鐐瑰悕绉板彲涓� app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/ + // launchtype椤瑰彲閰嶇疆鍊间负local鎴杛emote, local浠h〃鍓嶇杩炴湰鍦颁簯鍑芥暟锛宺emote浠h〃鍓嶇杩炰簯绔簯鍑芥暟 + "version" : "0.0", + "configurations" : [ + { + "default" : { + "launchtype" : "local" + }, + "h5" : { + "launchtype" : "local" + }, + "type" : "uniCloud" + }, + { + "playground" : "standard", + "type" : "uni-app:app-android" + } ] } diff --git a/manifest.json b/manifest.json index 134c087..c635e95 100644 --- a/manifest.json +++ b/manifest.json @@ -100,9 +100,16 @@ "mp-weixin" : { "appid" : "", "setting" : { - "urlCheck" : false + "urlCheck" : false, + "postcss" : false, + "es6" : false }, - "usingComponents" : true + "usingComponents" : true, + "permission" : { + "scope.userLocation" : { + "desc" : "111" + } + } }, "mp-alipay" : { "usingComponents" : true diff --git a/pages.json b/pages.json index b7f4982..d1cc8d1 100644 --- a/pages.json +++ b/pages.json @@ -17,7 +17,7 @@ "path" : "pages/parking/parking", "style" : { "navigationBarTitleText":"鎵惧仠杞︿綅", - "navigationBarBackgroundColor":"white", + "navigationBarBackgroundColor":"#ffffff", "enablePullDownRefresh": true } } @@ -25,7 +25,7 @@ "path" : "pages/addCar/addCar", "style" : { "navigationBarTitleText":"娣诲姞杞﹁締", - "navigationBarBackgroundColor":"white" + "navigationBarBackgroundColor":"#ffffff" } } ,{ @@ -44,7 +44,7 @@ "path" : "pages/login/login", "style" : { "navigationBarTitleText":"鐧诲綍", - "navigationBarBackgroundColor":"white" + "navigationBarBackgroundColor":"#ffffff" } } ,{ @@ -57,14 +57,14 @@ // "path" : "pages/parkDetail/parkDetail", // "style" : { // "navigationBarTitleText":"杞﹀簱璇︽儏", - // "navigationBarBackgroundColor":"white" + // "navigationBarBackgroundColor":"#ffffff" // } // } ,{ "path" : "pages/parkInfo/parkInfo", "style" : { "navigationBarTitleText":"杞﹀簱璇︽儏", - "navigationBarBackgroundColor":"white", + "navigationBarBackgroundColor":"#ffffff", "enablePullDownRefresh": true } } diff --git a/pages/index/index.vue b/pages/index/index.vue index 109d24e..bfc12f6 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -1,9 +1,13 @@ <template> +<view> + <view class="topNav" :style="{height:navHeight+'px',paddingTop:statusBarHeight+'px'}"> + <uni-icons class= "user-button" type="contact" size="26" color="#fff" @click="toMine"></uni-icons> + <view class="nav"> + <text class="nav-title">鍖椾含甯傝偛鑻变腑瀛�</text> + </view> + </view> <view class="content"> <view class="header_bg"> - <uniNavBar title="鍖椾含甯傝偛鑻变腑瀛�" class="header-bar" background-color="transparent" right-icon="contact" color="#fff" - @clickRight="toMine"> - </uniNavBar> <div class="header-info"> <div class="left"> <div class="weather-info"> @@ -56,6 +60,7 @@ </div> </view> --> </view> +</view> </template> <script> @@ -78,6 +83,8 @@ update: false, version:'', timerId:'', + navHeight: '', + statusBarHeight: '', } }, computed: { @@ -128,7 +135,13 @@ }, onLoad() { - + let { + statusBarHeight, + system + } = uni.getSystemInfoSync() + this.statusBarHeight = statusBarHeight + this.navHeight = statusBarHeight + (system.indexOf('iOS') > -1 ? 40 : 44) + console.log(this.navHeight, "瀵艰埅鏍忛珮搴�"); }, onPullDownRefresh(){ console.log("refresh"); @@ -181,6 +194,37 @@ </script> <style lang="scss"> + .topNav { + height: 100rpx; + background-color: #2894FF; + display: flex; + justify-content: flex-start; + align-items: center; + padding: 0 20rpx; + box-sizing: border-box; + position: relative; + } + .nav { + font-size: 36rpx; + font-weight: 600; + color: #fff; + margin-right: 30rpx; + position: absolute; + left: 50%; + transform: translateX(-50%); + } + .nav-search input { + width: 60%; + height: 62rpx; + border-radius: 30rpx; + padding-left: 25rpx; + background-color: #f0f8ffa6; + box-sizing: border-box; + } + .placClass { + font-size: 24rpx; + color: #fff; + } .content { display: flex; flex-direction: column; @@ -191,9 +235,10 @@ .header_bg { width: 100%; height: 500rpx; - background: url(../../static/index/u3.jpg) no-repeat; - background-size: 100% 100%; - background-position: left top; + background-image: url('../../static/index/u3.jpg'); + background-size: cover; + background-position: center; + .header-bar { /deep/.uni-navbar--border { border-bottom: none; @@ -380,4 +425,8 @@ display: flex; justify-content: center; } + + .user-button { + margin-right: auto; + } </style> diff --git a/static/index/u3.jpg b/static/index/u3.jpg index cccc6b9..5b5d9b8 100644 --- a/static/index/u3.jpg +++ b/static/index/u3.jpg Binary files differ -- Gitblit v1.8.0