index.js 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. import Vue from 'vue'
  2. import Vuex from 'vuex'
  3. import user from './model/user'
  4. import md5 from './model/md5'
  5. Vue.use(Vuex)
  6. const store = new Vuex.Store({
  7. namespaced: true,
  8. state: {
  9. // #ifdef H5
  10. baseURL: 'https://v5dgkivu.qiniu1314.com', //正式地址配置
  11. // baseURL: 'https://cbbshop.qiniu1314.com', //根目录下
  12. // baseURL:window.location.protocol + "//" + window.location.host,//请求地址配置
  13. // #endif
  14. // #ifndef H5
  15. baseURL: 'https://v5dgkivu.qiniu1314.com', //正式地址配置
  16. // #endif
  17. urlFile: '/index/', //项目部署所在文件夹,修改后需同步修改manifest.json文件中的配置
  18. userInfo: {}, //登录信息
  19. loginInterceptor: false, //是否打开强制登录
  20. isbuy: false, //是否进入购买时间
  21. isbuy1: false, //是否进入购买时间
  22. // #ifdef H5 || MP-WEIXIN
  23. weichatInfo: {}, //保存微信注册信息
  24. weichatObj: '', //微信对象
  25. // #endif
  26. latitude: '',
  27. longitude: '',
  28. // #ifdef APP-PLUS
  29. isShowIllegality:false,//不显示ios审核不允许的功能
  30. appversion:"1.0.0",
  31. // #endif
  32. // #ifndef APP-PLUS
  33. isShowIllegality:true,//允许显示隐藏信息
  34. // #endif
  35. },
  36. mutations: {
  37. // #ifdef APP-PLUS
  38. setappversion(state, provider){
  39. state.appversion = provider
  40. },
  41. // #endif
  42. setLat(state, provider) {
  43. state.latitude = provider
  44. },
  45. setLon(state, provider) {
  46. state.longitude = provider
  47. },
  48. setChoose(state, provider) {
  49. state.chooseProvince = provider.chooseProvince
  50. state.chooseCity = provider.chooseCity
  51. state.chooseDistrict = provider.chooseDistrict
  52. console.log(state.chooseProvince, state.chooseCity, state.chooseDistrict, 'dddddddddddddddddddd')
  53. },
  54. setDistrict(state, provider) {
  55. state.chooseDistrict = provider
  56. },
  57. //保存微信信息
  58. setWeiChatInfo(state, provider) {
  59. state.weichatInfo = provider;
  60. },
  61. //保存微信对象
  62. setWeiChatObj(state, provider) {
  63. state.weichatObj = provider;
  64. },
  65. //改变进入购买时间的状态
  66. setBuy(state, provider) {
  67. state.isbuy = provider;
  68. },
  69. setBuy1(state, provider) {
  70. state.isbuy1 = provider;
  71. },
  72. // 修改显示隐藏ios审核不允许显示的功能
  73. changeState(state, provider){
  74. console.log(provider,'provider');
  75. state.isShowIllegality = provider;
  76. }
  77. },
  78. modules: {
  79. user,
  80. md5
  81. },
  82. actions: {}
  83. })
  84. export default store