-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathErickBot.html
More file actions
113 lines (101 loc) · 2.75 KB
/
Copy pathErickBot.html
File metadata and controls
113 lines (101 loc) · 2.75 KB
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>test</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="src/build/botui.min.css">
<link rel="stylesheet" href="src/build/botui-theme-default.css">
</head>
<body>
<div class="botui-app-container" id="hello-world">
<bot-ui></bot-ui>
</div>
<script src="https://cdn.jsdelivr.net/vue/2.0.5/vue.min.js"></script>
<script src="src/build/botui.js"></script>
<script>
var botui = new BotUI('hello-world'); // id de contenedor
botui.message.bot({
delay: 200,
content: '¡Hola, soy Erick! 😃'
}).then(function () {
return botui.message.bot({
loading: true,
delay: 1750,
content: 'Soy un Ingeniero apasionado por la tecnología '
});
}).then(function () {
return botui.message.bot({
loading: true,
delay: 2000,
content: '¿Le gustaría conocer mas sobre mi perfil?'
});
}).then(function () {
return botui.action.button({
delay: 1000,
action: [ {
text: 'Personal',
value: '1'
},
{
text: 'Profesional',
value: '2'
},
{
text: 'Cuentame TODO',
value: '3'
}]
})
}).then(function (res) {
if(res.value == '1') {
personal();
}
if(res.value == '2') {
profesional();
} else {
todo();
}
})
var personal = function () {
botui.message
.bot({
loading: true,
delay: 1000,
content: '¡Que gusto!'
}).then(function (res) {
botui.message
.bot({
loading: true,
delay: 2600,
content: 'Veras, tengo 30 años, soltero, me gusta mucho cocinar, la fotografía y tengo un gato que se llama panchito'
});}).then(function () {
return botui.message.bot({
loading: true,
delay: 4000,
content: '¿Le gustaría conocer mis otros perfiles?'
});}).then(function () {
return botui.action.button({
delay: 1000,
action: [ {
text: 'Profesional',
value: '2'
},
{
text: 'Cuentame TODO',
value: '3'
}]
})
}).then(function (res) {
if(res.value == '1') {
personal();
}
if(res.value == '2') {
profesional();
} else {
todo();
}
});
}
</script>
</body>
</html>