zhangwei
2024-08-15 3fc70951bbd386c8c85e522cae80deba8823052e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import { createStore } from 'vuex'
 
const store = createStore({
  // 为了不和页面或组件的data中的造成混淆,state中的变量前面建议加上$符号
  state: {
      config: {
          shopLogo:"/static/images/logo/logo.png"
      }, // 店铺配置信息 //添加一个前端项目中的图片地址
      orderTab: 0, // 选中的订单tab页
      scene: 0, // 选中的订单tab页
      redirectPage: '',
      uuid: '',//当前客户端
      searchStyle: '',
      sessionAuthId: '', //微信缓存授权信息
      searchFixed: false,//搜索框样式
      showLoginTip:false,//显示登录框
      hasLogin: false,//存储用户当前是否登录,作为切换特效使用
      userShip: {}, //地区信息
      userInfo: {}, //用户信息存储
      invoice: {}, //发票信息
      deliveryData: {},//派送订单详情
  },
  mutations: {
      config(state, payload) {
          state.config = payload
      },
      orderTab(state, tab) {
          state.orderTab = tab
      },
      scene(state, tab) {
          state.scene = tab
      },
      redirect(state, payload) {
          state.redirectPage = payload.page
      },
      searchStyle(state, style) {
          state.searchStyle = style
      },
      sessionAuthId(state, payload) {
          state.sessionAuthId = payload
      },
      searchFixed(state, payload) {
          state.searchFixed = payload
      },
      showLoginTip(state, payload) {
          state.showLoginTip = payload
      },
      hasLogin(state, payload) {
          state.hasLogin = payload
      },
      userShip(state, userShip) {
          state.userShip = userShip
      },
      userInfo(state, userInfo) {
          state.userInfo = userInfo
      },
      invoice(state, invoice) {
          state.invoice = invoice
      },
      deliveryData(state,data){
          state.deliveryData = data
      }
  },
  actions: {
  
  },
  getters: {
      shopConfig: state => state.config,
      scene: state => state.scene,
      userInfo: state => state.userInfo,
      uuid: state => state.uuid,
      hasLogin: state => state.hasLogin,
      sessionAuthId: state => state.sessionAuthId,
      deliveryData: state => state.deliveryData
  }
})
 
export default store