|
|
import Vue from 'vue'; import Vuex from 'vuex'; import add from './modules/add'; import user from './modules/user'; import getters from './getters';
Vue.use(Vuex);
const store = new Vuex.Store({ state: { currentSchool: '', userInfo: {}, latLng: {}, classChooseItem: {}, pdfUrl: '', webViewUrl: '', havePay: 0, //tabbar 页面是否显示报错小图标
currentMyMsg: {}, billPrice: 0, //开发票的id
TrainingOrderId: '', //退款流程里的驾校id
bankInfo: { realName: uni.getStorageSync('userInfo').realName, phoneCode: '' }, chooseCoachItem: { coachId: '' }, //报名时选择的教练
realAuthsuccee: false,
}, getters, mutations: { // 选择学校
upDateTrainingSchoolId(state, currentSchool) { state.currentSchool = currentSchool }, // webViewUrl
updateWebVeiwUrl(state, url) { state.webViewUrl = url }, // 更新用户信息
upDateUserInfo(state, userInfo) { state.userInfo = userInfo }, updatePushMyMsg(state, item) { state.currentMyMsg = item }, upDateBillPrice(state, billPrice) { state.billPrice = billPrice }, upDateTrainingOrderId(state, trainingOrderId) { state.trainingOrderId = trainingOrderId }, // tabbar 页面是否显示报错小图标
updateHavePay(state, havePay) { state.havePay = havePay }, // 报名时选择教练
upDateCoachItem(state, item) { state.chooseCoachItem = item }, // 申请退款时的银行卡信息
upDateBankInfo(state, obj) { for (let k in obj) { if (state.bankInfo[k]) { state.bankInfo[k] = obj[k] } else { uni.$set(state.bankInfo, k, obj[k]) } } }, // 更新经纬度
updateLatLng(state, item) { state.latLng = item }, }, actions: { }, modules: { add, user, }, });
export default store;
|