碧桂园
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

87 satır
1.9 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. panduanFun(){
  17. let that = this
  18. wx.request({
  19. url: 'http://192.168.31.104:9998/ar/game/getOne',
  20. // url: 'https://cktest.2weisou.com/meta/ar/game/getOne',
  21. method: "get",
  22. data: {},
  23. header: {
  24. Authorization: 'bearer '+ getApp().globalData.token
  25. },
  26. success(res) {
  27. console.log(res)
  28. if (res.data.code == 0) {
  29. let data = res.data.data
  30. if(data.miniType==0){
  31. that.tabindex(data.linkUrl)
  32. }else{
  33. wx.navigateTo({
  34. url: '/pages/guodu/index'
  35. })
  36. }
  37. }else{
  38. wx.showToast({
  39. icon: 'none',
  40. title: res.data.msg
  41. })
  42. return ;
  43. }
  44. }
  45. })
  46. },
  47. inviteFun(id){
  48. let token = wx.getStorageSync('token')
  49. console.log(token)
  50. wx.request({
  51. url: 'https://cktest.2weisou.com/meta/ar/user/bindNShareUserId?shareUserId='+ id,
  52. method: "get",
  53. data: {},
  54. header: {
  55. Authorization: 'bearer '+ token
  56. },
  57. success(res) {
  58. if (res.data.code == 0) {
  59. }else{
  60. wx.showToast({
  61. icon: 'none',
  62. title: res.data.msg
  63. })
  64. return ;
  65. }
  66. }
  67. })
  68. },
  69. tabindex(url) {
  70. let userInfo = getApp().globalData.userInfo
  71. console.log(userInfo)
  72. let id = 0
  73. if(userInfo.phone){
  74. id = userInfo.id
  75. }
  76. wx.navigateTo({
  77. url: '/pages/out/index?index=1&userid=' + id+ '&gameid=1&type=1&url='+url
  78. })
  79. },
  80. tabsaoma() {
  81. wx.navigateTo({
  82. url: '/pages/AR/index'
  83. })
  84. }
  85. })