碧桂园
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

101 líneas
1.8 KiB

  1. // pages/out/index.js
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. },
  8. /**
  9. * 生命周期函数--监听页面加载
  10. */
  11. onLoad: function (options) {
  12. },
  13. backGame(){
  14. wx.navigateBack({
  15. delta: 1
  16. })
  17. // let userInfo = wx.getStorageSync('userInfo')
  18. // wx.navigateTo({
  19. // url: `/pages/out/index?index=1&userid=${userInfo.id}&gameid=1&type=2`,
  20. // })
  21. },
  22. /**
  23. * 生命周期函数--监听页面初次渲染完成
  24. */
  25. onReady: function () {
  26. },
  27. /**
  28. * 生命周期函数--监听页面显示
  29. */
  30. onShow: function () {
  31. },
  32. /**
  33. * 生命周期函数--监听页面隐藏
  34. */
  35. onHide: function () {
  36. },
  37. /**
  38. * 生命周期函数--监听页面卸载
  39. */
  40. onUnload: function () {
  41. },
  42. /**
  43. * 页面相关事件处理函数--监听用户下拉动作
  44. */
  45. onPullDownRefresh: function () {
  46. },
  47. /**
  48. * 页面上拉触底事件的处理函数
  49. */
  50. onReachBottom: function () {
  51. },
  52. /**
  53. * 用户点击右上角分享
  54. */
  55. onShareAppMessage: function (e) {
  56. console.log(e)
  57. this.shareFun()
  58. return {
  59. title: '5.5元购新房万份好礼免费兑',
  60. imageUrl: 'https://static.quhouse.com/468340e3a1374decb4fa51a172aa4f52.png',
  61. path: '/pages/index/index'
  62. }
  63. },
  64. shareFun(){
  65. let token = wx.getStorageSync('token')
  66. wx.request({
  67. url: 'https://cktest.2weisou.com/meta/ar/user/share',
  68. method: "POST",
  69. data: {},
  70. header: {
  71. Authorization: 'bearer '+ token
  72. },
  73. success(res) {
  74. console.log(res)
  75. if (res.data.code == 0) {
  76. }else{
  77. wx.showToast({
  78. icon: 'none',
  79. title: res.data.msg
  80. })
  81. return ;
  82. }
  83. }
  84. })
  85. }
  86. })