| @@ -5,12 +5,12 @@ Page({ | |||||
| data: { | data: { | ||||
| token: '', | token: '', | ||||
| userInfo: null, | userInfo: null, | ||||
| paramsid: ''// 邀请人ID | |||||
| shareid: ''// 邀请人ID | |||||
| }, | }, | ||||
| onLoad(option) { | onLoad(option) { | ||||
| console.log(option.id) | console.log(option.id) | ||||
| this.setData({ | this.setData({ | ||||
| paramsid: option.id | |||||
| shareid: option.id | |||||
| }) | }) | ||||
| this.loginGettoken() | this.loginGettoken() | ||||
| }, | }, | ||||
| @@ -29,7 +29,7 @@ Page({ | |||||
| if (res.data.code == 0) { | if (res.data.code == 0) { | ||||
| let data = res.data.data | let data = res.data.data | ||||
| // gameVersion为指定发版,和后台是否保持一致,方便提审通过,后续只需更改1为2,3,4,5... | // gameVersion为指定发版,和后台是否保持一致,方便提审通过,后续只需更改1为2,3,4,5... | ||||
| if(data.miniType==0&&data.gameVersion==2){ | |||||
| if(data.miniType==0&&data.gameVersion==3){ | |||||
| getApp().globalData.gameurl = data.linkUrl | getApp().globalData.gameurl = data.linkUrl | ||||
| that.tabindex(data.linkUrl) | that.tabindex(data.linkUrl) | ||||
| }else{ | }else{ | ||||
| @@ -73,12 +73,12 @@ Page({ | |||||
| }) | }) | ||||
| }, | }, | ||||
| tabindex(url) { | tabindex(url) { | ||||
| let id = 0 | |||||
| let openid = 0 | |||||
| if(this.data.userInfo.phone){ | if(this.data.userInfo.phone){ | ||||
| id = this.data.userInfo.id | |||||
| openid = this.data.userInfo.openid | |||||
| } | } | ||||
| wx.navigateTo({ | wx.navigateTo({ | ||||
| url: '/pages/out/index?index=1&userid=' + id+ '&gameid=1&type=1&url='+url | |||||
| url: '/pages/out/index?index=1&openid=' + openid+ '&gameid=1&type=1&url='+url | |||||
| }) | }) | ||||
| }, | }, | ||||
| saoma() { | saoma() { | ||||
| @@ -107,8 +107,8 @@ Page({ | |||||
| token: res1.data.access_token, | token: res1.data.access_token, | ||||
| userInfo: res1.data.user_info | userInfo: res1.data.user_info | ||||
| }) | }) | ||||
| if(that.data.paramsid){ // 有ID则是通过分享链接进来的 | |||||
| that.inviteFun(that.data.paramsid) | |||||
| if(that.data.shareid){ // 有ID则是通过分享链接进来的 | |||||
| that.inviteFun(that.data.shareid) | |||||
| } | } | ||||
| getApp().globalData.token = res1.data.access_token | getApp().globalData.token = res1.data.access_token | ||||
| getApp().globalData.userInfo = res1.data.user_info | getApp().globalData.userInfo = res1.data.user_info | ||||
| @@ -83,7 +83,7 @@ Page({ | |||||
| }, | }, | ||||
| leave(){ | leave(){ | ||||
| wx.navigateTo({ | wx.navigateTo({ | ||||
| url: '/pages/out/index?index=1&userid='+ this.data.userid+'&gameid=1'+'&type=2&url=' + getApp().globalData.gameurl, | |||||
| url: '/pages/out/index?index=1&openid='+ this.data.userInfo.openid+'&gameid=1'+'&type=2&url=' + getApp().globalData.gameurl, | |||||
| }) | }) | ||||
| }, | }, | ||||
| // 绑定用户头像信息 | // 绑定用户头像信息 | ||||
| @@ -1,9 +1,4 @@ | |||||
| // pages/out/index.js | |||||
| Page({ | Page({ | ||||
| /** | |||||
| * 页面的初始数据 | |||||
| */ | |||||
| data: { | data: { | ||||
| web:null, | web:null, | ||||
| index:0, | index:0, | ||||
| @@ -12,9 +7,6 @@ Page({ | |||||
| type: 1, | type: 1, | ||||
| allurl: "" | allurl: "" | ||||
| }, | }, | ||||
| /** | |||||
| * 生命周期函数--监听页面加载 | |||||
| */ | |||||
| onLoad: function (options) { | onLoad: function (options) { | ||||
| console.log(options); | console.log(options); | ||||
| this.setData({ | this.setData({ | ||||
| @@ -23,7 +15,7 @@ Page({ | |||||
| userid: options.userid, | userid: options.userid, | ||||
| gameid: options.gameid, | gameid: options.gameid, | ||||
| type: options.type, | type: options.type, | ||||
| allurl: options.url +`?userid=${options.userid||0}&gameid=${options.gameid||0}&type=${options.type==2?2:1}` | |||||
| allurl: options.url +`?openid=${options.openid||0}&gameid=${options.gameid||0}&type=${options.type==2?2:1}` | |||||
| }) | }) | ||||
| console.log(this.data.web) | console.log(this.data.web) | ||||
| console.log(this.data.index) | console.log(this.data.index) | ||||
| @@ -1,7 +1,5 @@ | |||||
| Page({ | Page({ | ||||
| /** | /** | ||||
| * 页面的初始数据 | * 页面的初始数据 | ||||
| */ | */ | ||||
| @@ -18,7 +16,7 @@ Page({ | |||||
| let userInfo = getApp().globalData.userInfo | let userInfo = getApp().globalData.userInfo | ||||
| console.log(userInfo) | console.log(userInfo) | ||||
| wx.navigateTo({ | wx.navigateTo({ | ||||
| url: `/pages/out/index?index=1&userid=${userInfo.id}&gameid=1&type=2&url=`+ getApp().globalData.gameurl | |||||
| url: `/pages/out/index?index=1&openid=${userInfo.openid}&gameid=1&type=2&url=`+ getApp().globalData.gameurl | |||||
| }) | }) | ||||
| }, | }, | ||||
| /** | /** | ||||
| @@ -67,12 +65,12 @@ Page({ | |||||
| * 用户点击右上角分享 | * 用户点击右上角分享 | ||||
| */ | */ | ||||
| onShareAppMessage: function (e) { | onShareAppMessage: function (e) { | ||||
| // console.log(getApp().globalData.userInfo.id) | |||||
| // console.log(getApp().globalData.userInfo.) | |||||
| this.shareFun() | this.shareFun() | ||||
| return { | return { | ||||
| title: '万套房源5折起,iPhone13 Pro Max免费赢!速来!', | title: '万套房源5折起,iPhone13 Pro Max免费赢!速来!', | ||||
| imageUrl: 'https://static.quhouse.com/468340e3a1374decb4fa51a172aa4f52.png', | imageUrl: 'https://static.quhouse.com/468340e3a1374decb4fa51a172aa4f52.png', | ||||
| path: '/pages/index/index?id=' + getApp().globalData.userInfo.id | |||||
| path: '/pages/index/index?openid=' + getApp().globalData.userInfo.openid | |||||
| } | } | ||||
| }, | }, | ||||
| shareFun(){ | shareFun(){ | ||||