-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
executable file
·346 lines (282 loc) · 11.8 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
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>Aram DApp</title>
<script src="https://sw91.net/devops/js-test/waykiBridge.js"></script>
<!-- Bootstrap core CSS -->
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="css/shop-homepage.css" rel="stylesheet">
</head>
<body>
<!-- Navigation -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
<div class="container">
<a class="navbar-brand" href="#">개인간 거래 플랫폼</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<li class="nav-item active">
<a class="nav-link" href="#">Home
<span class="sr-only">(current)</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Services</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Contact</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- Page Content -->
<div class="container">
<div class="row">
<div class="col-lg-3">
<h1 class="my-4">아람</h1>
<div class="list-group">
<a href="#" class="list-group-item">맞춤</a>
<a href="#" class="list-group-item">구독</a>
<a href="#" class="list-group-item">인기</a>
</div>
</div>
<!-- /.col-lg-3 -->
<div class="col-lg-9">
<div id="carouselExampleIndicators" class="carousel slide my-4" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
</ol>
<div class="carousel-inner" role="listbox">
<div class="carousel-item active">
<img class="d-block img-fluid" img src="https://raw.githubusercontent.com/robertchoi/aram/master/img/1.jpg" width="900" height="350" alt="First slide">
</div>
<div class="carousel-item">
<img class="d-block img-fluid" img src="https://raw.githubusercontent.com/robertchoi/aram/master/img/2.jpg" width="900" height="350" alt="Second slide">
</div>
<div class="carousel-item">
<img class="d-block img-fluid" img src="https://raw.githubusercontent.com/robertchoi/aram/master/img/3.jpg" width="900" height="350" alt="Third slide">
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
<div class="row">
<div class="col-lg-4 col-md-6 mb-4">
<div class="card h-100">
<a href="#"><img class="card-img-top" mg src="https://raw.githubusercontent.com/robertchoi/aram/master/img/1.jpg" width="700" height="400" alt=""></a>
<div class="card-body">
<h4 class="card-title">
<button onclick="addBuy1()">구매</button>
</h4>
<h5>$15.99</h5>
<p class="card-text">큰별이미지를 팝니다. 시원하고 강력한</p>
</div>
<div class="card-footer">
<small class="text-muted">★ ★ ★ ★ ☆</small>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 mb-4">
<div class="card h-100">
<a href="#"><img class="card-img-top" img src="https://raw.githubusercontent.com/robertchoi/aram/master/img/2.jpg" width="700" height="400" alt=""></a>
<div class="card-body">
<h4 class="card-title">
<button onclick="addBuy2()">구매</button>
</h4>
<h5>$29.99</h5>
<p class="card-text">성운이미지를 팝니다. </p>
</div>
<div class="card-footer">
<small class="text-muted">★ ★ ★ ★ ☆</small>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 mb-4">
<div class="card h-100">
<a href="#"><img class="card-img-top" img src="https://raw.githubusercontent.com/robertchoi/aram/master/img/3.jpg" width="700" height="400" alt=""></a>
<div class="card-body">
<h4 class="card-title">
<button onclick="addBuy3()">구매</button>
</h4>
<h5>$34.99</h5>
<p class="card-text">별의 탄생을 보여드립니다</p>
</div>
<div class="card-footer">
<small class="text-muted">★ ★ ★ ★ ☆</small>
</div>
</div>
</div>
</div>
<!-- /.row -->
</div>
<!-- /.col-lg-9 -->
</div>
<!-- /.row -->
</div>
<!-- /.container -->
<!-- Footer -->
<footer class="py-5 bg-dark">
<div class="container">
<p class="m-0 text-center text-white">Copyright © 아람 Website 2019</p>
</div>
<!-- /.container -->
</footer>
<!-- Bootstrap core JavaScript -->
<script>
// add name to contract data
function addBuy1() {
var yourname = '1';
//var yourname = document.getElementById( 'itemName' ).innerHTML;
var nameLen = yourname.length;
console.log(yourname);
console.log(nameLen);
var yourquote = '1c';
var ageLen = yourquote.length;
console.log(yourquote);
console.log(nameLen, yourname, ageLen, yourquote);
console.log(convertToHex(nameLen, yourname, ageLen, yourquote));
waykiBridge.walletPlugin(
"walletPluginContractInvoke",
{
regId: "1111117-1",
contractField: convertToHex(nameLen, yourname, ageLen, yourquote),
inputAmount: "100000000",
remark: ""
},
function (res) {
function timer() {
document.getElementById('txid').innerHTML = `<p>Saved Successfully</p>`
}
if (res.result.txid){
document.getElementById('txid').innerHTML = `<p>Saving your name...</p>`
setTimeout(timer, 1000);
// document.getElementById('txid').innerHTML = `<p>${res.result.txid}</p>`
}else{
document.getElementById('txid').innerHTML = `<p>Saved failed... Do you have the wallet installed?</p>`
}
console.log(res)
console.log(res.result.txid)
},
function (err) {
console.log(err)
}
);
}
function addBuy2() {
var yourname = '1';
//var yourname = document.getElementById( 'itemName' ).innerHTML;
var nameLen = yourname.length;
console.log(yourname);
console.log(nameLen);
var yourquote = '1c';
var ageLen = yourquote.length;
console.log(yourquote);
console.log(nameLen, yourname, ageLen, yourquote);
console.log(convertToHex(nameLen, yourname, ageLen, yourquote));
waykiBridge.walletPlugin(
"walletPluginContractInvoke",
{
regId: "1111117-1",
contractField: convertToHex(nameLen, yourname, ageLen, yourquote),
inputAmount: "150000000",
remark: ""
},
function (res) {
function timer() {
document.getElementById('txid').innerHTML = `<p>Saved Successfully</p>`
}
if (res.result.txid){
document.getElementById('txid').innerHTML = `<p>Saving your name...</p>`
setTimeout(timer, 1000);
// document.getElementById('txid').innerHTML = `<p>${res.result.txid}</p>`
}else{
document.getElementById('txid').innerHTML = `<p>Saved failed... Do you have the wallet installed?</p>`
}
console.log(res)
console.log(res.result.txid)
},
function (err) {
console.log(err)
}
);
}
function addBuy3() {
var yourname = '1';
//var yourname = document.getElementById( 'itemName' ).innerHTML;
var nameLen = yourname.length;
console.log(yourname);
console.log(nameLen);
var yourquote = '1c';
var ageLen = yourquote.length;
console.log(yourquote);
console.log(nameLen, yourname, ageLen, yourquote);
console.log(convertToHex(nameLen, yourname, ageLen, yourquote));
waykiBridge.walletPlugin(
"walletPluginContractInvoke",
{
regId: "1111117-1",
contractField: convertToHex(nameLen, yourname, ageLen, yourquote),
inputAmount: "200000000",
remark: ""
},
function (res) {
function timer() {
document.getElementById('txid').innerHTML = `<p>Saved Successfully</p>`
}
if (res.result.txid){
document.getElementById('txid').innerHTML = `<p>Saving your name...</p>`
setTimeout(timer, 1000);
// document.getElementById('txid').innerHTML = `<p>${res.result.txid}</p>`
}else{
document.getElementById('txid').innerHTML = `<p>Saved failed... Do you have the wallet installed?</p>`
}
console.log(res)
console.log(res.result.txid)
},
function (err) {
console.log(err)
}
);
}
//convert name and age and lengths into hex
function convertToHex(num1, str1, num2, str2) {
var hex1 = '';
var hex2 = '';
var hex3 = '';
var hex4 = '';
// for number or decemals
hex1 = (num1 + 0x10000).toString(16).substr(-2).toLowerCase() + "000000";
for (var i = 0; i < str1.length; i++) {
hex2 += '' + str1.charCodeAt(i).toString(16);
}
hex3 = (num2 + 0x10000).toString(16).substr(-2).toLowerCase() + "000000";
for (var i = 0; i < str2.length; i++) {
hex4 += '' + str2.charCodeAt(i).toString(16);
}
return hex1 + hex2 + hex3 + hex4;
}
</script>
<script src="vendor/jquery/jquery.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
</body>
</html>