123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- // pages/articleDetail/articleDetail.js
- const app = require('../../utils/util.js');
- // const appInstance= getApp();
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- link: ''
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- // console.log(`${app.globalData.publicUrl}/ruoyi/articlePreview.html?id=${options.id}`);
- let {id, title} = options;
- this.setData({
- link: `${app.globalData.publicUrl}/ruoyi/articlePreview.html?id=${id}`
- });
- let pages = getCurrentPages();
- // console.log('pages', pages);
- let currentPage = pages[pages.length - 1];
- if (currentPage.route === 'pages/articleDetail/articleDetail') {
- // 👆 如果不添加判断,快速返回上一页,动态设置导航标题会设置到上一页上
- wx.setNavigationBarTitle({
- title: decodeURI(title)
- });
- }
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {
- },
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide: function () {
- },
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload: function () {
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function () {
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {
- },
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage: function () {
- }
- })
|