提交 e67b3b04 编写于 作者: 张敬贤's avatar 张敬贤

Feature/zjx

上级 9c5ec883
......@@ -3,12 +3,16 @@ import store from 'storejs';
export default {
namespaced: true,
state: {
insuranceInfo: {}
insuranceInfo: {},
orderInfo:{}
},
mutations: {
// 存值
SET_INSURANCE_INFO(state, val = {}) {
state.insuranceInfo += val;
state.insuranceInfo = val;
},
SET_ORDER_INFO(state, val = {}) {
state.orderInfo = val;
}
},
actions: {
......@@ -17,12 +21,22 @@ export default {
commit('SET_INSURANCE_INFO', data);
store.set('insuranceInfo', data);
},
setOrderInfo({commit}, data) {
commit('SET_ORDER_INFO', data);
console.log('SET_ORDER_INFO', data);
store.set('orderInfo', data);
},
},
getters: {
// 获取 insuranceInfo 的值
insuranceInfo: state => {
const insuranceInfo = state.insuranceInfo.id ? state.insuranceInfo : store.get('insuranceInfo');
return insuranceInfo || {};
},
// 获取 订单详情 的值
orderInfo: state => {
const orderInfo = state.orderInfo.yunOrderNo ? state.orderInfo : store.get('orderInfo');
return orderInfo || {};
}
}
};
......@@ -386,7 +386,7 @@ export default {
this.dectionData = dectionData;
this.dectionForm.detectName = dectionData.detectionName;
this.dectionForm.goodsId = dectionData.goodsId;
this.$store.dispatch('setInsuranceInfo', dectionData);
this.$store.dispatch('home/setInsuranceInfo', dectionData);
}
});
......@@ -398,6 +398,7 @@ export default {
this.dectionForm.beneficiaryName = res.data.beneficiaryName;
this.dectionForm.beneficiaryPhone = res.data.beneficiaryPhone;
this.dectionForm.beneficiaryIdNum = res.data.beneficiaryIdNum;
this.$store.dispatch('home/setOrderInfo', res.data);
});
},
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册