forked from easemob/kefu-webim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo-sandbox.html
178 lines (164 loc) · 4.82 KB
/
demo-sandbox.html
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<meta name="format-detection" content="telephone=no">
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,user-scalable=no">
<style>
body { background-color: #eee;color: #555; }
button, a { display: block;margin: 20px 0;background: #00CEB9;border: none;color: #fff;line-height: 40px;width: 200px;cursor: pointer;outline: none;text-align: center; }
button:hover, a:hover { box-shadow: 0 0 5px #33CEB9; }
button:active, a:active { background: #fff;color: #00CEB9; }
input { height: 40px;outline: none;width: 300px;text-align: center;font-size: 16px;color: #00CEB9; float: left;border: 1px solid #fff; }
</style>
</head>
<body>
<h1>Demo</h1>
<a target='_blank' href='http://docs.easemob.com/cs/300visitoraccess/20webplugin'>集成文档</a>
<br><br><br><br><br><br><br>
<a href='javascript:;' onclick='easemobim.bind({
tenantId: 11885,
dialogWidth: "500px"
})'>窗口加宽示例</a>
<a href='javascript:;' onclick='easemobim.bind({
tenantId: 11885,
emgroup: "售前组"
})'>绑定技能组示例</a>
<br><br><br><h1>测试</h1>
<div><input id='testvalue' type='text' placeholder='请输入您的tenantId,点击测试按钮'/></div>
<a id='test' href="javascript:;">测试</a>
<button onclick="easemobim.bind()">测试 autoConnect</button>
<br><br><br>
<script>
var v = document.getElementById('testvalue');
v.value = localStorage.getItem('easemobtest') || '';
document.getElementById('test').onclick = function () {
if (/\d+/.test(v.value)) {
localStorage.setItem('easemobtest', v.value);
easemobim.bind({ tenantId: v.value.replace(/\s/g, '') })
}
};
</script>
<script>
window.easemobim = window.easemobim || {};
easemobim.config = {
// // benz private
// appKey: 'bcssy#chat',
// restServer: 'a2.114hunan.cn',
// domain: '//estore-int-bce.mercedes-benz.com.cn',
// xmppServer: 'a2.114hunan.cn',
// // benz dev
// tenantId: 18,
// domain: '//estore-int-bce.mercedes-benz.com.cn',
// h5Origin: '//estore-int-bce.mercedes-benz.com.cn',
// xmppServer: 'estore-int-bce.mercedes-benz.com.cn',
// restServer: 'estore-int-bce.mercedes-benz.com.cn',
// path: '//estore-int-bce.mercedes-benz.com.cn/webim',
// domain: '//kefu.easemob.com',
// h5Origin: '//localhost:8080',
domain: '//sandbox.kefu.easemob.com',
tenantId: '11885',
// emgroup: 'shouqian',
// hide: false,
// test
// 访客自动上报
// eventCollector: true,
// emgroup: '售前组',
//自动连接
// autoConnect: true
// extMsg: [
// {
// "imageName": "mallImage3.png",
// "type": "custom",
// "msgtype": {
// "order": {
// "img_url": "h.png",
// "title": "mmm",
// "desc": "mmm端午节粽子四",
// "order_title":"mmm订单号:123456789012345678901234567890",
// "price": "",
// "item_url": "http://www.baidu.com?s=order_sn/123123"
// }
// }
// },
// {
// "weichat": {
// "ctrlType": "inviteEnquiry"
// },
// "cmd": {
// "updateVisitorInfoSrc": {
// "params": {
// "userid": "123456",
// }
// }
// }
// }
// ],
// extMsg: {
// "imageName": "mallImage3.png",
// "type": "custom",
// "msgtype": {
// "order": {
// "img_url": "h.png",
// "title": "mmm",
// "desc": "mmm端午节粽子四",
// "order_title":"mmm订单号:123456789012345678901234567890",
// "price": "",
// "item_url": "http://www.baidu.com?s=order_sn/123123"
// }
// }
// },
// pc 端设置
// onready: function () {
// easemobim.sendExt({
// ext:{
// "weichat": {
// "ctrlType": "inviteEnquiry"
// },
// "cmd": {
// "updateVisitorInfoSrc": {
// "params": {
// "userid": "123456",
// }
// }
// }
// }
// });
// },
// pc 端设置
// onready: function () {
// easemobim.sendExt({
// ext:{
// "imageName": "mallImage3.png",
// //custom代表自定义消息,无需修改
// "type": "custom",
// "msgtype": {
// "order": {
// "img_url": "h\n.pn",
// "title": "测试track1",
// "desc": "端午节粽子四",
// "order_title":"订单号:123456789012345678901234567890",
// "price": "",
// "item_url": "http://www.baidu.com?s=order_sn/123123"
// }
// }
// }
// });
// },
// visitor: {
// trueName: '黎小冷',
// qq: '567**34',
// phone: '188****8888',
// companyName: '环信',
// userNickname: '我是黎小冷',
// description: '描述信息',
// email: '123456@**.com'
// },
unused: ''
};
</script>
<!-- <script src='easemob.js'></script> -->
<script src='//kefu.easemob.com/webim/easemob.js'></script>
</body>
</html>