index.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560
  1. import axios from '~plugins/axios'
  2. // 获取品牌详情产品分类信息
  3. function loadBrandCategories({ commit }, params = {}) {
  4. let id = params.id
  5. commit('brandCategories/REQUEST_CATEGORIES', params)
  6. return axios.get(`/api/product/brand/${id}/kinds`)
  7. .then(response => {
  8. commit('brandCategories/GET_CATEGORIES_SUCCESS', response.data)
  9. }, err => {
  10. commit('brandCategories/GET_CATEGORIES_FAILURE', err)
  11. })
  12. }
  13. // 获取品牌详情型号列表数据
  14. function loadBrandComponent({ commit }, params = {}) {
  15. commit('brandComponent/REQUEST_COMPONENT', params)
  16. return axios.get('/api/product/component/list', { params })
  17. .then(response => {
  18. commit('brandComponent/GET_COMPONENT_SUCCESS', response.data)
  19. }, err => {
  20. commit('brandComponent/GET_COMPONENT_FAILURE', err)
  21. })
  22. }
  23. export const actions = {
  24. // 全局服务初始化
  25. nuxtServerInit(store, { params, route, isDev, req }) {
  26. // 检查设备类型
  27. const userAgent = process.server ? req.headers['user-agent'] : navigator.userAgent
  28. const isMobile = /(iPhone|iPad|Opera Mini|Android.*Mobile|NetFront|PSP|BlackBerry|Windows Phone)/ig.test(userAgent)
  29. const cookie = process.server ? req.headers['cookie'] : null
  30. store.commit('option/SET_MOBILE_LAYOUT', isMobile)
  31. store.commit('option/SET_USER_AGENT', userAgent)
  32. store.commit('option/SET_COOKIES', cookie)
  33. // console.log(req.headers.referer)
  34. if (route.query) {
  35. let messageType = route.query.messageType || ''
  36. store.commit('option/GET_MESSAGETYPE', messageType)
  37. }
  38. if (cookie) {
  39. if (cookie && cookie.length) {
  40. for (let i = 0; i < cookie.length; i++) {
  41. if (cookie[i].indexOf('JSESSIONID') > -1) {
  42. const sessionId = cookie[i]
  43. const first = sessionId.indexOf(';')
  44. const second = sessionId.lastIndexOf(';')
  45. const newSessionId = sessionId.replace(sessionId.substring(first, second), '')
  46. store.commit('option/SET_SESSION_ID', newSessionId)
  47. break
  48. }
  49. }
  50. }
  51. axios.defaults.headers['cookie'] = store.state.option.cookies + '; ' + store.state.option.sessionId
  52. axios.defaults.headers['User-Agent'] = store.state.option.userAgent
  53. } else {
  54. axios.defaults.headers['cookie'] = ''
  55. axios.defaults.headers['User-Agent'] = ''
  56. }
  57. // 设置跳转的URL
  58. if (!isDev) {
  59. store.commit('option/UPDATE_URL', 'http://www.usoftmall.com')
  60. }
  61. return Promise.all([
  62. // 全局数据
  63. store.dispatch('loadUserInfo'),
  64. store.dispatch('loadProductCounts', { _status: 'actived' }),
  65. store.dispatch('loadHotSearchDevice'),
  66. store.dispatch('loadHotSearchBrand'),
  67. store.dispatch('loadNewFloors')
  68. ])
  69. },
  70. // 获取用户信息
  71. loadUserInfo({ commit }) {
  72. commit('option/REQUEST_USER_INFO')
  73. return axios.get('/user/authentication')
  74. .then(response => {
  75. if (response.data.userName) {
  76. let ens = response.data.enterprises
  77. if (ens && ens.length) {
  78. response.data.enterprise = ens.find(item => item.current) || { enName: '个人账户' }
  79. } else {
  80. response.data.enterprise = { enName: '个人账户' }
  81. }
  82. }
  83. commit('option/REQUEST_USER_INFO_SUCCESS', response.data)
  84. }, err => {
  85. commit('option/REQUEST_USER_INFO_FAILURE', err)
  86. })
  87. },
  88. loadUserWithAdmin ({commit}, params = {}) {
  89. commit('option/REQUEST_ADMIN_INFO')
  90. return axios.get('/basic/user/getUserByUU', {params: params})
  91. .then(response => {
  92. commit('option/REQUEST_ADMIN_INFO_SUCCESS', response.data)
  93. }, err => {
  94. commit('option/REQUEST_ADMIN_INFO_FAILURE', err)
  95. })
  96. },
  97. // 用户退出
  98. logout({ commit }) {
  99. return axios.get('/logout')
  100. .then(response => {
  101. commit('option/REQUEST_LOGOUT_SUCCESS', response.data)
  102. })
  103. },
  104. // 获取楼层配置
  105. loadFloors({ commit }) {
  106. commit('floor/REQUEST_LIST')
  107. return axios.get('/api/floors/home')
  108. .then(response => {
  109. commit('floor/GET_LIST_SUCCESS', response.data)
  110. }, err => {
  111. commit('floor/GET_LIST_FAILURE', err)
  112. })
  113. },
  114. // 批量获取产品信息
  115. loadBatchCommodities({ commit }, params = {}) {
  116. commit('floor/REQUEST_EXPANDLIST')
  117. return axios.post('/api/commodity/detail', params.batchCodeList)
  118. .then(response => {
  119. commit('floor/GET_EXPANDLIST_SUCCESS', response.data)
  120. }, err => {
  121. commit('floor/GET_EXPANDLIST_FAILURE', err)
  122. })
  123. },
  124. // 获取轮播配置
  125. loadBanners({ commit }, params = {}) {
  126. commit('carousel/REQUEST_BANNER')
  127. return axios.get(`/cmsApi?method=queryContentPage&module=${params.type}&orderBy=order_number%20ASC`)
  128. .then(response => {
  129. commit('carousel/GET_BANNER_SUCCESS', response.data)
  130. }, err => {
  131. commit('carousel/GET_BANNER_FAILURE', err)
  132. })
  133. },
  134. // 获取新楼层配置
  135. loadNewFloors({ commit }) {
  136. commit('floor/REQUEST_NEWLIST')
  137. return axios.get('/api/floors/home-v3')
  138. .then(response => {
  139. commit('floor/GET_NEWLIST_SUCCESS', response.data)
  140. }, err => {
  141. commit('floor/GET_NEWLIST_FAILURE', err)
  142. })
  143. },
  144. // 获取楼层配置f1
  145. loadNewFloorsF1({ commit }) {
  146. commit('floor/REQUEST_LISTF1')
  147. return axios.get(`/cmsApi?method=queryContentPage&module=home_floor_f1&orderBy=order_number%20ASC`)
  148. .then(response => {
  149. commit('floor/GET_LIST_SUCCESSF1', response.data)
  150. }, err => {
  151. commit('floor/GET_LIST_FAILUREF1', err)
  152. })
  153. },
  154. // 获取楼层配置f2
  155. loadNewFloorsF2({ commit }) {
  156. commit('floor/REQUEST_LISTF2')
  157. return axios.get(`/cmsApi?method=queryContentPage&module=home_floor_f2&orderBy=order_number%20ASC`)
  158. .then(response => {
  159. commit('floor/GET_LIST_SUCCESSF2', response.data)
  160. }, err => {
  161. commit('floor/GET_LIST_FAILUREF2', err)
  162. })
  163. },
  164. // 获取楼层配置f3
  165. loadNewFloorsF3({ commit }) {
  166. commit('floor/REQUEST_LISTF3')
  167. return axios.get(`/cmsApi?method=queryContentPage&module=home_floor_f3&orderBy=order_number%20ASC`)
  168. .then(response => {
  169. commit('floor/GET_LIST_SUCCESSF3', response.data)
  170. }, err => {
  171. commit('floor/GET_LIST_FAILUREF3', err)
  172. })
  173. },
  174. // 获取楼层配置f4
  175. loadNewFloorsF4({ commit }) {
  176. commit('floor/REQUEST_LISTF4')
  177. return axios.get(`/cmsApi?method=queryContentPage&module=home_floor_f4&orderBy=order_number%20ASC`)
  178. .then(response => {
  179. commit('floor/GET_LIST_SUCCESSF4', response.data)
  180. }, err => {
  181. commit('floor/GET_LIST_FAILUREF4', err)
  182. })
  183. },
  184. // 获取楼层配置f5
  185. loadNewFloorsF5({ commit }) {
  186. commit('floor/REQUEST_LISTF5')
  187. return axios.get(`/cmsApi?method=queryContentPage&module=home_floor_f5&orderBy=order_number%20ASC`)
  188. .then(response => {
  189. commit('floor/GET_LIST_SUCCESSF5', response.data)
  190. }, err => {
  191. commit('floor/GET_LIST_FAILUREF5', err)
  192. })
  193. },
  194. // 获取子器件类目
  195. loadProductKinds({ commit }, params = {}) {
  196. let id = params.id
  197. commit('product/kind/REQUEST_KIND', params)
  198. return axios.get(`/api/product/kind/${id}/children`)
  199. .then(response => {
  200. commit('product/kind/GET_KIND_SUCCESS', { id, result: response.data })
  201. }, err => {
  202. commit('product/kind/GET_KIND_FAILURE', { id, err })
  203. })
  204. },
  205. // 获取全部子器件类目
  206. loadAllProductKinds({ commit }, params = {}) {
  207. let id = params.id
  208. commit('product/kind/REQUEST_KIND', params)
  209. return axios.get(`/api/product/kind/${id}/children_all`)
  210. .then(response => {
  211. commit('product/kind/GET_KIND_SUCCESS', { id, result: response.data })
  212. }, err => {
  213. commit('product/kind/GET_KIND_FAILURE', { id, err })
  214. })
  215. },
  216. // 获取首页新闻
  217. loadNewsSnapshot({ commit }, params = {}) {
  218. commit('news/REQUEST_SNAPSHOT')
  219. return axios.get('/api/news/created', { params })
  220. .then(response => {
  221. commit('news/GET_SNAPSHOT_SUCCESS', response.data)
  222. }, err => {
  223. commit('news/GET_SNAPSHOT_FAILURE', err)
  224. })
  225. },
  226. // 获取器件统计信息
  227. loadProductCounts({ commit }, params = {}) {
  228. commit('product/common/REQUEST_COUNTS')
  229. return axios.get('/api/product/commoncount', { params })
  230. .then(response => {
  231. commit('product/common/GET_COUNTS_SUCCESS', response.data)
  232. }, err => {
  233. commit('product/common/GET_COUNTS_FAILURE', err)
  234. })
  235. },
  236. // 搜索关键字
  237. searchKeywords({ commit }, params = {}) {
  238. commit('search/REQUEST_KEYWORDS')
  239. return axios.get('/search/similarKeywords', { params })
  240. .then(response => {
  241. commit('search/GET_KEYWORDS_SUCCESS', response.data)
  242. }, err => {
  243. commit('search/GET_KEYWORDS_FAILURE', err)
  244. })
  245. },
  246. resetSearchKeywords({ commit }) {
  247. commit('search/RESET_KEYWORDS')
  248. },
  249. // 热卖推荐页面
  250. loadProductHot({ commit }, params = {}) {
  251. commit('original/REQUEST_HOT')
  252. return axios.get('/api/commodity/latest', { params })
  253. .then(response => {
  254. commit('original/GET_HOT_SUCCESS', response.data)
  255. }, err => {
  256. commit('original/GET_HOT_FAILURE', err)
  257. })
  258. },
  259. // 器件详情页面
  260. // 获得器件详情信息
  261. loadComponentDetail({ commit }, params = {}) {
  262. let id = params.id
  263. commit('componentDetail/REQUEST_DETAIL', params)
  264. return axios.get(`/api/product/component/${id}`)
  265. .then(response => {
  266. commit('componentDetail/GET_DETAIL_SUCCESS', response.data)
  267. if (response.data) {
  268. commit('componentMenu/REQUEST_MENU', params)
  269. return axios.get(`/api/product/kind/structing/${response.data.kindid}`)
  270. .then(response => {
  271. commit('componentMenu/GET_MENU_SUCCESS', response.data)
  272. }, err => {
  273. commit('componentMenu/GET_MENU_FAILURE', err)
  274. })
  275. }
  276. }, err => {
  277. commit('componentDetail/GET_DETAIL_FAILURE', err)
  278. })
  279. },
  280. // 获取器件详情页面包屑导航
  281. loadComponentMenu({ commit }, params = {}) {
  282. let pid = params.id
  283. commit('componentMenu/REQUEST_MENU', params)
  284. return axios.get(`/api/product/kind/structing/${pid}`)
  285. .then(response => {
  286. commit('componentMenu/GET_MENU_SUCCESS', response.data)
  287. }, err => {
  288. commit('componentMenu/GET_MENU_FAILURE', err)
  289. })
  290. },
  291. // 器件详情页选择商家
  292. loadComponentStore({ commit }, params = {}) {
  293. let id = params.uuid
  294. commit('componentStore/REQUEST_STORE', params)
  295. return axios.get(`/api/store-service/stores/uuid/${id}`)
  296. .then(response => {
  297. commit('componentStore/GET_STORE_SUCCESS', response.data)
  298. }, err => {
  299. commit('componentStore/GET_STORE_FAILURE', err)
  300. })
  301. },
  302. // 器件详情页商家列表
  303. loadComponentInformation({ commit }, params = {}) {
  304. // let params = {}
  305. // let filter = {uuid: uuid.uuid, ignoreUMall: false, ignoreStore: false}
  306. // // let sorting = {minPriceRMB: 'ASC'}
  307. // params.filter = filter
  308. // // params.sorting = sorting
  309. // params.page = pageParams.page
  310. // params.count = pageParams.count
  311. commit('componentInformation/REQUEST_INFORMATION')
  312. return axios.get('/api/commodity/goods/page', { params })
  313. .then(response => {
  314. commit('componentInformation/GET_INFORMATION_SUCCESS', response.data)
  315. }, err => {
  316. commit('componentInformation/GET_INFORMATION_FAILURE', err)
  317. })
  318. },
  319. // 获取库存寄售店铺storeid
  320. getUmallStoreId({ commit }) {
  321. commit('componentUmallStoreId/REQUEST_STOREID')
  322. return axios.get('/api/store-service/stores/UmallStore')
  323. .then(response => {
  324. commit('componentUmallStoreId/GET_STOREID_SUCCESS', response.data)
  325. }, err => {
  326. commit('componentUmallStoreId/GET_STOREID_FAILURE', err)
  327. })
  328. },
  329. // 品牌详情页面
  330. // 获得品牌详情信息
  331. loadBrandDetail({ commit, dispatch }, params = {}) {
  332. let id = params.id
  333. commit('brandDetail/REQUEST_DETAIL', params)
  334. return axios.get(`/api/product/brand/${id}`)
  335. .then(response => {
  336. let brand = response.data || {}
  337. commit('brandDetail/GET_DETAIL_SUCCESS', response.data)
  338. return Promise.all([
  339. loadBrandCategories({ commit }, { id: brand.id }),
  340. loadBrandComponent({ commit }, { count: 10, filter: { brandid: brand.id }, page: 1 })
  341. ])
  342. }, err => {
  343. commit('brandDetail/GET_DETAIL_FAILURE', err)
  344. })
  345. },
  346. // 获取品牌详情产品分类信息
  347. loadBrandCategories({ commit }, params = {}) {
  348. let id = params.id
  349. commit('brandCategories/REQUEST_CATEGORIES', params)
  350. return axios.get(`/api/product/brand/${id}/kinds`)
  351. .then(response => {
  352. commit('brandCategories/GET_CATEGORIES_SUCCESS', response.data)
  353. }, err => {
  354. commit('brandCategories/GET_CATEGORIES_FAILURE', err)
  355. })
  356. },
  357. // 获取品牌详情型号列表数据
  358. loadBrandComponent({ commit }, params = {}) {
  359. commit('brandComponent/REQUEST_COMPONENT', params)
  360. return axios.get('/api/product/component/list', { params })
  361. .then(response => {
  362. commit('brandComponent/GET_COMPONENT_SUCCESS', response.data)
  363. }, err => {
  364. commit('brandComponent/GET_COMPONENT_FAILURE', err)
  365. })
  366. },
  367. // 获取品牌详情分页信息
  368. loadBrandPages({ commit }, params = {}) {
  369. commit('brandPages/REQUEST_PAGES', params)
  370. return axios.get('/api/product/PAGES/list', { params })
  371. .then(response => {
  372. commit('brandPages/GET__SUCCESS', response.data)
  373. }, err => {
  374. commit('brandPages/GET_COMPONENT_FAILURE', err)
  375. })
  376. },
  377. // 留言板
  378. // 提交了留言板信息
  379. uploadMessageBoardInformation({ commit }, params) {
  380. commit('messageBoard/REQUEST_INFORMATION')
  381. return axios.post('/api/operation/messageBoard', params)
  382. .then(response => {
  383. commit('messageBoard/GET_INFORMATION_SUCCESS', response.data)
  384. }, err => {
  385. commit('messageBoard/GET_INFORMATION_FAILURE', err)
  386. })
  387. },
  388. // 验证用户是否登录
  389. userIsLogin({ commit }) {
  390. commit('messageBoardIsLogin/REQUEST_LOGIN')
  391. return axios.get('/user/authentication')
  392. .then(response => {
  393. commit('messageBoardIsLogin/GET_LOGIN_SUCCESS', response.data)
  394. }, err => {
  395. commit('messageBoardIsLogin/GET_LOGIN_FAILURE', err)
  396. })
  397. },
  398. // 获取留言记录信息
  399. getMessageBoardInformation({ commit }, params) {
  400. let sorting = { createDate: 'DESC' }
  401. params.sorting = sorting
  402. commit('messageBoardInformation/REQUEST_INFORMATION', params)
  403. return axios.get('/operation/messageBoard/pageInfo/user', { params })
  404. .then(response => {
  405. commit('messageBoardInformation/GET_INFORMATION_SUCCESS', response.data)
  406. }, err => {
  407. commit('messageBoardInformation/GET_INFORMATION_FAILURE', err)
  408. })
  409. },
  410. // 获取帮助中心信息
  411. loadHelpSnapsho({ commit }, params = {}) {
  412. commit('help/REQUEST_SNAPSHO')
  413. return axios.get('/api/help-service/helps', { params })
  414. .then(response => {
  415. commit('help/GET_SNAPSHO_SUCCESS', response.data)
  416. }, err => {
  417. commit('help/GET_SNAPSHO_FAILURE', err)
  418. })
  419. },
  420. // 获取帮助中心二级菜单
  421. loadHelpList({ commit }, params = {}) {
  422. commit('help/REQUEST_HELPLIST')
  423. return axios.get('/api/help-service/issues', { params })
  424. .then(response => {
  425. commit('help/GET_HELPLIST_SUCCESS', response.data)
  426. }, err => {
  427. commit('help/GET_HELPLIST_FAILURE', err)
  428. })
  429. },
  430. // 获取帮助中心名称
  431. loadHelpTitle({ commit }, params = {}) {
  432. let id = params.id
  433. commit('help/REQUEST_TITLE')
  434. return axios.get(`/api/help-service/${id}`, { params })
  435. .then(response => {
  436. commit('help/GET_TITLE_SUCCESS', response.data)
  437. }, err => {
  438. commit('help/GET_TITLE_FAILURE', err)
  439. })
  440. },
  441. // 获取详情
  442. loadHelpDetail({ commit }, params = {}) {
  443. let id = params.id
  444. commit('help/REQUEST_DETAIL')
  445. return axios.get(`/api/help-service/issues/${id}`, { params })
  446. .then(response => {
  447. commit('help/GET_DETAIL_SUCCESS', response.data)
  448. let id = response.data.navId
  449. commit('help/REQUEST_TITLE')
  450. return axios.get(`/api/help-service/${id}`)
  451. .then(response => {
  452. commit('help/GET_TITLE_SUCCESS', response.data)
  453. }, err => {
  454. commit('help/GET_TITLE_FAILURE', err)
  455. })
  456. }, err => {
  457. commit('help/GET_DETAIL_FAILURE', err)
  458. })
  459. },
  460. // 获取最多搜索量的 器件
  461. loadHotSearchDevice({ commit }) {
  462. commit('hotSearchDevice/REQUEST_HOT')
  463. return axios.get('/api/product/component/mostSearchComponent')
  464. .then(response => {
  465. commit('hotSearchDevice/GET_HOT_SUCCESS', response.data)
  466. }, err => {
  467. commit('hotSearchDevice/GET_HOT_FAILURE', err)
  468. })
  469. },
  470. // 获取最多搜索量的 品牌
  471. loadHotSearchBrand({ commit }) {
  472. commit('hotSearchBrand/REQUEST_HOT')
  473. return axios.get('/api/product/brand/mostSearchBrands')
  474. .then(response => {
  475. commit('hotSearchBrand/GET_HOT_SUCCESS', response.data)
  476. }, err => {
  477. commit('hotSearchBrand/GET_HOT_FAILURE', err)
  478. })
  479. },
  480. // 获取用户开店信息
  481. loadStoreStatus({ commit }, params = {}) {
  482. commit('option/REQUEST_STORE_STATUS')
  483. return axios.get('/store-service/stores', { params: params })
  484. .then(response => {
  485. commit('option/REQUEST_STORE_STATUS_SUCCESS', response.data)
  486. }, err => {
  487. commit('option/REQUEST_STORE_STATUS_FAILURE', err)
  488. })
  489. },
  490. // 获取首页悬浮计数器交易金额
  491. loadAllCount ({commit}, params) {
  492. commit('count/REQUEST_ALLCOUNT')
  493. return axios.get('/api/product/commoncount', {params})
  494. .then(res => {
  495. commit('count/GET_ALLCOUNT_SUCCESS', res.data)
  496. }, (err) => {
  497. commit('count/GET_ALLCOUNT_FAILURE', err)
  498. })
  499. },
  500. // 获取首页悬浮计数器询价单
  501. loadInquirySheet ({commit}, params) {
  502. commit('count/REQUEST_INQUIRYSHEET')
  503. return axios.get('/inquiry/public/getPurcInquiryItemCountByMonth', {params})
  504. .then(res => {
  505. commit('count/GET_INQUIRYSHEET_SUCCESS', res.data)
  506. }, (err) => {
  507. commit('count/GET_INQUIRYSHEET_FAILURE', err)
  508. })
  509. },
  510. loadInquirySheetLast ({commit}, params) {
  511. commit('count/REQUEST_INQUIRYSHEETLAST')
  512. return axios.get('/inquiry/public/getPurcInquiryItemCountByMonth', {params})
  513. .then(res => {
  514. commit('count/GET_INQUIRYSHEETLAST_SUCCESS', res.data)
  515. }, (err) => {
  516. commit('count/GET_INQUIRYSHEETLAST_FAILURE', err)
  517. })
  518. },
  519. // 保存微信信息
  520. GerWechatInfo({ commit }, params = {}) {
  521. commit('option/REQUEST_WECHATINFO_STATUS')
  522. return axios.get('/wx/getWxUserInfo', { params: params })
  523. .then(response => {
  524. commit('option/REQUEST_WECHATINFO_STATUS_SUCCESS', response.data)
  525. if (response.data.openid) {
  526. localStorage.setItem('USOFTMALLWECHATINFO', JSON.stringify(response.data))
  527. } else {
  528. // localStorage.removeItem('USOFTMALLWECHATINFO')
  529. }
  530. }, err => {
  531. localStorage.removeItem('USOFTMALLWECHATINFO')
  532. commit('option/REQUEST_WECHATINFO_STATUS_FAILURE', err)
  533. })
  534. },
  535. // 获取品牌中心轮播图
  536. loadBrandCarousel ({ commit }) {
  537. commit('carousel/REQUEST_BRANDCAROUSEL')
  538. return axios.get('/cmsApi?method=queryContentPage&module=brandCenter_littleSlideshow')
  539. .then(response => {
  540. commit('carousel/GET_BRANDCAROUSEL_SUCCESS', response.data)
  541. }, err => {
  542. commit('carousel/GET_BRANDCAROUSEL_FAILURE', err)
  543. })
  544. },
  545. // 获取品牌中心首屏背景图
  546. loadBrandBanner ({ commit }) {
  547. commit('product/banner/REQUEST_BRANDBANNER')
  548. return axios.get('/cmsApi?method=queryContentPage&module=brandCenter_firstScreen')
  549. .then(response => {
  550. commit('product/banner/GET_BRANDBANNER_SUCCESS', response.data)
  551. }, err => {
  552. commit('product/banner/GET_BRANDBANNER_FAILURE', err)
  553. })
  554. }
  555. }