index.html
10.3 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="user-scalable=0, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
<meta content="telephone=no" name="format-detection" />
<meta content="black" name="apple-mobile-web-app-status-bar-style" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>鲜香优质--沈阳专场</title>
<link rel="stylesheet" href="css/topic.css">
</head>
<body>
<div class="m-page"></div>
<script src="js/jquery-2.1.3.min.js"></script>
<script src="js/underscore-min.js"></script>
<script type="text/template" id="contentTpl">
<%if(wap){%>
<header class="m-header header-light">
<div class="head">
<a href="javascript:history.go(-1);" class="lt-bar m-icon icon-back">返回</a>
<h1>鲜香优质--沈阳专场</h1>
<!-- <a href="#" class="rt-bar text">分享</a> -->
</div>
</header>
<%}%>
<div class="nf_main">
<!-- 顶部banner -->
<div class="section">
<img src="images/main/banner_01.jpg" alt="鲜香优质--沈阳专场">
</div>
<div class="section">
<%_.each(features, function(feature, index){%>
<a href="<%=wap ? 'http://m.nong12.com/goods/getIntroductionPageById.do?pid='+feature.id : 'http://www.nong12.com/product/'+feature.id+'.html'%>" title="<%=feature.title%>"><img src="images/main/banner_0<%=index+2%>.jpg" alt="<%=feature.title%>"></a>
<%})%>
</div>
<div class="section product background-green">
<ul>
<%_.each(products[0], function(product, index){%>
<li>
<a href="<%=wap ? 'http://m.nong12.com/goods/getIntroductionPageById.do?pid='+product.id : 'http://www.nong12.com/product/'+product.id+'.html'%>" title="<%=product.title%>"><img src="images/product/product_1_0<%=index+1%>.jpg" alt="<%=product.title%>"></a>
</li>
<%})%>
</ul>
</div>
<div class="section product background-orange">
<a href="http://m.nong12.com/features/category.do?id=0&rid=481" title=""><img src="images/main/header_01.jpg" alt="鲜香优质--沈阳专场"></a>
<img src="images/main/header_02.jpg" alt="鲜香优质--沈阳专场">
<ul>
<%_.each(products[1], function(product, index){%>
<li>
<a href="<%=wap ? 'http://m.nong12.com/goods/getIntroductionPageById.do?pid='+product.id : 'http://www.nong12.com/product/'+product.id+'.html'%>" title="<%=product.title%>"><img src="images/product/product_2_0<%=index+1%>.jpg" alt="<%=product.title%>"></a>
</li>
<%})%>
</ul>
</div>
<div class="section product background-red">
<a href="http://m.nong12.com/features/category.do?id=0&rid=875" title=""><img src="images/main/header_03.jpg" alt="鲜香优质--沈阳专场"></a>
<img src="images/main/header_04.jpg" alt="鲜香优质--沈阳专场">
<ul>
<%_.each(products[2], function(product, index){%>
<li>
<a href="<%=wap ? 'http://m.nong12.com/goods/getIntroductionPageById.do?pid='+product.id : 'http://www.nong12.com/product/'+product.id+'.html'%>" title="<%=product.title%>"><img src="images/product/product_3_0<%=index+1%>.jpg" alt="<%=product.title%>"></a>
</li>
<%})%>
</ul>
</div>
<div class="section">
<a href="http://m.nong12.com/features/category.do?id=0&rid=1009" title=""><img src="images/main/header_05.jpg" alt="鲜香优质--沈阳专场"></a>
<img src="images/main/header_06.jpg" alt="鲜香优质--沈阳专场">
</div>
<div class="section store">
<%_.each(stores, function(store, index){%>
<a href="<%='http://m.nong12.com/shop/storedetail.do?id='+store.id%>" title="<%=store.title%>"><img src="images/store/shop_0<%=index+1%>.jpg" alt="<%=store.title%>"></a>
<%})%>
</div>
<div class="section">
<a href="http://m.nong12.com/features/category.do?id=0&rid=875" title=""><img src="images/main/header_07.jpg" alt="鲜香优质--沈阳专场"></a>
</div>
<div class="section market">
<img src="images/main/market_bg.jpg" alt="鲜香优质--沈阳专场">
<dl class="clearfix">
<%_.each(markets, function(market){%>
<dd><a href="http://m.nong12.com/goods/searchByKeyword.do?type=0&key=<%=market.key%>"><%=market.title%></a></dd>
<%})%>
</dl>
</div>
<div class="section footer">
<a href="http://static.nong12.com/static/app.html" title="app下载"><img src="images/main/footer.jpg" alt="app下载"></a>
</div>
</div>
<a href="#" class="m-to-top"></a>
</script>
<script>
$(function() {
var Topic = {
wap: false,
data: {
features:[{
"id": "1000025750",
"title": "沃特芒产地四川攀枝花"
},{
"id": "1000025603",
"title": "柚子 产地 福建"
},{
"id": "1000030238",
"title": "蜜桔"
}],
products:[
[{
"id": "1000030384",
"title": "蛇果 产地 美国"
},{
"id": "1000008234",
"title": "金枕榴莲 产地 泰国 "
},{
"id": "1000002682",
"title": "橙子 产地 南非"
},{
"id": "1000002778",
"title": "凤梨 产地台湾台北市"
},{
"id": "1000009343",
"title": "红心火龙果产地越南"
},{
"id": "1000030378",
"title": "牛油果 产地 美国"
}],
[{
"id": "1000003611",
"title": "圣女果产地辽宁鞍山"
},{
"id": "1000025712",
"title": "玖红瓜产地山东"
},{
"id": "1000025762",
"title": "哈密瓜产地山东"
},{
"id": "1000040859",
"title": "香蕉 产地 广西南宁"
},{
"id": "1000025530",
"title": "金心猕猴桃产地四川"
},{
"id": "1000025751",
"title": "辽峰葡萄 产地 辽宁 辽阳"
}],
[{
"id": "1000011984",
"title": "开口松子产地辽宁沈阳"
},{
"id": "1000037759",
"title": "榛子产地辽宁沈阳"
},{
"id": "1000037738",
"title": "和田枣产地辽宁沈阳"
},{
"id": "1000049794",
"title": "核桃 产地 新疆"
}]
],
stores: [{
id:2213,
title: '永飞果业'
},{
id:2873,
title: '亦春芒果'
},{
id:107499,
title: '徐文水果'
},{
id:110637,
title: '振福水果批发'
}],
markets: [{
'key':'%E5%AF%BF%E5%85%89',
title: '山东寿光地利'
},{
'key':'%E7%89%A1%E4%B8%B9%E6%B1%9F',
title: '牡丹江牡达'
},{
'key':'%E9%BD%90%E9%BD%90%E5%93%88%E5%B0%94',
title: '齐齐哈尔哈达'
},{
'key':'%%E5%93%88%E5%B0%94%E6%BB%A8',
title: '哈尔滨哈达'
},{
'key':'%E8%B4%B5%E9%98%B3',
title: '贵阳地利'
},{
'key':'%E5%9B%9B%E5%B7%9D',
title: '四川聚合'
}]
},
initialize: function() {
this.bindEvents();
this.render();
},
bindEvents: function() {
$(document).on('touchstart', '.m-to-top', function(e) {
e.preventDefault();
$('body').animate({
scrollTop: 0
}, 300);
});
},
getParameterByName: function(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
},
render: function() {
var _this = this,
source = this.getParameterByName('source');
if (source != '' && source.length > 0) {
if (source && source.toLowerCase() == 'wap') {
this.wap = true;
}
}
this.data.wap = this.wap;
$('.m-page').html(_.template($('#contentTpl').html())(this.data));
}
};
Topic.initialize();
});
</script>
</body>
</html>