index.js 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. // #ifdef H5
  9. baseURL:window.location.protocol + "//" + window.location.host,//请求地址配置
  10. // #endif
  11. // #ifndef H5
  12. // baseURL:'http://cbb.qiniu1314.com',//请求地址配置
  13. baseURL: 'https://www.shangshiyiqu.com', //测试地址配置
  14. // #endif
  15. urlFile: '/index', //项目部署所在文件夹
  16. userInfo: {}, //登录信息
  17. loginInterceptor: false, //是否打开强制登录
  18. isbuy: false, //是否进入购买时间
  19. isbuy1: false, //是否进入购买时间
  20. // #ifdef H5 || MP-WEIXIN
  21. weichatInfo: {}, //保存微信注册信息
  22. weichatObj: '', //微信对象
  23. // #endif
  24. latitude: '',
  25. longitude: '',
  26. // #ifdef APP-PLUS
  27. isShowIllegality:false,//不显示ios审核不允许的功能
  28. // #endif
  29. // #ifndef APP-PLUS
  30. isShowIllegality:true,//允许显示隐藏信息
  31. // #endif
  32. },
  33. mutations: {
  34. setLat(state, provider) {
  35. state.latitude = provider
  36. },
  37. setLon(state, provider) {
  38. state.longitude = provider
  39. },
  40. setChoose(state, provider) {
  41. state.chooseProvince = provider.chooseProvince
  42. state.chooseCity = provider.chooseCity
  43. state.chooseDistrict = provider.chooseDistrict
  44. console.log(state.chooseProvince, state.chooseCity, state.chooseDistrict, 'dddddddddddddddddddd')
  45. },
  46. setDistrict(state, provider) {
  47. state.chooseDistrict = provider
  48. },
  49. //保存微信信息
  50. setWeiChatInfo(state, provider) {
  51. state.weichatInfo = provider;
  52. },
  53. //保存微信对象
  54. setWeiChatObj(state, provider) {
  55. state.weichatObj = provider;
  56. },
  57. //改变进入购买时间的状态
  58. setBuy(state, provider) {
  59. state.isbuy = provider;
  60. },
  61. setBuy1(state, provider) {
  62. state.isbuy1 = provider;
  63. },
  64. // 修改显示隐藏ios审核不允许显示的功能
  65. changeState(state, provider){
  66. state.isShowIllegality = provider;
  67. }
  68. },
  69. modules: {
  70. user
  71. },
  72. actions: {}
  73. })
  74. export default store