|
@@ -10,8 +10,9 @@
|
|
|
<!-- 这里我就直接用文本代替了,返回图标大家自行替换哈 -->
|
|
|
<!-- #ifdef APP-PLUS || H5 -->
|
|
|
<view v-if="isLeft" @click="back()">
|
|
|
- <u-icon name="arrow-left" color="unset"></u-icon>
|
|
|
- {{ leftText }}
|
|
|
+ <u-icon v-if="isPageUp" name="arrow-left" color="unset"></u-icon>
|
|
|
+ <u-icon v-if="!isPageUp" name="home" size="22" color="unset"></u-icon>
|
|
|
+ {{ isPageUp ? '':leftText }}
|
|
|
</view>
|
|
|
<!-- #endif -->
|
|
|
<!-- 这里考虑到微信小程序分享的页面,在页面中不存在上一页面时,直接返回首页。-->
|
|
@@ -106,6 +107,10 @@
|
|
|
isFixed: {
|
|
|
type: Boolean,
|
|
|
default: false
|
|
|
+ },
|
|
|
+ delta: {
|
|
|
+ type: Number,
|
|
|
+ default: 1,
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
@@ -143,15 +148,20 @@
|
|
|
// 返回上一页面
|
|
|
back() {
|
|
|
console.log("返回上一页!")
|
|
|
- uni.navigateBack({
|
|
|
- delta: 1
|
|
|
- })
|
|
|
+ if(this.isPageUp) {
|
|
|
+ uni.navigateBack({
|
|
|
+ delta: this.delta
|
|
|
+ })
|
|
|
+ }else {
|
|
|
+ this.homePage()
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
// 微信小程序返回首页
|
|
|
homePage() {
|
|
|
console.log("返回首页!")
|
|
|
- uni.switchTab({
|
|
|
- url: '/pages/index/index'
|
|
|
+ uni.reLaunch({
|
|
|
+ url: '/pages/main/index'
|
|
|
})
|
|
|
}
|
|
|
}
|