Commit b15c7062386ba8425bf2c79d560a612c1f54a17a

Authored by yvan.ni
1 parent b740ad1f

顶部的优化

components/com_top_nav/com_top_nav.js
... ... @@ -15,13 +15,14 @@ Component({
15 15 iurl: os.imghost,
16 16 height:0,
17 17 h1:0,
18   - h2:0
  18 + h2:0,
  19 + user_id:0
19 20 },
20 21 ready: function() {
21 22 let height= getApp().globalData.navBarHeight;
22 23 let menuInfo = getApp().globalData.menuInfo;
23 24 //-- 胶囊的高度 --
24   - this.setData({height,h1:menuInfo.top,h2:menuInfo.height});
  25 + this.setData({height,h1:menuInfo.top,h2:menuInfo.height,user_id:getApp().globalData.user_id});
25 26 },
26 27 methods: {
27 28  
... ...
components/com_top_nav/com_top_nav.wxml
1 1 <cover-view class="t_nav" style="height:{{height}}px;background-color:{{bcolor}};color:{{color}}">
2   - <cover-view style="height:{{h1}}px"></cover-view>
  2 + <cover-view class="tab" style="height:{{h1}}px;">
  3 + ID:{{user_id}}
3 4 <cover-view class="contant" style="height:{{h2}}px">
4 5 <cover-view class="title_set">{{title}}</cover-view>
5   - <cover-view class="tab">ID:454545</cover-view>
6 6 </cover-view>
  7 +
7 8 </cover-view>
8 9 <!-- 用于顶开层的高 -->
9 10 <cover-view style="height:{{height}}px"></cover-view>
10 11 \ No newline at end of file
... ...
components/com_top_nav/com_top_nav.wxss
1 1 .t_nav{ color: #313131; position:fixed;top:0;left:0; width:100%;z-index:9999; background-color: #fff;font-size: 30rpx }
2 2 .title_set{ }
3   -.tab{ font-size:24rpx; position: absolute; right: 24rpx; top:-32rpx }
4   -.contant{ display: flex; justify-content: center; align-items: center; width: 100%; position: relative }
  3 +.tab{ font-size:24rpx; display: flex;;align-items: flex-end;width: 100% }
  4 +.contant{ display: flex; justify-content: center; align-items: center; width: 100%; }
... ...