// pages/out/index.js Page({ /** * 页面的初始数据 */ data: { }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { }, closeShare(){ // wx.navigateBack({ // delta: 1 // }) let userInfo = wx.getStorageSync('userInfo') wx.navigateTo({ url: `/pages/out/index?index=1&userid=${userInfo.id}&gameid=1&type=2`, }) }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, /** * 生命周期函数--监听页面显示 */ onShow: function () { }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { }, /** * 用户点击右上角分享 */ onShareAppMessage: function (e) { console.log(e) this.shareFun() return { title: '万套特惠房源5折起iPhone13 Pro Max免费赢', imageUrl: 'https://static.quhouse.com/468340e3a1374decb4fa51a172aa4f52.png', path: '/pages/index/index' } }, shareFun(){ let token = wx.getStorageSync('token') wx.request({ url: 'https://cktest.2weisou.com/meta/ar/user/share', method: "POST", data: {}, header: { Authorization: 'bearer '+ token }, success(res) { console.log(res) if (res.data.code == 0) { }else{ wx.showToast({ icon: 'none', title: res.data.msg }) return ; } } }) } })