返回调整
This commit is contained in:
@@ -20,12 +20,13 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(['initWaterMarker', 'logout', 'getConfig']),
|
||||
goto(params) {
|
||||
goto(params, cb) {
|
||||
let {path: url, query: {app}} = this.$route
|
||||
params.query = {app, ...(params.query || {})}
|
||||
uni.navigateTo({
|
||||
url, success: () => {
|
||||
this.$router.push({...params})
|
||||
cb && cb()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
</div>
|
||||
<ai-fixed-btn>
|
||||
<div class="addBtn iconfont iconfont-iconfangda" @tap="gotoAdd()"/>
|
||||
<ai-back btn/>
|
||||
</ai-fixed-btn>
|
||||
</template>
|
||||
<interview-detail v-else/>
|
||||
@@ -46,6 +47,7 @@ import AiImage from "../../components/AiImage";
|
||||
import AiDate from "../../components/AiDate";
|
||||
import AiFixedBtn from "../../components/AiFixedBtn";
|
||||
import InterviewDetail from "./interviewDetail";
|
||||
import AiBack from "../../components/AiBack";
|
||||
|
||||
export default {
|
||||
name: "AppInterview",
|
||||
@@ -53,7 +55,7 @@ export default {
|
||||
inject: {
|
||||
root: {}
|
||||
},
|
||||
components: {InterviewDetail, AiFixedBtn, AiDate, AiImage, AiCard, AiTopFixed, AiSelect},
|
||||
components: {AiBack, InterviewDetail, AiFixedBtn, AiDate, AiImage, AiCard, AiTopFixed, AiSelect},
|
||||
data() {
|
||||
return {
|
||||
search: {title: ""},
|
||||
|
||||
@@ -41,6 +41,7 @@ import AiBack from "../../components/AiBack";
|
||||
export default {
|
||||
name: 'interviewDetail',
|
||||
components: {AiBack, AiTextarea, AiImage, AiUploader},
|
||||
inject: {root: {}},
|
||||
computed: {
|
||||
isEdit() {
|
||||
let flag = this.$route.query?.detail != 1
|
||||
@@ -73,7 +74,7 @@ export default {
|
||||
}).then(res => {
|
||||
if (res?.code == 0) {
|
||||
this.$u.toast("提交成功!")
|
||||
uni.navigateBack()
|
||||
this.root.goto({query: {}})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ export default {
|
||||
})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
onShow() {
|
||||
this.getApps()
|
||||
this.result = {
|
||||
tips: "欢迎进入开发应用",
|
||||
|
||||
Reference in New Issue
Block a user