<template>
	<view>
		<!-- #ifdef H5 -->
		<mumu-get-qrcode @success='qrcodeSucess' @error="qrcodeError" ></mumu-get-qrcode>
		<!-- #endif -->
	</view>
</template>

<script>
	// #ifdef H5
	import mumuGetQrcode from '../components/mumu-getQrcode/mumu-getQrcode.vue'
	// #endif
	export default {
		data() {
			return {
				
			}
		},
		// #ifdef H5
		components: {
			mumuGetQrcode
		},
		// #endif
		methods: {
			qrcodeSucess(data) {
				uni.$emit("scanCode", data)
				uni.navigateBack({
				        delta: 1, //返回层数，2则上上页
				})
			},
		  qrcodeError(err) {
			console.log(err)
			uni.showModal({
			  title: '摄像头授权失败',
			  content: '摄像头授权失败，请检测当前浏览器是否有摄像头权限。',
			  success: () => {
				uni.navigateBack({})
			  }
			})
		  }
		}
	}
</script>

<style>

</style>
