导航栏返回

This commit is contained in:
魏啾
2024-08-03 17:20:39 +08:00
parent 7b7b8ddac3
commit 2a3f125bce
2 changed files with 27 additions and 7 deletions

View File

@@ -58,22 +58,26 @@
type: Boolean, type: Boolean,
default: false default: false
}, },
titleshow: {//标题是否显示 titleshow: { //标题是否显示
type: Boolean, type: Boolean,
default: false default: false
}, },
heightshow: {//是否要占位高度 heightshow: { //是否要占位高度
type: Boolean, type: Boolean,
default: false default: false
}, },
iconshow: {//返回键是否显示 iconshow: { //返回键是否显示
type: Boolean, type: Boolean,
default: true default: true
}, },
iconcolor:{//返回键颜色 iconcolor: { //返回键颜色
type: String, type: String,
default: '#000' default: '#000'
}, },
navigateBacknavtitle: {
type: Boolean,
default: false
}
}, },
computed: { computed: {
HeighT() { //手机类型的尺寸 HeighT() { //手机类型的尺寸
@@ -95,7 +99,11 @@
}) })
}, },
clicknavigateBack() { clicknavigateBack() {
uni.navigateBack() if (this.navigateBacknavtitle) {
this.$emit('navigateBacknav')
} else {
uni.navigateBack()
}
} }
} }

View File

@@ -8,9 +8,11 @@
</view> </view>
<!-- 顶部面板 --> <!-- 顶部面板 -->
<view class="top--panel"> <view class="top--panel">
<navseat :opacity='opacity' :titleshow='true'></navseat> <navseat :opacity='opacity' :titleshow='true' @navigateBacknav='navigateBacknav' :navigateBacknavtitle='true'></navseat>
<!-- 顶部面板可添加所需要放在页面顶部的内容代码比如banner图 --> <!-- 顶部面板可添加所需要放在页面顶部的内容代码比如banner图 -->
<image class="panelimgbackground" :src="shopInfo.storeInfo.coverImg||'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/shopDetails/topBanner.png'" mode="aspectFill"> <image class="panelimgbackground"
:src="shopInfo.storeInfo.coverImg||'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/shopDetails/topBanner.png'"
mode="aspectFill">
</image> </image>
<view class="panelone"> <view class="panelone">
{{ shopInfo.storeInfo.shopName }} {{ shopInfo.storeInfo.shopName }}
@@ -393,6 +395,10 @@
this.fixedtrue = true this.fixedtrue = true
}, },
onShow() { onShow() {
uni.pageScrollTo({
scrollTop: 0,
duration: 0
});
console.log(!uni.cache.get('token')) console.log(!uni.cache.get('token'))
if (!uni.cache.get('token')) { if (!uni.cache.get('token')) {
uni.login({ uni.login({
@@ -427,6 +433,9 @@
} }
}, },
methods: { methods: {
navigateBacknav() {
uni.pro.switchTab('index/index')
},
getQueryString(url, name) { //解码 getQueryString(url, name) { //解码
var reg = new RegExp('(^|&|/?)' + name + '=([^&|/?]*)(&|/?|$)', 'i') var reg = new RegExp('(^|&|/?)' + name + '=([^&|/?]*)(&|/?|$)', 'i')
var r = url.substr(1).match(reg) var r = url.substr(1).match(reg)
@@ -837,6 +846,7 @@
new Promise((resolve, reject) => { new Promise((resolve, reject) => {
let view = uni.createSelectorQuery().selectAll('.main-item'); let view = uni.createSelectorQuery().selectAll('.main-item');
view.boundingClientRect(async data => { view.boundingClientRect(async data => {
console.log(data, 840)
resolve(data); resolve(data);
}).exec(); }).exec();
this.$u.getRect('.scroll-panel').then(res => { this.$u.getRect('.scroll-panel').then(res => {
@@ -955,6 +965,7 @@
font-size: 24rpx; font-size: 24rpx;
color: #999999; color: #999999;
padding: 0 20rpx; padding: 0 20rpx;
.paneltheretext { .paneltheretext {
font-family: Source Han Sans CN, Source Han Sans CN; font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400; font-weight: 400;
@@ -983,6 +994,7 @@
.panelfive { .panelfive {
width: 100%; width: 100%;
padding: 0 20rpx; padding: 0 20rpx;
.panelfive_list { .panelfive_list {
display: flex; display: flex;
} }