微信小程序:长按图片识别二维码

方法一:使用小程序提供的image组件,image组件上有一个show-menu-by-longpress的属性,设置为true,当image被长按时会弹出选择菜单

<image show-menu-by-longpress="{
    
    {true}}"></image>

方法二:当图片预览时,长按图片会弹出菜单:

wx.previewImage({
    urls:['http/imgs/xxx.png']
})

猜你喜欢

转载自blog.csdn.net/spring_007_999/article/details/129120651