123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- export const state = () => ({
- userAgent: '',
-
- isMobile: false,
-
- cookies: '',
-
- sessionId: '',
-
- url: 'http://218.17.158.219:9090/platform-b2c',
-
- user: {
-
- logged: false,
- fetching: false,
- data: {}
- },
-
- counter: {
- fetching: false,
- data: {}
- },
-
- globalOptions: {
- fetching: false,
- data: {}
- },
- storeStatus: {
- fetching: false,
- data: {}
- },
- infoWithAdmin: {
- fetching: false,
- data: {}
- },
-
- wechatInfo: {
- fetching: false,
- data: {}
- },
-
- currency: '',
- messageType: '',
- showMobileFooter: true
- })
- export const mutations = {
- SET_USER_AGENT (state, result) {
- state.userAgent = result
- },
- SET_MOBILE_LAYOUT (state, result) {
- state.isMobile = result
- },
- SET_COOKIES (state, result) {
- state.cookies = result || ''
- },
- ADD_COOKIES (state, result) {
- state.cookies += result || ''
- },
- SET_SESSION_ID (state, result) {
- state.sessionId = result || ''
- },
- UPDATE_URL (state, result) {
- state.url = result
- },
- REQUEST_USER_INFO (state) {
- state.user.fetching = true
- },
- REQUEST_USER_INFO_SUCCESS (state, result) {
- state.user.fetching = false
- state.user.data = result || {}
- state.user.logged = result && result.userName
- },
- REQUEST_USER_INFO_FAILURE (state) {
- state.user.fetching = false
- state.user.data = {}
- },
- REQUEST_COUNTER (state) {
- state.counter.fetching = true
- },
- REQUEST_COUNTER_SUCCESS (state, result) {
- state.counter.fetching = false
- state.counter.data = result || {}
- },
- REQUEST_COUNTER_FAILURE (state) {
- state.counter.fetching = false
- state.counter.data = {}
- },
- REQUEST_ADMIN_INFO (state) {
- state.infoWithAdmin.fetching = true
- },
- REQUEST_ADMIN_INFO_SUCCESS (state, result) {
- state.infoWithAdmin.fetching = false
- state.infoWithAdmin.data = result || {}
- },
- REQUEST_ADMIN_INFO_FAILURE (state) {
- state.user.fetching = false
- state.infoWithAdmin.data = {}
- },
- REQUEST_LOGOUT_SUCCESS (state) {
- state.user.data = {}
- state.user.logged = false
- },
- REQUEST_GLOBAL_OPTIONS (state) {
- state.globalOptions.fetching = true
- },
- REQUEST_GLOBAL_OPTIONS_SUCCESS (state, result) {
- state.globalOptions.fetching = false
- state.globalOptions.data = result
- },
- REQUEST_GLOBAL_OPTIONS_FAILURE (state) {
- state.globalOptions.fetching = false
- },
- REQUEST_STORE_STATUS (state) {
- state.storeStatus.fetching = true
- },
- REQUEST_STORE_STATUS_SUCCESS(state, result) {
- state.storeStatus.fetching = false
- state.storeStatus.data = result
- },
- REQUEST_STORE_STATUS_FAILURE (state) {
- state.storeStatus.fetching = false
- state.storeStatus.data = {}
- },
- REQUEST_WECHATINFO_STATUS (state) {
- state.wechatInfo.fetching = true
- },
- REQUEST_WECHATINFO_STATUS_SUCCESS(state, result) {
- state.wechatInfo.fetching = false
- state.wechatInfo.data = result
- },
- REQUEST_WECHATINFO_STATUS_FAILURE (state) {
- state.wechatInfo.fetching = false
- },
- SET_CURRENCY (state, result) {
- state.currency = result.data || 'RMB'
- },
- GET_MESSAGETYPE (state, result) {
- state.messageType = result || ''
- },
- SET_SHOW_MOBILE_FOOTER (state, result) {
- state.showMobileFooter = result
- }
- }
|