daofu-applet/pages/web/index.js

147 lines
2.6 KiB
JavaScript
Raw Normal View History

2024-01-29 17:42:38 +08:00
// pages/web/index.js
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
topBarH: app.globalData.CustomBar,
url: '',
title: ''
},
2024-03-20 17:09:58 +08:00
/**
* 获取消息详情
*/
getDetail: function (id) {
app.axios("GET", "app", `/notice/noticeDetail/${id}`, {}, false).then(res => {
if (res.code == 1) {
this.data.content = res.data.content;
this.setData(this.data)
wx.setNavigationBarTitle({
title: res.data.title,
})
}
})
},
2024-01-29 17:42:38 +08:00
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
2024-03-20 17:09:58 +08:00
const title = options.title || '';
2024-01-29 17:42:38 +08:00
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)
})
2024-03-20 17:09:58 +08:00
this.getDetail(options.id)
2024-01-29 17:42:38 +08:00
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
2024-06-04 14:45:44 +08:00
})
// data: {
// topBarH: app.globalData.CustomBar,
// url: '',
// title: '',
// currentIndex: 0,
// tabs: [{
// lab: '今日工作'
// }, {
// lab: '历史工作'
// }],
// dealContent:'',
// },
// /**
// * 选择菜单
// */
// tabSelect: function (params) {
// this.data.currentIndex = params.currentTarget.dataset.index;
// console.log(this.data.currentIndex,'this.data.currentIndex==>');
// this.setData(this.data);
// this.getDetail();
// },
// /**
// * 获取消息详情
// */
// getDetail: function () {
// let dealKeyWord = '';
// if (this.data.currentIndex == 1) {
// dealKeyWord = 'privacy_deal';
// }else{
// dealKeyWord = 'user_deal';
// }
// app.axios("GET", "app", `/sysKey/dealSetting/${dealKeyWord}`, {}, false).then(res => {
// console.log(res,'res===>');
// if (res.code == 1) {
// this.data.dealContent = res.data.dealContent;
// this.setData(this.data)
// // wx.setNavigationBarTitle({
// // title: res.data.title,
// // })
// }
// })
// },