<template>
	<view></view>
</template>
<script>
	// pages/tabbar/index/index.js
	import {
		mapMutations,
	} from 'vuex';
	var app = getApp();

	export default {
		data() {
			return {
				puid: ""
			};
		},
		onLoad: function(options) {
			uni.showLoading({
				title:'正在加载'
			})
			this.puid = options.puid||'';
			this.bind()
		},

		onShareAppMessage: function() {},
		methods: {
			...mapMutations(['login']),
			
			async bind() {
				var  userInfo = await this.$wechatMiniLogin(true);
				this.login(userInfo);				
				setTimeout(() => {
					let res = this.$api.request('/team/add', 'GET', {
						puid: this.puid
					});
					wx.switchTab({
						url:"/pages/index/index"
					});
				}, 2000);
			}
		}
	};
</script>
<style>
	page {
		background: #F5F5F5;
		padding: 20rpx;
		box-sizing: border-box;
	}
</style>
