index.vue 849 B

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