小程序中,使用web-view,预览图片使用的是JSSDK的 wx.previewImage
wx.previewImage({
showmenu: false,
current: index, // 当前显示图片的http链接
urls: list, // 需要预览的图片http链接列表
});
其中 showmenu 无效,JSSDK版本是 1.6.0
https://res.wx.qq.com/open/js/jweixin-1.6.0.js
如果是在小程序中直接使用 showmenu 是有效果的,但是 web-view中无效果
你好,请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。
2.远程地址 https://www.abc.com/123.html 中使用了JSSDK。点击图片,调用 wx.previewImage 功能。如下所示JS代码
问题:wx.previewImage 中一个参数 showmenu: false,无效。长按图片还是会出现菜单。
----------------
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
•<script>
$(function () {
•var list = []
$(".vgapp_article img").each(function () {
var img = $(this).attr("src");
list.push(img);
})
wx.config({
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: '{{ wx_info.appId }}', // 必填,公众号的唯一标识
timestamp: '{{ wx_info.timestamp }}', // 必填,生成签名的时间戳
nonceStr: '{{ wx_info.nonceStr }}', // 必填,生成签名的随机串
signature: '{{ wx_info.signature }}',// 必填,签名
jsApiList: ["previewImage"] // 必填,需要使用的JS接口列表
});
wx.ready(function () {
$(".vgapp_article img").click(function () {
var index = $(this).attr('src');
wx.previewImage({
showmenu: false,
current: index, // 当前显示图片的http链接
urls: list, // 需要预览的图片http链接列表
});
})
})
})
</script>