提交 b223b97e 编写于 作者: zhangwen's avatar zhangwen

新增store

上级 fd719dee
......@@ -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,
}
});
......
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
};
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
};
......@@ -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",
});
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册