返回调整
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
<template>
|
||||
<ai-fixed-btn v-if="!isTopPage||custom">
|
||||
<div v-if="btn" class="AiBack" @click.stop="back">
|
||||
<img :src="$cdn + 'home/back.png'" alt="">
|
||||
<text>返回</text>
|
||||
</div>
|
||||
<ai-fixed-btn v-else-if="!isTopPage||custom">
|
||||
<div class="AiBack" @click.stop="back">
|
||||
<img :src="$cdn + 'home/back.png'" alt="">
|
||||
<text>返回</text>
|
||||
@@ -12,6 +16,7 @@ import AiFixedBtn from "./AiFixedBtn";
|
||||
export default {
|
||||
name: "AiBack",
|
||||
components: {AiFixedBtn},
|
||||
inject: {root: {}},
|
||||
props: {
|
||||
delta: {
|
||||
type: Number,
|
||||
@@ -28,6 +33,7 @@ export default {
|
||||
},
|
||||
custom: Boolean,
|
||||
visible: Boolean,
|
||||
btn: Boolean
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -36,20 +42,14 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
back() {
|
||||
if (this.visible)
|
||||
if (this.visible) {
|
||||
return this.$parent.$emit(this.eventName, this.data)
|
||||
|
||||
if (this.custom) {
|
||||
} else if (this.custom) {
|
||||
this.$emit("back")
|
||||
} else uni.navigateBack({
|
||||
delta: this.delta,
|
||||
success: () => {
|
||||
if (this.eventName != '') {
|
||||
uni.$emit(this.eventName, this.data)
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error(err)
|
||||
} else if (this.custom) {
|
||||
} else this.root.goto({}, () => {
|
||||
if (this.eventName != '') {
|
||||
uni.$emit(this.eventName, this.data)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user