洛阳学员端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
728 B

3 months ago
  1. import { mapState } from 'vuex'
  2. export default {
  3. computed: {
  4. ...mapState({
  5. city: state=> state.user.vuex_cityInfo.city,
  6. vuex_cityInfo: state=> state.user.vuex_cityInfo,
  7. vuex_userInfo: state=> state.user.vuex_userInfo,
  8. userId: state=> state.user.vuex_loginInfo.userId,
  9. studentId: state=> state.user.vuex_userInfo.id,
  10. apiOk: state=> state.user.apiOk,
  11. }),
  12. },
  13. data() {
  14. return {
  15. }
  16. },
  17. onload() {
  18. uni.hideLoading()
  19. },
  20. onPullDownRefresh() {
  21. setTimeout(()=>{
  22. uni.stopPullDownRefresh()
  23. },1500)
  24. let token = this.$store.state.user.vuex_loginInfo.accessToken
  25. if(token) {
  26. this.$store.dispatch('getUserInfo')
  27. }
  28. if(!this.vuex_cityInfo.lat) {
  29. this.$store.dispatch('getCity')
  30. }
  31. },
  32. }