修改 app
This commit is contained in:
@@ -1,29 +1,47 @@
|
||||
<template>
|
||||
<Cn-page :loading="loading" beforeRender>
|
||||
<view slot="body">
|
||||
<view class="transfer">
|
||||
<!-- <div class="transfer-img" ref="qrCodeUrl" /> -->
|
||||
<!-- <uqrcode ref="uqrcode" canvas-id="qrcode" :value="content" :options="{ margin: 10 }"></uqrcode> -->
|
||||
<uqrcode ref="uqrcode" canvas-id="qrcode" :value="content" size="200"
|
||||
@complete="complete"
|
||||
:loading="false"></uqrcode>
|
||||
<view style="height: 200rpx"></view>
|
||||
<view class="transfer-text ">请让接收人员扫码接收</view>
|
||||
<view class="transfer-btn">
|
||||
<button class="transfer-btn-item" style="background-color: #fff; color: #111" @click="back">
|
||||
返回
|
||||
</button>
|
||||
<button class="transfer-btn-item ml20" @click="scan">扫一扫</button>
|
||||
<view>
|
||||
<Cn-page :loading="loading" beforeRender>
|
||||
<view slot="body">
|
||||
<view class="transfer">
|
||||
<!-- <div class="transfer-img" ref="qrCodeUrl" /> -->
|
||||
<!-- <uqrcode ref="uqrcode" canvas-id="qrcode" :value="content" :options="{ margin: 10 }"></uqrcode> -->
|
||||
<uqrcode
|
||||
ref="uqrcode"
|
||||
canvas-id="qrcode"
|
||||
:value="content"
|
||||
size="200"
|
||||
@complete="complete"
|
||||
:loading="false"
|
||||
></uqrcode>
|
||||
<view style="height: 200rpx"></view>
|
||||
<view class="transfer-text">请让接收人员扫码接收</view>
|
||||
<view class="transfer-btn">
|
||||
<button class="transfer-btn-item" style="background-color: #fff; color: #111" @click="back">
|
||||
返回
|
||||
</button>
|
||||
<button class="transfer-btn-item ml20" @click="scan">扫一扫</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</Cn-page>
|
||||
</Cn-page>
|
||||
<uni-popup ref="alertDialog" type="dialog">
|
||||
<uni-popup-dialog
|
||||
type="info"
|
||||
cancelText="禁止"
|
||||
confirmText="允许"
|
||||
title="权限说明"
|
||||
content='是否允许"灿能物联"使用相机?'
|
||||
@confirm="handleScon"
|
||||
@close="dialogClose"
|
||||
></uni-popup-dialog>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
// import QRCode from 'qrcodejs2'
|
||||
// import UQRCode from '@/uni_modules/Sansnn-uQRCode/js_sdk/uqrcode/uqrcode.js';
|
||||
|
||||
import {transferDevice} from "@/common/api/device";
|
||||
import { transferDevice } from '@/common/api/device'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@@ -38,10 +56,10 @@ export default {
|
||||
this.loading = false
|
||||
},
|
||||
back() {
|
||||
uni.navigateBack({delta: 1})
|
||||
uni.navigateBack({ delta: 1 })
|
||||
},
|
||||
home() {
|
||||
uni.navigateBack({delta: 1})
|
||||
uni.navigateBack({ delta: 1 })
|
||||
},
|
||||
transferDevice(userId) {
|
||||
transferDevice(this.options.id, userId).then((res) => {
|
||||
@@ -53,6 +71,18 @@ export default {
|
||||
})
|
||||
},
|
||||
scan() {
|
||||
if (
|
||||
plus.os.name == 'Android' &&
|
||||
plus.navigator.checkPermission('android.permission.CAMERA') === 'undetermined'
|
||||
) {
|
||||
//未授权
|
||||
|
||||
this.$refs.alertDialog.open()
|
||||
} else {
|
||||
this.handleScon()
|
||||
}
|
||||
},
|
||||
handleScon() {
|
||||
uni.scanCode({
|
||||
success: (res) => {
|
||||
console.log(res)
|
||||
@@ -68,6 +98,7 @@ export default {
|
||||
},
|
||||
})
|
||||
},
|
||||
dialogClose() {},
|
||||
},
|
||||
onLoad(options) {
|
||||
this.options = options
|
||||
|
||||
Reference in New Issue
Block a user