-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaceedit.html
125 lines (83 loc) · 3.15 KB
/
placeedit.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>placeedit</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="place.html" data-ignore="push"></a>
<a class="icon icon-check pull-right" onclick="func();" ></a>
<h1 class="title">Место назначения</h1>
</header>
<div class="content">
<form class="input-group">
<div class="input-row">
<label>Название:</label>
<input id="name" type="text">
</div>
<div class="input-row">
<label>Адрес:</label>
<input id="address" type="text">
</div>
<div class="input-row">
<label>Время:</label>
<input id="time" type="text" value="">
</div>
<div class="input-row">
<label>Контакт:</label>
<input id="contact" type="text" value="">
</div>
<div class="input-row">
<label>Тел.:</label>
<input id="tel" type="text" value="">
</div>
<div class="input-row">
<label>E-mail:</label>
<input id="email" type="email" value="">
</div>
</form>
</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').value = Route.list[i].name;
document.getElementById('address').value = Route.list[i].postal_address;
document.getElementById('time').value = Route.list[i].time;
document.getElementById('contact').value = Route.list[i].contact;
document.getElementById('tel').value = Route.list[i].tel;
document.getElementById('email').value = 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').value = res2.result.name;
document.getElementById('address').value = res2.result.postal_address;
Route.list[i].name = res2.result.name;
Route.list[i].postal_address = res2.result.postal_address;
})
);
}
function func() {
Route.list[i].name = document.getElementById('name').value;
Route.list[i].postal_address = document.getElementById('address').value;
Route.list[i].time = document.getElementById('time').value;
Route.list[i].contact = document.getElementById('contact').value;
Route.list[i].tel = document.getElementById('tel').value;
Route.list[i].email = document.getElementById('email').value;
Route.list[i].e = true;
localStorage[Routeindex] = JSON.stringify(Route);
}
</script>
</body>
</html>