Blame view

pc-master/src/store/mutations.js 1.24 KB
3f535f30   杨鑫   '初始'
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
  import * as types from './mutation-types'
  
  const mutations = {
    [types.SET_SEARCHOBJ] (state, searchObj) {
      state.searchObj = searchObj
    },
    [types.SET_NEWADDRESS] (state, obj) {
      state.newAddress = obj
    },
    [types.SET_AREACODE] (state, arr) {
      state.areaCode = arr
    },
    [types.SET_USERINFO] (state, obj) {
      state.userInfo = obj
    },
    [types.SET_AVATAR] (state, img) {
      state.userInfo.headImage = img
    },
    [types.SET_CURRENTPRO] (state, obj) {
      state.currentPro = obj
    },
    [types.SET_SHOPPINGCART] (state, obj) {
      state.shoppingCart = obj
    },
    [types.SET_CARTNUMBER] (state, num) {
      state.cartNumber = num
    },
    [types.SET_NOTICEID] (state, num) {
      state.noticeId = num
    },
    [types.SET_COLLECTDATA] (state, obj) {
      state.collectData = obj
    },
    [types.SHOW_LOGIN] (state, obj) {
      state.showLogin = !state.showLogin
    },
    [types.IS_LOGIN] (state, obj) {
      state.isLogin = obj
    },
    resetVuex (state) {
      state.searchObj = {}
      state.newAddress = {}
      state.areaCode = []
      state.currentPro = {}
      state.userInfo = {
        headImage: ''
      }
      state.shoppingCart = {}
      state.cartNumber = ''
      state.evaluateOrders = {}
      state.noticeId = {}
      state.collectData = {}
    }
  }
  
  export default mutations