当前位置:   article > 正文

uniapp小程序——长按识别二维码_uni-app开发微信小程序长按识别微信收款码

uni-app开发微信小程序长按识别微信收款码

说明

写法一:

小程序版本:
<image class="pic" show-menu-by-longpress="{{true}}" :src="src" mode="widthFix" />
  • 1
uniapp版本:
<image :src="src" mode="widthFix" :show-menu-by-longpress="true"></image>
  • 1

写法二:

长按预览图片,之后再长按图片进行识别

<image :src="i.image(image)" mode="aspectFill" @longpress="handleLongPress(i.image(image))"></image>
  • 1
//长按识别二维码
const handleLongPress = (e) => {
	uni.previewImage({
		urls:[e],
		longPressActions: {
			itemList: ['发送给朋友', '保存图片', '收藏'],
			success: (res) =>{
				console.log(res);
			},
			fail: (res)=> {
				console.log(res.errMsg);
			}
		}
	})
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop】
推荐阅读
相关标签
  

闽ICP备14008679号