-
Notifications
You must be signed in to change notification settings - Fork 0
/
getconpon.html
83 lines (77 loc) · 2.19 KB
/
getconpon.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="./css/getconpon.css">
<title>Document</title>
</head>
<body>
<header>
<a href="#" class="back"></a>
<div class="tlt">
<h3>优惠券</h3>
</div>
<a href="#" class="app">
<img src="./images/header_app.png" alt="">
</a>
</header>
<section class="conpons">
<!-- <div class="item">
<a href="conpons.html">
<div class="logo">
<img src="./images/kfc.jpg" alt="">
</div>
<span>肯德基</span>
</a>
</div>
<div class="item">
<a href="conpons.html">
<div class="logo">
<img src="./images/kfc.jpg" alt="">
</div>
<span>肯德基</span>
</a>
</div> -->
</section>
<section class="location">
<div>
<span>首页 </span>
<i>></i>
<span> 优惠券</span>
</div>
</section>
</body>
<script src="js/zepto.min.js"></script>
<script src="js/dialog.js"></script>
<script src="./js/template-web.js"></script>
<script type="text/template" id="template">
{{each data value}}
<div class="item">
<a href="conpons_item.html?id={{value.couponId}}">
<div class="logo">
<img src="{{value.couponImg}}" alt="">
</div>
<span>{{value.couponTitle}}</span>
</a>
</div>
{{/each}}
</script>
<script>
$(function () {
$.ajax({
type: 'GET',
url: 'http://mmb.ittun.com/api/getcoupon',
dataType: 'json',
success: function (res) {
console.log(res);
var data = res.result;
console.log(data);
var dataJson = template('template',{"data":data});
$(".conpons").html(dataJson);
}
})
})
</script>
</html>