导航栏返回

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,
default: false
},
titleshow: {//
titleshow: { //
type: Boolean,
default: false
},
heightshow: {//
heightshow: { //
type: Boolean,
default: false
},
iconshow: {//
iconshow: { //
type: Boolean,
default: true
},
iconcolor:{//
iconcolor: { //
type: String,
default: '#000'
},
navigateBacknavtitle: {
type: Boolean,
default: false
}
},
computed: {
HeighT() { //
@ -95,7 +99,11 @@
})
},
clicknavigateBack() {
uni.navigateBack()
if (this.navigateBacknavtitle) {
this.$emit('navigateBacknav')
} else {
uni.navigateBack()
}
}
}

View File

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