index.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import Vue from 'vue'
  2. import Vuex from 'vuex'
  3. import user from './model/user'
  4. Vue.use(Vuex)
  5. const store = new Vuex.Store({
  6. namespaced: true,
  7. state: {
  8. // baseURL: 'https://www.shangshiyiqu.com', //地址配置
  9. baseURL: 'https://xx.accle.shop', //测试地址配置
  10. urlFile: '/index', //项目部署所在文件夹
  11. userInfo: {}, //登录信息
  12. loginInterceptor: false, //是否打开强制登录
  13. isbuy: false, //是否进入购买时间
  14. isbuy1: false, //是否进入购买时间
  15. // #ifdef H5 || MP-WEIXIN
  16. weichatInfo: {}, //保存微信注册信息
  17. weichatObj: '', //微信对象
  18. // #endif
  19. latitude: '',
  20. longitude: ''
  21. },
  22. mutations: {
  23. setLat(state, provider) {
  24. state.latitude = provider
  25. },
  26. setLon(state, provider) {
  27. state.longitude = provider
  28. },
  29. setChoose(state, provider) {
  30. state.chooseProvince = provider.chooseProvince
  31. state.chooseCity = provider.chooseCity
  32. state.chooseDistrict = provider.chooseDistrict
  33. console.log(state.chooseProvince, state.chooseCity, state.chooseDistrict, 'dddddddddddddddddddd')
  34. },
  35. setDistrict(state, provider) {
  36. state.chooseDistrict = provider
  37. },
  38. //保存微信信息
  39. setWeiChatInfo(state, provider) {
  40. state.weichatInfo = provider;
  41. },
  42. //保存微信对象
  43. setWeiChatObj(state, provider) {
  44. state.weichatObj = provider;
  45. },
  46. //改变进入购买时间的状态
  47. setBuy(state, provider) {
  48. state.isbuy = provider;
  49. },
  50. setBuy1(state, provider) {
  51. state.isbuy1 = provider;
  52. },
  53. },
  54. modules: {
  55. user
  56. },
  57. actions: {}
  58. })
  59. export default store