You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
113 lines
3.2 KiB
JavaScript
113 lines
3.2 KiB
JavaScript
// pages/noticeDetail/index.js
|
|
const app = getApp();
|
|
import dateUtil from "../../utils/dateUtil";
|
|
Page({
|
|
/**
|
|
* 页面的初始数据
|
|
*/
|
|
data: {
|
|
articleId: "",
|
|
record: {},
|
|
html: "",
|
|
tagStyle: {
|
|
p: "min-height:24px",
|
|
body: " margin: 0; color: #333; font-size: 14px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-variant: tabular-nums; line-height: 1.8; -webkit-font-feature-settings: 'tnum'; font-feature-settings: 'tnum';",
|
|
h1: " margin-top: 0; margin-bottom: 0.5em;margin-top:0.3em;color: rgba(0, 0, 0, 0.85); font-weight: 500;line-height: 1.1;font-size:24px; ",
|
|
h2: " margin-top: 0; margin-bottom: 0.5em;margin-top:0.3em; color: rgba(0, 0, 0, 0.85); font-weight: 500;line-height: 1.1;font-size:21px; ",
|
|
h3: " margin-top: 0; margin-bottom: 0.5em;margin-top:0.3em; color: rgba(0, 0, 0, 0.85); font-weight: 500;line-height: 1.1;font-size:16px; ",
|
|
h4: " margin-top: 0; margin-bottom: 0.5em;margin-top:0.3em; color: rgba(0, 0, 0, 0.85); font-weight: 500;line-height: 1.1 ",
|
|
h5: " margin-top: 0; margin-bottom: 0.5em;margin-top:0.3em; color: rgba(0, 0, 0, 0.85); font-weight: 500;line-height: 1.1 ",
|
|
h6: " margin-top: 0; margin-bottom: 0.5em;margin-top:0.3em; color: rgba(0, 0, 0, 0.85); font-weight: 500;line-height: 1.1 ",
|
|
strong: "font-weight: bolder;",
|
|
b: "font-weight: bolder;",
|
|
dl: "margin-top: 0; margin-bottom: 1em;",
|
|
ol: "margin-top: 0; margin-bottom: 1em;",
|
|
ul: "margin-top: 0; margin-bottom: 1em;",
|
|
li: "line-height: 1.8",
|
|
hr: "box-sizing: content-box;height:1rpx;overflow: visible;background-color: #ddd;border:0;",
|
|
table: "border-collapse: collapse;border: 1px solid #d9d9d9;margin: 18px 0 16px 0;line-height: 1.8",
|
|
td: "border: 1px solid #d9d9d9;vertical-align: top;padding: 4px 8px;line-height: 1.8",
|
|
},
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
onLoad(options) {
|
|
console.log(options.workOrderId);
|
|
this.setData({
|
|
articleId: options.workOrderId,
|
|
});
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
*/
|
|
onReady() {},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面显示
|
|
*/
|
|
onShow() {
|
|
this.getDetail();
|
|
|
|
|
|
},
|
|
getDetail() {
|
|
var that = this;
|
|
wx.request({
|
|
url: app.globalData.ip + "/cms/article/getArticleDetails",
|
|
data: { articleId: that.data.articleId },
|
|
header: app.globalData.header,
|
|
method: "GET",
|
|
success: function (res) {
|
|
console.log(res.data);
|
|
that.setData({
|
|
record: res.data.data,
|
|
html: res.data.data.articleContent.replace(/<!doctype html>/g, ""),
|
|
});
|
|
|
|
wx.setNavigationBarTitle({
|
|
title: "详情",
|
|
});
|
|
|
|
|
|
},
|
|
fail: function (res) {
|
|
console.log(res);
|
|
},
|
|
});
|
|
},
|
|
close: function () {
|
|
this.setData({
|
|
phoneDialog: false,
|
|
});
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面隐藏
|
|
*/
|
|
onHide() {},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面卸载
|
|
*/
|
|
onUnload() {},
|
|
|
|
/**
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
*/
|
|
onPullDownRefresh() {},
|
|
|
|
/**
|
|
* 页面上拉触底事件的处理函数
|
|
*/
|
|
onReachBottom() {},
|
|
|
|
/**
|
|
* 用户点击右上角分享
|
|
*/
|
|
onShareAppMessage() {},
|
|
});
|