import { post } from "../../app"; // pages/agreement/index.js Page({ /** * 页面的初始数据 */ data: { stage: "first", q: "", e: "", s: "", }, toStage2() { this.setData({ stage: "second" }); }, async agree() { wx.showLoading(); const app = getApp(); const openid = app.globalData.openid; try { await post("/api/Privacy/Agreement", { openid }); app.globalData.agreed = true; const { q, e, s } = this.data; wx.redirectTo({ url: `/pages/h5map/index?q=${q}&e=${e}&s=${s}&fe=true`, }); } catch (error) { console.warn(error); } finally { wx.hideLoading(); } }, exit() { wx.exitMiniProgram(); }, toPrivacy() { wx.navigateTo({ url: "/pages/privacy/index", }); }, /** * 生命周期函数--监听页面加载 */ onLoad({ q, e, s }) { q && this.setData({ q }); e && this.setData({ e }); s && this.setData({ s }); }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () {}, /** * 生命周期函数--监听页面显示 */ onShow: function () {}, /** * 生命周期函数--监听页面隐藏 */ onHide: function () {}, /** * 生命周期函数--监听页面卸载 */ onUnload: function () {}, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () {}, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () {}, /** * 用户点击右上角分享 */ onShareAppMessage: function () {}, });