bobo 3 anni fa
parent
commit
a729c423bd

+ 5 - 2
components/topbar.js

@@ -1,12 +1,15 @@
 // components/topbar.js
 Component({
+    externalClasses: ['topbar-class'],
     /**
      * 组件的属性列表
      */
     properties: {
-
+        title: {
+            type: String,
+            value: ''
+        }
     },
-
     /**
      * 组件的初始数据
      */

+ 3 - 0
components/topbar.wxml

@@ -3,4 +3,7 @@
    <view class="back" catchtap="handleBack">
       <image src="/images/back.png" />
    </view>
+
+   <view class="title">{{title}}</view>
+
 </view>

+ 10 - 0
components/topbar.wxss

@@ -10,8 +10,18 @@
 .topbar .back {
     width: 36rpx;
     height: 36rpx;
+    position: absolute;
+    left: 0;
+    top: 0;
 }
 .topbar .back image {
     width: 20rpx;
     height: 36rpx;
+}
+.topbar .title {
+    width: calc(100vw - 60rpx);
+    height: 100%;
+    text-align: center;
+    font-size: 32rpx;
+    color: #fff;
 }

+ 1 - 4
pages/signIn/activity/activity.wxml

@@ -1,6 +1,6 @@
 <!--pages/signIn/index.wxml-->
 <view wx:if="{{showPage}}">
-<topbar />
+<topbar title="签到中心" topbar-class="colortopbar" />
 <!-- 页面主体 -->
 <view class="sign-scroll-body" style="margin-top:{{navHeight}}px; height: {{bodyHeight}}px;">
     <view class="sign-info-extra">
@@ -91,9 +91,6 @@
    <view class="head-bg">
     <image src="{{activity.themePic}}" />
    </view>
-   <view class="head-bar" style="height:{{navHeight}}px">
-      <view style="margin-top: {{capsuleTop}}px;line-height: {{capHeight}}px;">签到中心</view>
-   </view>
 </view>
 
 

+ 6 - 0
pages/signIn/activity/activity.wxss

@@ -2,6 +2,12 @@
 page {
     background: #EDEDED;
 }
+.colortopbar {
+    color: #fff;
+}
+.colortopbar .title {
+    color: #fff;
+}
 
 .sign-head {
     position: fixed;