江西小程序管理端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
1.8 KiB

1 year ago
  1. import Vue from 'vue';
  2. import Vuex from 'vuex';
  3. import add from './modules/add';
  4. import user from './modules/user';
  5. import getters from './getters';
  6. Vue.use(Vuex);
  7. const store = new Vuex.Store({
  8. state: {
  9. currentSchool: '',
  10. userInfo: {},
  11. latLng: {},
  12. classChooseItem: {},
  13. pdfUrl: '',
  14. webViewUrl: '',
  15. havePay: 0, //tabbar 页面是否显示报错小图标
  16. currentMyMsg: {},
  17. billPrice: 0, //开发票的id
  18. TrainingOrderId: '', //退款流程里的驾校id
  19. bankInfo: {
  20. realName: uni.getStorageSync('userInfo').realName,
  21. phoneCode: ''
  22. },
  23. chooseCoachItem: {
  24. coachId: ''
  25. }, //报名时选择的教练
  26. realAuthsuccee: false,
  27. },
  28. getters,
  29. mutations: {
  30. // 选择学校
  31. upDateTrainingSchoolId(state, currentSchool) {
  32. state.currentSchool = currentSchool
  33. },
  34. // webViewUrl
  35. updateWebVeiwUrl(state, url) {
  36. state.webViewUrl = url
  37. },
  38. // 更新用户信息
  39. upDateUserInfo(state, userInfo) {
  40. state.userInfo = userInfo
  41. },
  42. updatePushMyMsg(state, item) {
  43. state.currentMyMsg = item
  44. },
  45. upDateBillPrice(state, billPrice) {
  46. state.billPrice = billPrice
  47. },
  48. upDateTrainingOrderId(state, trainingOrderId) {
  49. state.trainingOrderId = trainingOrderId
  50. },
  51. // tabbar 页面是否显示报错小图标
  52. updateHavePay(state, havePay) {
  53. state.havePay = havePay
  54. },
  55. // 报名时选择教练
  56. upDateCoachItem(state, item) {
  57. state.chooseCoachItem = item
  58. },
  59. // 申请退款时的银行卡信息
  60. upDateBankInfo(state, obj) {
  61. for (let k in obj) {
  62. if (state.bankInfo[k]) {
  63. state.bankInfo[k] = obj[k]
  64. } else {
  65. uni.$set(state.bankInfo, k, obj[k])
  66. }
  67. }
  68. },
  69. // 更新经纬度
  70. updateLatLng(state, item) {
  71. state.latLng = item
  72. },
  73. },
  74. actions: {
  75. },
  76. modules: {
  77. add,
  78. user,
  79. },
  80. });
  81. export default store;