prom_goods.html
14 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
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>
<head>
<meta name="Generator" content="tpshop"/>
<meta charset="utf-8">
<meta name="format-detection" content="telephone=no">
<meta name="viewport"
content="minimal-ui=yes,width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<title>
优惠促销列表-{$tpshop_config['shop_info_store_title']}
</title>
<meta http-equiv="keywords" content="{$tpshop_config['shop_info_store_keyword']}"/>
<meta name="description" content="{$tpshop_config['shop_info_store_desc']}"/>
<link rel="stylesheet" type="text/css" href="__STATIC__/css/public.css"/>
<link rel="stylesheet" type="text/css" href="__STATIC__/css/category_list.css"/>
<script type="text/javascript" src="__STATIC__/js/jquery.js"></script>
<script type="text/javascript" src="__STATIC__/js/layer.js"></script>
<script src="__PUBLIC__/js/global.js"></script>
<script src="__PUBLIC__/js/mobile_common.js"></script>
<script src="__PUBLIC__/static/js/common.js"></script>
<script src="__STATIC__/js/iLocalStorage.js"></script>
<style>
.l_r{
padding-left: 10px;
padding-right: 10px;
}
</style>
</head>
<body style="position: relative;">
<section class="_pre">
<header id="head_search_box" style="position: fixed; top: 0; width: 100%;">
<div class="search_header">
<a href="javascript:history.back(-1)" class="back search_back"></a>
<div class="search">
<form name="sourch_form" id="sourch_form2" method="post"
action="{:U('Goods/prom_goods',array('stoid'=>$Think.request.stoid))}">
<div class="text_box">
<input type="hidden" name="prom_id" value="{$prom_id}">
<input type="hidden" name="all" value="{$all}">
<input type="text" class="text" name="key" id="keyword" value="{:I('key')}"
placeholder="搜索关键字"/>
</div>
<input type="button" value="" class="submit"
onclick="if($.trim($('#keyword').val())!= '') $('#sourch_form2').submit();"/>
</form>
</div>
</div>
</header>
<div style="height:51px;" class="empty_div"> </div>
<div style="text-align: center;background-color: #FFFFFF">
<ul style="padding: 10px 0;">
<volist name="prom_list" id="vv" key="k">
<li class="ellipsis-1 t_l l_r">
满{$vv.condition}
<if condition="$vv.prom_type eq 0">元 <else/>件 </if>
<if condition="$vv.money neq 0">减{$vv.money}元 </if>
<if condition="$vv.sale neq 0">打{$vv.sale}折 </if>
<if condition="$vv.past eq 1">包邮 </if>
<if condition="$vv.int neq 0">送{$vv.int}积分 </if>
<if condition="$vv.coupon_id neq 0">送{$vv.coupon}元优惠券 </if>
<if condition="$vv.gift_id neq 0">送{$vv.goods_name}</if>
</li>
</volist>
</ul>
</div>
<section id="product_back">
<div class="touchweb-com_searchListBox openList" id="goods_list">
<empty name="goods_list">
<p class="goods_title">抱歉暂时没有相关结果,换个筛选条件试试吧</p>
<else/>
<foreach name="goods_list" item="vo" key="k">
<li>
<a a-href="{:U('Mobile/Goods/goodsInfo',array('stoid'=>$Think.request.stoid,'id'=>$vo[goods_id]))}"
class="item" onclick="goproduct(this)">
<div class="pic_box">
<img src="{:getimg($vo['original_img'],NOIMG,0,1)}">
</div>
<div class="goods_info">
<div class="title_box">{$vo.goods_name}</div>
<div class="price_box">
<span class="new_price">
<if condition="$vo.prom_integral">
<i>{$vo.prom_integral}积分<if condition="$vo.final_price gt 0"> +¥{$vo.final_price}</if></i>
<else/>
<i>¥{$vo.final_price}</i>
</if>
</span>
<div class="comment_box">已售{$vo.sales_sum}</div>
</div>
</div>
<p class="clear"></p>
</a>
</li>
</foreach>
</empty>
</div>
<eq name="mshow" value="1">
<notempty name="goods_list">
<div id="getmore"
style="font-size:.24rem;text-align: center;color:#888;padding:.25rem .24rem .4rem; clear:both">
<a href="javascript:void(0)" onClick="ajax_sourch_submit()">点击加载更多</a>
</div>
</notempty>
</eq>
</section>
</section>
<script>
var IsLoading = true; //是否加载数据
var page = 1;
/*** ajax 提交表单 查询订单列表结果*/
function ajax_sourch_submit() {
page += 1;
$.ajax({
type: "POST",
url: "{:U('Mobile/Goods/prom_goods')}",//+tab,
data: {stoid: {:I('get.stoid')},prom_id:{:I('get.prom_id')},all:{:I('get.all')},key:"{:I('get.key')}", is_ajax:1, page:page},
success: function (data) {
if ($.trim(data) == '') {
$('#getmore').hide();
IsLoading = false;
} else {
$("#goods_list").append(data);
IsLoading = true;
}
}
});
}
///滑动到底部事件
$(document).unbind("scroll");
$(document).bind("scroll", function () {
if ($(document).scrollTop() >= $(document).height() - $(window).height()) {
if (IsLoading == true) {
IsLoading = false;
ajax_sourch_submit();
}
}
});
</script>
<!--筛选-e-->
<section id="mix_search_div" style="display: none;">
<header class="con floatsearch">
<section class="mix_new_header">
<a href="javascript:void(0)" class="mix_back"></a>
<form class="set_ip" name="sourch_form" id="sourch_form" method="post"
action="{:U('Goods/prom_goods',array('stoid'=>$Think.request.stoid))}">
<div class="search">
<div class="text_box">
<input class="keyword text" name="key" id="key" placeholder="请输入关键词" type="text"
value="{:I('key')}"/>
<input type="hidden" name="prom_id" value="{$prom_id}">
<input type="hidden" name="all" value="{$all}">
</div>
<span class="mix_submit"
onClick="if($.trim($('#key').val()) != '') $('#sourch_form').submit();"></span>
<a href="javascript:void(0)" class="clear_input" id="clear_input" style="display: block;"></a>
</div>
<input type="button"
onClick="if($.trim($('#key').val()) != '') $('#sourch_form').submit(); else alert('输入搜索词');"
value="搜索" class="mix_filtrate">
</form>
</section>
<div class="spacer"></div>
</header>
</section>
<script type="text/javascript" src="__STATIC__/js/zepto.min.js"></script>
<script type="text/javascript" src="__STATIC__/js/filter.min.js"></script>
<script>
function goproduct(ob) {
window.location.href = $(ob).attr('a-href');
// var url=$(ob).attr('a-href');
// var url2=window.location.href;
// var strkye="goodsList"+uid;
// $.ajax({
// type : "POST",
// url:"{:U('Mobile/Goods/firstsetCaChe')}",//+tab,
// data:{key:strkye,stoid:"{$Think.request.stoid}",url:url2},
// success: function(data) {
// if (data == 1) {
//
// var product_back = $("#product_back").html();
//
// iLocalStorage.setItem('goodsList_product_back' + uid, product_back); //缓存商品内容
// iLocalStorage.setItem('goodsListpage' + uid, page); //缓存索引
// var sl = $(document).scrollTop();
// iLocalStorage.setItem('goodsListscroll' + uid, sl + ""); //缓存滚动多少
// window.location.href = url;
// }
// }
// });
}
$(function () {
var gotop = $(".gotop");
$(window).scroll(function () {
($(window).scrollTop() > 100) ? gotop.show(500) : gotop.hide(100);
});
//搜索浮层显示逻辑
var sbox = $("#head_search_box"),
g_list = $("#goods_list"),
g_m1 = "0", g_m2 = "96px";
var initCss = function (type) {
if (type == 1) {
sort.css({"position": "none", "width": "100%", "background-color": "#fff"});
g_list.css("margin-top", g_m1);
} else {
sort.attr("style", "");
g_list.css("margin-top", g_m2);
}
};
var m = {
input: $("#keyword"),
rawAll: '',
dd: $(".text_box"),
cancel: $(".mix_back"),
rawKey: '请输入商品名称 货号',
main: function () {
this.init();
this.be();
},
init: function () {
this.rawAll = this.input.val();
},
be: function () {
var _this = this;
this.input.focus(function () {
var mix_search = $("#mix_search_div");
if (mix_search.length > 0) {
$("._pre").hide();
mix_search.show();
return;
}
var newKey = _this.input.val();
if (newKey != _this.rawKey && newKey != _this.rawAll) {
$(this).val(newKey);
} else {
$(this).val(_this.rawKey);
}
if ($(window).scrollTop() > 0) {
initCss(1);
window.scrollTo(0, 0);
_this.dd.trigger("click"); //for ddclick
}
})
.blur(function () {
var newKey = _this.input.val();
if (newKey === _this.rawKey) {
$(this).val(_this.rawAll);
} else {
$(this).val(newKey);
}
});
this.cancel.bind("click", function () {
$("#mix_search_div").hide();
$("._pre").show();
});
document.getElementById("clear_input").onclick = function () {
$("#mix_search_div").hide();
$("._pre").show();
}
}
};
m.main();
$(window).resize(function () {
sbox.css("width", "100%");
sort.css("width", "100%");
});
//顶部sticky效果
setTimeout(function () {
// var sboxH = sbox.height();
var sortH = sort.height();
var sortStart = sort.offset().top /*- sboxH*/;
var showEnd = sort.offset().top;
var init = function () {
sbox.css({"position": "fixed", "top": "0"});
window.scrollTo(0, 0);
};
var rawScroll = 0, nowScroll = 0;
var upOrDown = function () {
var delta = 30;
if (nowScroll > rawScroll + delta) {
return 1;
} else if (nowScroll < rawScroll - delta) {
return 2;
} else {
return 0;
}
};
var sticky = function () {
nowScroll = $(window).scrollTop();
if (nowScroll >= sortStart) {
sort.css({"position": "none", "top": sboxH, "background-color": "#fff"});
// g_list.css({"margin-top":sortH});
} else {
sort.attr("style", "");
g_list.attr("style", "");
}
if (nowScroll > showEnd + sortH) {
var up = upOrDown();
if (up == 1) {
if (sbox.css("display") != "none") {
sbox.hide();
sort.hide();
}
rawScroll = nowScroll;
} else if (up == 2) {
if (sbox.css("display") == "none") {
sbox.show();
sort.show();
}
rawScroll = nowScroll;
}
} else {
if (sbox.css("display") == "none") {
sbox.show();
sort.show();
}
}
};
init();
$(document).on("touchmove", sticky);
$(window).on("scroll", sticky);
}, 500);
});
</script>
<footer>
<include file="public/footer_nav"/>
</footer>
<script>
$(function () {
var gotop = $(".gotop");
$(window).scroll(function () {
($(window).scrollTop() > 100) ? gotop.show(500) : gotop.hide(100);
});
});
function goTop() {
$('html,body').animate({'scrollTop': 0}, 600);
}
</script>
<a href="javascript:goTop();" class="gotop" style=" z-index:9999;display: none"><img src="__STATIC__/images/topup.png"></a>
</body>
</html>