This commit is contained in:
2020-09-04 17:29:45 +08:00
parent 377f3b080a
commit 83eb365628
12 changed files with 745 additions and 26 deletions

View File

@@ -21,6 +21,10 @@ const store = new Vuex.Store({
showLoginModel: false, // 登录框
question: {}, // 帮助与反馈
showCoupons: true, // 是否显示新人领取优惠券
invoiceInfo: { // 是否选择发票
invoice_type: '',
invoice_id: 0,
}
},
getters: {
getOrderAddress(state) {
@@ -31,8 +35,15 @@ const store = new Vuex.Store({
},
getGoodsInfo(state) {
return state.goodsDetails.goods;
},
hasInvoice(state) {
const type = state.invoiceInfo.invoice_type;
return type ? type : 0;
},
getInvoiceId(state) {
return state.invoiceInfo.invoice_id || 0;
}
},
},
mutations: {
// 登录
loginIn(state, token) {
@@ -83,6 +94,9 @@ const store = new Vuex.Store({
},
updateShowCoupons(state, status) {
state.showCoupons = status;
},
setInvoiceInfo(state, invoice = {}) {
state.invoiceInfo = invoice;
}
}
})