index.vue 832 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <template>
  2. <view></view>
  3. </template>
  4. <script>
  5. // pages/tabbar/index/index.js
  6. import {
  7. mapMutations,
  8. } from 'vuex';
  9. var app = getApp();
  10. export default {
  11. data() {
  12. return {
  13. puid: ""
  14. };
  15. },
  16. onLoad: function(options) {
  17. uni.showLoading({
  18. title:'正在加载'
  19. })
  20. this.puid = options.puid||'';
  21. this.bind()
  22. },
  23. onShareAppMessage: function() {},
  24. methods: {
  25. ...mapMutations(['login']),
  26. async bind() {
  27. var userInfo = await this.$wechatMiniLogin(true);
  28. this.login(userInfo);
  29. setTimeout(() => {
  30. let res = this.$api.request('/team/add', 'GET', {
  31. puid: this.puid
  32. });
  33. wx.switchTab({
  34. url:"/pages/index/index"
  35. });
  36. }, 2000);
  37. }
  38. }
  39. };
  40. </script>
  41. <style>
  42. page {
  43. background: #F5F5F5;
  44. padding: 20rpx;
  45. box-sizing: border-box;
  46. }
  47. </style>