diff --git a/src/stores/index.ts b/src/stores/index.ts index 4def054c866982cbecd46fc4ab09c7bf2543eb5a..6ea67098b29cdec7c41b6a774668e3dcd1d6d4ca 100644 --- a/src/stores/index.ts +++ b/src/stores/index.ts @@ -6,6 +6,8 @@ * @FilePath: \mcep-h5\src\stores\index.ts * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ +import CountResultStore from "@/stores/modules/CountResultStore.module"; + export * from "./token.store"; export * from "./user.store"; import dict from "@/services/dict.service"; @@ -16,7 +18,7 @@ Vue.use(Vuex); export default new Vuex.Store({ modules: { - + CountResultStore, } }); diff --git a/src/stores/modules/CountResultStore.module.ts b/src/stores/modules/CountResultStore.module.ts new file mode 100644 index 0000000000000000000000000000000000000000..9c908e0ef4c5b8a24f7dbaaabed517943ee169ee --- /dev/null +++ b/src/stores/modules/CountResultStore.module.ts @@ -0,0 +1,28 @@ + +const state = { + resultData:{} +}; +const mutations = { + setResultData: (state: any, resultData: any) => { + state.resultData = resultData + }, + +}; +const actions = { + setResultData({ commit }: any, params: any) { + commit("setApproveParams", params); + }, + +}; +const getters = { + getResultData: (state: any) => { + return state.resultData; + }, + +}; +export default { + state, + mutations, + actions, + getters +}; diff --git a/src/stores/modules/tsts.module.ts b/src/stores/modules/tsts.module.ts deleted file mode 100644 index 3ae7e390911a01376eecb3a5d8264df600bc673a..0000000000000000000000000000000000000000 --- a/src/stores/modules/tsts.module.ts +++ /dev/null @@ -1,37 +0,0 @@ -const state = { - questionAnswerObj: {}, - faceSignInfo: {}, - imageFileObj: [] -}; -const mutations = { - setQuestionAnswerObj: (state: any, questionAnswerObj: any) => { - state.questionAnswerObj = questionAnswerObj - }, - setFaceSignInfo: (state: any, faceSignListInfo: any) =>{ - state.faceSignInfo = faceSignListInfo - }, - setImageFileObj: (state: any, imageFileObj: any) =>{ - state.imageFileObj = imageFileObj - }, - addImageFileObj: (state: any, imageFileObj: any) =>{ - state.imageFileObj.push(imageFileObj); - } -}; -const actions = {}; -const getters = { - getQuestionAnswerObj: (state: any) => { - return state.questionAnswerObj; - }, - getFaceSignInfo: (state: any) => { - return state.faceSignInfo; - }, - getImageFileObj: (state: any) => { - return state.imageFileObj; - } -}; -export default { - state, - mutations, - actions, - getters -}; diff --git a/src/views/DepositInterestTrial/CountResult.vue b/src/views/DepositInterestTrial/CountResult.vue index 2f662994103d998baaaa5aed88af46e2412cf2dc..a715f052f17238e92c09fdd3d49ae34fe8046846 100644 --- a/src/views/DepositInterestTrial/CountResult.vue +++ b/src/views/DepositInterestTrial/CountResult.vue @@ -70,6 +70,7 @@ Vue.use(VueRouter); name: "CountResult", }) export default class CountResult extends Vue{ + resultData:any={}; flag=true; resultPlus:any=""; result:any=""; @@ -98,23 +99,33 @@ export default class CountResult extends Vue{ //router.beforeEach((to,from,next) => {}); //beforeRouteLeave(to:any,from,next){} created() { - this.result = window.localStorage.getItem("result"); + /*this.result = window.localStorage.getItem("result"); this.loanAmt= window.localStorage.getItem("loanAmt"); this.resultPlus=window.localStorage.getItem("resultPlus"); this.loanRate=window.localStorage.getItem("loanRate"); this.loanTime=window.localStorage.getItem("loanTime"); - this.repayType=window.localStorage.getItem("repayType"); + this.repayType=window.localStorage.getItem("repayType");*/ + let getStoreData = this.$store.getters["CountResultStore/getResultData"]; + console.log("获取到getStoreData的数据"); + console.log(getStoreData); } returnCount() { this.$router.back(); } toSeeRepayPlan() { - window.localStorage.setItem("result",this.result); + /* window.localStorage.setItem("result",this.result); window.localStorage.setItem("loanAmt",this.loanAmt); window.localStorage.setItem("resultPlus",this.resultPlus); window.localStorage.setItem("loanRate",this.loanRate); window.localStorage.setItem("loanTime",this.loanTime); - window.localStorage.setItem("repayType",this.repayType); + window.localStorage.setItem("repayType",this.repayType);*/ + this.resultData.result = this.result; + this.resultData.loanAmt = this.loanAmt; + this.resultData.resultPlus = this.resultPlus; + this.resultData.loanRate = this.loanRate; + this.resultData.loanTime = this.loanTime; + this.resultData.repayType = this.repayType; + this.$store.commit("CountResultStore/setResultData",this.resultData); this.$router.push({ name: "RepayPlan", });