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

Feature/zjx

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