mc.previewImage(Object object)
在新页面中全屏预览图片。
Object object 参数
属性 | 类型 | 默认值 | 必填 | 说明 | 最低版本 |
---|---|---|---|---|---|
urls | [String] | 是 | 需要预览的图片链接列表。 | ||
showmenu | Boolean | true | 否 | 是否显示长按菜单 | |
current | String | urls 的第一张 | 否 | 当前显示图片的链接 | |
referrerPolicy | String | no-referrer | 否 | origin : 发送完整的 referrer; no-referrer : 不发送。 |
|
success | Function | 否 | 接口调用成功的回调函数 | ||
fail | Function | 否 | 接口调用失败的回调函数 | ||
complete | Function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
示例代码:
previewImage: function (e) {
mc.previewImage({
urls: [
'http://cn.bing.com/th?id=OHR.OberweissbacherBergbahn_EN-CN3026301899_UHD.jpg',
'https://cn.bing.com/th?id=OHR.ReddishEgret_EN-CN3104674362_UHD.jpg',
'https://cn.bing.com/th?id=OHR.SemucChampey_EN-CN8984695719_UHD.jpg',
'https://cn.bing.com/th?id=OHR.SouthernGate_EN-CN5746299507_UHD.jpg'
],
complete: (res) => {
this.setData({
previewImageInfo: JSON.stringify(res, null, 2)
})
}
})
},