dev
xiaowen 3 years ago
parent e6c12336cd
commit 92c15d60b0

@ -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,//胶囊按钮 距离屏幕右边的距离
}
})

@ -22,7 +22,7 @@
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#006BFF",
"navigationBarTitleText": "硕为思汽车智能洞",
"navigationBarTitleText": "硕为思汽车智能洞",
"navigationBarTextStyle": "white"
},
"tabBar": {

@ -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();
},
});

@ -2,6 +2,5 @@
"usingComponents": {
},
"component": true,
"navigationStyle": "custom"
}

@ -1,6 +1,8 @@
<view class="view-page">
<view class="navigation nav-top" style="background: #006BFF">
<view class="bs-top-title">硕为思汽车智能洞查</view>
<view class="navigation nav-top" style="background: #006BFF;">
<!--手机状态栏的高度-->
<view style="height:{{statusBarHeight}}px;width: 100%;"></view>
<view class="bs-top-title" style="height: {{navBarHeight}}px;width: 100%;">硕为思汽车智能洞察</view>
<view class="bs-top">
<van-search style="width: 100%;" background="#006BFF" value="{{ value }}" placeholder="请输入品牌" />
</view>
@ -14,7 +16,7 @@
</view>
</view>
<view class="bs-block"></view>
<van-index-bar class="bs-bar" sticky-offset-top="178">
<van-index-bar class="bs-bar" sticky-offset-top="196">
<view>
<van-index-anchor index="A" />
<view class="bs-item">

@ -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 {

@ -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'

@ -1,6 +1,8 @@
<view class="view-page">
<view class="navigation nav-top" style="background: #006BFF">
<view class="bs-top-title">硕为思汽车智能洞察</view>
<!--手机状态栏的高度-->
<view style="height:{{statusBarHeight}}px;width: 100%;"></view>
<view class="bs-top-title" style="height: {{navBarHeight}}px;width: 100%;">硕为思汽车智能洞察</view>
<van-tabs class="menu-tabs" active="{{ active }}">
<van-tab wx:for="{{navData}}" title="{{item.text}}" wx:key="index">
</van-tab>

@ -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;

Loading…
Cancel
Save