碧桂园
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.1 KiB

  1. // index.js
  2. // 获取应用实例
  3. const app = getApp()
  4. Page({
  5. data: {
  6. },
  7. onLoad(option) {
  8. // console.log(option.id)
  9. // let that = this
  10. // if(option.id){ // 有ID则是通过分享链接进来的
  11. // setTimeout(function(){
  12. // that.inviteFun(option.id)
  13. // },1000)
  14. // }
  15. },
  16. inviteFun(id){
  17. let token = wx.getStorageSync('token')
  18. console.log(token)
  19. wx.request({
  20. url: 'https://cktest.2weisou.com/meta/ar/user/bindNShareUserId?shareUserId='+ id,
  21. method: "get",
  22. data: {},
  23. header: {
  24. Authorization: 'bearer '+ token
  25. },
  26. success(res) {
  27. if (res.data.code == 0) {
  28. }else{
  29. wx.showToast({
  30. icon: 'none',
  31. title: res.data.msg
  32. })
  33. return ;
  34. }
  35. }
  36. })
  37. },
  38. tabindex() {
  39. let userInfo = getApp().globalData.userInfo
  40. console.log(userInfo)
  41. let id = 0
  42. if(userInfo.phone){
  43. id = userInfo.id
  44. }
  45. wx.navigateTo({
  46. url: '/pages/out/index?index=1&userid=' + id+ '&gameid=1&type=1'
  47. })
  48. },
  49. tabsaoma() {
  50. wx.navigateTo({
  51. url: '/pages/AR/index'
  52. })
  53. }
  54. })