-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplace.html
171 lines (98 loc) · 3.61 KB
/
place.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>place</title>
<meta name="viewport" content="initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link href="css/ratchet.min.css" rel="stylesheet">
<script src="js/ratchet.min.js"></script>
<script src="js/menu-bottom.js"></script>
</head>
<body>
<header class="bar bar-nav">
<a class="icon icon-left-nav pull-left" href="route.html" data-ignore="push"></a>
<a class="icon icon-edit pull-right" href="placeedit.html" data-ignore="push"></a>
<h1 class="title">Место назначения</h1>
</header>
<div class="content">
<div class="card">
<p>Название: <span id="name"></span></p>
<p>Адрес: <span id="address"></span></p>
<p>Время: <span id="time"></span></p>
<p>Контакт: <span id="contact"></span></p>
<p>Тел.: <span id="tel"></span></p>
<p>E-mail: <span id="email"></span></p>
</div>
<div id="buttons">
<button class="btn" onclick="fn1();">Звонок</button>
<button class="btn" onclick="fn2();">Смс</button>
<button class="btn" onclick="fn3();">Email</button>
<button class="btn" onclick="fn4();">Navi</button>
</div>
</div>
<div id="menu-bottom"></div>
<script type="text/javascript">
var Routeindex = "#_route" + localStorage['routeindex'];
var Route = JSON.parse(localStorage[Routeindex]);
var i = Number(localStorage['itemindex']);
if (Route.list[i].e == true) {
document.getElementById('name').innerHTML = Route.list[i].name;
document.getElementById('address').innerHTML = Route.list[i].postal_address;
document.getElementById('time').innerHTML = Route.list[i].time;
document.getElementById('contact').innerHTML = Route.list[i].contact;
document.getElementById('tel').innerHTML = Route.list[i].tel;
document.getElementById('email').innerHTML = Route.list[i].email;
}
else {
let url = 'https://staging-api.naviaddress.com/api/v1.5/Addresses/' + Route.list[i].naddr;
fetch(url).then((res1)=>
res1.json().then((res2)=>{
document.getElementById('name').innerHTML = res2.result.name;
document.getElementById('address').innerHTML = res2.result.postal_address;
})
);
if (Route.list[i].time !== undefined) {
document.getElementById('time').innerHTML = Route.list[i].time;
}
if (Route.list[i].contact !== undefined) {
document.getElementById('contact').innerHTML = Route.list[i].contact;
}
if (Route.list[i].tel !== undefined) {
document.getElementById('tel').innerHTML = Route.list[i].tel;
}
if (Route.list[i].email !== undefined) {
document.getElementById('email').innerHTML = Route.list[i].email;
}
}
function fn1() {
if (Route.list[i].tel !== undefined) {
document.location.href = "tel:" + Route.list[i].tel;
}
else {
document.location.href = "tel:";
}
}
function fn2() {
if (Route.list[i].tel !== undefined) {
document.location.href = "smsto:" + Route.list[i].tel;
}
else {
document.location.href = "smsto:";
}
}
function fn3() {
if (Route.list[i].email !== undefined) {
document.location.href = "mailto:" + Route.list[i].email;
}
else {
document.location.href = "mailto:";
}
}
function fn4() {
document.location.href = "https://naviaddress.com/" + Route.list[i].naddr;
}
</script>
</body>
</html>