-
Notifications
You must be signed in to change notification settings - Fork 1
/
call.vue
95 lines (92 loc) · 2.24 KB
/
call.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<template>
<div class="wrapper">
<div class="title_root">
<div class="tdot"></div>
<text class="tlab">Simple Call</text>
</div>
<div class="pannel" @click="onSimpleCall">
<text class="cme">click me</text>
<text class="content">call.invoke('10010');</text>
</div>
<div class="title_root">
<div class="tdot"></div>
<text class="tlab">Call with callback</text>
</div>
<div class="pannel" @click="onCallbackCall">
<text class="cme">click me</text>
<text class="content">call.invoke('10010', (e) => {
if(e.result == 'success') {
modal.toast({
message: "called",
gravity: "bottom",
duration: 1
});
}
});</text>
</div>
</div>
</template>
<script>
var modal = weex.requireModule('modal');
var call = weex.requireModule('call');
module.exports = {
data: {
},
methods: {
onSimpleCall() {
call.invoke('10010');
},
onCallbackCall() {
call.invoke('10010', (e) => {
if(e.result == 'success') {
modal.toast({
message: "called",
gravity: "bottom",
duration: 1
});
}
});
}
}
}
</script>
<style scoped>
.wrapper {
padding: 40px;
}
.title_root {
flex-direction: row;
align-items: center;
}
.tdot {
width: 20px;
height: 20px;
background-color: #0088fb;
border-radius: 10px;
}
.tlab {
font-size: 32px;
font-weight: bold;
margin-left: 20px;
}
.pannel {
flex-direction: column;
margin-top: 20px;
margin-bottom: 20px;
background-color: #F2F2F2;
border-radius: 10px;
padding: 40px;
}
.cme {
font-size: 24px;
color: #CCC;
align-self: flex-end;
position: absolute;
right: 20px;
top: 20px;
}
.content {
font-size: 26px;
color: #666;
}
</style>