default.phtml
24.4 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
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="shortcut icon" href="http://www.yohobuy.com/favicon.ico" type="image/x-icon" />
<?php
echo $this->_headTitle;
echo $this->_headLink;
echo $this->_headScript;
echo $this->_headmeta;
$profile = array('email'=>'');
if (isset($this->uid) and !empty($this->uid)) {
$profile = $this->profile($this->uid);
}
if ($this->moduleName === 'product' || $this->moduleName === 'passport') {
echo '<script type="text/javascript">var _ozprm;</script>';
}
?>
<script type="text/javascript">
var apiDomain = '<?php print empty(QINLib_Http_Config::$apiAction[Q_APPLICATION_ENV]) ? 'http://api.open.yohobuy.com' : QINLib_Http_Config::$apiAction[Q_APPLICATION_ENV];?>';
var __custom = {"online":<?php echo $this->uid > 0 ? '"on"' : '"off"'; ?>};
</script>
<!--[if !IE 6]>
<script type="text/javascript" src="http://static.yohobuy.com/js/v3/common/respond.min.js"></script>
<![endif]-->
<!--[if lt IE 7]>
<script defer type="text/javascript" src="http://static.yohobuy.com/js/v3/pngfix.js"></script>
<![endif]-->
<!--[if lte IE 6]>
<link media="screen" rel="stylesheet" type="text/css" href="http://static.yohobuy.com/css/v3/ie6.css?v=20130924"/>
<![endif]-->
<style type="text/css">
@font-face {
font-family: 'icomoon';
src:url('/fonts/icomoon.eot');
src:url('/fonts/icomoon.eot?#iefix') format('embedded-opentype'),
url('/fonts/icomoon.ttf') format('truetype'),
url('/fonts/icomoon.woff') format('woff'),
url('/fonts/icomoon.svg#icomoon') format('svg');
font-weight: normal;
font-style: normal;
}
[class*="icon-"] {
font-family: 'icomoon';
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
/* Better Font Rendering =========== */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.ifont{
font-family: "icomoon" ;
display:inline-block;
}
.ifont10{
font-family: "icomoon" ;
display:inline-block;
font-size: 10px;
line-height: 10px;
-webkit-transform:scale(0.8);
}
.searchColor{
color:#999;
}
</style>
</head>
<body class="page-index-new">
<!-- Google Tag Manager -->
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-W958MG"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-W958MG');</script>
<!-- End Google Tag Manager -->
<?php //echo $this->_newSsoProxy;?>
<div class="head2014">
<div class="head-top">
<div class="screen clear">
<div class="left">
<ul class="clear site-list">
<li class="cur"><a href="<?php print QLibConfigs_Static::$siteUrl;?>">YOHO!有货</a> </li>
<li><a href="http://www.yoho.cn" target="_blank">YOHO.CN</a> </li>
<li><a href="http://www.yohoshow.com" target="_blank">YOHO!SHOW</a> </li>
</ul>
</div>
<div class="right">
<ul class="clear top-list">
<li class="list" id="loginBox"></li>
<li class="list " id="myYohoBox"><!--list-cur-->
<a href="<?php print QLibConfigs_Static::$siteUrl?>/home?t=<?php print microtime(true);?>" class="list-a">MY有货 <span class="ifont10">.</span></a>
<div class="list-layer my-yohobuy"><div class="account"><img src="http://static.yohobuy.com/images/v3/icon/loading.gif"/> 加载中...</div></div>
</li>
<li class="list" id="miniCartBox"><!--list-cur-->
<a href="<?php print QLibConfigs_Static::$siteUrl?>/shopping/cart" class="list-a"><span class="ifont">B</span> 购物车 <span class="red icart-num">0</span> <span class="ifont10">.</span></a>
<!--start mini cart-->
<div class="list-layer mini-cart">
<div><img src="http://static.yohobuy.com/images/v3/icon/loading.gif"/> 加载中...</div>
</div>
<!--end mini cart-->
</li>
<li class="list"><a href="<?php print QLibConfigs_Static::$siteUrl?>/home/orders?t=<?php print microtime(true);?>" class="list-a">我的订单</a></li>
<li class="list"><a href="<?php print QLibConfigs_Static::$siteUrl?>/home/favorite?t=<?php print microtime(true);?>" class="list-a">我的收藏</a></li>
<li class="list " id="messageBox">
<a href="<?php print QLibConfigs_Static::$siteUrl?>/home/message?t=<?php print microtime(true);?>" class="list-a"><span class="ifont">m</span> 消息 <span class="red imessage-num">0</span> <span id="upDown" class="ifont10">.</span></a>
<div class="list-layer message"><div class="loading center middle"><img src="http://static.yohobuy.com/images/v3/icon/loading.gif"/> 加载中...</div></div>
</li>
<li class="list line-v"><span>|</span></li>
<li class="list"><a href="javascript:void(0);" class="list-a" id="favoriteYoho">收藏有货</a></li>
</ul>
</div>
</div>
</div>
<div class="head-mid">
<div class="screen clear">
<div class="left boys-girls">
<a onclick="getSource('性别入口','BOYS','homepage_man');" href="<?php print QLibConfigs_Static::$siteUrl;?>" class="<?php print ($this->Gender == '1,3') ? 'cur' : '';?>">BOYS<b>男装</b></a><span>|</span><a onclick="getSource('性别入口','GIRLS','homepage_woman');" href="<?php print QLibConfigs_Static::$siteUrl;?>/woman" class="girls <?php print ($this->Gender == '2,3') ? 'cur_girls' : '';?>">GIRLS<b>女装</b></a>
</div>
<?php print QLibView_Sidebar::show('activity', array('ads_id' => 52));
$search_gender = empty($this->gender) ? '1,3': $this->gender;
$search_keyword_type = $search_gender == '1,3' ? 2 : 4;
$search_keyword = QINOperations_Models_Searchkeyword_Client::getAllList($search_keyword_type,1);
$keyword_info = empty($search_keyword) ? "" : $search_keyword[0];
$keyword = $keyword_info['keyword'];
?>
<style type="text/css">
.searchColor{
color:#999;
}
</style>
<div class="right">
<script type="text/javascript">
var keyword = '<?php print empty($keyword_info) ? '' : str_replace("'", "\'", $keyword);?>';
var link ='<?php print empty($keyword_info) ? '' : str_replace("'", "\'", $keyword_info['link']);?>';
function submitSearch(){
var keyword_input = $('#query_key').val().replace("'", "\'");
if((link != '') && (keyword != '') && ($.trim(keyword.toLowerCase()) == $.trim(keyword_input.toLowerCase()))){
location.href=link.replace("\'","'");
}else{
$('#searchForm').submit();
return false;
}
}
</script>
<div class="relative" id="search_box">
<form action="http://search.yohobuy.com" method="get" id="searchForm">
<input type="text" name="keyword" id="query_key" autocomplete="off" x-webkit-speech="" lang="zh-CN" x-webkit-grammar="builtin:translate" value="<?php echo !empty($this->_keyword) ? $this->_keyword : $keyword_info['keyword']; ?>" onfocus="if(this.value==this.defaultValue){this.value='';this.style.color='#333'}" onblur="if(this.value==''){this.value=this.defaultValue;this.style.color='#999'}" />
<a class="search_btn absolute" href="javascript:submitSearch();">搜索</a>
<ul id="shelper_notice" class="search-tips hidden" style="display:none;"></ul>
</form>
</div>
<script type="text/javascript">
var keyword_input = $('#query_key').val().replace("'", "\'");
if(keyword != '' && (keyword == keyword_input)){
$("#query_key").attr("class", "searchColor");
}
</script>
<?php
$search_hot_keyword_type = $search_gender == '1,3' ? 3 : 5;
$hot_keyword = QINOperations_Models_Searchkeyword_Client::getAllList($search_hot_keyword_type);
if(!empty($hot_keyword)){?>
<div class="search_tips">
<div class="tips">
<?php
$i = 0;
$hotKeywords = array();
foreach ($hot_keyword as $k => $v){
$str = $i== 0 ? '' : '|';
$color = empty($v['color']) ? '' : 'color=#'.$v['color'];
$hotKeywords[] = '<a href="'. $v['link'].'" target="_blank">'.$str.'<font '.$color.'>'.$v['keyword'].'</font></a>';
$i++;
}print empty($hotKeywords) ? '' : implode('',$hotKeywords);
?>
</div>
</div>
<?php }?>
<!--end search-->
</div>
<div class="center"><?php if($this->Gender == '1,3'){?><a href="<?php print QLibConfigs_Static::$siteUrl;?>"><img alt="YOHO!有货" src="http://static.yohobuy.com/images/v3/icon/logo-boys.png"></a><?php }else{?><a href="<?php print QLibConfigs_Static::$siteUrl;?>/woman"><img alt="YOHO!有货" src="http://static.yohobuy.com/images/v3/icon/logo-girls.png"></a><?php }?></div>
</div>
</div>
<!-- 头部导航 -->
<?php print QLibView_Sidebar::show('topNav', array('gender' => $this->Gender));?>
<!-- 头部导航结束 -->
</div>
<?php
//中间内容
print $content;
//底部
print QLibView_Sidebar::show('footer', array('result' => 1));
?>
<div class="return-top">
<a href="javascript:void(0);" id="toTop" class="ifont">,</a>
</div>
<script type="text/html" id="mini-cart-tpl">
<div id="cartItem">
{{~it.cartData.main_goods :v:index}}
<div class="list">
<div class="li-t">
<a href="{{=v.product_url}}" class="{{? v.is_advance == 'Y' }} activity-flag {{?}}">
{{? v.is_advance == 'Y' }}<span class="flag-virtual">预售商品</span>{{?}}<img src="{{=v.default_img}}">
</a>
</div>
<div class="li-m">
<strong><a href="{{=v.product_url}}">{{=v.product_name}}</a></strong>
<p>
<span>颜色:{{=v.color_name}} 尺码:{{=v.size_name}}
{{? v.is_cheapest_free == 1 }}<img src="http://static.yohobuy.com/images/v2/common/icon_charge_free.png" class="cart-charge-free">{{?}}</span>
</p>
</div>
<div class="li-b">
<span>{{=v.show_price}} × {{=v.buy_number}}</span><br>
<a class="a_e" href="javascript:void(0)" onclick="delCartGoods({{=v.goods_incart_id}},{{=v.is_cheapest_free}});">删除</a>
</div>
</div>
{{~}}
{{~it.cartData.advance_goods :v:index}}
<div class="list">
<div class="li-t">
<a href="{{=v.product_url}}" class="{{? v.activities_id==1}} activity-flag {{?}}{{? v.activities_id!=1}}cartnew_mark_virtual {{?}}">
<span class="flag-yohood">{{? v.activities_id!=1}}预售商品{{?}}</span><img src="{{=v.default_img}}" /></a>
</div>
<div class="li-m">
<strong><a href="{{=v.product_url}}">{{=v.product_name}}</a></strong>
<p><span>
颜色:{{=v.color_name}} 尺码:{{=v.size_name}}
{{? v.is_cheapest_free == 1 }}<img src="http://static.yohobuy.com/images/v2/common/icon_charge_free.png" class="cart-charge-free">{{?}}</span></p>
</div>
<div class="li-b">
<span>{{=v.show_price}} × {{=v.buy_number}}</span><br />
<a href="javascript:void(0)" onclick="delCartGoods({{=v.goods_incart_id}},{{=v.is_cheapest_free}});" class="a_e">删除</a>
</div>
</div>
{{~}}
{{~it.cartData.outlet_goods :v:index}}
<div class="list">
<div class="li-t">
<a href="{{=v.product_url}}" class="activity-flag">
<span class="flag-outlet">OUTLET</span><img src="{{=v.default_img}}">
</a>
</div>
<div class="li-m">
<strong><a href="{{=v.product_url}}">{{=v.product_name}}</a></strong>
<p>
<span>颜色:{{=v.color_name}} 尺码:{{=v.size_name}}
{{? v.is_cheapest_free == 1 }}<img src="http://static.yohobuy.com/images/v2/common/icon_charge_free.png" class="cart-charge-free">{{?}}</span>
</p>
</div>
<div class="li-b">
<span>{{=v.show_price}} × {{=v.buy_number}}</span><br>
<a class="a_e" href="javascript:void(0)" onclick="delCartGoods({{=v.goods_incart_id}},{{=v.is_cheapest_free}});">删除</a>
</div>
</div>
{{~}}
{{~it.cartData.gift_goods :v:index}}
<div class="list">
<div class="li-t">
<a href="{{=v.product_url}}" class="activity-flag"><span class="flag-gift">赠品</span><img src="{{=v.default_img}}" /></a>
</div>
<div class="li-m">
<strong><a href="{{=v.product_url}}">{{=v.product_name}}</a></strong><br />
颜色:{{=v.color_name}} 尺码:{{=v.size_name}}
</div>
<div class="li-b">
<span>{{=v.show_price}} × {{=v.buy_number}}</span><br />
<a href="javascript:void(0)" onclick="delCartGoods({{=v.goods_incart_id}},{{=v.is_cheapest_free}});" class="a_e">删除</a>
</div>
</div>
{{~}}
{{~it.cartData.need_pay_gifts :v:index}}
<div class="list">
<div class="li-t">
<a href="{{=v.product_url}}" class="activity-flag"><span class="flag-addon">加价购</span><img src="{{=v.default_img}}" /></a>
</div>
<div class="li-m">
<strong><a href="{{=v.product_url}}">{{=v.product_name}}</a></strong><br />
颜色:{{=v.color_name}} 尺码:{{=v.size_name}}
</div>
<div class="li-b">
<span>{{=v.show_price}} × {{=v.buy_number}}</span><br />
<a href="javascript:void(0)" onclick="delCartGoods({{=v.goods_incart_id}},{{=v.is_cheapest_free}});" class="a_e">删除</a>
</div>
</div>
{{~}}
</div>
{{? it.cartData.has_promotion == 1}}
<dl>
<dt>活 动</dt>
<dd>
{{? it.cartData.fit_outlet_promotion }}
<div>购outlet商品,满¥1999再享9折</div>
{{?}}
{{? it.cartData.has_other_promotion == 1 }}
<span class="mycart_i_down" title="更多" onclick="dispDom(this, 'mycartmore');"></span>
{{?}}
{{? it.cartData.has_first_promotion == 1 }}
<div>{{=it.cartData.first_promotions.promotion_title}}</div>
{{?}}
<div id="mycartmore" style="display:none;">
{{~ it.cartData.other_promotions :v:index}}
<div>{{=v.promotion_title}}</div>
{{~}}
</div>
</dd>
</dl>
{{?}}
{{? it.cartData.fit_free_shipping == 1}}
<dl>
<dt>免运费</dt>
<dd class="">全场商品满 <span class="f_rz">¥499</span> 免运费</dd>
</dl>
{{?}}
<div class="submit">
<a href="<?php print QLibConfigs_Static::$siteUrl;?>/shopping/cart">去购物车结算<span class="ifont">></span></a>
</div>
</script>
<script type="text/html" id="tmpl-nologin">
<span>Hi~</span>[<a href="<?php print QLibConfigs_Static::$siteUrl;?>/signin.html" class="list-a login-out">请登录</a>] [<a href="<?php print QLibConfigs_Static::$siteUrl;?>/reg.html" class="list-a login-out">免费注册</a>]
</script>
<script type="text/html" id="tmpl-login">
<span>Hi~<a href="<?php print QLibConfigs_Static::$siteUrl;?>/home?t=<?php print microtime(true);?>">{{=it.user_name}}</a></span> {{? it.is_login == 1}}[<a href="{{=it.logout}}" class="list-a login-out">退出</a>]{{??}}[<a href="<?php print QLibConfigs_Static::$siteUrl;?>/signin.html" class="list-a login-out">请登录</a>] [<a href="<?php print QLibConfigs_Static::$siteUrl;?>/reg.html" class="list-a login-out">免费注册</a>]{{?}}
</script>
<script type="text/html" id="tmpl-my-login">
<div class="account">
<p class="name"><a href="<?php print QLibConfigs_Static::$siteUrl?>/home?t={{=it.random}}">{{=it.profile_name}}</a></p>
<p class="clear">
<span class="left"><span class="rgb9">VIP:</span> <a href="<?php print QLibConfigs_Static::$siteUrl?>/home/vip?t={{=it.random}}"><span class="blue">{{=it.vip.curVipInfo.title}}</span></a></span>
{{? it.vip.vipEndDay >= 30}} {{??}}{{? it.vip.curVipInfo.curLevel > 0}}<span class="right red">{{=it.vip.vipEndDay}}天到期</span>{{?}}{{?}}
</p>
{{? it.vip.curVipInfo.curLevel < 3}}
<div class="clear">
<div class="left">
<div class="slider relative">
<div class="slider-over" style="width: {{=it.vip.curYearCostPer}}%;"></div>
{{? it.vip.curYearCostPer >= 40}}
<span style="width: {{=(100 - it.vip.curYearCostPer)}}%;left:0;">{{=it.vip.curYearCost}}/{{=it.vip.nextVipInfo.needCost}}</span>
{{??}}
<!--slider-over width < 40%-->
<span style="width: {{=(100 - it.vip.curYearCostPer)}}%;right:0;">{{=it.vip.curYearCost}}/{{=it.vip.nextVipInfo.needCost}}</span>
{{?}}
</div>
</div>
<div class="right"><span class="rgb9">{{=it.vip.nextVipInfo.title}}</span></div>
</div>
{{?}}
</div>
<ul class="home-layer">
<li class="clear"><a href="<?php print QLibConfigs_Static::$siteUrl?>/home/orders?t=<?php print microtime(true);?>" class="left">待处理的订单</a><span class="right">{{=it.orderCount}}</span></li>
<li class="clear"><a href="<?php print QLibConfigs_Static::$siteUrl?>/home/favorite?t=<?php print microtime(true);?>" class="left">我的收藏</a></li>
<li class="clear"><a href="<?php print QLibConfigs_Static::$siteUrl?>/home/coupons?t=<?php print microtime(true);?>" class="left">我的优惠券</a><span class="right">{{=it.couponCount}}</span></li>
<li class="clear"><a href="<?php print QLibConfigs_Static::$siteUrl?>/home/currency?t=<?php print microtime(true);?>" class="left">我的YOHO币</a><span class="right">{{=it.YohocoinCount}}</span></li>
<li class="clear"><a href="<?php print QLibConfigs_Static::$siteUrl?>/home/returns?t=<?php print microtime(true);?>" class="left">我的退换货</a><span class="right">{{=it.refundCount}}</span></li>
</ul>
<div class="setting">
<a href="<?php print QLibConfigs_Static::$siteUrl?>/home/user?t=<?php print microtime(true);?>">完善资料</a><!--span class="red"> 送50元优惠券</span-->
</div>
</script>
<script type="text/html" id="tmpl-my-noLogin">
<div class="account-login">
<div><a href="<?php print QLibConfigs_Static::$siteUrl?>/signin.html" class="button">立即登录</a></div>
<div><span>新用户?</span><a href="<?php print QLibConfigs_Static::$siteUrl?>/reg.html">[免费注册]</a></div>
</div>
<ul class="home-layer">
<li class="clear"><a href="<?php print QLibConfigs_Static::$siteUrl?>/home/orders?t=<?php print microtime(true);?>" class="left">我的订单</a></li>
<li class="clear"><a href="<?php print QLibConfigs_Static::$siteUrl?>/home/favorite?t=<?php print microtime(true);?>" class="left">我的收藏</a></li>
<li class="clear"><a href="<?php print QLibConfigs_Static::$siteUrl?>/home/coupons?t=<?php print microtime(true);?>" class="left">我的优惠券</a></li>
<li class="clear"><a href="<?php print QLibConfigs_Static::$siteUrl?>/home/currency?t=<?php print microtime(true);?>" class="left">我的YOHO币</a></li>
<li class="clear"><a href="<?php print QLibConfigs_Static::$siteUrl?>/home/returns?t=<?php print microtime(true);?>" class="left">我的退换货</a></li>
</ul>
</script>
<script type="text/html" id="tmpl-message">
<ul>{{~ it :v:index}}<li><a href="<?php print QLibConfigs_Static::$siteUrl;?>/home/message/detail?id={{=v.id}}">{{=v.title}}</a></li>{{~}}</ul>
</script>
<script type="text/html" id="tmpl-layout-qr">
{{~ it :v:index}}
<a href="javascript:void(0);"><img class="dim-img" src="{{=v.ads_image}}"></a>
{{~}}
</script>
<script type="text/javascript">
function toUrl(ads_url){
window.open(ads_url);
}
function showActivity()
{
$('#phoneact').attr('style','display:block;position:relative;');
return false;
}
function hideActivity()
{
$('#phoneact').attr('style','display:none;position:relative');
}
function getSource(column,postition,event){
try {
dataLayer.push({
'louceng': column,
'weizhi': postition,
'event': event
});
} catch (e) {
console.log(e.event + ": " + e.column + ": " + e.postition);
}
}
$('.boys-girls a').click(function(){
var index = $('.boys-girls a').index(this);
var _cookie = $.cookie('_Gender');
if(typeof _cookie != 'undefined' && _cookie != ''){
$.setcookie('_Gender',1,{path : '/',domain : '.yohobuy.com',expires : -1});
}
if(index == 0){
$.setcookie('_Gender','1,3',{path : '/',domain : '.yohobuy.com',expires : 'number'});
}else{
$.setcookie('_Gender','2,3',{path : '/',domain : '.yohobuy.com',expires : 'number'});
}
});
$('#backToOld').click(function(){
$.setcookie('_New', 1, {
path : '/',
domain : '.yohobuy.com'
});
location.href = 'http://www.yohobuy.com';
});
$('#favoriteYoho').favorite(this.title, this.href);
var cartTpl = ''; //用于存储模板
$('#miniCartBox').mouseenter(function(){showMiniCart(1);});
$('#miniCartBox').mouseleave(function(){showMiniCart(0);});
//加载小购物车数据
function loadCartData() {
$.getData(apiDomain, {'method':'open.Shoppingcart.getCartData','shopping_key':$.getShoppingKey()}, function(jsonData) {
if(cartTpl == '') {
cartTpl = doT.template($('#mini-cart-tpl').html());
}
$(".mini-cart").html(cartTpl({ cartData: jsonData}));
});
}
/** 购物车商品数量 **/
function updateCartNum(){
$('#miniCartBox').miniCart({cartNum:'.icart-num'});
}
//从购物车删除商品
function delCartGoods(id, is_reduce) {
$.getData(apiDomain, {'method':'open.Shoppingcart.delone','shopping_key':$.getShoppingKey(),'id':id, 'is_reduce':is_reduce}, function(jsonData) {
var shoppingInfo = $.cookie('_g');
var shoppingData = eval('(' + shoppingInfo + ')');
var strK = '{"_k":"' + shoppingData._k + '","_nac":' + jsonData.total_goods_num + ',"_ac":0,"_r":0}';
$.setcookie('_g', strK, {path: '/', domain:'.yohobuy.com'});
loadCartData();
updateCartNum();
});
}
function showMiniCart(isShow) {
if(isShow == 1 && parseInt($('.icart-num').html())>0) {
$('#miniCartBox').addClass('list-cur');
loadCartData();
} else {
$('#miniCartBox').removeClass('list-cur');
$('.mini-cart').html('<div><img src="http://static.yohobuy.com/images/v3/icon/loading.gif"/> 加载中...</div>');
}
}
//控制显示
function dispDom(ctrlObj, domId) {
$(ctrlObj).toggleClass("mycart_i_up");
$('#' + domId).slideToggle(300);
}
$(document).ready(function(){
$.userInfo('loginBox', '', 'tmpl-login', 'tmpl-nologin');
updateCartNum();
setInterval(updateCartNum, 2000);
$('#subscriberBtn').click(function(){
var email = $('#subscriberBox').val();
if(!/^[.\-_a-zA-Z0-9]+@[\-_a-zA-Z0-9]+\.[a-zA-Z0-9]/.test(email)){
$('#subscriberBox').animate({'backgroundColor':'#ffa7a7'}, 500).animate({'backgroundColor':'#ffffff'}, 500).animate({'backgroundColor':'#ffa7a7'}, 500).animate({'backgroundColor':'#ffffff'}, 500);
$('#subscriberBox').val('').focus();
return false;
}
var uid = $.uid('_UID');
$.getData(apiDomain,{'method':'open.subscriber.subscriber','email':email,'uid':uid},function(data){
if(data.result == 1){
$('#subscriberBox').addClass('done').val('已订阅到:'+email);
$('#subscriberBtn').text('=').addClass('done').click(function(){
return false;
});
return false;
}$('#subscriberBox').animate({'backgroundColor':'#ffa7a7'}, 500).animate({'backgroundColor':'#ffffff'}, 500).animate({'backgroundColor':'#ffa7a7'}, 500).animate({'backgroundColor':'#ffffff'}, 500);$('#subscriberBox').val('').focus();return false;
});
});
$('#subscriberBox').focus(function(){$(this).val('');$('#subscriberBtn').text('m').removeClass('done');});
/** 收藏 **/
/** 返回顶部 **/
$.goTop({'item' : '#toTop','time':500,'scroll':true});
$('#query_key').search(apiDomain);
});
</script>
<script type="text/javascript">
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?65dd99e0435a55177ffda862198ce841";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<script type="text/javascript">
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?c6ee7218b8321cb65fb2e98f284d8311";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<script src="http://static.yohobuy.com/js/analytics/analysis.js"></script>
<script type="text/javascript">
(function () {
try {
var timestamp = (new Date()).valueOf();
var view = document.createElement('img');
view.src = 'http://itemapi.yohobuy.com/1.jpg?t='+timestamp;
} catch (e) {}
} )();
</script>
</body>
</html>