|
- // index.js
- // 获取应用实例
- const app = getApp()
-
- Page({
- data: {
- },
- onLoad(option) {
- console.log(option.id)
- let that = this
- if(option.id){ // 有ID则是通过分享链接进来的
- setTimeout(function(){
- that.inviteFun(option.id)
- },1000)
- }
- },
- inviteFun(id){
- let token = wx.getStorageSync('token')
- console.log(token)
- wx.request({
- url: 'https://cktest.2weisou.com/meta/ar/user/bindNShareUserId?shareUserId='+ id,
- method: "get",
- data: {},
- header: {
- Authorization: 'bearer '+ token
- },
- success(res) {
- if (res.data.code == 0) {
-
- }else{
- wx.showToast({
- icon: 'none',
- title: res.data.msg
- })
- return ;
- }
- }
- })
- },
- tabindex() {
- let userInfo = getApp().globalData.userInfo
- console.log(userInfo)
- let id = 0
- if(userInfo.phone){
- id = userInfo.id
- }
- wx.navigateTo({
- url: '/pages/out/index?index=1&userid=' + id+ '&gameid=1&type=1'
- })
- },
- tabsaoma() {
- wx.navigateTo({
- url: '/pages/AR/index'
- })
- }
- })
|