first commit
This commit is contained in:
86
衣莎项目/源码/YiShaXiYi/pages/richText/richText.js
Normal file
86
衣莎项目/源码/YiShaXiYi/pages/richText/richText.js
Normal file
@@ -0,0 +1,86 @@
|
||||
// pages/richText/richText.js
|
||||
const app = getApp();
|
||||
const regeneratorRuntime = app.loadAsync()
|
||||
const model = app.loadModel("index")
|
||||
const util = app.loadUtils("util")
|
||||
const http = app.loadHttp()
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
system: app.globalData.system, //设备相关信息
|
||||
pageTitle: "关于我们", //头部标题
|
||||
isBack: true,//显示返回
|
||||
rich: {},//传入的id和头部名称
|
||||
nodes: "",//富文本
|
||||
},
|
||||
// 获取富文本
|
||||
async newsDetails() {
|
||||
let res = await http.http.request1({ url: `${http.api.newsDetails}/${this.data.rich.id}`, method: "GET" })
|
||||
this.setData({
|
||||
nodes: res.data.data.content
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
this.setData({
|
||||
'rich.id': options.id,
|
||||
'rich.title': options.title,
|
||||
pageTitle: options.title,
|
||||
})
|
||||
this.newsDetails()
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user