提交 4484958c 编写于 作者: donghuawangliang0612's avatar donghuawangliang0612

试算返回修改

上级 631440a3
import Vue from 'vue'
/**
* 定义空的vue实例,作为 goBackEntity实现非父子组件之间的通信(vue2.x中去掉了broadcast)
*/
var goBackEntity = new Vue({});
export default goBackEntity;
......@@ -79,6 +79,7 @@ import {Component, Prop, Vue} from "vue-property-decorator";
import router from "@/router";
import VueRouter, { Route, RouteConfig } from "vue-router";
import {RouteMeta} from "vue-router/types/router";
import eventBus from "@/services/goBackEntity";
Vue.use(VueRouter);
@Component({
name: "CountResult",
......@@ -134,12 +135,14 @@ export default class CountResult extends Vue{
this.$router.back();
}
returnCountReset() {
this.$router.push({
name: "DepositInterestTrial",
params: {
reset: "1",
},
});
// this.$router.push({
// name: "DepositInterestTrial",
// params: {
// reset: "1",
// },
// });
eventBus.$emit("reset",-1);
this.$router.back();
}
toSeeRepayPlan() {
window.localStorage.setItem("result",this.result);
......
......@@ -63,6 +63,7 @@
<script lang="ts">
import {Component, Prop, Vue} from "vue-property-decorator";
import eventBus from "@/services/goBackEntity"
@Component({
name: "CountResultB",
})
......@@ -77,17 +78,20 @@ export default class CountResultB extends Vue{
titleName="试算结果";
titleflag=true;
returnCount() {
this.$router.push({
name: "DepositInterestTrial",
});
// this.$router.push({
// name: "DepositInterestTrial",
// });
this.$router.back();
}
returnCountReset() {
this.$router.push({
name: "DepositInterestTrial",
params: {
reset: "1",
},
});
eventBus.$emit("reset",-1);
// this.$router.push({
// name: "DepositInterestTrial",
// params: {
// reset: "1",
// },
// });
this.$router.back();
}
mounted() {
this.saveType = this.$route.params.saveType;
......
......@@ -196,6 +196,7 @@
import {Component, Vue} from "vue-property-decorator";
import {Test} from "@/views/DepositInterestTrial/Test";
import {Toast} from "vant";
import eventBus from "@/services/goBackEntity"
@Component({
name: "DepositInterestTrial",
})
......@@ -405,10 +406,18 @@ export default class DepositInterestTrial extends Vue{
});
}
activated(){
if(this.$route.params.reset=="1"){
eventBus.$on("reset",function (data){
console.log("@#######@@#@#@#@"+data);
if(data==-1){
this.clearData();
this.clearDataB();
}
}.bind(this));
// if(this.$route.params.reset=="1"){
// this.clearData();
// this.clearDataB();
// }
}
}
</script>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册