poster.html
4.31 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="format-detection" content="telephone=no" />
<meta name="msapplication-tap-highlight" content="no" />
<!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
<!-- <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" /> -->
<meta content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" name="viewport" />
<title>农丰网--专题</title>
<link rel="stylesheet" href="../css/common.css">
<link rel="stylesheet" href="../css/topic.css">
</head>
<body class="topicPage">
<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="topicPageTmpl">
<%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><%=title%></h1>
</div>
</header>
<%}%>
<section class="m-content">
<a href="http://mobapi.nong12.com/topic/html/index.html?source=wap&banner=<%=banner%>&modelCode=<%=modelCode%>" title="">
<img src="<%=fullScreenBanner%>" alt="<%=title%>" class="full-banner">
</a>
</section>
<a href="#" class="m-to-top"></a>
</script>
<script>
$(function(){
var Topic = {
wap:false,
initialize:function(){
this.render();
},
bindEvents:function(){
$(document).on('touchstart', '.back-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,
response = {},
source = this.getParameterByName('source'),
banner = this.getParameterByName('banner'),
fullScreenBanner = this.getParameterByName('fullScreenBanner'),
title = this.getParameterByName('title'),
modelCode = this.getParameterByName('modelCode');
if(source != '' && source.length > 0){
if(source && source.toLowerCase() == 'wap'){
this.wap = true;
}
}
if(title == '' && title.length <= 0){
title = '活动专题';
}
if(modelCode == '' || modelCode.length <= 0){
alert('模块id不能为空!');
return;
}
if(banner == '' || banner.length <= 0){
alert('专题banner图不能为空!');
return;
}
if(fullScreenBanner == '' || fullScreenBanner.length <= 0){
alert('专题全屏banner图不能为空!');
return;
}
response.wap = this.wap;
response.banner = banner;
response.title = title;
response.modelCode = modelCode;
response.fullScreenBanner = fullScreenBanner;
$('.m-page').html(_.template($('#topicPageTmpl').html())(response));
}
};
Topic.initialize();
});
</script>
</body>
</html>