-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
65 lines (64 loc) · 2.45 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>DolphinWeex Preview</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-touch-fullscreen" content="yes">
<meta name="format-detection" content="telephone=no, email=no">
<link rel="stylesheet" href="./assets/style.css">
<script src="./config.js"></script>
<!-- <script src="./assets/url.js"></script> -->
<script src="./assets/qrcode.js"></script>
<script src="./node_modules/vue/dist/vue.js"></script>
</head>
<body>
<h1>Weex Preview</h1>
<div id="app"></div>
<template id="app-template">
<div id="app">
<div class="mock-phone">
<div class="inner">
<iframe id="preview" src="./weex.html"></iframe>
</div>
<div class="camera"></div>
<div class="earpiece"></div>
<div class="home-btn"></div>
</div>
<div id="qrcode">
<h2>QRCode</h2>
<a :href="val" target="_blank">
<canvas ref="canvas" width="200" height="200"></canvas>
</a>
<p class="bundle-url">
<a :href="val" target="_blank">{{val}}</a>
</p>
</div>
</div>
</template>
<script>
// getIPs(function (ip) {
// if (ip) {
// CURRENT_IP = ip
// }
console.log('ip: ' + CURRENT_IP)
var protocol = location.protocol + '//'
var hostname = typeof CURRENT_IP === 'string' ? CURRENT_IP : location.hostname
var port = location.port ? ':' + location.port : ''
var url = protocol + hostname + port + location.pathname.replace(/\/index\.html$/, '/').replace(/\/$/, '/dist/midea-demo/weex.js?ip=' + CURRENT_IP)
console.log('QR CODE URL: ' + url)
new Vue({
el: '#app',
template: '#app-template',
data: { val: url },
mounted: function () {
var qrcodedraw = new QRCodeLib.QRCodeDraw()
qrcodedraw.draw(this.$refs.canvas, this.val, function () { })
}
})
// })
</script>
</body>
</html>