From 92c15d60b09dcc08d3d6bc02645f5ac95786ce86 Mon Sep 17 00:00:00 2001 From: xiaowen <372193233@qq.com> Date: Fri, 8 Jul 2022 16:09:00 +0800 Subject: [PATCH] no message --- app.js | 19 +++++++++++++++++-- app.json | 2 +- pages/brandSearch/index.js | 19 ++++++++++++++++++- pages/brandSearch/index.json | 1 - pages/brandSearch/index.wxml | 8 +++++--- pages/brandSearch/index.wxss | 12 ++++++------ pages/insight/index.js | 32 ++++---------------------------- pages/insight/index.wxml | 4 +++- pages/insight/index.wxss | 7 ++++--- 9 files changed, 58 insertions(+), 46 deletions(-) diff --git a/app.js b/app.js index 3b8fda9..a15f4cd 100644 --- a/app.js +++ b/app.js @@ -1,7 +1,22 @@ //app.js App({ + onLaunch: function () { + // 展示本地存储能力 + var logs = wx.getStorageSync('logs') || [] + logs.unshift(Date.now()) + wx.setStorageSync('logs', logs) + const systemInfo = wx.getSystemInfoSync(); //获取系统信息 + const menuInfo = wx.getMenuButtonBoundingClientRect(); // 获取胶囊按钮的信息 + this.globalData.menuHeight = menuInfo.height; // 获取胶囊按钮的高 + this.globalData.statusBarHeight = systemInfo.statusBarHeight; // 获取状态栏的高 + this.globalData.menuRight = menuInfo.right; // 获取胶囊按钮的距离屏幕最右边的距离(此处用于设置导航栏左侧距离屏幕的距离) + this.globalData.navBarHeight = (menuInfo.top - systemInfo.statusBarHeight) * 2 + menuInfo.height; // 计算出导航栏的高度 + }, globalData: { - imageUrl: "https://cdn.sws010.com/wxapp/images" - + imageUrl: "https://cdn.sws010.com/wxapp/images", + navBarHeight:0,// 导航栏高度 + menuHeight:0,//胶囊按钮 高度 + statusBarHeight:0,//状态栏高度 + menuRight:0,//胶囊按钮 距离屏幕右边的距离 } }) \ No newline at end of file diff --git a/app.json b/app.json index 2fbbdb7..1389fcc 100644 --- a/app.json +++ b/app.json @@ -22,7 +22,7 @@ "window": { "backgroundTextStyle": "light", "navigationBarBackgroundColor": "#006BFF", - "navigationBarTitleText": "硕为思汽车智能洞查", + "navigationBarTitleText": "硕为思汽车智能洞察", "navigationBarTextStyle": "white" }, "tabBar": { diff --git a/pages/brandSearch/index.js b/pages/brandSearch/index.js index 1130104..0087a5c 100644 --- a/pages/brandSearch/index.js +++ b/pages/brandSearch/index.js @@ -1,10 +1,13 @@ // index.js - +const app = getApp(); Page({ data: { value: "", tabActive: 0, active: 1, + height:app.globalData.navBarHeight + app.globalData.statusBarHeight, + statusBarHeight:app.globalData.statusBarHeight, + navBarHeight:app.globalData.navBarHeight, navData: [ { img: "./cars/audi.jpg", @@ -36,7 +39,21 @@ Page({ } ] }, + onLaunch() { + wx.getSystemInfo({ + success: (res) => { + const ratio = 750 / res.windowWidth + const menuInfo = wx.getMenuButtonBoundingClientRect(); + this.setData({ + top: menuInfo.top * ratio , + left: menuInfo.left * ratio , + height: menuInfo.height * ratio , + }) + } + }) + }, onShow() { this.getTabBar().init(); }, + }); diff --git a/pages/brandSearch/index.json b/pages/brandSearch/index.json index a40e049..0400296 100644 --- a/pages/brandSearch/index.json +++ b/pages/brandSearch/index.json @@ -2,6 +2,5 @@ "usingComponents": { }, - "component": true, "navigationStyle": "custom" } \ No newline at end of file diff --git a/pages/brandSearch/index.wxml b/pages/brandSearch/index.wxml index ecf2b77..2e4dbb4 100644 --- a/pages/brandSearch/index.wxml +++ b/pages/brandSearch/index.wxml @@ -1,6 +1,8 @@ - - 硕为思汽车智能洞查 + + + + 硕为思汽车智能洞察 @@ -14,7 +16,7 @@ - + diff --git a/pages/brandSearch/index.wxss b/pages/brandSearch/index.wxss index ed6f949..593091e 100644 --- a/pages/brandSearch/index.wxss +++ b/pages/brandSearch/index.wxss @@ -4,10 +4,11 @@ background: #fff; } .bs-top-title { - text-align: center; + display: flex; + justify-content: center; + align-items: center; color: #fff; - font-size: 28rpx; - padding-top: 60rpx; + font-size: 34rpx; } .nav-top { position: fixed; @@ -25,7 +26,6 @@ background: #006BFF; padding-left: 13rpx; padding-right: 13rpx; - padding-top: 10rpx; } .bs-item { display: flex; @@ -42,7 +42,7 @@ } .bs-block { position: relative; - height: 370rpx; + height: 395rpx; } .bs-bar { position: relative; @@ -52,7 +52,7 @@ background: #F9F9F9; } .bs-bar .van-index-bar__sidebar { - top: 810rpx !important; + top: 63% !important; } /*横向列表项*/ .bs-tabs { diff --git a/pages/insight/index.js b/pages/insight/index.js index c15ec2a..5360b80 100644 --- a/pages/insight/index.js +++ b/pages/insight/index.js @@ -1,35 +1,11 @@ // index.js -const words = [ - ["江南", 1], - ["乌镇", 2], - ["儿时", 20], - ["入园", 8], - ["长大", 9], - ["happy", 10], - ["音乐喷泉", 1], - ["门票", 33], - ["江南", 1], - ["乌镇", 2], - ["玩耍", 12], - ["风景", 4], - ["六月", 5], - ["江南", 1], - ["乌镇", 2], - ["儿时", 20], - ["入园", 8], - ["长大", 9], - ["happy", 10], - ["音乐喷泉", 1], - ["门票", 33], - ["江南", 1], - ["乌镇", 2], - ["玩耍", 12], - ["风景", 4], - ["六月", 5] -] +const app = getApp(); Page({ data: { active: 0, + height:app.globalData.navBarHeight + app.globalData.statusBarHeight, + statusBarHeight:app.globalData.statusBarHeight, + navBarHeight:app.globalData.navBarHeight, navData: [{ text: '品牌洞察', component: 'data-child' diff --git a/pages/insight/index.wxml b/pages/insight/index.wxml index cec548e..66380b4 100644 --- a/pages/insight/index.wxml +++ b/pages/insight/index.wxml @@ -1,6 +1,8 @@ - 硕为思汽车智能洞察 + + + 硕为思汽车智能洞察 diff --git a/pages/insight/index.wxss b/pages/insight/index.wxss index b7e42a9..cfb40e6 100644 --- a/pages/insight/index.wxss +++ b/pages/insight/index.wxss @@ -4,10 +4,11 @@ background: #fff; } .bs-top-title { - text-align: center; + display: flex; + justify-content: center; + align-items: center; color: #fff; - font-size: 14px; - padding-top: 30px; + font-size: 34rpx; } .nav-top { position: fixed;