share.js 434 B

123456789101112131415161718192021222324252627
  1. const state = {
  2. shareTitle: '',
  3. shareImg: '',
  4. inviteCode: uni.getStorageSync('token') || ''
  5. }
  6. const mutations = {
  7. setShareInfo(state, data) {
  8. state.shareTitle = data.title
  9. state.shareImg = data.img
  10. },
  11. setInviteCode(state, data) {
  12. state.inviteCode = data.code
  13. uni.setStorageSync("invite_code", data.code);
  14. }
  15. }
  16. const actions = {
  17. }
  18. export default {
  19. namespaced: true,
  20. state,
  21. mutations,
  22. actions
  23. }