init: initial commit
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
const { getLayout } = require('../../utils/layout');
|
||||
Component({
|
||||
properties: { title: String, back: Boolean },
|
||||
data: { statusBarHeight: 20, barHeight: 44, navSide: 100 },
|
||||
lifetimes: { attached: function() { this.setData(getLayout()); } },
|
||||
pageLifetimes: { resize: function() { this.setData(getLayout()); } },
|
||||
methods: { goBack: function() {
|
||||
this.triggerEvent('back');
|
||||
if (getCurrentPages().length > 1) wx.navigateBack();
|
||||
else wx.reLaunch({ url: '/pages/index/index' });
|
||||
} }
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
{"component":true}
|
||||
@@ -0,0 +1,6 @@
|
||||
<view class="nav" style="padding-top:{{statusBarHeight}}px;">
|
||||
<view class="bar" style="height:{{barHeight}}px;padding:0 {{navSide}}px;">
|
||||
<view wx:if="{{back}}" class="back" bindtap="goBack" aria-label="返回"><image src="/images/back.svg" /></view>
|
||||
<text class="title">{{title}}</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1 @@
|
||||
.nav{position:fixed;top:0;left:0;right:0;z-index:900;background:#FAF5EE;box-sizing:border-box}.bar{position:relative;display:flex;align-items:center;justify-content:center;box-sizing:border-box}.title{font-size:32rpx;font-weight:600;color:#352E2A;white-space:nowrap}.back{position:absolute;left:20rpx;top:0;bottom:0;width:80rpx;display:flex;align-items:center;justify-content:center}.back image{width:36rpx;height:36rpx}
|
||||
Reference in New Issue
Block a user