|
- let app = getApp();
- var WxParse = require('../../wxParse/wxParse.js');
- const config = require("../../config/config");
- const Http = require("../../utils/HttpBasics");
- Page({
-
- /**
- * 页面的初始数据
- */
- data: {
- url: config.url,
- token: app.globalData.token,
- id:'',
- date:new Date()
- },
-
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- const that = this;
- that.setData({
- url: config.url,
- id:options.id,
- token: app.globalData.token
- })
-
- /*** WxParse.wxParse(bindName , type, data, target,imagePadding)
- * 1.bindName绑定的数据名(必填)
- * 2.type可以为html或者md(必填)
- * 3.data为传入的具体数据(必填)
- * 4.target为Page对象,一般为this(必填)
- * 5.imagePadding为当图片自适应是左右的单一padding(默认为0,可选)*/
- // that.getWord(options.id)
-
- wx.request({
- url: 'https://ciformall.youlane.cn/C/api' + config.api.printHtmlById,
- data: {
- token: app.globalData.token,
- id: options.id,
- date: new Date()
- },
- header: {
- 'content-type': 'application/html'
- },
- success: function (res) {
- var temp = WxParse.wxParse('article', 'html',res.data, that, 5);
- }
- })
- },
-
- /**
- * 获得宣传页富文本详情
- */
- getWord(id){
- let that = this;
- wx.request({
- url: 'https://ciformall.youlane.cn/C/api'+config.api.printHtmlById,
- data: {
- token: app.globalData.token,
- id: id,
- date: new Date()
- },
- header: {
- 'content-type': 'application/html'
- },
- success:function(res){
- that.setData({
- wordHtml:res.data
- })
- }
- })
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
-
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function () {
- this.setData({
- date:new Date()
- })
- },
-
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide: function () {
-
- },
-
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload: function () {
-
- },
-
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function () {
-
- },
-
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function () {
-
- },
-
- })
|