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.

87 lines
1.7 KiB

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