H5 plus 扫码功能实现
scan.vue界面<template> <view class="content"> <view>二维码数据是:{{result}}</view> <button class="btn" type="primary" @tap="open">自定义二维码界面</button> </view> </template> <script> export default { data() { return { text: '测试', type: 'scan-listener', result: '' //获取到的二维码内容,根据自己需求处理结果 } }, methods: { handClick(res){ this.result = res; }, open() { uni.navigateTo({ url: './test?text=' + this.text + '&type=' + this.type, success: res => {}, fail: () => {}, complete: () => {} }); } }, onReady() { uni.$on('handClick',this.handClick) // #ifdef APP-PLUS // #endif }, onLoad() { // #ifdef APP-PLUS this.$eventHub.