1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- const app = getApp()
- const host = app.globalData.host;
- Page({
-
- data: {
- },
-
- onLoad: function (options) {
- wx.request({
- url: host + '/api/wx/article?id=' + options.id,
- method: 'GET',
- success: res => {
- wx.setNavigationBarTitle({
- title: res.data.data.title,
- })
- this.setData({
- data: res.data.data
- })
- this.init()
- }
- })
- },
- init:function(){
- const query = wx.createSelectorQuery()
- const that=this
- query.select('#editor').context(function (res) {
- res.context.setContents({
- html: that.data.data.content
- })
- })
- .exec()
- },
-
- onReady: function () {
- },
-
- onShow: function () {
- },
-
- onHide: function () {
- },
-
- onUnload: function () {
- },
-
- onPullDownRefresh: function () {
- },
-
- onReachBottom: function () {
- },
-
- onShareAppMessage: function () {
- }
- })
|