yuminge-app/yun-min-program-plugin-master/packageE/stationNotice/stationNoticeActivityDetail/stationNoticeActivityDetail.js

83 lines
1.6 KiB
JavaScript

// packageE/stationNotice/stationNoticeActivityDetail/stationNoticeActivityDetail.js
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
id: 0,
detailData: {},
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.data.id = options.id;
this.getDetails();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
getDetails() {
let urlStr = app.getNetAddresss(
"plugin.instation-message.api.message.get-message-detail"
);
app._postNetWork({
url: urlStr,
data: {
id: this.data.id,
},
success: (resdata) => {
var res = resdata.data;
if (res.result != 1) return this.tips(res.msg);
res.data = res.data.replace(/<img/gi, '<img style="max-width:100%;height:auto;display:block" ');
this.setData({
detailData: res.data,
});
},
});
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {},
tips(msg) {
wx.showToast({
title: msg,
icon: "none",
duration: 2000,
});
return false;
},
});