11
@ -1,91 +0,0 @@
|
||||
<template>
|
||||
<view class="header">
|
||||
<view class="header-content">
|
||||
<view class="left" @click="goBack">
|
||||
<u-icon name="arrow-left" color="#fff" size="36rpx"></u-icon>
|
||||
</view>
|
||||
<view class="center">
|
||||
<text class="title">{{ title }}</text>
|
||||
</view>
|
||||
<view class="right">
|
||||
<!-- 右侧占位 -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
title: {
|
||||
type: String,
|
||||
default: '标题'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
goBack() {
|
||||
let pages = getCurrentPages(); // 获取页面栈
|
||||
console.log("-----pages",pages)
|
||||
if (pages.length > 1) {
|
||||
// 如果页面栈深度大于 1,说明可以返回上一页
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
});
|
||||
} else {
|
||||
// 如果已经是首页,可以选择跳转到某个指定页面或不做任何操作
|
||||
uni.showToast({
|
||||
title: '已经是首页了',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.header {
|
||||
background-color: transparent;
|
||||
/* 蓝色背景 */
|
||||
padding: 20rpx 30rpx;
|
||||
position: fixed;
|
||||
top: 90rpx;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 999;
|
||||
|
||||
.header-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.left {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.back-icon {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.center {
|
||||
flex: 2;
|
||||
text-align: center;
|
||||
|
||||
.title {
|
||||
color: #2e2e2e;
|
||||
font-size: 36rpx;
|
||||
// font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.right {
|
||||
flex: 1;
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -10,6 +10,10 @@
|
||||
"usingComponents" : true,
|
||||
"nvueStyleCompiler" : "uni-app",
|
||||
"compilerVersion" : 3,
|
||||
"permissions": [
|
||||
"camera",
|
||||
"album"
|
||||
],
|
||||
"splashscreen" : {
|
||||
"alwaysShowBeforeRender" : true,
|
||||
"waiting" : true,
|
||||
@ -68,7 +72,13 @@
|
||||
"permission" : {
|
||||
"scope.userLocation" : {
|
||||
"desc" : "你的位置信息将用于获取周边服务"
|
||||
}
|
||||
},
|
||||
"scope.album": {
|
||||
"desc": "需要您的相册权限以便选择图片"
|
||||
},
|
||||
"scope.camera": {
|
||||
"desc": "需要您的相机权限以便拍照"
|
||||
}
|
||||
}
|
||||
},
|
||||
"mp-alipay" : {
|
||||
|
||||
|
Before Width: | Height: | Size: 628 B After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 429 B After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 616 B After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 930 B |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 2.1 KiB |