common.js 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. // 公共
  2. const module = {
  3. // 开启命名空间
  4. namespaced: true,
  5. // 仓库
  6. state: {
  7. iphoneX:false,
  8. curShop:{},
  9. tabIndex:0,
  10. editClassify:null, // manage/classify-form 编辑时保存的临时数据
  11. specData: null, // manage/spec-edit 编辑时临时保存
  12. skuItem: null, // manage/spec-item-form 编辑时临时保存
  13. curOrder: null, // index/refund 售后临时保存
  14. disparityData:null, // index/disparity 售后临时保存
  15. couponData:null, // manage/coupon/form 优惠券临时保存
  16. cashierGoodList:null, // manage/cashier/index 收银临时保存
  17. closeSelectList:false, //manage/cashier/index 收银临时保存
  18. cashierRefundData:false, //manage/cashier/Refund 收银退货临时保存
  19. groupData:null, //assistant/setting/xxx 临时保存
  20. platformData:null,//assistant/setting2/xxx 临时保存
  21. withdrawalData:null,//wallet/detail/ 临时保存
  22. tabList:[{
  23. id: 1,
  24. name: "订单",
  25. imgOff: "../../static/tabBar/icon_green_1.png",
  26. imgOn: "../../static/tabBar/icon_green_1_select.png",
  27. "url": "/pages/index/index",
  28. hide:false,
  29. },
  30. {
  31. id: 2,
  32. name: "管理",
  33. imgOff: "../../static/tabBar/icon_green_2.png",
  34. imgOn: "../../static/tabBar/icon_green_2_select.png",
  35. "url": "/pages/manage/index",
  36. hide:false,
  37. },
  38. {
  39. id: 3,
  40. name: "群助理",
  41. imgOff: "../../static/tabBar/icon_green_4.png",
  42. imgOn: "../../static/tabBar/icon_green_4_select.png",
  43. "url": "/pages/assistant/index",
  44. hide:false,
  45. }
  46. ]
  47. },
  48. // 同步方法
  49. mutations: {
  50. // 更新数据
  51. update(state, data) {
  52. for (let key in data) {
  53. if (data.hasOwnProperty(key)) {
  54. state[key] = data[key]
  55. }
  56. }
  57. },
  58. // 移除数据
  59. remove(state, name) {
  60. if (typeof name === 'string') {
  61. delete state[name]
  62. } else {
  63. for (let key in name) {
  64. if (name.hasOwnProperty(key)) {
  65. delete state[name[key]]
  66. }
  67. }
  68. }
  69. },
  70. // 移除所有数据
  71. removeAll(state) {
  72. for (let key in state) {
  73. if (state.hasOwnProperty(key)) {
  74. delete state[key]
  75. }
  76. }
  77. },
  78. },
  79. // 异步方法
  80. actions: {},
  81. }
  82. export default module