-
Notifications
You must be signed in to change notification settings - Fork 1
/
scan.vue
79 lines (76 loc) · 1.82 KB
/
scan.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<template>
<scroller show-scrollbar="false">
<div class="group center">
<div class="panel">
<text class="text">{{value}}</text>
</div>
</div>
<div class="group">
<mpwx-btn class="btn" label='扫描二维码' id="0" @onBtnClicked="scan"></mpwx-btn>
</div>
</scroller>
</template>
<script>
const scan = weex.requireModule('scan');
var modal = weex.requireModule('modal');
import MpwxBtn from "../mpwx-btn"
export default {
components : {MpwxBtn},
data() {
return {
value: '---'
}
},
methods: {
scan () {
var self = this;
scan.scan({
base64: false
}, function (e) {
if (e.result === 'success') {
self.value = e.data;
}
});
}
}
}
</script>
<style scoped>
.panel {
min-height: 100px;
flex-direction: column;
justify-content: center;
border-width: 2px;
border-style: solid;
border-color: rgb(162, 217, 192);
background-color: rgba(162, 217, 192, 0.2);
}
.group {
flex-direction: column;
width: 650px;
margin-left: 50px;
margin-top: 50px;
}
.center {
justify-content: center;
}
.text {
font-size: 50px;
text-align: center;
padding-left: 25px;
padding-right: 25px;
color: #41B883;
}
.image {
min-width: 200px;
min-height: 200px;
margin-top: 50px;
align-self: center;
width: 200px;
height: 200px;
}
.btn {
margin-bottom: 12px;
margin-top: 12px;
}
</style>