// pages/message/detail/index.js import Scene from '../../index/scene' const math = require('../../../utils/math') const app = getApp() Scene({ /** * 页面的初始数据 */ data: { fheight: app.globalData.fragmentHeight, src: null, height: 1200 }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { if(!options.src){ wx.navigateBack() return } this.setData({ fheight: app.globalData.fragmentHeight, height: app.globalData.fragmentHeight, StatusBar: app.globalData.StatusBar || 40, CustomBar: app.globalData.CustomBar || (app.globalData.isIos ? 64 : 60), src: options.src }) }, onImageLoad: function({detail}){ if(detail && detail.width){ var radio = math.divide(detail.width, 750) var height = parseInt(math.divide(detail.height, radio)) this.setData({ height }) } }, backPage: function() { wx.navigateBack() } })