counter.js 822 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import Apis from '@/common/apis/index'
  2. const state = {
  3. currentPatient: null, // 当前查看患者
  4. }
  5. const mutations = {
  6. // 当前查看患者
  7. SET_CURRENT_PATIENT(state, data) {
  8. state.currentPatient = data
  9. },
  10. }
  11. const actions = {
  12. GetUserProfile({
  13. commit,
  14. dispatch,
  15. state
  16. }, params) {
  17. uni.showLoading({
  18. title:'',
  19. mask: true
  20. })
  21. setTimeout(() => {
  22. uni.hideLoading()
  23. }, 1000)
  24. uni.getUserProfile({
  25. lang: 'zh_CN',
  26. desc: '用于完善会员资料',
  27. success: res => {
  28. uni.hideLoading()
  29. uni.setStorageSync('userProfile', res.userInfo)
  30. uni.navigateTo({
  31. url: '/pages/login/index'
  32. })
  33. },
  34. fail: err => {
  35. uni.hideLoading()
  36. console.error('identify:error', err)
  37. }
  38. })
  39. }
  40. }
  41. const getters = {}
  42. export default {
  43. state,
  44. getters,
  45. actions,
  46. mutations
  47. }