You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
949 B
42 lines
949 B
// pages/html/banner/index.js
|
|
const math = require('../../../utils/math')
|
|
const app = getApp()
|
|
|
|
Page({
|
|
/**
|
|
* 页面的初始数据
|
|
*/
|
|
data: {
|
|
src: null,
|
|
height: 1200
|
|
},
|
|
/**
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
onLoad: function (options) {
|
|
if(!options.src){
|
|
wx.navigateBack()
|
|
return
|
|
}
|
|
wx.showLoading({ title: '处理中', mask: true })
|
|
this.setData({
|
|
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 })
|
|
}
|
|
wx.hideLoading()
|
|
},
|
|
backPage() {
|
|
wx.navigateBack()
|
|
},
|
|
onClick: function(){
|
|
wx.redirectTo({ url: '/pages/goods/ablility/index' })
|
|
}
|
|
})
|