import { delMessages } from '../../api/message' // pages/message_details/index.js var base64 = require('../../utils/base64') const app = getApp() Page({ /** * 页面的初始数据 */ data: { parameter: { title: '消息详情', navbar: '1', return: '1', color: false }, id: 0, title: '', from: '', date: '', type: 1, content: '', read: 0, fixed: false }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { var data = JSON.parse(decodeURIComponent(options.data)) var params = this.data.parameter params.title = data.subject this.setData({ id: data.id, title: data.subject, from: data.from, date: data.ts, type: data.type, content: data.body, read: data.read, parameter: params, fixed: app.globalData.isFixed }) }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () {}, /** * 生命周期函数--监听页面显示 */ onShow: function () {}, /** * 生命周期函数--监听页面隐藏 */ onHide: function () {}, /** * 生命周期函数--监听页面卸载 */ onUnload: function () {}, onClickedDelete: function () { delMessages([this.data.id]) wx.switchTab({ url: '/pages/message/index' }) } })