daofu-applet/pages/party-member/web/index.js

99 lines
1.7 KiB
JavaScript
Raw Permalink Normal View History

2024-06-04 14:45:44 +08:00
// pages/web/index.js
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
topBarH: app.globalData.CustomBar,
url: '',
title: ''
},
/**
* 查看公开内容详情
*/
getDetail: function (id) {
console.log(id,'id');
app.axios("GET", "app", `/publicContent/publicContentDetail/${id}`, {}, false).then(res => {
if (res.code == 1) {
console.log(res,'res===>');
this.data.content = res.data.content;
this.setData(this.data)
wx.setNavigationBarTitle({
title: res.data.title,
})
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
const title = options.title || '';
this.data.title = title;
this.setData(this.data)
wx.setNavigationBarTitle({
title,
})
const eventChannel = this.getOpenerEventChannel()
eventChannel.on('getUrl', (url) => {
this.data.url = url;
this.setData(this.data)
})
console.log(options.id,'options.id===>');
this.getDetail(options.id)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})