-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
160 lines (156 loc) · 4.19 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, user-scalable=no">
<title></title>
<link rel="stylesheet" type="text/css" href="css/app.css">
</head>
<body>
<div id="app">
<div class="header">
<div class="nav">
<div class="back" v-on:click="goBack">
<span class="arrow">
<span class="arrow green"></span>
</span>
</div>
<div class="login">登录</div>
<h1>团购网</h1>
</div>
<div class="search" v-show="showSearch">
<input type="text" v-model="search" v-on:keyup.enter="goSearch" placeholder="请输入搜索关键字">
</div>
</div>
<!-- 页面组件 -->
<component v-bind:csearch="dealSearch" v-bind:is="view" ></component>
</div>
<!-- home模板 -->
<script type="text/template" id="tpl_home">
<section class="home">
<ul class="home-type clearfix">
<li v-for="item in types">
<a href="#/list/type/{{item.id}}">
<img v-bind:src="'img/icon/'+ item.url">
<p>{{item.title}}</p>
</a>
</li>
</ul>
<ul class="home-ad clearfix">
<li v-for="item in ad">
<a href="#/product/{{item.id}}">
<h3>{{item.title}}</h3>
<p>{{item.description}}</p>
<img v-bind:src="'img/product/' + item.url" alt="">
</a>
</li>
</ul>
<ul class="list-container">
<li v-for="item in list">
<a href="#/product/{{item.id}}">
<img v-bind:src="'img/list/' + item.img">
<div class="description">
<h2>{{item.title}}</h2>
<p>
<span class="price">{{item.price | price}}</span>
<span class="orign-price">{{item.orignPrice | orignPrice}}</span>
<span class="sales">{{item.sales | sales}}</span>
</p>
</div>
</a>
</li>
</ul>
</section>
</script>
<!-- list页面组件模板 -->
<script type="text/template" id="tpl_list">
<section class="list">
<ul class="list-type clearfix">
<li v-for="item in types" v-on:click="sortBy(item.key)">
<span>{{item.value}}</span>
<span class="arrow"></span>
</li>
</ul>
<ul class="list-container">
<li v-for="item in list | filterBy csearch">
<a href="#/product/{{item.id}}">
<img v-bind:src="'img/list/' + item.img">
<div class="description">
<h2>{{item.title}}</h2>
<p>
<span class="price">{{item.price | price}}</span>
<span class="orign-price">{{item.orignPrice | orignPrice}}</span>
<span class="sales">{{item.sales | sales}}</span>
</p>
</div>
</a>
</li>
</ul>
<div class="load-more" v-on:click='loadmore' v-show="other.length">
<span>查看其他 {{other.length}} 条团购</span>
<span class="arrow"><span class="arrow green"></span></span>
</div>
</section>
</script>
<!-- 产品页面组件模板 -->
<script type="text/template" id="tpl_product">
<section class="product">
<div class="title">
<img v-bind:src="'img/item/' + data.src">
<h1>{{data.title}}</h1>
<p>{{data.description}}</p>
</div>
<div class="price">
<span class="green">
<span class="big">{{data.price}}</span>
元
</span>
<span>{{data.orignPrice | orignPrice}}</span>
<span class="btn">立即购买</span>
</div>
<ul class="sales clearfix">
<li class="info">支持随时退款</li>
<li class="info">支持过期退货</li>
<li>已售{{data.sales}}</li>
</ul>
<div class="part store">
<h3 class="sub-title">店家信息</h3>
<div class="container">
<p>{{data.storeName}}</p>
<p>{{data.storeAdress}}</p>
</div>
<div class="footer">查看 {{data.storeNum}} 家试用分店</div>
</div>
<div class="part buy">
<h3 class="sub-title">购买须知</h3>
<div class="container">
<ul class="list">
<li>
<h4>有效期</h4>
<div>
<p>{{data.validateTime}}</p>
</div>
</li>
<li>
<h4>使用时间</h4>
<div>
<p>{{data.useTime}}</p>
</div>
</li>
<li>
<h4>使用规则</h4>
<div>
<ul>
<li v-for="item in data.rules">{{item}}</li>
</ul>
</div>
</li>
</ul>
</div>
</div>
</section>
</script>
<script type="text/javascript" src="js/vue.js"></script>
<script type="text/javascript" src="js/app.js"></script>
</body>
</html>