shop.js 592 B

12345678910111213141516171819202122232425262728293031323334
  1. let state = {
  2. shopDetail: {}, //用户当前所属地区商家信息
  3. shopAction:{
  4. name:'',
  5. image:'',
  6. }//商店账号商家数据
  7. }
  8. let mutations = {
  9. // 保存用户信息
  10. setShopInfo(state, provider) {
  11. state.shopDetail = provider;
  12. uni.setStorage({ //缓存用户登陆状态
  13. key: 'shopDetail',
  14. data: provider
  15. })
  16. },
  17. setShopAction(state, provider) {
  18. state.shopAction = provider;
  19. uni.setStorage({ //缓存用户登陆状态
  20. key: 'shopDetailAction',
  21. data: provider
  22. })
  23. },
  24. }
  25. let getters = {}
  26. export default {
  27. namespaced: true,
  28. state,
  29. mutations,
  30. getters
  31. }