Authored by hf

do merge develop code to test

Showing 100 changed files with 2906 additions and 1034 deletions

Too many changes to show.

To preserve performance only 100 of 100+ files are displayed.

<?php return function ($in, $debugopt = 1) {
$cx = array(
'flags' => array(
'jstrue' => false,
'jsobj' => false,
'spvar' => true,
'prop' => false,
'method' => false,
'mustlok' => true,
'echo' => false,
'debug' => $debugopt,
),
'constants' => array(),
'helpers' => array(),
'blockhelpers' => array(),
'hbhelpers' => array(),
'partials' => array(),
'scopes' => array(),
'sp_vars' => array('root' => $in),
'lcrun' => 'Plugin\LCRun3',
);
return ''.'<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('title')), ENT_QUOTES, 'UTF-8').'</title>
<meta name="keywords" content="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('keywords')), ENT_QUOTES, 'UTF-8').'">
<meta name="description" content="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('description')), ENT_QUOTES, 'UTF-8').'">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta http-equiv="cleartype" content="on">
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta content="telephone=no" name="format-detection" />
<meta content="email=no" name="format-detection" />
<script type="text/javascript">
(function(doc, win) {
var docEl = doc.documentElement;
(function() {
var clientWidth = docEl.clientWidth;
if (!clientWidth) {
return;
}
docEl.style.fontSize = 20 * (clientWidth / 320) + \'px\';
}());
})(document, window);
</script>
<link rel="dns-prefetch" href="//cdn.yoho.cn">
<link rel="dns-prefetch" href="//static.yohobuy.com">
<link rel="dns-prefetch" href="//img12.static.yhbimg.com">
<link rel="dns-prefetch" href="//img13.static.yhbimg.com">
'.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('rlsEnv')))) ? '<link rel="stylesheet" href="http://cdn.yoho.cn/myohobuy/'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('version')), ENT_QUOTES, 'UTF-8').'/index.css">
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('preEnv')))) ? '<link rel="stylesheet" href="http://cdn.yoho.cn/myohobuy/'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('version')), ENT_QUOTES, 'UTF-8').'/index.css">
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('testEnv')))) ? '<link rel="stylesheet" href="http://static.buy.test.yoho.cn/dist/myohobuy/'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('version')), ENT_QUOTES, 'UTF-8').'/index.css">
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('devEnv')))) ? '<link rel="stylesheet" href="http://static.dev.yohobuy.com/css/index.css">
' : '').'<link rel="apple-touch-icon-precomposed" href="http://static.yohobuy.com/m/v1/img/touch/apple-touch-icon-144x144-precomposed-new.png">
<link rel="apple-touch-startup-image" sizes="640x920" href="http://static.yohobuy.com/m/v1/img/startup/startup-retina.png" media="screen and (max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2)">
<link rel="apple-touch-startup-image" sizes="320x460" href="http://static.yohobuy.com/m/v1/img/startup/startup.png" media="screen and (max-device-width: 320)">
</head>
<body '.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('isPassportPage')))) ? 'class=passport-body' : '').'>
'.''.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('pageHeader')), $in, false, function($cx, $in) {return '<header class="yoho-header'.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('boys')))) ? ' boys' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('girls')))) ? ' girls' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('kids')))) ? ' kids' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('lifeStyle')))) ? ' life-style' : '').'">
'.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('navBack')))) ? ' <a href="javascript:history.go(-1);" class="iconfont nav-back">&#xe610;</a>
' : '').''.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('navHome')), $in, false, function($cx, $in) {return ' <a href="'.htmlentities((string)$in, ENT_QUOTES, 'UTF-8').'" class="iconfont nav-home">&#xe611;</a>
';}).''.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('navTitle')), $in, false, function($cx, $in) {return ' <p class="nav-title">'.htmlentities((string)$in, ENT_QUOTES, 'UTF-8').'</p>
';}).'</header>
';}).''.''.' <div class="mobile-container">
<div class="mobile-wrap boys-wrap yoho-page">
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('homeHeader')), $in, false, function($cx, $in) {return ''.' <div class="home-header clearfix" '.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('bgColor')), $in, false, function($cx, $in) {return 'style="background-color:'.htmlentities((string)$in, ENT_QUOTES, 'UTF-8').';background-image:none"';}).'>
<span class="nav-btn iconfont">&#xe60b;</span>
<span class="logo"></span>
<span class="search-btn iconfont"><a href="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('searchUrl')), ENT_QUOTES, 'UTF-8').'">&#xe60f;</a></span>
</div>'.'';}).'
'.''.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('content')), $in, false, function($cx, $in) {return ''.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('bannerTop')), $in, false, function($cx, $in) {return ''.' <div class="banner-top">
<div class="banner-swiper swiper-container">
<ul class="swiper-wrapper">
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('list')), $in, true, function($cx, $in) {return ''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $cx['sp_vars'], array('first')))) ? ' <li class="swiper-slide">
<a href="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('url')), ENT_QUOTES, 'UTF-8').'">
<img src="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('img')), ENT_QUOTES, 'UTF-8').'">
</a>
</li>
' : ' <li class="swiper-slide">
<a href="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('url')), ENT_QUOTES, 'UTF-8').'">
<img class="swiper-lazy" data-src="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('img')), ENT_QUOTES, 'UTF-8').'">
</a>
<div class="swiper-lazy-preloader"></div>
</li>
').'';}).' </ul>
</div>
<div class="swiper-pagination">
<div class="pagination-inner">
</div>
</div>
</div>'.'';}).'
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('iconsEnter')), $in, false, function($cx, $in) {return ''.' <div class="icons-wrapper">
<ul class="icons-list clearfix">
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('list')), $in, false, function($cx, $in) {return ' <li class="icons-item"><a href="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('url')), ENT_QUOTES, 'UTF-8').'" class="imagebar"><img src="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('img')), ENT_QUOTES, 'UTF-8').'" alt=""></a><a href="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('url')), ENT_QUOTES, 'UTF-8').'" class="linkbar">'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('title')), ENT_QUOTES, 'UTF-8').'</a></li>
';}).' </ul>
</div>
'.'';}).'
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('banner')), $in, false, function($cx, $in) {return ''.' <div class="banner-center">
<a href="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('url')), ENT_QUOTES, 'UTF-8').'">
<img class="lazy" data-original="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('img')), ENT_QUOTES, 'UTF-8').'" alt="">
</a>
</div>'.'';}).'
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('hotCategory')), $in, false, function($cx, $in) {return ''.' <div class="hot-category">
'.''.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('name')), $in, false, function($cx, $in) {return ' <div class="floor-header">
<h2>'.htmlentities((string)$in, ENT_QUOTES, 'UTF-8').'</h2>
</div>
';}).''.'
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('banner')), $in, false, function($cx, $in) {return ' <a class="category-banner" href="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('url')), ENT_QUOTES, 'UTF-8').'">
<img class="lazy" data-original="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('img')), ENT_QUOTES, 'UTF-8').'">
</a>
';}).' <ul class="category-list clearfix">
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('list')), $in, false, function($cx, $in) {return ' <li>
<a href="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('url')), ENT_QUOTES, 'UTF-8').'">
<div class="img-box">
<img class="lazy" data-original="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('img')), ENT_QUOTES, 'UTF-8').'" alt="">
</div>
</a>
</li>
';}).' </ul>
</div>'.'';}).'
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('hotBrands')), $in, false, function($cx, $in) {return ''.' <ul class="hot-brands clearfix">
'.''.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('name')), $in, false, function($cx, $in) {return ' <div class="floor-header">
<h2>'.htmlentities((string)$in, ENT_QUOTES, 'UTF-8').'</h2>
</div>
';}).''.''.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('list')), $in, false, function($cx, $in) {return ' <li class="brand">
<a href="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('url')), ENT_QUOTES, 'UTF-8').'">
<div class="brand-logo">
<img class="lazy" data-original="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('img')), ENT_QUOTES, 'UTF-8').'">
</div>
<p class="brand-name">'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('name')), ENT_QUOTES, 'UTF-8').'</p>
</a>
</li>
';}).' <li class="more">
<a href="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('more')), ENT_QUOTES, 'UTF-8').'"></a>
</li>
</ul>'.'';}).'
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('hotBrandsScroll')), $in, false, function($cx, $in) {return ''.' <div class="hot-brands">
'.''.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('name')), $in, false, function($cx, $in) {return ' <div class="floor-header">
<h2>'.htmlentities((string)$in, ENT_QUOTES, 'UTF-8').'</h2>
</div>
';}).''.' <div class="brands-swiper">
<ul class="brands-list swiper-wrapper clearfix">
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('list')), $in, false, function($cx, $in) {return ' <li class="swiper-slide">
<a href="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('url')), ENT_QUOTES, 'UTF-8').'">
<img src="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('img')), ENT_QUOTES, 'UTF-8').'" alt="">
<span class="brands-title">'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('textCn')), ENT_QUOTES, 'UTF-8').'</span>
</a>
</li>
';}).' </ul>
</div>
</div>'.'';}).'
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('trendColloaction')), $in, false, function($cx, $in) {return ''.' <div class="trend-coll-wrapper">
'.''.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('title')), $in, false, function($cx, $in) {return ' <div class="floor-header-more">
<h2>'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('title')), ENT_QUOTES, 'UTF-8').'</h2>
<a class="more-btn iconfont" href="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('more_url')), ENT_QUOTES, 'UTF-8').'">&#xe618;</a>
</div>
';}).''.' <div class="trend-coll-content clearfix">
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('article')), $in, false, function($cx, $in) {return ' <div class="lspan">
<a href="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('url')), ENT_QUOTES, 'UTF-8').'"><img class="lazy rspanimg" data-original="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('img')), ENT_QUOTES, 'UTF-8').'" ></a>
</div>
';}).' </div>
<div class="trend-coll-tail">
<h3 class="recommend-title">推荐搭配</h3>
<div class="recommend-swiper">
<ul class="recommend-list swiper-wrapper clearfix">
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('recommend_collocation')), $in, false, function($cx, $in) {return ' <li class="recommend-item swiper-slide"><a href="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('url')), ENT_QUOTES, 'UTF-8').'"><img class="img" src="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('img')), ENT_QUOTES, 'UTF-8').'" alt="" /></a></li>
';}).' </ul>
</div>
</div>
</div>
'.'';}).'
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('trendTopics')), $in, false, function($cx, $in) {return ''.' <div class="trend-topic-wrapper">
'.''.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('title')), $in, false, function($cx, $in) {return ' <div class="floor-header-more">
<h2>'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('title')), ENT_QUOTES, 'UTF-8').'</h2>
<a class="more-btn iconfont" href="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('more_url')), ENT_QUOTES, 'UTF-8').'">&#xe618;</a>
</div>
';}).''.' <div class="trend-topic-content">
<div class="trend-topic-swiper">
<ul class="swiper-wrapper">
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('list')), $in, false, function($cx, $in) {return ' <li class="swiper-slide">
<a href="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('url')), ENT_QUOTES, 'UTF-8').'">
<div class="img-box">
<img class="lazy" data-original="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('img')), ENT_QUOTES, 'UTF-8').'" src="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('img')), ENT_QUOTES, 'UTF-8').'" alt="">
</div>
<div class="item-content">
<p class="title">'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('title')), ENT_QUOTES, 'UTF-8').'</p>
<p class="time">
<span class="iconfont time-icon">&#xe603;</span>
<span>'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('publish_time')), ENT_QUOTES, 'UTF-8').'</span>
</p>
</div>
</a>
</li>
';}).' </ul>
</div>
<div class="swiper-pagination">
<div class="pagination-inner clearfix">
</div>
</div>
</div>
</div>
'.'';}).'
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('goodsCategory')), $in, false, function($cx, $in) {return ''.''.''.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('title')), $in, false, function($cx, $in) {return ' <div class="floor-header-more">
<h2>'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('title')), ENT_QUOTES, 'UTF-8').'</h2>
<a class="more-btn iconfont" href="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('more_url')), ENT_QUOTES, 'UTF-8').'">&#xe618;</a>
</div>
';}).''.' <div class="goods-category">
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('big_image')), $in, false, function($cx, $in) {return ' <div class="category-swiper">
<ul class="swiper-wrapper">
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('list')), $in, false, function($cx, $in) {return ' <li class="swiper-slide">
<a href="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('url')), ENT_QUOTES, 'UTF-8').'">
<img class="lazy" data-original="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('img')), ENT_QUOTES, 'UTF-8').'" alt="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('title')), ENT_QUOTES, 'UTF-8').'">
</a>
</li>
';}).' </ul>
<div class="swiper-pagination">
<div class="pagination-inner clearfix">
</div>
</div>
</div>
';}).' <ul class="category-list clearfix">
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('list')), $in, false, function($cx, $in) {return ' <li>
<a href="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('url')), ENT_QUOTES, 'UTF-8').'">
<div class="img-box">
<img class="lazy" data-original="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('img')), ENT_QUOTES, 'UTF-8').'" alt="">
</div>
<p class="category-name">'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('textCn')), ENT_QUOTES, 'UTF-8').'</p>
</a>
</li>
';}).' </ul>
</div>'.'';}).'
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('creativeLife')), $in, false, function($cx, $in) {return ''.''.''.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('title')), $in, false, function($cx, $in) {return ' <div class="floor-header-more">
<h2>'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('title')), ENT_QUOTES, 'UTF-8').'</h2>
<a class="more-btn iconfont" href="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('more_url')), ENT_QUOTES, 'UTF-8').'">&#xe618;</a>
</div>
';}).''.' <div class="creative-life">
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('banner')), $in, false, function($cx, $in) {return ' <a class="banner" href="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('url')), ENT_QUOTES, 'UTF-8').'">
<img class="lazy" data-original="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('img')), ENT_QUOTES, 'UTF-8').'">
</a>
';}).' <ul class="classify-list clearfix">
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('list')), $in, false, function($cx, $in) {return ' <li class="classify">
<a href="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('url')), ENT_QUOTES, 'UTF-8').'">
<div class="classify-logo">
<img class="lazy" data-original="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('img')), ENT_QUOTES, 'UTF-8').'">
</div>
<p class="classify-name">'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('name')), ENT_QUOTES, 'UTF-8').'</p>
</a>
</li>
';}).' </ul>
</div>'.'';}).'
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('plusStar')), $in, false, function($cx, $in) {return ''.'
<div class="plus-star">
'.''.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('name')), $in, false, function($cx, $in) {return ' <div class="floor-header">
<h2>'.htmlentities((string)$in, ENT_QUOTES, 'UTF-8').'</h2>
</div>
';}).''.' <a href="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('url')), ENT_QUOTES, 'UTF-8').'">
<img class="lazy" data-original="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('img')), ENT_QUOTES, 'UTF-8').'">
</a>
</div>'.'';}).'';}).'
'.'<div class="maybe-like">
<p class="title">
<i class="icon"></i>
<span>你可能喜欢</span>
</p>
<div id="goods-list" class="goods-list clearfix"></div>
</div>
<div class="load-more-img hide" id="load-more-img">
<a href="">
<img src="">
</a>
</div>
'.''.'
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('twoColumnGoods')), $in, false, function($cx, $in) {return ''.' <div class="two-column-goods">
<ul class="column-nav clearfix">
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('columnNav')), $in, false, function($cx, $in) {return ' <li data-url="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('url')), ENT_QUOTES, 'UTF-8').'">'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('textCn')), ENT_QUOTES, 'UTF-8').'</li>
';}).' </ul>
<div class="goods-list clearfix">
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('goods')), $in, false, function($cx, $in) {return ''.' '.((Plugin\LCRun3::ifvar($cx, $in)) ? '
<div class="good-info" data-id="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('id')), ENT_QUOTES, 'UTF-8').'">
<div class="tag-container clearfix">
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('tags')), $in, false, function($cx, $in) {return ''.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('is_new')), $in, false, function($cx, $in) {return ' <p class="good-tag new-tag">NEW</p>
';}).''.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('is_advance')), $in, false, function($cx, $in) {return ' <p class="good-tag renew-tag">再到着</p>
';}).''.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('is_discount')), $in, false, function($cx, $in) {return ' <p class="good-tag sale-tag">SALE</p>
';}).''.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('is_yohoood')), $in, false, function($cx, $in) {return ' <div class="good-tag yohood-tag"></div>
';}).''.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('is_limited')), $in, false, function($cx, $in) {return ' <p class="good-tag limit-tag">限量商品</p>
';}).'';}).' </div>
<div class="good-detail-img">
<a class="good-thumb" href="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('url')), ENT_QUOTES, 'UTF-8').'">
<img class="lazy" data-original="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('thumb')), ENT_QUOTES, 'UTF-8').'">
</a>
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('is_soon_sold_out')), $in, false, function($cx, $in) {return ' <p class="few-tag">即将售罄</p>
';}).' </div>
<div class="good-detail-text">
<div class="name">
<a href="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('url')), ENT_QUOTES, 'UTF-8').'">'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('name')), ENT_QUOTES, 'UTF-8').'</a>
</div>
<div class="price">
<span class="sale-price '.((Plugin\LCRun3::isec($cx, Plugin\LCRun3::v($cx, $in, array('price')))) ? 'no-price' : '').'">¥'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('salePrice')), ENT_QUOTES, 'UTF-8').'</span>
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('price')), $in, false, function($cx, $in) {return ' <span class="market-price">¥'.htmlentities((string)$in, ENT_QUOTES, 'UTF-8').'</span>
';}).' </div>
</div>
</div>
' : '').''.'';}).' </div>
</div>'.'';}).'
<div class="overlay"></div>
'.''.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('showFooterTab')), $in, false, function($cx, $in) {return ' <div class="footer-tab">
<a class="tab-item '.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('grilsHomePage')))) ? 'current' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('boysHomePage')))) ? 'current' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('kidsHomePage')))) ? 'current' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('lifestyleHomePage')))) ? 'current' : '').'" href="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('indexUrl')), ENT_QUOTES, 'UTF-8').'">
<p class="iconfont tab-icon">&#xe62a;</p>
<p class="tab-name">首页</p>
</a>
<a class="tab-item '.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('categoryPage')))) ? 'current' : '').'" href="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('categoryUrl')), ENT_QUOTES, 'UTF-8').'">
<p class="iconfont tab-icon">&#xe62d;</p>
<p class="tab-name">分类</p>
</a>
<a class="tab-item '.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('guangHome')))) ? 'current' : '').'" href="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('guangUrl')), ENT_QUOTES, 'UTF-8').'">
<p class="iconfont tab-icon">&#xe627;</p>
<p class="tab-name">逛</p>
</a>
<a class="tab-item '.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('shoppingCartPage')))) ? 'current' : '').'" href="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('shoppingCartUrl')), ENT_QUOTES, 'UTF-8').'">
<p class="iconfont tab-icon">&#xe62c;</p>
<p class="tab-name">购物车</p>
</a>
<a class="tab-item '.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('minePage')))) ? 'current' : '').'" href="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('mineUrl')), ENT_QUOTES, 'UTF-8').'">
<p class="iconfont tab-icon">&#xe62b;</p>
<p class="tab-name">我的</p>
</a>
</div>
';}).' '.' </div>
'.' <div class="side-nav">
<ul>
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('sideNav')), $in, false, function($cx, $in) {return ' <li class="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('styleClass')), ENT_QUOTES, 'UTF-8').'">
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('url')), $in, false, function($cx, $in) {return ' <a href="'.htmlentities((string)$in, ENT_QUOTES, 'UTF-8').'">
';}).''.((Plugin\LCRun3::isec($cx, Plugin\LCRun3::v($cx, $in, array('url')))) ? ' <a href="javascript:;">
' : '').''.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('img')), $in, false, function($cx, $in) {return ' <span class="nav-img" style="background-image: url('.htmlentities((string)$in, ENT_QUOTES, 'UTF-8').')"></span>
';}).''.((Plugin\LCRun3::isec($cx, Plugin\LCRun3::v($cx, $in, array('img')))) ? ' <i class="nav-icon"></i>
' : '').' <em>'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('textCn')), ENT_QUOTES, 'UTF-8').'</em>'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('textEn')), ENT_QUOTES, 'UTF-8').'
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('subNav')), $in, false, function($cx, $in) {return ' <span class="enter-subnav iconfont">&#xe614;</span>
';}).' </a>
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('subNav')), $in, false, function($cx, $in) {return ' <ul class="sub-nav">
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('list')), $in, false, function($cx, $in) {return ' <li class="'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('isSelect')), $in, false, function($cx, $in) {return 'current';}).'" style="background-color:'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('bgColor')), ENT_QUOTES, 'UTF-8').'">
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('url')), $in, false, function($cx, $in) {return ' <a href="'.htmlentities((string)$in, ENT_QUOTES, 'UTF-8').'">
';}).''.((Plugin\LCRun3::isec($cx, Plugin\LCRun3::v($cx, $in, array('url')))) ? ' <a href="javascript:;">
' : '').''.((Plugin\LCRun3::isec($cx, Plugin\LCRun3::v($cx, $in, array('back')))) ? ' <span class="nav-point iconfont">&#xe60c;</span>
' : '').''.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('back')), $in, false, function($cx, $in) {return ' <i class="nav-back iconfont">&#xe610;</i>
';}).' <em>'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('textCn')), ENT_QUOTES, 'UTF-8').'</em>
'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('textEn')), ENT_QUOTES, 'UTF-8').'
</a>
</li>
';}).' </ul>
';}).' </li>
';}).' </ul>
</div>'.' </div>
'.''.''.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('pageFooter')), $in, false, function($cx, $in) {return '<footer id="yoho-footer" class="yoho-footer hide">
<p class="op-row">
<span class="back-to-top">
Back to top
<i class="iconfont">&#xe608;</i>
</span>
</p>
<address class="copyright">
CopyRight©2007-2016 南京新与力文化传播有限公司
</address>
</footer>
';}).'
'.''.''.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('showDownloadApp')), $in, false, function($cx, $in) {return '<div class="float-layer hide" id="float-layer-app">
<div class="float-layer-left">
<span class="yoho-icon iconfont">&#xe60d;</span>
<p>新用户送千元礼包</p>
</div>
<a href="javascript:void(0);" id="float-layer-close" >
<i class="close-icon iconfont">&#xe623;</i>
<div class="circle-rightbottom"></div>
</a>
<a href="http://m.yohobuy.com/download/hyapp" id="float-layer-btn">
立即下载
</a>
</div>
';}).'
'.''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('hasWxShare')))) ? '<script type="text/javascript" charset="utf-8" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('rlsEnv')))) ? '<script src="http://cdn.yoho.cn/myohobuy/'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('version')), ENT_QUOTES, 'UTF-8').'/lib.js"></script>
<script src="http://cdn.yoho.cn/myohobuy/'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('version')), ENT_QUOTES, 'UTF-8').'/index.js"></script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('preEnv')))) ? '<script src="http://cdn.yoho.cn/myohobuy/'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('version')), ENT_QUOTES, 'UTF-8').'/lib.js"></script>
<script src="http://cdn.yoho.cn/myohobuy/'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('version')), ENT_QUOTES, 'UTF-8').'/index.js"></script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('testEnv')))) ? '<script src="http://static.buy.test.yoho.cn/dist/myohobuy/'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('version')), ENT_QUOTES, 'UTF-8').'/lib.js"></script>
<script src="http://static.buy.test.yoho.cn/dist/myohobuy/'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('version')), ENT_QUOTES, 'UTF-8').'/index-debug.js"></script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('devEnv')))) ? '<script src="http://localhost:8000/static/js/sea.js?nowrap"></script>
<script>seajs.config({base: \'http://localhost:8000/\'});</script>
' : '').'<script type="text/javascript">
(function(w,d,s,j,f){
w[\'YohoAcquisitionObject\']=f;
w[f]=function(){w[f].p=arguments;};
var a=d.createElement(s);
var m=d.getElementsByTagName(s)[0];
a.async=1;
a.src=j;
m.parentNode.insertBefore(a,m);
})(window,document,\'script\',\'http://cdn.yoho.cn/yas-jssdk/1.0.8/yas.js\',\'_yas\');
</script>
'.'<script>
seajs.use(\'js/common\');
</script>
'.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('psList')))) ? '<script>
seajs.use(\'js/guang/plus-star/list\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('psDetail')))) ? '<script>
seajs.use(\'js/guang/plus-star/detail\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('guangHome')))) ? '<script>
seajs.use(\'js/guang/home\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('guangList')))) ? '<script>
seajs.use(\'js/guang/list\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('guangDetail')))) ? '<script>
seajs.use(\'js/guang/detail\', function(d) {
d.i(true);
});
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('guangEzine')))) ? '<script>
seajs.use(\'js/guang/detail\', function(d) {
d.i(false);
});
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('regIndex')))) ? '<script>
seajs.use(\'js/passport/register/register\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('regCode')))) ? '<script>
seajs.use(\'js/passport/register/code\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('regPwd')))) ? '<script>
seajs.use(\'js/passport/register/password\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('loginIndex')))) ? '<script>
seajs.use(\'js/passport/login/login\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('loginInternational')))) ? '<script>
seajs.use(\'js/passport/login/international\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('backEmail')))) ? '<script>
seajs.use(\'js/passport/back/email\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('backEmailSuccess')))) ? '<script>
seajs.use(\'js/passport/back/email-success\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('backMobile')))) ? '<script>
seajs.use(\'js/passport/back/mobile\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('backCode')))) ? '<script>
seajs.use(\'js/passport/back/code\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('backNewPwd')))) ? '<script>
seajs.use(\'js/passport/back/new-password\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('channelPage')))) ? '<script>
seajs.use(\'js/index/channel\');
seajs.use(\'js/index/footer\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('grilsHomePage')))) ? '<script>
seajs.use(\'js/home/home\', function(h) {
h.set(\'girls\');
});
seajs.use(\'js/index/footer\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('boysHomePage')))) ? '<script>
seajs.use(\'js/home/home\', function(h) {
h.set(\'boys\');
});
seajs.use(\'js/index/footer\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('kidsHomePage')))) ? '<script>
seajs.use(\'js/home/home\', function(h) {
h.set(\'kids\');
});
seajs.use(\'js/index/footer\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('lifestyleHomePage')))) ? '<script>
seajs.use(\'js/home/home\', function(h) {
h.set(\'lifestyle\');
});
seajs.use(\'js/index/footer\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('newArrivalPage')))) ? '<script>
seajs.use(\'js/product/newsale/newarrival\');
seajs.use(\'js/index/footer\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('discountPage')))) ? '<script>
seajs.use(\'js/product/newsale/discount\');
seajs.use(\'js/index/footer\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('goodListPage')))) ? '<script>
seajs.use(\'js/product/list\');
seajs.use(\'js/index/footer\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('goodsDetailPage')))) ? '<script>
seajs.use(\'js/product/detail/detail\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('categoryPage')))) ? '<script>
seajs.use(\'js/category/index\');
seajs.use(\'js/index/footer\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('brandPage')))) ? '<script>
seajs.use(\'js/category/brand\');
seajs.use(\'js/index/footer\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('searchPage')))) ? '<script>
seajs.use(\'js/index/search\');
seajs.use(\'js/index/footer\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('shoppingCartPage')))) ? '<script>
seajs.use(\'js/shopping-cart/cart\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('giftAdvancePage')))) ? '<script>
seajs.use(\'js/shopping-cart/gift-advance\');
</script>
' : '').''.''.'<!-- 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 -->
<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>
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 src="http://static.yohobuy.com/js/analytics/analysis.js"></script>
<script src="http://static.yohobuy.com/m/v1/js/om_code.js"></script>
'.'</body>
</html>'.'';
}
?>
\ No newline at end of file
... ...
<?php return function ($in, $debugopt = 1) {
$cx = array(
'flags' => array(
'jstrue' => false,
'jsobj' => false,
'spvar' => true,
'prop' => false,
'method' => false,
'mustlok' => true,
'echo' => false,
'debug' => $debugopt,
),
'constants' => array(),
'helpers' => array(),
'blockhelpers' => array(),
'hbhelpers' => array(),
'partials' => array(),
'scopes' => array(),
'sp_vars' => array('root' => $in),
'lcrun' => 'Plugin\LCRun3',
);
return ''.'<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('title')), ENT_QUOTES, 'UTF-8').'</title>
<meta name="keywords" content="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('keywords')), ENT_QUOTES, 'UTF-8').'">
<meta name="description" content="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('description')), ENT_QUOTES, 'UTF-8').'">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta http-equiv="cleartype" content="on">
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta content="telephone=no" name="format-detection" />
<meta content="email=no" name="format-detection" />
<script type="text/javascript">
(function(doc, win) {
var docEl = doc.documentElement;
(function() {
var clientWidth = docEl.clientWidth;
if (!clientWidth) {
return;
}
docEl.style.fontSize = 20 * (clientWidth / 320) + \'px\';
}());
})(document, window);
</script>
<link rel="dns-prefetch" href="//cdn.yoho.cn">
<link rel="dns-prefetch" href="//static.yohobuy.com">
<link rel="dns-prefetch" href="//img12.static.yhbimg.com">
<link rel="dns-prefetch" href="//img13.static.yhbimg.com">
'.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('rlsEnv')))) ? '<link rel="stylesheet" href="http://cdn.yoho.cn/myohobuy/'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('version')), ENT_QUOTES, 'UTF-8').'/index.css">
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('preEnv')))) ? '<link rel="stylesheet" href="http://cdn.yoho.cn/myohobuy/'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('version')), ENT_QUOTES, 'UTF-8').'/index.css">
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('testEnv')))) ? '<link rel="stylesheet" href="http://static.buy.test.yoho.cn/dist/myohobuy/'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('version')), ENT_QUOTES, 'UTF-8').'/index.css">
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('devEnv')))) ? '<link rel="stylesheet" href="http://static.dev.yohobuy.com/css/index.css">
' : '').'<link rel="apple-touch-icon-precomposed" href="http://static.yohobuy.com/m/v1/img/touch/apple-touch-icon-144x144-precomposed-new.png">
<link rel="apple-touch-startup-image" sizes="640x920" href="http://static.yohobuy.com/m/v1/img/startup/startup-retina.png" media="screen and (max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2)">
<link rel="apple-touch-startup-image" sizes="320x460" href="http://static.yohobuy.com/m/v1/img/startup/startup.png" media="screen and (max-device-width: 320)">
</head>
<body '.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('isPassportPage')))) ? 'class=passport-body' : '').'>
'.''.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('pageHeader')), $in, false, function($cx, $in) {return '<header class="yoho-header'.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('boys')))) ? ' boys' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('girls')))) ? ' girls' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('kids')))) ? ' kids' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('lifeStyle')))) ? ' life-style' : '').'">
'.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('navBack')))) ? ' <a href="javascript:history.go(-1);" class="iconfont nav-back">&#xe610;</a>
' : '').''.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('navHome')), $in, false, function($cx, $in) {return ' <a href="'.htmlentities((string)$in, ENT_QUOTES, 'UTF-8').'" class="iconfont nav-home">&#xe611;</a>
';}).''.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('navTitle')), $in, false, function($cx, $in) {return ' <p class="nav-title">'.htmlentities((string)$in, ENT_QUOTES, 'UTF-8').'</p>
';}).'</header>
';}).''.''.'<div class="index-page yoho-page">
<div class="index-container">
<div class="index-header clearfix">
<div class="index-logo"></div>
<div class="box">
<a href="javascript:void(0);" class="no-search">取消</a>
<form action="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('searchUrl')), ENT_QUOTES, 'UTF-8').'" class="index-search">
<div class="search-box">
<input type="hidden" name="from" value="search">
<input type="text" name="query" placeholder="搜索" autocomplete="off">
<span class="iconfont clear-text">&#xe623;</span>
<span class="iconfont search-icon empty">&#xe60f;</span>
</div>
</form>
</div>
</div>
<div class="index-channel">
<img class="img" src="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('background')), ENT_QUOTES, 'UTF-8').'">
<div class="index-channel-list">
<a href="/boys" class="list-item">男生 <span class="lighter">BOYS</span> <span class="iconfont right-icon">&#xe614;</span></a>
<a href="/girls" class="list-item">女生 <span class="lighter">GIRLS</span> <span class="iconfont right-icon">&#xe614;</span></a>
<a href="/kids" class="list-item">潮童 <span class="lighter">KIDS</span> <span class="iconfont right-icon">&#xe614;</span></a>
<a href="/lifestyle" class="list-item">创意生活 <span class="lighter">LIFESTYLE</span> <span class="iconfont right-icon">&#xe614;</span></a>
</div>
</div>
</div>
</div>
'.''.''.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('pageFooter')), $in, false, function($cx, $in) {return '<footer id="yoho-footer" class="yoho-footer hide">
<p class="op-row">
<span class="back-to-top">
Back to top
<i class="iconfont">&#xe608;</i>
</span>
</p>
<address class="copyright">
CopyRight©2007-2016 南京新与力文化传播有限公司
</address>
</footer>
';}).'
'.''.''.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('showDownloadApp')), $in, false, function($cx, $in) {return '<div class="float-layer hide" id="float-layer-app">
<div class="float-layer-left">
<span class="yoho-icon iconfont">&#xe60d;</span>
<p>新用户送千元礼包</p>
</div>
<a href="javascript:void(0);" id="float-layer-close" >
<i class="close-icon iconfont">&#xe623;</i>
<div class="circle-rightbottom"></div>
</a>
<a href="http://m.yohobuy.com/download/hyapp" id="float-layer-btn">
立即下载
</a>
</div>
';}).'
'.''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('hasWxShare')))) ? '<script type="text/javascript" charset="utf-8" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('rlsEnv')))) ? '<script src="http://cdn.yoho.cn/myohobuy/'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('version')), ENT_QUOTES, 'UTF-8').'/lib.js"></script>
<script src="http://cdn.yoho.cn/myohobuy/'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('version')), ENT_QUOTES, 'UTF-8').'/index.js"></script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('preEnv')))) ? '<script src="http://cdn.yoho.cn/myohobuy/'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('version')), ENT_QUOTES, 'UTF-8').'/lib.js"></script>
<script src="http://cdn.yoho.cn/myohobuy/'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('version')), ENT_QUOTES, 'UTF-8').'/index.js"></script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('testEnv')))) ? '<script src="http://static.buy.test.yoho.cn/dist/myohobuy/'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('version')), ENT_QUOTES, 'UTF-8').'/lib.js"></script>
<script src="http://static.buy.test.yoho.cn/dist/myohobuy/'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('version')), ENT_QUOTES, 'UTF-8').'/index-debug.js"></script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('devEnv')))) ? '<script src="http://localhost:8000/static/js/sea.js?nowrap"></script>
<script>seajs.config({base: \'http://localhost:8000/\'});</script>
' : '').'<script type="text/javascript">
(function(w,d,s,j,f){
w[\'YohoAcquisitionObject\']=f;
w[f]=function(){w[f].p=arguments;};
var a=d.createElement(s);
var m=d.getElementsByTagName(s)[0];
a.async=1;
a.src=j;
m.parentNode.insertBefore(a,m);
})(window,document,\'script\',\'http://cdn.yoho.cn/yas-jssdk/1.0.8/yas.js\',\'_yas\');
</script>
'.'<script>
seajs.use(\'js/common\');
</script>
'.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('psList')))) ? '<script>
seajs.use(\'js/guang/plus-star/list\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('psDetail')))) ? '<script>
seajs.use(\'js/guang/plus-star/detail\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('guangHome')))) ? '<script>
seajs.use(\'js/guang/home\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('guangList')))) ? '<script>
seajs.use(\'js/guang/list\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('guangDetail')))) ? '<script>
seajs.use(\'js/guang/detail\', function(d) {
d.i(true);
});
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('guangEzine')))) ? '<script>
seajs.use(\'js/guang/detail\', function(d) {
d.i(false);
});
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('regIndex')))) ? '<script>
seajs.use(\'js/passport/register/register\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('regCode')))) ? '<script>
seajs.use(\'js/passport/register/code\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('regPwd')))) ? '<script>
seajs.use(\'js/passport/register/password\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('loginIndex')))) ? '<script>
seajs.use(\'js/passport/login/login\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('loginInternational')))) ? '<script>
seajs.use(\'js/passport/login/international\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('backEmail')))) ? '<script>
seajs.use(\'js/passport/back/email\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('backEmailSuccess')))) ? '<script>
seajs.use(\'js/passport/back/email-success\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('backMobile')))) ? '<script>
seajs.use(\'js/passport/back/mobile\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('backCode')))) ? '<script>
seajs.use(\'js/passport/back/code\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('backNewPwd')))) ? '<script>
seajs.use(\'js/passport/back/new-password\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('channelPage')))) ? '<script>
seajs.use(\'js/index/channel\');
seajs.use(\'js/index/footer\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('grilsHomePage')))) ? '<script>
seajs.use(\'js/home/home\', function(h) {
h.set(\'girls\');
});
seajs.use(\'js/index/footer\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('boysHomePage')))) ? '<script>
seajs.use(\'js/home/home\', function(h) {
h.set(\'boys\');
});
seajs.use(\'js/index/footer\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('kidsHomePage')))) ? '<script>
seajs.use(\'js/home/home\', function(h) {
h.set(\'kids\');
});
seajs.use(\'js/index/footer\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('lifestyleHomePage')))) ? '<script>
seajs.use(\'js/home/home\', function(h) {
h.set(\'lifestyle\');
});
seajs.use(\'js/index/footer\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('newArrivalPage')))) ? '<script>
seajs.use(\'js/product/newsale/newarrival\');
seajs.use(\'js/index/footer\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('discountPage')))) ? '<script>
seajs.use(\'js/product/newsale/discount\');
seajs.use(\'js/index/footer\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('goodListPage')))) ? '<script>
seajs.use(\'js/product/list\');
seajs.use(\'js/index/footer\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('goodsDetailPage')))) ? '<script>
seajs.use(\'js/product/detail/detail\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('categoryPage')))) ? '<script>
seajs.use(\'js/category/index\');
seajs.use(\'js/index/footer\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('brandPage')))) ? '<script>
seajs.use(\'js/category/brand\');
seajs.use(\'js/index/footer\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('searchPage')))) ? '<script>
seajs.use(\'js/index/search\');
seajs.use(\'js/index/footer\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('shoppingCartPage')))) ? '<script>
seajs.use(\'js/shopping-cart/cart\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('giftAdvancePage')))) ? '<script>
seajs.use(\'js/shopping-cart/gift-advance\');
</script>
' : '').''.''.'<!-- 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 -->
<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>
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 src="http://static.yohobuy.com/js/analytics/analysis.js"></script>
<script src="http://static.yohobuy.com/m/v1/js/om_code.js"></script>
'.'</body>
</html>'.'';
}
?>
\ No newline at end of file
... ...
<?php return function ($in, $debugopt = 1) {
$cx = array(
'flags' => array(
'jstrue' => false,
'jsobj' => false,
'spvar' => true,
'prop' => false,
'method' => false,
'mustlok' => true,
'echo' => false,
'debug' => $debugopt,
),
'constants' => array(),
'helpers' => array(),
'blockhelpers' => array(),
'hbhelpers' => array(),
'partials' => array(),
'scopes' => array(),
'sp_vars' => array('root' => $in),
'lcrun' => 'Plugin\LCRun3',
);
return ''.'<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('title')), ENT_QUOTES, 'UTF-8').'</title>
<meta name="keywords" content="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('keywords')), ENT_QUOTES, 'UTF-8').'">
<meta name="description" content="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('description')), ENT_QUOTES, 'UTF-8').'">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta http-equiv="cleartype" content="on">
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta content="telephone=no" name="format-detection" />
<meta content="email=no" name="format-detection" />
<script type="text/javascript">
(function(doc, win) {
var docEl = doc.documentElement;
(function() {
var clientWidth = docEl.clientWidth;
if (!clientWidth) {
return;
}
docEl.style.fontSize = 20 * (clientWidth / 320) + \'px\';
}());
})(document, window);
</script>
<link rel="dns-prefetch" href="//cdn.yoho.cn">
<link rel="dns-prefetch" href="//static.yohobuy.com">
<link rel="dns-prefetch" href="//img12.static.yhbimg.com">
<link rel="dns-prefetch" href="//img13.static.yhbimg.com">
'.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('rlsEnv')))) ? '<link rel="stylesheet" href="http://cdn.yoho.cn/myohobuy/'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('version')), ENT_QUOTES, 'UTF-8').'/index.css">
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('preEnv')))) ? '<link rel="stylesheet" href="http://cdn.yoho.cn/myohobuy/'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('version')), ENT_QUOTES, 'UTF-8').'/index.css">
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('testEnv')))) ? '<link rel="stylesheet" href="http://static.buy.test.yoho.cn/dist/myohobuy/'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('version')), ENT_QUOTES, 'UTF-8').'/index.css">
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('devEnv')))) ? '<link rel="stylesheet" href="http://static.dev.yohobuy.com/css/index.css">
' : '').'<link rel="apple-touch-icon-precomposed" href="http://static.yohobuy.com/m/v1/img/touch/apple-touch-icon-144x144-precomposed-new.png">
<link rel="apple-touch-startup-image" sizes="640x920" href="http://static.yohobuy.com/m/v1/img/startup/startup-retina.png" media="screen and (max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2)">
<link rel="apple-touch-startup-image" sizes="320x460" href="http://static.yohobuy.com/m/v1/img/startup/startup.png" media="screen and (max-device-width: 320)">
</head>
<body '.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('isPassportPage')))) ? 'class=passport-body' : '').'>
'.''.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('pageHeader')), $in, false, function($cx, $in) {return '<header class="yoho-header'.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('boys')))) ? ' boys' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('girls')))) ? ' girls' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('kids')))) ? ' kids' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('lifeStyle')))) ? ' life-style' : '').'">
'.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('navBack')))) ? ' <a href="javascript:history.go(-1);" class="iconfont nav-back">&#xe610;</a>
' : '').''.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('navHome')), $in, false, function($cx, $in) {return ' <a href="'.htmlentities((string)$in, ENT_QUOTES, 'UTF-8').'" class="iconfont nav-home">&#xe611;</a>
';}).''.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('navTitle')), $in, false, function($cx, $in) {return ' <p class="nav-title">'.htmlentities((string)$in, ENT_QUOTES, 'UTF-8').'</p>
';}).'</header>
';}).''.''.'<div class="category-page yoho-page">
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('category')), $in, false, function($cx, $in) {return ' <div id="search-input" class="search-input">
<a href='.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('searchUrl')), ENT_QUOTES, 'UTF-8').'>
<i class="search-icon iconfont">&#xe60f;</i>
<p>搜索商品</p>
</a>
</div>
<div class="category-nav clearfix">
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('class')), $in, false, function($cx, $in) {return ' <li class='.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('focus')))) ? 'focus' : '').'>
<span>'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('name')), ENT_QUOTES, 'UTF-8').'</span>
</li>
';}).' </div>
<div class="category-container clearfix">
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('class')), $in, false, function($cx, $in) {return ' <div class="content '.((!Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('focus')))) ? 'hide' : '').'">
<ul class="primary-level">
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('ca')), $in, false, function($cx, $in) {return ' <li class="p-level-item'.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $cx['sp_vars'], array('first')))) ? ' focus' : '').'">'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('name')), ENT_QUOTES, 'UTF-8').'</li>
';}).' </ul>
<div class="sub-level-container">
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('ca')), $in, false, function($cx, $in) {return ' <ul class="sub-level '.((!Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $cx['sp_vars'], array('first')))) ? 'hide' : '').'">
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('sub')), $in, false, function($cx, $in) {return ' <li>
<a href='.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('url')), ENT_QUOTES, 'UTF-8').'>
'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('name')), ENT_QUOTES, 'UTF-8').'
</a>
</li>
';}).' </ul>
';}).' </div>
</div>
';}).' </div>
';}).'</div>
'.''.''.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('pageFooter')), $in, false, function($cx, $in) {return '<footer id="yoho-footer" class="yoho-footer hide">
<p class="op-row">
<span class="back-to-top">
Back to top
<i class="iconfont">&#xe608;</i>
</span>
</p>
<address class="copyright">
CopyRight©2007-2016 南京新与力文化传播有限公司
</address>
</footer>
';}).'
'.''.''.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('showDownloadApp')), $in, false, function($cx, $in) {return '<div class="float-layer hide" id="float-layer-app">
<div class="float-layer-left">
<span class="yoho-icon iconfont">&#xe60d;</span>
<p>新用户送千元礼包</p>
</div>
<a href="javascript:void(0);" id="float-layer-close" >
<i class="close-icon iconfont">&#xe623;</i>
<div class="circle-rightbottom"></div>
</a>
<a href="http://m.yohobuy.com/download/hyapp" id="float-layer-btn">
立即下载
</a>
</div>
';}).'
'.''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('hasWxShare')))) ? '<script type="text/javascript" charset="utf-8" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('rlsEnv')))) ? '<script src="http://cdn.yoho.cn/myohobuy/'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('version')), ENT_QUOTES, 'UTF-8').'/lib.js"></script>
<script src="http://cdn.yoho.cn/myohobuy/'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('version')), ENT_QUOTES, 'UTF-8').'/index.js"></script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('preEnv')))) ? '<script src="http://cdn.yoho.cn/myohobuy/'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('version')), ENT_QUOTES, 'UTF-8').'/lib.js"></script>
<script src="http://cdn.yoho.cn/myohobuy/'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('version')), ENT_QUOTES, 'UTF-8').'/index.js"></script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('testEnv')))) ? '<script src="http://static.buy.test.yoho.cn/dist/myohobuy/'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('version')), ENT_QUOTES, 'UTF-8').'/lib.js"></script>
<script src="http://static.buy.test.yoho.cn/dist/myohobuy/'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('version')), ENT_QUOTES, 'UTF-8').'/index-debug.js"></script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('devEnv')))) ? '<script src="http://localhost:8000/static/js/sea.js?nowrap"></script>
<script>seajs.config({base: \'http://localhost:8000/\'});</script>
' : '').'<script type="text/javascript">
(function(w,d,s,j,f){
w[\'YohoAcquisitionObject\']=f;
w[f]=function(){w[f].p=arguments;};
var a=d.createElement(s);
var m=d.getElementsByTagName(s)[0];
a.async=1;
a.src=j;
m.parentNode.insertBefore(a,m);
})(window,document,\'script\',\'http://cdn.yoho.cn/yas-jssdk/1.0.8/yas.js\',\'_yas\');
</script>
'.'<script>
seajs.use(\'js/common\');
</script>
'.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('psList')))) ? '<script>
seajs.use(\'js/guang/plus-star/list\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('psDetail')))) ? '<script>
seajs.use(\'js/guang/plus-star/detail\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('guangHome')))) ? '<script>
seajs.use(\'js/guang/home\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('guangList')))) ? '<script>
seajs.use(\'js/guang/list\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('guangDetail')))) ? '<script>
seajs.use(\'js/guang/detail\', function(d) {
d.i(true);
});
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('guangEzine')))) ? '<script>
seajs.use(\'js/guang/detail\', function(d) {
d.i(false);
});
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('regIndex')))) ? '<script>
seajs.use(\'js/passport/register/register\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('regCode')))) ? '<script>
seajs.use(\'js/passport/register/code\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('regPwd')))) ? '<script>
seajs.use(\'js/passport/register/password\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('loginIndex')))) ? '<script>
seajs.use(\'js/passport/login/login\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('loginInternational')))) ? '<script>
seajs.use(\'js/passport/login/international\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('backEmail')))) ? '<script>
seajs.use(\'js/passport/back/email\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('backEmailSuccess')))) ? '<script>
seajs.use(\'js/passport/back/email-success\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('backMobile')))) ? '<script>
seajs.use(\'js/passport/back/mobile\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('backCode')))) ? '<script>
seajs.use(\'js/passport/back/code\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('backNewPwd')))) ? '<script>
seajs.use(\'js/passport/back/new-password\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('channelPage')))) ? '<script>
seajs.use(\'js/index/channel\');
seajs.use(\'js/index/footer\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('grilsHomePage')))) ? '<script>
seajs.use(\'js/home/home\', function(h) {
h.set(\'girls\');
});
seajs.use(\'js/index/footer\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('boysHomePage')))) ? '<script>
seajs.use(\'js/home/home\', function(h) {
h.set(\'boys\');
});
seajs.use(\'js/index/footer\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('kidsHomePage')))) ? '<script>
seajs.use(\'js/home/home\', function(h) {
h.set(\'kids\');
});
seajs.use(\'js/index/footer\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('lifestyleHomePage')))) ? '<script>
seajs.use(\'js/home/home\', function(h) {
h.set(\'lifestyle\');
});
seajs.use(\'js/index/footer\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('newArrivalPage')))) ? '<script>
seajs.use(\'js/product/newsale/newarrival\');
seajs.use(\'js/index/footer\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('discountPage')))) ? '<script>
seajs.use(\'js/product/newsale/discount\');
seajs.use(\'js/index/footer\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('goodListPage')))) ? '<script>
seajs.use(\'js/product/list\');
seajs.use(\'js/index/footer\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('goodsDetailPage')))) ? '<script>
seajs.use(\'js/product/detail/detail\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('categoryPage')))) ? '<script>
seajs.use(\'js/category/index\');
seajs.use(\'js/index/footer\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('brandPage')))) ? '<script>
seajs.use(\'js/category/brand\');
seajs.use(\'js/index/footer\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('searchPage')))) ? '<script>
seajs.use(\'js/index/search\');
seajs.use(\'js/index/footer\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('shoppingCartPage')))) ? '<script>
seajs.use(\'js/shopping-cart/cart\');
</script>
' : '').''.((Plugin\LCRun3::ifvar($cx, Plugin\LCRun3::v($cx, $in, array('giftAdvancePage')))) ? '<script>
seajs.use(\'js/shopping-cart/gift-advance\');
</script>
' : '').''.''.'<!-- 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 -->
<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>
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 src="http://static.yohobuy.com/js/analytics/analysis.js"></script>
<script src="http://static.yohobuy.com/m/v1/js/om_code.js"></script>
'.'</body>
</html>'.'';
}
?>
\ No newline at end of file
... ...
<?php return function ($in, $debugopt = 1) {
$cx = array(
'flags' => array(
'jstrue' => false,
'jsobj' => false,
'spvar' => true,
'prop' => false,
'method' => false,
'mustlok' => true,
'echo' => false,
'debug' => $debugopt,
),
'constants' => array(),
'helpers' => array(),
'blockhelpers' => array(),
'hbhelpers' => array(),
'partials' => array(),
'scopes' => array(),
'sp_vars' => array('root' => $in),
'lcrun' => 'Plugin\LCRun3',
);
return ''.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('goods')), $in, false, function($cx, $in) {return ''.' '.((Plugin\LCRun3::ifvar($cx, $in)) ? '
<div class="good-info" data-id="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('id')), ENT_QUOTES, 'UTF-8').'">
<div class="tag-container clearfix">
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('tags')), $in, false, function($cx, $in) {return ''.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('is_new')), $in, false, function($cx, $in) {return ' <p class="good-tag new-tag">NEW</p>
';}).''.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('is_advance')), $in, false, function($cx, $in) {return ' <p class="good-tag renew-tag">再到着</p>
';}).''.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('is_discount')), $in, false, function($cx, $in) {return ' <p class="good-tag sale-tag">SALE</p>
';}).''.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('is_yohoood')), $in, false, function($cx, $in) {return ' <div class="good-tag yohood-tag"></div>
';}).''.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('is_limited')), $in, false, function($cx, $in) {return ' <p class="good-tag limit-tag">限量商品</p>
';}).'';}).' </div>
<div class="good-detail-img">
<a class="good-thumb" href="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('url')), ENT_QUOTES, 'UTF-8').'">
<img class="lazy" data-original="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('thumb')), ENT_QUOTES, 'UTF-8').'">
</a>
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('is_soon_sold_out')), $in, false, function($cx, $in) {return ' <p class="few-tag">即将售罄</p>
';}).' </div>
<div class="good-detail-text">
<div class="name">
<a href="'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('url')), ENT_QUOTES, 'UTF-8').'">'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('name')), ENT_QUOTES, 'UTF-8').'</a>
</div>
<div class="price">
<span class="sale-price '.((Plugin\LCRun3::isec($cx, Plugin\LCRun3::v($cx, $in, array('price')))) ? 'no-price' : '').'">¥'.htmlentities((string)Plugin\LCRun3::v($cx, $in, array('salePrice')), ENT_QUOTES, 'UTF-8').'</span>
'.Plugin\LCRun3::sec($cx, Plugin\LCRun3::v($cx, $in, array('price')), $in, false, function($cx, $in) {return ' <span class="market-price">¥'.htmlentities((string)$in, ENT_QUOTES, 'UTF-8').'</span>
';}).' </div>
</div>
</div>
' : '').''.'';}).'';
}
?>
\ No newline at end of file
... ...
... ... @@ -69,9 +69,7 @@
kids: true,
lifeStyle: true,
//对应页面有就传,没有就不传
navBack: {
backUrl: '' //需要指定回退路径的传此值,若使用默认history.back(-1)的就不传
},
navBack: true,
navTitle: '',
navHome: ''
}
... ...
... ... @@ -277,11 +277,14 @@ class AbstractAction extends Controller_Abstract
/**
* 获取当前登录的用户ID
*
* @param bool $useSession 是否使用Session会话
* @param bool $useSession (true:从服务端session中检查, false:从客户端cookie中检查)
* @return int
*/
protected function getUid($useSession = false)
{
// @todo debug 因登录没有写老的SESSION会话,此处使用COOKIE
$useSession = false;
if (!$this->_uid) {
// 从SESSION获取
if ($useSession) {
... ... @@ -369,7 +372,7 @@ class AbstractAction extends Controller_Abstract
* @param string $homeUrl 返回首页的链接
* @return void
*/
protected function setNavHeader($title = '', $backUrl = true, $homeUrl = '/')
protected function setNavHeader($title = '', $backUrl = true, $homeUrl = '/', $navBtn = false)
{
$header = array();
... ... @@ -387,6 +390,9 @@ class AbstractAction extends Controller_Abstract
if (!empty($homeUrl)) {
$header['navHome'] = $homeUrl . '?go=1&t=' . time();
}
if ($navBtn) {
$header['navBtn'] = true;
}
$controller = $this->getRequest()->getControllerName();
if ($controller !== 'Home') {
... ...
... ... @@ -16,27 +16,29 @@ use Plugin\Cache;
class Yohobuy
{
/* 正式环境 */
// const API_URL = 'http://api2.open.yohobuy.com/';
// const API_URL2 = 'http://api.open.yohobuy.com/';
// const SERVICE_URL = 'http://service.api.yohobuy.com/';
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
/* 测试环境 */
const API_URL = 'http://test2.open.yohobuy.com/';
const SERVICE_URL = 'http://test.service.api.yohobuy.com/';
const API_URL = 'http://devapi.yoho.cn:58078/';
const SERVICE_URL = 'http://devservice.yoho.cn:58077/';
const YOHOBUY_URL = 'http://www.yohobuy.com/';
const YOHOBUY_ORDER = 'http://192.168.102.205:8084/order/'; //我的订单
const API_URL_MYCENTER = 'http://192.168.102.205:8081/users/'; // 我的个人中心接口URL
const API_URL_SHOPINGCART = 'http://192.168.102.213:8080/api-gateway-web/'; // 我的购物车接口URL
const API_URL_PRODUCTDETAIL = 'http://192.168.102.205:8083/product/'; // 商品详情页
const API_URL_LOGISTICS = 'http://192.168.102.205:8080/gateway'; //查看物流接口URL
/**
* 私钥列表
*
* @var array
*/
private static $privateKeyList = array(
'android' => 'fd4ad5fcfa0de589ef238c0e7331b585',
'iphone' => 'a85bb0674e08986c6b115d5e3a4884fa',
... ... @@ -62,23 +64,23 @@ class Yohobuy
}
}
/**
* 取得当前的IP地址
*
* @param bool $int 返回int类型的ip地址,默认是
* @return mixed 当前的IP地址
*/
/**
* 取得当前的IP地址
*
* @param bool $int 返回int类型的ip地址,默认是
* @return mixed 当前的IP地址
*/
public static function ip($int = true)
{
if (isset($_SERVER['HTTP_CLIENT_IP']) && $_SERVER['HTTP_CLIENT_IP']) {
$onlineip = $_SERVER['HTTP_CLIENT_IP'];
} elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR']) {
$onlineip = $_SERVER['HTTP_X_FORWARDED_FOR'];
} else {
$onlineip = $_SERVER['REMOTE_ADDR'];
}
return $int ? ip2long($onlineip) : $onlineip;
if (isset($_SERVER['HTTP_CLIENT_IP']) && $_SERVER['HTTP_CLIENT_IP']) {
$onlineip = $_SERVER['HTTP_CLIENT_IP'];
} elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR']) {
$onlineip = $_SERVER['HTTP_X_FORWARDED_FOR'];
} else {
$onlineip = $_SERVER['REMOTE_ADDR'];
}
return $int ? ip2long($onlineip) : $onlineip;
}
/**
... ... @@ -121,16 +123,16 @@ class Yohobuy
return $url;
}
/**
* get方式调用接口
*
* @param string $url 接口URL
* @param array $data 参数列表
* @parma mixed $cache 控制是否启用接口数据的缓存(时间单位为秒). 如3600表示缓存1小时, false表示不缓存
* @param bool $returnJson 控制是否返回json格式数据
* @param int $timeout 超时时间
* @return mixed
*/
/**
* get方式调用接口
*
* @param string $url 接口URL
* @param array $data 参数列表
* @parma mixed $cache 控制是否启用接口数据的缓存(时间单位为秒). 如3600表示缓存1小时, false表示不缓存
* @param bool $returnJson 控制是否返回json格式数据
* @param int $timeout 超时时间
* @return mixed
*/
public static function get($url, $data = array(), $cache = false, $returnJson = false, $timeout = 5)
{
// 销毁私钥参数
... ... @@ -403,7 +405,6 @@ class Yohobuy
\Yar_Concurrent_Client::loop($callback);
}
/**
* 提交json格式数据请求java有关接口
*
... ... @@ -414,7 +415,7 @@ class Yohobuy
* @param array $cookie
* @return mixed
*/
public static function jsonPost($url, $data = array(), $returnJson = false, $timeout = 5, $cookie = array())
public static function jsonPost($url, $data = array(), $returnJson = false, $timeout = 30, $cookie = array())
{
$ch = curl_init($url);
... ...
... ... @@ -18,10 +18,24 @@ class GradeData
* @param string $uid 用户id
* @return array 接口返回的会员等级数据
*/
public static function getGradeData($uid) {
//获取会员等级数据
$param['uid'] = $uid;
return Yohobuy::jsonPost(Yohobuy::API_URL_MYCENTER.'UserVipRest/getVipDetailInfo', $param);
public static function getGradeData($channel, $uid) {
$urlList = array();
//获取会员等级数据
$param = Yohobuy::param();
$param['yh_channel'] = $channel;
$param['uid'] = $uid;
$param['method'] = 'app.Passport.vip';
$param['client_secret'] = Sign::getSign($param);
$urlList['grade'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL, $param);
//获取用户基本信息数据(用来得到username)
$param = Yohobuy::param();
$param['uid'] = $uid;
$param['method'] = 'app.passport.profile';
$param['client_secret'] = Sign::getSign($param);
$urlList['userProfile'] = Yohobuy::httpBuildQuery(Yohobuy::API_URL, $param);
return Yohobuy::getMulti($urlList);
}
/**
... ... @@ -30,9 +44,14 @@ class GradeData
* @param string $uid 用户id
* @return array 接口返回的会员特权详情数据
*/
public static function getPreferentialData() {
return Yohobuy::jsonPost(Yohobuy::API_URL_MYCENTER.'UserVipRest/getPrivilege');
public static function getPreferentialData($channel, $uid) {
$param = Yohobuy::param();
$param['yh_channel'] = $channel;
$param['uid'] = $uid;
$param['method'] = 'app.passport.getPrivilege';
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
}
... ...
... ... @@ -5,12 +5,6 @@ namespace LibModels\Wap\Home;
use Api\Yohobuy;
use Api\Sign;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Description of OrderData
*
... ... @@ -24,12 +18,20 @@ class OrderData
* and open the template in the editor.
*/
static function getOrderData($type, $page, $limit, $uid) {
static function getOrderData($type, $page, $limit, $gender, $yh_channel, $uid)
{
//构建必传参数
$param = Yohobuy::param();
$param['gender'] = $gender;
$param['limit'] = $limit;
$param['method'] = 'app.SpaceOrders.get';
$param['page'] = $page;
$param['type'] = $type;
$param['uid'] = $uid;
return Yohobuy::jsonPost(Yohobuy::YOHOBUY_ORDER.'orderInfo/getOrderList',$param);
$param['yh_channel'] = $yh_channel;
$param['client_secret'] = Sign::getSign($param);
//调用接口获得数据
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/*
... ... @@ -38,14 +40,15 @@ class OrderData
* and open the template in the editor.
*/
static function cancelOrderData($order_code, $uid, $gender, $yh_channel) {
static function cancelOrderData($order_code, $uid, $gender, $yh_channel)
{
//构建必传参数
$param = Yohobuy::param();
$param['order_code'] = $order_code;
$param['uid'] = $uid;
$param['gender'] = $gender;
$param['yh_channel'] = $yh_channel;
$param['method'] = 'app.SpaceOrders.close';;
$param['method'] = 'app.SpaceOrders.close';
$param['client_secret'] = Sign::getSign($param);
//调用接口获得数据
return Yohobuy::get(Yohobuy::API_URL, $param);
... ... @@ -57,7 +60,8 @@ class OrderData
* and open the template in the editor.
*/
static function deleteOrderData($order_code, $uid, $gender, $yh_channel) {
static function deleteOrderData($order_code, $uid, $gender, $yh_channel)
{
//构建必传参数
$param = Yohobuy::param();
$param['order_code'] = $order_code;
... ... @@ -76,7 +80,8 @@ class OrderData
* and open the template in the editor.
*/
static function LogisticsData() {
static function LogisticsData()
{
//构建必传参数
$param = Yohobuy::param();
$param['method'] = 'app.express.li';
... ... @@ -84,15 +89,15 @@ class OrderData
//$param['yh_channel'] = $yh_channel;
$param['client_secret'] = Sign::getSign($param);
//调用接口获得数据
return Yohobuy::get('http://api.open.yohobuy.com/', $param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/*
* 支付url
* To change this template file, choose Tools | Templates
*/
static function paymentData($gender, $yh_channel, $code) {
static function paymentData($gender, $yh_channel, $code)
{
//构建必传参数
$param = Yohobuy::param();
$param['content_code'] = $code;
... ... @@ -107,8 +112,8 @@ class OrderData
* 随便逛逛url
* To change this template file, choose Tools | Templates
*/
static function strollData($gender, $yh_channel, $code) {
static function strollData($gender, $yh_channel, $code)
{
//构建必传参数
$param = Yohobuy::param();
$param['content_code'] = $code;
... ...
... ... @@ -17,434 +17,418 @@ use Api\Yohobuy;
class UserData
{
/**
* 个人详情数据
*
* @param int $uid 用户ID
* @return array 个人详情接口返回的数据
*/
public static function userData($uid)
{
$param = array();
$param['uid'] = $uid;
return Yohobuy::jsonPost(Yohobuy::API_URL_MYCENTER . 'ProfilesRest/getUserprofile', $param);
}
/**
* 个人中心页面优惠券,收藏的商品等的数目数据
*
* @param int $uid 用户ID
* @return array 接口返回的数据
*/
public static function infoNum($uid)
{
$param = Yohobuy::param();
$param['method'] = 'app.home.getInfoNum';
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 用户优惠券数量
*
* @param int $uid 用户ID
* @return array 接口返回的数据
*/
public static function couponNum($uid)
{
$param = Yohobuy::param();
$param['uid'] = $uid;
$param['type'] = 'notuse';
return Yohobuy::jsonPost(Yohobuy::API_URL_MYCENTER . 'CouponRest/getCouponsCount', $param);
}
/**
* 用户收藏的品牌数量
*
* @param int $uid 用户ID
* @return array 接口返回的数据
*/
public static function favoriteBrandNum($uid)
{
$param = Yohobuy::param();
$param['uid'] = $uid;
return Yohobuy::jsonPost(Yohobuy::API_URL_MYCENTER . 'FavoriteRest/getFavoriteBrandCount', $param);
}
/**
* 用户收藏的商品数量
*
* @param int $uid 用户ID
* @return array 接口返回的数据
*/
public static function favoriteProductNum($uid)
{
$param = Yohobuy::param();
$param['uid'] = $uid;
return Yohobuy::jsonPost(Yohobuy::API_URL_MYCENTER . 'FavoriteRest/getFavoriteProductCount', $param);
}
/**
* 消息数目
*
* @param int $uid 用户ID
* @return array 接口返回的数据
*/
public static function messageNum($uid)
{
$param = Yohobuy::param();
$param['uid'] = $uid;
$param['isRead'] = 'N';
return Yohobuy::jsonPost(Yohobuy::API_URL_MYCENTER . 'inbox/getFavoriteProductCount', $param);
}
/**
* 个人中心页面优选新品数据
*
* @param int $yh_channel 频道,1代表男生,2代表女生,3代表潮童,4代表创意生活
* @return array 接口返回的数据
*/
public static function preference($yh_channel)
{
$param = Yohobuy::param();
$param['method'] = 'app.home.preference';
$param['yh_channel'] = $yh_channel;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 订单数据
*
* @param int $uid 用户ID
* @param int $type 订单类型,1表示全部,2表示待付款,3表示待发货,4表示待收货,5表示待评价
* @param int $page 第几页,默认1
* @param int $limit 限制读取的数目,默认10
* @return array 订单接口返回的数据
*/
public static function orderData($uid, $type, $page = 1, $limit = 10)
{
$param = Yohobuy::param();
$param['method'] = 'app.SpaceOrders.get';
$param['uid'] = $uid;
$param['type'] = $type;
$param['page'] = $page;
$param['limit'] = $limit;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 收藏的商品数据
*
* @param int $uid 用户ID
* @param int $page 第几页,默认1
* @param int $limit 限制读取的数目,默认10
* @return array 收藏的商品接口返回的数据
*/
public static function favoriteProductData($uid, $page = 1, $limit = 10)
{
$param = array();
$param['uid'] = $uid;
$param['page'] = $page;
$param['limit'] = $limit;
return Yohobuy::jsonPost(Yohobuy::API_URL_MYCENTER . 'FavoriteRest/getFavoriteProductList', $param);
}
/**
* 收藏的品牌数据
*
* @param int $uid 用户ID
* @param int $size 每页条数,size会覆盖limit值
* @param int $page 第几页,默认1
* @param int $limit 限制读取的数目,默认10
* @return array 收藏的品牌接口返回的数据
*/
public static function favoriteBrandData($uid, $size, $page = 1, $limit = 10)
{
$param = array();
$param['uid'] = $uid;
$param['page'] = $page;
$param['size'] = $size;
$param['limit'] = $limit;
return Yohobuy::jsonPost(Yohobuy::API_URL_MYCENTER . 'FavoriteRest/getFavoriteBrandList', $param);
}
/**
* 取消收藏的商品数据
*
* @param int $uid 用户ID
* @param int $fav_id 要取消的收藏id
* @return array 接口返回的数据
*/
public static function favoriteDelete($uid, $fav_id)
{
$param = Yohobuy::param();
$param['method'] = 'app.favorite.cancel';
$param['type'] = 'product';
$param['uid'] = $uid;
$param['fav_id'] = $fav_id;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 浏览记录数据
*
* @param int $uid 用户ID
* @param int $udid 客户端唯一标识
* @param int $page 第几页,默认为1
* @param int $limit 限制多少条,默认100
* @return array 接口返回的数据
*/
public static function browseRecord($uid, $udid, $page = 1, $limit = 100)
{
$param = Yohobuy::param();
$param['method'] = 'app.browse.product';
$param['uid'] = $uid;
$param['udid'] = $udid;
$param['page'] = $page;
$param['limit'] = $limit;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* YOHO币数据
*
* @param int $uid 用户ID
* @param int $page 第几页,默认1
* @param int $limit 限制读取的数目,默认10
* @return array YOHO币接口返回的数据
*/
public static function yohoCoinData($uid, $page = 1, $limit = 10)
{
$param = array();
$param['uid'] = $uid;
/*$param['limit'] = 10;
$param['page'] = 1;*/
// http://192.168.102.213:8080/yoho-users-web /YohoCoinLogRest/getYohoCoinLog 这个接口返回的有货币数组
return Yohobuy::jsonPost(Yohobuy::API_URL_MYCENTER.'YohoCoinLogRest/getYohoCoinNum', $param);
}
/**
* 优惠券数据
*
* @param int $uid 用户ID
* @param int $status 优惠券状态,0表示未使用,1表示已使用
* @return array 优惠券接口返回的数据
*/
public static function couponData($uid, $status)
{
$param = array();
$param['uid'] = $uid;
$param['status'] = $status;
return Yohobuy::jsonPost(Yohobuy::API_URL_MYCENTER .'CouponRest/getCouponsList', $param);
}
/**
* 地址数据
*
* @param int $uid 用户ID
* @return array 地址接口返回的数据
*/
public static function addressData($uid)
{
$param = array('uid' => $uid);
return Yohobuy::jsonPost(Yohobuy::API_URL_MYCENTER . 'AddressRest/selectAddressList', $param);
}
/**
* 获取三级地址列表数据
*
* @param int $uid 用户ID
* @return array 地址接口返回的数据
*/
public static function addressListData($uid)
{
$param = Yohobuy::param();
$param['method'] = 'app.address.getlist';
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 保存地址数据
*
* @param int $uid 用户ID
* @param string $address 地址信息
* @param int $areaCode 城市码
* @param string $consignee 收货人
* @param string $email 邮箱地址
* @param int $id 地址唯一标识符id
* @param string $mobile 手机号码
* @param string $zipCode 邮编
* @return array 地址接口返回的数据
*/
public static function saveAddressData($uid, $address, $areaCode, $consignee, $email, $id, $mobile, $zipCode)
{
$param = array();
$param['address'] = $address;
$param['area_code'] = $areaCode;
$param['addressee_name'] = $consignee;
$param['email'] = $email;
if (!empty($id)) { // 修改
$param['id'] = $id;
$urlExtra = 'AddressRest/update';
} else { // 添加
$urlExtra = 'AddressRest/insertAddress';
}
$param['mobile'] = $mobile;
$param['zipCode'] = $zipCode;
$param['uid'] = $uid;
return Yohobuy::jsonPost(Yohobuy::API_URL_MYCENTER . $urlExtra, $param);
}
/**
* 设置默认地址
*
* @param int $uid 用户ID
* @param int $id 地址唯一标识符id
* @return array 接口返回的数据
*/
public static function setDefaultAddress($uid, $id)
{
$param = array();
$param['id'] = $id;
$param['uid'] = $uid;
return Yohobuy::get(Yohobuy::API_URL_MYCENTER . 'AddressRest/setDefault', $param);
}
/**
* 删除地址
*
* @param int $uid 用户ID
* @param int $id 地址唯一标识符id
* @return array 接口返回的数据
*/
public static function deleteAddress($uid, $id)
{
$param = array();
$param['id'] = $id;
$param['uid'] = $uid;
return Yohobuy::jsonPost(Yohobuy::API_URL_MYCENTER . 'AddressRest/del', $param);
}
/**
* 意见反馈数据
*
* @param string $udid 客户端唯一标识
* @param int $page 第几页,默认1
* @param int $limit 限制读取的数目,默认10
* @return array 意见反馈接口返回的数据
*/
public static function suggestData($udid, $page = 1, $limit = 30)
{
$param = Yohobuy::param();
$param['udid'] = $udid;
$param['page'] = $page;
$param['limit'] = $limit;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::SERVICE_URL . 'suggest/api/v1/suggest/getList', $param);
}
/**
* 意见靠谱,不靠谱接口
*
* @param int $uid 用户ID
* @param string $udid 客户端唯一标识
* @param int $suggest_id 意见id
* @return array 接口返回的数据
*/
public static function upAndDown($uid, $udid, $suggest_id)
{
$param = Yohobuy::param();
$param['uid'] = $uid;
$param['udid'] = $udid;
$param['content'] = $suggest_id;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::SERVICE_URL . 'suggest/api/v1/suggest/is_reliable', $param);
}
/**
* 提交意见反馈接口
*
* @param int $uid 用户ID
* @param string $content 意见内容
* @param mixed $image 图片地址
* @param int $suggest_type 意见类型
* @return array 意见反馈接口返回的数据
*/
public static function savesuggestData($uid, $content, $image, $suggest_type)
{
$param = Yohobuy::param();
$param['uid'] = $uid;
$param['content'] = $content;
if($image !== null) {
$param['image'] = $image;
}
$param['suggest_type'] = $suggest_type;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::SERVICE_URL . 'suggest/api/v1/suggest/saveSuggest', $param);
}
/**
* 我的消息接口
*
* @param int $uid 用户ID
* @param int $page 获取第一页,默认是0
* @param int $size 获取数目,默认是10
* @return array 消息接口返回的数据
*/
public static function messageData($uid, $page = 0, $size = 10)
{
$param = Yohobuy::param();
$param['uid'] = $uid;
$param['size'] = $size;
$param['page'] = $page;
$param['method'] = 'app.inbox.getlist';
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 在线客服接口
*
* @return array 消息接口返回的数据
*/
public static function onlineServiceData()
{
$param = Yohobuy::param();
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::SERVICE_URL . 'operations/api/v1/help/getCategory', $param);
}
/**
* 个人详情数据
*
* @param int $uid 用户ID
* @return array 个人详情接口返回的数据
*/
public static function userData($uid)
{
$param = Yohobuy::param();
$param['method'] = 'app.passport.profile';
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param, 3600); // 缓存1小时
}
/**
* 个人中心页面优惠券,收藏的商品等的数目数据
*
* @param int $uid 用户ID
* @return array 接口返回的数据
*/
public static function infoNum($uid)
{
$param = Yohobuy::param();
$param['method'] = 'app.home.getInfoNum';
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 个人中心页面优选新品数据
*
* @param int $yh_channel 频道,1代表男生,2代表女生,3代表潮童,4代表创意生活
* @return array 接口返回的数据
*/
public static function preference($yh_channel)
{
$param = Yohobuy::param();
$param['method'] = 'app.home.preference';
$param['yh_channel'] = $yh_channel;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 订单数据
*
* @param int $uid 用户ID
* @param int $type 订单类型,1表示全部,2表示待付款,3表示待发货,4表示待收货,5表示待评价
* @param int $page 第几页,默认1
* @param int $limit 限制读取的数目,默认10
* @return array 订单接口返回的数据
*/
public static function orderData($uid, $type, $page = 1, $limit = 10)
{
$param = Yohobuy::param();
$param['method'] = 'app.SpaceOrders.get';
$param['uid'] = $uid;
$param['type'] = $type;
$param['page'] = $page;
$param['limit'] = $limit;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 收藏的商品数据
*
* @param int $uid 用户ID
* @param int $page 第几页,默认1
* @param int $limit 限制读取的数目,默认10
* @return array 收藏的商品接口返回的数据
*/
public static function favoriteProductData($uid, $page = 1, $limit = 10)
{
$param = Yohobuy::param();
$param['method'] = 'app.favorite.product';
$param['uid'] = $uid;
$param['page'] = $page;
$param['limit'] = $limit;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 收藏的品牌数据
*
* @param int $uid 用户ID
* @param string $gender 性别 1,3表示男,2,3表示女,1,2,3表示全部
* @param int $page 第几页,默认1
* @param int $limit 限制读取的数目,默认10
* @return array 收藏的品牌接口返回的数据
*/
public static function favoriteBrandData($uid, $gender, $page = 1, $limit = 10)
{
$param = Yohobuy::param();
$param['method'] = 'app.favorite.brand';
$param['uid'] = $uid;
$param['gender'] = $gender;
$param['page'] = $page;
$param['limit'] = $limit;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 取消收藏的商品数据
*
* @param int $uid 用户ID
* @param int $fav_id 要取消的收藏id
* @return array 接口返回的数据
*/
public static function favoriteDelete($uid, $fav_id)
{
$param = Yohobuy::param();
$param['method'] = 'app.favorite.cancel';
$param['type'] = 'product';
$param['uid'] = $uid;
$param['fav_id'] = $fav_id;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 浏览记录数据
*
* @param int $uid 用户ID
* @param int $udid 客户端唯一标识
* @param int $page 第几页,默认为1
* @param int $limit 限制多少条,默认100
* @return array 接口返回的数据
*/
public static function browseRecord($uid, $udid, $page = 1, $limit = 100)
{
$param = Yohobuy::param();
$param['method'] = 'app.browse.product';
$param['uid'] = $uid;
$param['udid'] = $udid;
$param['page'] = $page;
$param['limit'] = $limit;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 删除浏览记录
*
* @param int $uid 用户ID
* @param int $skn 商品SKN
* @return array 接口返回的数据
*/
public static function delRecord($uid, $skn)
{
$param = Yohobuy::param();
$param['method'] = 'app.browse.delete';
$param['uid'] = $uid;
$param['skn'] = $skn;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* YOHO币数据
*
* @param int $uid 用户ID
* @param int $page 第几页,默认1
* @param int $limit 限制读取的数目,默认10
* @return array YOHO币接口返回的数据
*/
public static function yohoCoinData($uid, $page = 1, $limit = 10)
{
$param = Yohobuy::param();
$param['method'] = 'app.yohocoin.lists';
$param['uid'] = $uid;
$param['page'] = $page;
$param['limit'] = $limit;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 优惠券数据
*
* @param int $uid 用户ID
* @param int $status 优惠券状态,0表示未使用,1表示已使用
* @param int $page 第几页,默认1
* @param int $limit 限制读取的数目,默认10
* @return array 优惠券接口返回的数据
*/
public static function couponData($uid, $status, $page = 1, $limit = 10)
{
$param = Yohobuy::param();
$param['method'] = 'app.coupons.li';
$param['uid'] = $uid;
$param['status'] = $status;
$param['page'] = $page;
$param['limit'] = $limit;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 地址数据
*
* @param int $uid 用户ID
* @return array 地址接口返回的数据
*/
public static function addressData($uid)
{
$param = Yohobuy::param();
$param['method'] = 'app.address.get';
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 获取三级地址列表数据
*
* @param int $uid 用户ID
* @return array 地址接口返回的数据
*/
public static function addressListData($uid)
{
$param = Yohobuy::param();
$param['method'] = 'app.address.getlist';
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 保存地址数据
*
* @param int $uid 用户ID
* @param string $address 地址信息
* @param int $area_code 城市码
* @param string $consignee 收货人
* @param string $email 邮箱地址
* @param int $id 地址唯一标识符id
* @param string $mobile 手机号码
* @param string $zip_code 邮编
* @return array 地址接口返回的数据
*/
public static function saveAddressData($uid, $address, $area_code, $consignee, $email, $id, $mobile, $zip_code)
{
$param = Yohobuy::param();
$param['address'] = $address;
$param['area_code'] = $area_code;
$param['consignee'] = $consignee;
$param['email'] = $email;
if (!empty($id)) { // 修改
$param['id'] = $id;
$param['method'] = 'app.address.update';
} else { // 添加
$param['method'] = 'app.address.add';
}
$param['mobile'] = $mobile;
$param['zip_code'] = $zip_code;
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 设置默认地址
*
* @param int $uid 用户ID
* @param int $id 地址唯一标识符id
* @return array 接口返回的数据
*/
public static function setDefaultAddress($uid, $id)
{
$param = Yohobuy::param();
$param['id'] = $id;
$param['method'] = 'app.address.setdefault';
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 删除地址
*
* @param int $uid 用户ID
* @param int $id 地址唯一标识符id
* @return array 接口返回的数据
*/
public static function deleteAddress($uid, $id)
{
$param = Yohobuy::param();
$param['id'] = $id;
$param['method'] = 'app.address.del';
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 意见反馈数据
*
* @param string $udid 客户端唯一标识
* @param int $page 第几页,默认1
* @param int $limit 限制读取的数目,默认10
* @return array 意见反馈接口返回的数据
*/
public static function suggestData($udid, $page = 1, $limit = 30)
{
$param = Yohobuy::param();
$param['udid'] = $udid;
$param['page'] = $page;
$param['limit'] = $limit;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::SERVICE_URL . 'suggest/api/v1/suggest/getList', $param);
}
/**
* 意见靠谱,不靠谱接口
*
* @param int $uid 用户ID
* @param string $udid 客户端唯一标识
* @param int $suggest_id 意见id
* @param int $reliable 是否靠谱,1表示靠谱,2表示不靠谱
* @return array 接口返回的数据
*/
public static function upAndDown($uid, $udid, $suggest_id, $reliable)
{
$param = Yohobuy::param();
$param['uid'] = $uid;
$param['udid'] = $udid;
$param['is_reliable'] = $reliable;
$param['suggest_id'] = $suggest_id;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::SERVICE_URL . 'suggest/api/v1/suggest/is_reliable', $param);
}
/**
* 提交意见反馈接口
*
* @param int $uid 用户ID
* @param string $content 意见内容
* @param mixed $image 图片地址
* @param int $suggest_type 意见类型
* @return array 意见反馈接口返回的数据
*/
public static function savesuggestData($uid, $content, $image, $suggest_type)
{
$param = Yohobuy::param();
$param['uid'] = $uid;
$param['content'] = $content;
if ($image !== null) {
$param['image'] = $image;
}
$param['suggest_type'] = $suggest_type;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::SERVICE_URL . 'suggest/api/v1/suggest/saveSuggest', $param);
}
/**
* 我的消息接口
*
* @param int $uid 用户ID
* @param int $page 获取第一页,默认是1
* @param int $size 获取数目,默认是10
* @return array 消息接口返回的数据
*/
public static function messageData($uid, $page = 1, $size = 10)
{
$param = Yohobuy::param();
$param['uid'] = $uid;
$param['size'] = $size;
$param['page'] = $page;
$param['method'] = 'app.inbox.getlist';
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 在线客服接口
*
* @return array 消息接口返回的数据
*/
public static function onlineServiceData()
{
$param = Yohobuy::param();
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::SERVICE_URL . 'operations/api/v1/help/getCategory', $param);
}
}
... ...
... ... @@ -26,13 +26,14 @@ class LoginData
*/
public static function signin($area, $profile, $password)
{
$param = array();
$param['profile'] = $profile;
$param['password'] = $password;
$param['area'] = $area;
$param['client_type'] = Yohobuy::clientType();
$param = Yohobuy::param();
$param['method'] = 'app.passport.signin';
$param['area'] = $area;
$param['profile'] = $profile;
$param['password'] = $password;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::jsonPost(Yohobuy::API_URL_MYCENTER . 'AutherRest/login', $param);
return Yohobuy::post(Yohobuy::API_URL, $param);
}
/**
... ... @@ -60,30 +61,14 @@ class LoginData
*/
public static function signinByOpenID($nickname, $openId, $sourceType)
{
/*
// 调试用的数据
$param['openId'] = 'oGUyctyKK3lahkmHRp6c7CTp1234';
$param['client_type'] = Yohobuy::clientType();
$param['mobile'] = '18998733230';
$param['area'] = '86';
$param['realname'] = 'AA';
$param['email'] = 'terry1255@163.com';
$param['nickname'] = 'BB';
$param['replace_id'] = 'oGUyctyKK3lahkmHRp6c7CTp1234';
$param['source_type'] = 'wechat';
$param['password'] = 'abc6399';*/
// 构建必传参数
$param = array();
$param['openId'] = $openId;
// 微信登录时使用replace_id
$param['replace_id'] = $openId;
$param['client_type'] = Yohobuy::clientType();
$param['realname'] = $nickname;
$param['nickname'] = $nickname;
$param['source_type'] = $sourceType;
$param = Yohobuy::param();
$param['method'] = 'app.passport.signinByOpenID';
$param['openId'] = $openId;
$param['source_type'] = $sourceType;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::jsonPost(Yohobuy::API_URL_MYCENTER . 'AutherRest/signinByOpenID', $param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
}
... ...
... ... @@ -158,13 +158,14 @@ class RegData
*/
public static function regMobile($area, $mobile, $password)
{
$param['client_type'] = Yohobuy::clientType();
$param = Yohobuy::param();
$param['method'] = 'app.passport.register';
$param['area'] = $area;
$param['profile'] = $mobile;
$param['password'] = $password;
$param['ip'] = Yohobuy::ip();
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::jsonPost(Yohobuy::API_URL_MYCENTER . 'RegisterRest/register', $param);
return Yohobuy::post(Yohobuy::API_URL, $param);
}
}
... ...
... ... @@ -16,11 +16,12 @@ use Api\Yohobuy;
*/
class DetailData
{
const PRODUCT_BASE_INFO = 'product/queryProductDetailByProductId';
const PRODUCT_SIZE_INFO = 'product/queryProductIntroBySkn';
const PRODUCT_CONSULT_LIST = 'consult/queryConsults';
const PRODUCT_COMMENT_LIST = 'sns/comments/commentList';
/**
* 商品基本信息
*
... ... @@ -30,11 +31,11 @@ class DetailData
*/
public static function baseInfo($productId, $uid)
{
return Yohobuy::jsonPost(Yohobuy::API_URL_PRODUCTDETAIL . self::PRODUCT_BASE_INFO, array(
'param' => intval($productId), 'userId' => intval($uid)
) );
return Yohobuy::jsonPost(Yohobuy::API_URL_PRODUCTDETAIL . self::PRODUCT_BASE_INFO, array(
'param' => intval($productId), 'userId' => intval($uid)
));
}
/**
* 商品尺码信息
*
... ... @@ -43,9 +44,9 @@ class DetailData
*/
public static function sizeInfo($productSkn)
{
return Yohobuy::jsonPost(Yohobuy::API_URL_PRODUCTDETAIL . self::PRODUCT_SIZE_INFO, array('param' => intval($productSkn) ) );
return Yohobuy::jsonPost(Yohobuy::API_URL_PRODUCTDETAIL . self::PRODUCT_SIZE_INFO, array('param' => intval($productSkn)));
}
/**
* 咨询内容列表
*
... ... @@ -57,10 +58,63 @@ class DetailData
public static function consultList($productId, $pageNum, $pageSize)
{
return Yohobuy::jsonPost(Yohobuy::API_URL_PRODUCTDETAIL . self::PRODUCT_CONSULT_LIST, array(
'productId' => intval($productId),
'pageNum' => intval($pageNum),
'pageSize' => intval($pageSize),
) );
'productId' => intval($productId),
'pageNum' => intval($pageNum),
'pageSize' => intval($pageSize),
));
}
/**
* 评论内容列表
*
* @param int $productId 产品ID
* @param int $pageNum 页码数
* @param int $pageSize 每页显示个数
* @return array
*/
public static function commentList($productId, $pageNum, $pageSize)
{
return Yohobuy::jsonPost(Yohobuy::API_URL_PRODUCTDETAIL . self::PRODUCT_COMMENT_LIST, array(
'productId' => intval($productId),
'pageNum' => intval($pageNum),
'pageSize' => intval($pageSize),
));
}
/**
* 为你优选的商品列表
*
* @todo 需要替换成JAVA接口
* @param int $productSkn 商品SKN号
* @return array
*/
public static function preference($productSkn)
{
$param = Yohobuy::param();
$param['method'] = 'app.product.topreference';
$param['product_skn'] = $productSkn;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param, 3600); // 缓存1小时
}
/**
* 添加咨询
*
* @param int $uid 用户ID
* @param int $productId 商品ID
* @return array
*/
public static function addConsult($uid, $productId, $content)
{
$param = Yohobuy::param();
$param['method'] = 'app.consult.add';
$param['product_id'] = $productId;
$param['content'] = $content;
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
}
... ...
... ... @@ -301,7 +301,7 @@ class FloorProcess
// 区别多张图与一张图
if (count($data['big_image']) > 1) {
$result['big_image']['list'] = $data['big_image'];
$result['big_image']['big_list'] = $data['big_image'];
unset($data['big_image']);
}
... ...
... ... @@ -118,6 +118,10 @@ class TemplateLayout implements View_Interface
}
// 应用版本号
$tpl_vars['version'] = $config->version;
// JS统计代码的版本号
if (isset($config->yas->version)) {
$tpl_vars['yas_version'] = $config->yas->version;
}
// SEO相关的标题、关键词、描述内容信息
if (!empty($tpl_vars['title_more'])) {
... ...
... ... @@ -173,22 +173,6 @@ server
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "gzip";
}
location ^~ /product/pro_ {
proxy_redirect off;
proxy_pass http://yohobuy;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "gzip";
}
location ^~ /product/intro_ {
proxy_redirect off;
proxy_pass http://yohobuy;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "gzip";
}
# 逛相关
location ^~ /guang/ {
... ...
... ... @@ -50,4 +50,31 @@ server
expires 30d;
}
}
server
{
listen 80;
server_name huodong.dev.yohobuy.com;
#access_log /nginx/logs/access_test_yoho_cn.log combined;
error_log /nginx/logs/error_test_yoho_cn.log warn;
root D:/workspace/yohobuy.git.dev.yoho.cn/yohobuy/huodong.m.yohobuy.com/public;
location / {
index index-dev.php;
if (!-f $request_filename){
rewrite ^/(.+)$ /index-dev.php?$1& last;
}
}
location ~ .*\.php?$ {
fastcgi_pass 172.16.6.158:9000;
fastcgi_index index-dev.php;
#fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
\ No newline at end of file
... ...
... ... @@ -116,7 +116,7 @@ function rePosFooter() {
return;
}
if ($('body').height() <= $(window).height()) {
if ($('body').height() <= $(window).height() - parseInt($footer.css('height'), 0)) {
$footer.addClass('bottom');
} else {
$footer.removeClass('bottom');
... ... @@ -129,25 +129,23 @@ function rePosFooter() {
var user = getUser();
if ($('body').height() <= $(window).height()) {
$footer.addClass('bottom');
}
rePosFooter(); //计算底部位置
if (user === 0) {
//未登录
$op.prepend(
'<a href="/signin.html?refer=' + location.href + '">登录</a>' +
'<a href="http://m.yohobuy.com/signin.html?refer=' + location.href + '">登录</a>' +
'<span class="sep-line">|</span>' +
'<a href="/reg.html">注册</a>'
'<a href="http://m.yohobuy.com/reg.html">注册</a>'
);
} else {
//已登录
$op.prepend(
'Hi,' +
'<a class="user-name" href="/home?tmp=' + Math.random() + '">' + user[0] + '</a>' +
'<a href="/passport/signout/index?token=' + user[3] + '">退出</a>'
'<a class="user-name" href="http://m.yohobuy.com/home?tmp=' + Math.random() + '">' + user[0] + '</a>' +
'<a href="http://m.yohobuy.com/passport/signout/index?token=' + user[3] + '">退出</a>'
);
}
... ... @@ -166,7 +164,7 @@ function rePosFooter() {
window._ozuid = uid;//暴露ozuid
if (window._yas) {
window._yas(1 * new Date(), '1.0.13', 'yohobuy_m', uid, '');
window._yas(1 * new Date(), '1.0.13.2', 'yohobuy_m', uid, '');
}
}());
... ... @@ -390,7 +388,7 @@ $fixTitleBar.css({
minBrandListTop = brandSwipe + $('.hot-brand').outerHeight() + $('.banner-top').outerHeight();
$brandList.last().append($fixTitleBar);
$(window).scroll(function() {
function scrollHandler() {
var scrTop = $(window).scrollTop();
if ($brandList.eq(0).offset().top < minBrandListTop) {
... ... @@ -407,8 +405,14 @@ $(window).scroll(function() {
}
});
}
//srcoll to load more
$(window).scroll(function() {
window.requestAnimationFrame(scrollHandler);
});
function changeBackground() {
var $brandList = $('.brand-list').find('p');
... ... @@ -1180,12 +1184,17 @@ $nav.on('touchend touchcancel', function(e) {
}
});
$(document).scroll(function() {
function scrollHandler() {
var $c = $infos.not('.hide');
if ($(window).scrollTop() + winH >= $(document).height() - 0.25 * $c.height()) {
loadMore($c, state[curType]);
}
}
//srcoll to load more
$(document).scroll(function() {
window.requestAnimationFrame(scrollHandler);
});
$nav.on('touchstart', function(e) {
... ... @@ -1239,11 +1248,17 @@ if ($tag.length > 0) {
});
}
$(document).scroll(function() {
function scrollHandler() {
if ($(window).scrollTop() + winH >= $(document).height() - 0.25 * $infos.height()) {
loadMore($infos, setting);
}
}
//srcoll to load more
$(window).scroll(function() {
window.requestAnimationFrame(scrollHandler);
});
});
define("js/guang/detail", ["jquery","mlellipsis","lazyload","iscroll-probe"], function(require, exports, module){
/**
... ... @@ -1877,15 +1892,19 @@ function search() {
});
}
$('.maybe-like p').on('touchstart', function (e) {
$('.maybe-like p').on('touchstart', function(e) {
search();
});
//srcoll to load more
$(window).scroll(function () {
function scrollHandler() {
if ($(window).scrollTop() + winH >= $(document).height() - 50) {
search();
}
}
//srcoll to load more
$(window).scroll(function() {
window.requestAnimationFrame(scrollHandler);
});
});
define("js/index/entry", ["jquery","hammer"], function(require, exports, module){
... ... @@ -1907,6 +1926,7 @@ define("js/index/search", ["jquery","hammer"], function(require, exports, module
*/
var $ = require("jquery"),
security = require("js/plugin/security"),
Hammer = require("hammer");
var $input = $('#search-input input');
... ... @@ -1949,6 +1969,9 @@ cHammer.on('tap', function() {
});
$('#search').on('touchend', function() {
if (security.hasDangerInput()) {
return false;
}
$(this).closest('form').submit();
return false;
});
... ... @@ -1981,6 +2004,60 @@ $('#search').on('touchend', function() {
}());
writeSearch.bindWirteLocal($form);
});
define("js/plugin/security", ["jquery"], function(require, exports, module){
/**
* 校验input, 防止SQL注入
* @author: 赵彪<bill.zhao@yoho.cn>
* @date: 2015/11/30
*/
var $ = require("jquery"),
tip = require("js/plugin/tip");
/**
* hasStrangeInput() return true when input have danger value
*
* @param {Bool} needConvert Set if the danger input value should be converted to space
* @return {Bool} true/false If the input have danger value
*/
function hasDangerInput(needConvert) {
var $inputs = $('input[type!=hidden], textarea');
var validationPartten = /['"<>&\|]|--/g,
inputsLength = $inputs.length,
val,
i,
matchChars,
// to set if the input value should be coverted, and its default value is true;
willConvert = needConvert === undefined || typeof needConvert !== 'boolean' ? true : needConvert;
for (i = 0; i < inputsLength; i++) {
val = $inputs.eq(i).val();
if (validationPartten.test(val)) {
if (willConvert) {
$inputs.eq(i).val(val.replace(validationPartten, ' '));
} else {
matchChars = val.match(validationPartten).join(' ');
tip.show('不可以输入 ' + matchChars + ' 哦!');
}
return !willConvert && true;
}
}
return false;
}
exports.hasDangerInput = hasDangerInput;
});
define("js/index/write-search", [], function(require, exports, module){
/**
... ... @@ -2086,17 +2163,30 @@ define("js/index/channel", ["jquery"], function(require, exports, module){
* @author: bikai<kai.bi@yoho.cn>
* @date: 2015/10/28
*/
var $ = require("jquery");
var $ = require("jquery"),
security = require("js/plugin/security");
var $searchBox = $('.search-box'),
$box = $('.box'),
$indexSearch = $('.index-search'),
$indexLogo = $('.index-logo'),
$channelLink = $('.index-channel a');
$channelLink = $('.index-channel a'),
$win = $(window),
$doc = $(document),
$appFloatLayer = $('#float-layer-app');
var $search = $searchBox.children('input[type="text"]'),
$cancelSearch = $box.children('.no-search'),
$searchIcon = $searchBox.children('.search-icon');
$cancelSearch = $box.children('.no-search'),
$searchIcon = $searchBox.children('.search-icon');
// variables for calculate the app download layer position
var layerInit = false,
windowViewHeight = 0,
layerContentHeight = $appFloatLayer.height(),
layerPaddingTop = parseInt($appFloatLayer.css('padding-top')),
layerPaddingBottom = parseInt($appFloatLayer.css('padding-bottom')),
layerHeight = layerContentHeight + layerPaddingTop + layerPaddingBottom,
layerNewPos;
require("js/common");
... ... @@ -2123,6 +2213,9 @@ $searchBox.children('.clear-text').on('touchstart', function() {
});
$searchBox.children('.search-icon').on('touchstart', function() {
if (security.hasDangerInput()) {
return false;
}
$indexSearch.submit();
});
... ... @@ -2149,6 +2242,43 @@ $channelLink.on('touchstart', function() {
});
});
function updateLayerPosition() {
var winHeight = window.innerHeight,
bodyHeight = $doc.height(),
scrollTopPosition = $win.scrollTop();
if (layerInit) {
//keyboard is shown
if (windowViewHeight - winHeight > 200) {
if (scrollTopPosition + windowViewHeight + layerHeight >= bodyHeight) {
layerNewPos = 0;
} else {
layerNewPos = bodyHeight - windowViewHeight - scrollTopPosition - layerHeight;
}
} else {
layerNewPos = bodyHeight - winHeight - scrollTopPosition;
}
} else {
windowViewHeight = winHeight;
layerNewPos = bodyHeight - winHeight - scrollTopPosition + layerHeight;
layerInit = true;
}
$appFloatLayer.css({
position: 'relative',
bottom: layerNewPos + 'px'
});
}
$(window).scroll(function() {
window.requestAnimationFrame(updateLayerPosition);
});
$doc.on('ready', updateLayerPosition);
});
define("js/passport/entry", ["jquery"], function(require, exports, module){
/**
... ... @@ -3407,7 +3537,7 @@ $listNav.on('touchend touchcancel', function(e) {
e.stopPropagation();
});
$(window).scroll(function() {
function scrollHandler() {
//当scroll到1/4$goodsContainer高度后继续请求下一页数据
if ($(window).scrollTop() + winH >
... ... @@ -3416,6 +3546,11 @@ $(window).scroll(function() {
search();
}
}
}
//srcoll to load more
$(window).scroll(function() {
window.requestAnimationFrame(scrollHandler);
});
//初始请求最新第一页数据
... ... @@ -4060,11 +4195,10 @@ $listNav.on('touchend touchcancel', function(e) {
search();
}
}
e.stopPropagation();
});
$(window).scroll(function() {
function scrollHandler() {
//当scroll到1/4$goodsContainer高度后继续请求下一页数据
if ($(window).scrollTop() + winH >
... ... @@ -4073,6 +4207,11 @@ $(window).scroll(function() {
search();
}
}
}
//srcoll to load more
$(window).scroll(function() {
window.requestAnimationFrame(scrollHandler);
});
//初始请求最新第一页数据
... ... @@ -4450,13 +4589,18 @@ $listNav.on('touchend touchcancel', function(e) {
}
});
$(window).scroll(function() {
function scrollHandler() {
//当scroll到1/4$goodsContainer高度后继续请求下一页数据
if ($(window).scrollTop() + winH >
$(document).height() - 0.25 * $goodsContainer.height()) {
search();
}
}
//srcoll to load more
$(window).scroll(function() {
window.requestAnimationFrame(scrollHandler);
});
if ($brandHeader.length > 0) {
... ... @@ -4531,6 +4675,10 @@ $listNav.on('touchstart', 'li', function() {
$listNav.find('li').removeClass('bytouch');
});
// 用于统计点击了商品列表的第几个商品,序号从1开始计算。
if (window._yas) {
window._yas(1 * new Date(), '1.0.13.2', 'yohobuy_m', window._ozuid, '#goods-container >div >div .good-thumb >img');
}
});
define("js/product/detail/detail", ["jquery","swiper","lazyload","hammer","index"], function(require, exports, module){
/**
... ... @@ -4542,11 +4690,15 @@ define("js/product/detail/detail", ["jquery","swiper","lazyload","hammer","index
Swiper = require("swiper"),
lazyLoad = require("lazyload");
var goodsSwiper;
var goodsSwiper,
$discountFolder = $('.goodsDiscount .discount-folder'),
$discountArrow = $('.goodsDiscount .first-item span');
require("js/product/detail/desc");
require("js/product/detail/comments-consults");
require("js/product/detail/like");
lazyLoad($('img.lazy'));
... ... @@ -4554,7 +4706,6 @@ lazyLoad($('img.lazy'));
goodsSwiper = new Swiper('.banner-swiper', {
lazyLoading: true,
lazyLoadingInPrevNext: true,
loop: true,
paginationClickable: true,
pagination: '.banner-top .pagination-inner',
nextButton: '.my-swiper-button-next',
... ... @@ -4562,33 +4713,27 @@ goodsSwiper = new Swiper('.banner-swiper', {
});
(function() {
//初始化goods-discount
if (0 === $('.goods-discount .discount-folder').children().length) {
$('.goods-discount .discount-folder').css('display', 'none');
$('.goods-discount .first-item span').html('');
}
})();
//初始化goods-discount
if (0 === $('.goodsDiscount .discount-folder').children().length) {
$discountFolder.css('display', 'none');
$discountArrow.html('');
}
//goods-discount下拉按钮点击事件
$('.goodsDiscount .dropdown').on('click', function() {
if ($('.goodsDiscount .discount-folder').is(':hidden')) {
$('.goodsDiscount .first-item span').removeClass('icon-down');
$('.goodsDiscount .first-item span').addClass('icon-up');
$('.goodsDiscount .first-item span').html('&#xe608;');
$('.goodsDiscount .discount-folder').slideDown();
if ($discountFolder.is(':hidden')) {
$discountArrow.removeClass('icon-down').addClass('icon-up').html('&#xe608;');
$discountFolder.slideDown();
} else {
$('.goodsDiscount .first-item span').removeClass('icon-up');
$('.goodsDiscount .first-item span').addClass('icon-down');
$('.goodsDiscount .first-item span').html('&#xe609;');
$('.goodsDiscount .discount-folder').slideUp();
$discountArrow.removeClass('icon-up').addClass('icon-down').html('&#xe609;');
$discountFolder.slideUp();
}
});
require("js/product/detail/like");
});
define("js/product/detail/desc", ["jquery","lazyload","swiper","index"], function(require, exports, module){
/**
* 商品详情
* 商品详情 --异步加载页面下半部分
* @author: liangzhifeng<zhifeng.liang@yoho.cn>
* @date: 2015/11/18
*/
... ... @@ -4609,12 +4754,29 @@ var sizeSwiper,
require("js/product/recommend-for-you");
//判断是否要显示向左滑动提示
function hiddenTips($ele) {
if ($ele.length > 0) {
var offsetContainer = $ele[0].getBoundingClientRect().right;
var offsetLastColumn = $ele.find('.swiper-slide:last-child')[0].getBoundingClientRect().right;
if (offsetLastColumn - offsetContainer < 0) {
$ele.next('.tips').css('display', 'none');
} else {
$ele.next('.tips').css('display', 'block');
}
}
}
function search() {
if (searching || end) {
return;
}
searching = true;
// alert($('#reference-swiper-container .swiper-wrapper').width());
loading.showLoadingMask();
$.ajax({
... ... @@ -4636,6 +4798,9 @@ function search() {
slidesPerView: 'auto'
});
hiddenTips($('#size-swiper-container'));
hiddenTips($('#reference-swiper-container'));
searching = false;
end = true;
loading.hideLoadingMask();
... ... @@ -4676,7 +4841,7 @@ var recommendSwiper,
$recommendForYou = $('.recommend-for-you');
$.get('/home/preference').then(function(html) {
$recommendForYou.html(html);
$recommendForYou.html(html).show();
if ($('#swiper-recommend').length) {
recommendSwiper = new Swiper('#swiper-recommend', {
slidesPerView: 'auto',
... ... @@ -4691,6 +4856,11 @@ $.get('/home/preference').then(function(html) {
});
});
define("js/product/detail/comments-consults", ["jquery"], function(require, exports, module){
/**
* 商品详情 --评论和咨询tab
* @author: Lynnic
* @date: 2015/11/18
*/
var $ = require("jquery"),
tip = require("js/plugin/tip");
var commentsNum;
... ... @@ -4742,28 +4912,34 @@ $('#nav-tab li').on('touchend', function() {
});
define("js/product/detail/like", ["jquery","hammer"], function(require, exports, module){
/**
* 商品详情
* 商品详情 --添加收藏
* @author: Lynnic
* @date: 2015/11/24
*/
var $ = require("jquery"),
Hammer = require("hammer"),
tip = require("js/plugin/tip");
var likeHammer = new Hammer(document.getElementById('likeBtn'));
var addToCartHammer = new Hammer(document.getElementById('addtoCart'));
var productId = $('#productId').val();
likeHammer.on('tap', function(e) {
var productId = $('#productId').val(),
opt;
var opt,
favorite;
var $this = $(this);
var $this = $(e.target);
if ($this.hasClass('liked')) {
opt = 'cancel';
favorite = 0;
} else {
opt = 'ok';
favorite = 1;
}
$.ajax({
type: 'POST',
url: '/product/opt/favoriteProduct',
... ... @@ -4774,11 +4950,25 @@ likeHammer.on('tap', function(e) {
success: function(data) {
if (data.code === 200) {
$this.toggleClass('liked');
if ('cancel' === opt) {
tip.show('取消收藏成功');
} else if ('ok' === opt) {
tip.show('收藏成功');
}
} else if (data.code === 400) {
location.href = data.data;//未登录跳转登录页
} else {
tip.show(data.message);
}
// 统计代码:用于统计用户加入或取消商品收藏的动作
if (window._yas) {
window._yas.sendCustomInfo({
pd: productId,
fa: favorite
});
}
},
error: function() {
tip.show('网络断开连接了~');
... ... @@ -4787,11 +4977,21 @@ likeHammer.on('tap', function(e) {
});
// $('#likeBtn').on('click', function(e) {
// return false;
// });
addToCartHammer.on('tap', function(e) {
// 统计代码:用于统计用户加入购物车的动作
if (window._yas) {
window._yas.sendCustomInfo({
pd: productId,
by: 1
});
}
});
});
define("js/me/entry", ["jquery","hammer","lazyload","swiper","handlebars","source-map","index"], function(require, exports, module){
define("js/me/entry", ["jquery","hammer","lazyload","handlebars","source-map","swiper","mlellipsis","index"], function(require, exports, module){
/**
* 个人中心js打包入口文件
* @author: xuqi<qi.xu@yoho.cn>
... ... @@ -4801,13 +5001,17 @@ define("js/me/entry", ["jquery","hammer","lazyload","swiper","handlebars","sourc
require("js/me/order");
require("js/me/order-detail");
require("js/me/fav");
require("js/me/suggest");
require("js/me/index");
require("js/me/coupons");
require("js/me/online-service");
require("js/me/address");
require("js/me/suggest");
require("js/me/browse-record");
require("js/me/address-act");
});
define("js/me/order", ["jquery","hammer","lazyload"], function(require, exports, module){
define("js/me/order", ["jquery","hammer","lazyload","handlebars","source-map"], function(require, exports, module){
/**
* 个人中心--我的订单
* @author: xuqi<qi.xu@yoho.cn>
... ... @@ -4836,6 +5040,8 @@ var inAjax = false;
var loading = require("js/plugin/loading");
var dialog = require("js/me/dialog");
var orderHammer;
//加载订单
... ... @@ -4920,36 +5126,52 @@ orderHammer.on('tap', function(e) {
if ($cur.closest('.del').length > 0) {
//Order delete
$.ajax({
type: 'GET',
url: '/home/delOrder',
data: {
id: id
},
success: function(data) {
if (data.code === 200) {
dialog.showDialog({
dialogText: '确定删除订单吗?',
hasFooter: {
leftBtnText: '取消',
rightBtnText: '确定'
}
}, function() {
$.ajax({
type: 'GET',
url: '/home/delOrder',
data: {
id: id
},
success: function(data) {
if (data.code === 200) {
//删除订单页面刷新
location.href = location.href;
//删除订单页面刷新
history.go(0);
}
}
}
});
});
} else if ($cur.closest('.cancel').length > 0) {
//Order cancel
$.ajax({
type: 'GET',
url: '/home/cancelOrder',
data: {
id: id
},
success: function(data) {
if (data.code === 200) {
dialog.showDialog({
dialogText: '确定取消订单吗?',
hasFooter: {
leftBtnText: '取消',
rightBtnText: '确定'
}
}, function() {
$.ajax({
type: 'GET',
url: '/home/cancelOrder',
data: {
id: id
},
success: function(data) {
if (data.code === 200) {
//取消订单页面刷新
location.href = location.href;
//取消订单页面刷新
history.go(0);
}
}
}
});
});
} else {
... ... @@ -4959,7 +5181,7 @@ orderHammer.on('tap', function(e) {
}
});
$(window).scroll(function() {
function scrollHandler() {
if (order.end === false && $(window).scrollTop() + winH >
$(document).height() - 0.25 * $orderContainer.height()) {
... ... @@ -4968,56 +5190,147 @@ $(window).scroll(function() {
noLoadingMask: true
});
}
}
//srcoll to load more
$(window).scroll(function() {
window.requestAnimationFrame(scrollHandler);
});
//初始化请求第一页数据
getOrders();
});
define("js/me/order-detail", ["jquery","lazyload","hammer"], function(require, exports, module){
/**
* 订单详情页
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/11/16
define("js/me/dialog", ["jquery","handlebars","source-map","hammer"], function(require, exports, module){
/*
* @Description: dialog
* @Time: 2015/11/18
* @author: chenglong.wang
*/
var $ = require("jquery"),
lazyLoad = require("lazyload"),
Handlebars = require("handlebars"),
Hammer = require("hammer");
var orderId = $('#order-detail').data('id');
var $dialogWrapper,
dialogTpl,
dialogTemplate;
var optHammer;
lazyLoad();
dialogTpl = '<div id="dialog-wrapper" class="dialog-wrapper">' +
'<div class="dialog-box">' +
'{{# hasHeader}}' +
'{{/ hasHeader}}' +
'<div class="dialog-content">{{dialogText}}</div>' +
'{{# hasFooter}}' +
'<div class="dialog-footer">' +
'{{# leftBtnText}}' +
'<span class="dialog-left-btn">{{.}}</span>' +
'{{/ leftBtnText}}' +
'{{# rightBtnText}}' +
'<span class="dialog-right-btn">{{.}}</span>' +
'{{/ rightBtnText}}' +
'</div>' +
'{{/ hasFooter}}' +
'</div>' +
'</div>';
//订单删除
optHammer = new Hammer(document.getElementsByClassName('opt')[0]);
optHammer.on('tap', function(e) {
var $cur = $(e.target);
dialogTemplate = Handlebars.compile(dialogTpl);
if ($cur.hasClass('btn-del')) {
exports.showDialog = function(data, callback) {
//删除订单
if (confirm('确定删除订单吗?')) {
$.ajax({
type: 'GET',
url: '/home/delOrder',
data: {
id: orderId
}
});
}
} else if ($cur.hasClass('btn-cancel')) {
var dialogStr = dialogTemplate(data),
$dialogBox,
dialogWrapperHammer;
//取消订单
if (confirm('确定取消订单吗?')) {
$.ajax({
type: 'GET',
url: '/home/cancelOrder',
data: {
id: orderId
}
});
$('.dialog-wrapper').remove();
$('body').append($(dialogStr));
$dialogBox = $('.dialog-box');
$dialogWrapper = $('.dialog-wrapper');
dialogWrapperHammer = new Hammer(document.getElementById('dialog-wrapper'));
// 显示
if (data.fast) {
$dialogWrapper.css({
display: 'block'
});
} else {
$dialogWrapper.fadeIn();
}
$dialogBox.css({
top: '50%',
marginTop: -($dialogBox.height() / 2)
});
//隐藏
if (data.autoHide) {
setTimeout(function() {
$dialogWrapper.fadeOut();
}, 1000);
}
dialogWrapperHammer.on('tap', function(event) {
if ($(event.target).hasClass('dialog-left-btn')) {
$dialogWrapper.fadeOut();
} else if ($(event.target).hasClass('dialog-right-btn')) {
callback();
}
});
};
exports.hideDialog = function() {
$dialogWrapper.fadeOut();
};
});
define("js/me/order-detail", ["jquery","lazyload","hammer"], function(require, exports, module){
/**
* 订单详情页
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/11/16
*/
var $ = require("jquery"),
lazyLoad = require("lazyload"),
Hammer = require("hammer");
var orderId = $('#order-detail').data('id');
var optHammer;
lazyLoad();
//订单删除
optHammer = new Hammer(document.getElementsByClassName('opt')[0]);
optHammer.on('tap', function(e) {
var $cur = $(e.target);
if ($cur.hasClass('btn-del')) {
//删除订单
if (confirm('确定删除订单吗?')) {
$.ajax({
type: 'GET',
url: '/home/delOrder',
data: {
id: orderId
}
});
}
} else if ($cur.hasClass('btn-cancel')) {
//取消订单
if (confirm('确定取消订单吗?')) {
$.ajax({
type: 'GET',
url: '/home/cancelOrder',
data: {
id: orderId
}
});
}
}
});
... ... @@ -5037,44 +5350,117 @@ var diaLog = require("js/me/dialog");
var $navLi = $('#fav-tab > li'),
$favContainer = $('.fav-content > .fav-type'),
$swiperList = $('.swiper-container'),
$swiperList = '',
swiperObj = {},
favTabHammer,
favContentHammer;
favContentHammer,
footerH = $('#yoho-footer').height(),
$loadMore = $('.fav-load-more'),
$brandLoadMore = $('.fav-brand-load-more'),
winH = $(window).height(),
$favProductList = $('.fav-product-list'),
$favBrandList = $('.fav-brand-swiper'),
pageId = 1,
brandPageId = 1, //收藏品牌的当前页数
lockId = true,
brandLockId = true, //收藏品牌是否可下拉加载更多
brandTab = false; //当前是否停留在收藏品牌页
function showFavTab(index) {
var i,
id;
$navLi.filter('.active').removeClass('active');
$navLi.eq(index).addClass('active');
$favContainer.filter('.show').removeClass('show');
$favContainer.eq(index).addClass('show');
}
if (index === 1) {
//导航
for (i = 0; i < $swiperList.length; i++) {
id = $swiperList.eq(i).attr('data-id');
swiperObj[id] = new Swiper('#swiper-container-' + id, {
slidesPerView: 'auto',
grabCursor: true,
slideElement: 'li',
wrapperClass: 'swiper-wrapper-' + id,
lazyLoading: true,
watchSlidesVisibility: true
});
//初始化swiper
function initSwiper() {
var i,
id;
$swiperList = $('.swiper-container');
for (i = 0; i < $swiperList.length; i++) {
id = $swiperList.eq(i).attr('data-id');
if (!!swiperObj[id]) {
swiperObj[id].destroy(true, true);
}
swiperObj[id] = new Swiper('#swiper-container-' + id, {
slidesPerView: 'auto',
grabCursor: true,
slideElement: 'li',
wrapperClass: 'swiper-wrapper-' + id,
lazyLoading: true,
watchSlidesVisibility: true
});
}
}
// 上拉加载更多
function loadData($parent, url, page) {
if (url === 'favBrand') {
brandLockId = true;
} else {
lockId = true;
}
$.ajax({
method: 'post',
url: '/home/' + url,
data: {
page: page
},
success: function(data) {
//setTimeout(function() { //模拟延时
if (url === 'favBrand') {
$brandLoadMore.addClass('hide');
} else {
$loadMore.addClass('hide');
}
if (data === ' ') {
$parent.closest('.fav-type').find('.fav-content-loading').addClass('hide');
$parent.closest('.fav-type').find('.fav-null-box').removeClass('hide');
} else if (data === 'end') {
$parent.closest('.fav-type').find('.fav-load-background')
.removeClass('fav-load-background').html('没有更多了');
} else if (data.length > 10) {
$parent.append(data);
$parent.closest('.fav-type').find('.fav-content-loading').remove();
if (url === 'favBrand') {
initSwiper();//如果是收藏品牌需要初始化swiper
brandLockId = false;//请求成功后解锁品牌收藏page++
} else {
lockId = false;//请求成功后解锁商品收藏page++
}
window.rePosFooter();
} else {
return;
}
window.rePosFooter();
//},1000);
}
});
}
// 如果从品牌收藏入口进入
if ($('#fav-tab').hasClass('brand-tab')) {
showFavTab(1);
loadData($favBrandList, 'favBrand', 1);
brandTab = true;
window.rePosFooter();
} else {
showFavTab(0);
loadData($favProductList, 'favProduct', 1);
brandTab = false;
window.rePosFooter();
}
favTabHammer = new Hammer(document.getElementById('fav-tab'));
... ... @@ -5087,7 +5473,22 @@ favTabHammer.on('tap', function(e) {
}
index = $cur.index();
if (index === 0) {
brandTab = false;
if ($favProductList.find('li').length === 0 &&
$favProductList.closest('.fav-type').find('.fav-null-box').hasClass('hide')) {
loadData($favProductList, 'favProduct', 1);
}
} else {
brandTab = true;
if ($favBrandList.find('div').length === 0 &&
$favBrandList.closest('.fav-type').find('.fav-null-box').hasClass('hide')) {
loadData($favBrandList, 'favBrand', 1);
}
}
showFavTab(index);
window.rePosFooter();
});
... ... @@ -5140,376 +5541,76 @@ favContentHammer.on('tap', function(e) {
}).fail(function() {
//TODO
diaLog.showDialog({
autoHide: true,
dialogText: '网络错误~'
});
});
});
});
});
define("js/me/dialog", ["jquery","handlebars","source-map","hammer"], function(require, exports, module){
/*
* @Description: dialog
* @Time: 2015/11/18
* @author: chenglong.wang
*/
var $ = require("jquery"),
Handlebars = require("handlebars"),
Hammer = require("hammer");
var dialogTpl,
dialogTemplate;
dialogTpl = '<div id="dialog-wrapper" class="dialog-wrapper">' +
'<div class="dialog-box">' +
'{{# hasHeader}}' +
'{{/ hasHeader}}' +
'<div class="dialog-content">{{dialogText}}</div>' +
'{{# hasFooter}}' +
'<div class="dialog-footer">' +
'{{# leftBtnText}}' +
'<span class="dialog-left-btn">{{.}}</span>' +
'{{/ leftBtnText}}' +
'{{# rightBtnText}}' +
'<span class="dialog-right-btn">{{.}}</span>' +
'{{/ rightBtnText}}' +
'</div>' +
'{{/ hasFooter}}' +
'</div>' +
'</div>';
dialogTemplate = Handlebars.compile(dialogTpl);
exports.showDialog = function(data, callback) {
var dialogStr = dialogTemplate(data),
$dialogBox,
$dialogWrapper,
dialogWrapperHammer;
$('.dialog-wrapper').remove();
$('body').append($(dialogStr));
function scrollHandler() {
$dialogBox = $('.dialog-box');
$dialogWrapper = $('.dialog-wrapper');
dialogWrapperHammer = new Hammer(document.getElementById('dialog-wrapper'));
if ($(window).scrollTop() + winH >= $(document).height() - footerH) {
// 显示
if (data.fast) {
$dialogWrapper.css({
display: 'block'
});
} else {
$dialogWrapper.fadeIn();
}
if (brandTab) {
$brandLoadMore.filter('.hide').removeClass('hide');
$dialogBox.css({
top: '50%',
marginTop: -($dialogBox.height() / 2)
});
if (!brandLockId) {
brandPageId++;
loadData($favBrandList, 'favBrand', brandPageId);
}
//隐藏
if (data.autoHide) {
setTimeout(function() {
$dialogWrapper.fadeOut();
}, 1000);
}
} else {
dialogWrapperHammer.on('tap', function(event) {
$loadMore.filter('.hide').removeClass('hide');
if ($(event.target).hasClass('dialog-left-btn')) {
$dialogWrapper.fadeOut();
} else if ($(event.target).hasClass('dialog-right-btn')) {
callback();
if (!lockId) {
pageId++;
loadData($favProductList, 'favProduct', pageId);
}
}
});
}
}
};
//srcoll to load more
$(window).scroll(function() {
window.requestAnimationFrame(scrollHandler);
});
define("js/me/index", ["jquery","swiper","index"], function(require, exports, module){
});
define("js/me/suggest", ["jquery","hammer","lazyload","handlebars","source-map"], function(require, exports, module){
/**
* 个人中心首页
* @author: bikai<kai.bi@yoho.cn>
* 个人中心--意见反馈
* @author: chenglong<chenglong.wang@yoho.cn>
* @date: 2015/11/12
*/
var $ = require("jquery");
var $userAvatar = $('.user-avatar'),
$listItem = $('.list-item');
var myImage = new Image(),
avatar;
require("js/product/recommend-for-you");
require("js/product/suspend-cart");
// 部分老用户没有头像,显示默认头像
avatar = $userAvatar.data('avatar');
myImage.src = avatar;
myImage.onload = function() {
$userAvatar.css('background-image', 'url(' + avatar + ')');
};
var $ = require("jquery"),
Hammer = require("hammer"),
lazyLoad = require("lazyload"),
Handlebars = require("handlebars");
$('.yoho-page').on('touchstart', '.list-item, .type-item', function() {
$listItem.removeClass('highlight');
$(this).addClass('highlight');
}).on('touchend touchcancel', '.list-item, .type-item', function() {
$(this).removeClass('highlight');
});
var diaLog = require("js/me/dialog");
});
define("js/me/coupons", ["jquery","hammer"], function(require, exports, module){
var $ = require("jquery"),
Hammer = require("hammer");
var employ;
$('.employ span').each(function(index) {
employ = new Hammer($('.employ span')[index]);
employ.on('tap', function(e) {
$('.employ-list').addClass('none').eq(index).removeClass('none');
$('.employ span').removeClass('active').eq(index).addClass('active');
});
});
});
define("js/me/online-service", ["jquery"], function(require, exports, module){
/**
* 在线客服
* @author: bikai<kai.bi@yoho.cn>
* @date: 2015/11/16
*/
var $ = require("jquery");
var $questionTab = $('.question-tab .tab-item');
$questionTab.on('touchend', function() {
var clickTab = $(this).data('tab');
clickTab = '[data-tab-name="' + clickTab + '"]';
$questionTab.removeClass('current');
$(this).addClass('current');
$('.question-list').removeClass('current');
$(clickTab).addClass('current');
});
});
define("js/me/address", ["jquery"], function(require, exports, module){
/**
* 地址管理
* @author: bikai<kai.bi@yoho.cn>
* @date: 2015/11/17
*/
var $ = require("jquery"),
tip = require("js/plugin/tip");
var $action = $('.action'),
$addressForm = $('.edit-address'),
$submit = $('.submit'),
$addAddress = $('.add-address'),
$editAddressPage = $('.my-edit-address-page'),
$addressListPage = $('.my-address-list-page'),
$area = $('.area'),
$footer = $('#yoho-footer'),
$confim = $('.confim-mask'),
$pageWrap = $('.page-wrap'),
$backBtn = $('.nav-back'),
isSubmiting,
deleteId,
currentPage = 'address',
newArea = [];
// 清除原有链接
$backBtn.attr('href', 'javascript:void(0);');
// 自定义事件
$backBtn.on('touchend', function(e) {
if (currentPage === 'edit') {
$pageWrap.hide();
$pageWrap.first().show();
e.preventDefault();
currentPage = 'address';
} else if (currentPage === 'list') {
$pageWrap.hide();
$editAddressPage.show();
e.preventDefault();
currentPage = 'edit';
} else {
window.history.go(-1);
}
});
function editAddress(data) {
data = data || {};
$addressForm.find('[name="id"]').val(data.id || '');
$addressForm.find('[name="consignee"]').val(data.consignee || '');
$addressForm.find('[name="mobile"]').val(data.mobile || '');
$addressForm.find('[name="area_code"]').val(data.areaCode || '');
$addressForm.find('[name="area"]').val(data.area || '');
$addressForm.find('[name="address"]').val(data.address || '');
currentPage = 'edit';
$footer.hide();
$pageWrap.hide();
$editAddressPage.show();
}
$confim.on('touchend', '.cancel', function() {
deleteId = null;
$confim.hide();
}).on('touchend', '.confim', function() {
$.ajax({
method: 'POST',
url: '/home/deladdress',
data: {
id: deleteId
}
}).then(function(res) {
if ($.type(res) !== 'object') {
res = {};
}
if (res.code !== 200) {
tip.show(res.message || '网络出了点问题~');
} else {
window.location.reload();
}
}).fail(function() {
tip.show('网络出了点问题~');
}).always(function() {
deleteId = null;
$confim.hide();
});
});
// 添加地址
$addAddress.on('touchend', function() {
editAddress();
});
// 编辑或删除
$action.on('touchend', '.edit', function() {
editAddress($(this).data());
}).on('touchend', '.del', function() {
deleteId = $(this).data('id');
$confim.show();
});
$submit.on('touchend', function() {
$addressForm.submit();
return false;
});
$addressForm.on('submit', function() {
if (isSubmiting) {
return false;
}
// 简单的表单校验
if (!$(this).find('[name="consignee"]').val()) {
tip.show('收件人不能为空');
$(this).find('[name="consignee"]').focus();
return false;
}
if (!$(this).find('[name="mobile"]').val()) {
tip.show('手机号不能为空');
$(this).find('[name="mobile"]').focus();
return false;
}
if (!$(this).find('[name="area_code"]').val() || !$(this).find('[name="area"]').val()) {
tip.show('省市区不能为空');
return false;
}
if (!$(this).find('[name="address"]').val()) {
tip.show('地址不能为空');
$(this).find('[name="address"]').focus();
return false;
}
isSubmiting = true;
$.ajax({
method: 'POST',
url: '/home/saveaddress',
data: $(this).serialize()
}).then(function(res) {
if ($.type(res) !== 'object') {
res = {};
}
if (res.code !== 200) {
tip.show(res.message || '网络出了点问题~');
} else {
window.location.reload();
}
}).fail(function() {
tip.show('网络出了点问题~');
}).always(function() {
isSubmiting = false;
});
return false;
});
// 省市区
$area.on('touchend', function() {
$footer.hide();
$pageWrap.hide();
$addressListPage.show();
currentPage = 'list';
});
$addressListPage.on('touchend', '.address', function() {
var caption = $(this).children('.caption').text();
newArea.push(caption);
$(this).siblings().hide();
$(this).children('ul').show();
return false;
}).on('touchend', '.address-last', function() {
// 填结果到 html
newArea.push($(this).children('.caption').text());
$('[name="area"]').val(newArea.join(' '));
$('[name="area_code"]').val($(this).data('id'));
$editAddressPage.show();
currentPage = 'edit';
// 恢复默认的三级选择
$addressListPage.hide();
$addressListPage.find('ul').hide();
$addressListPage.children('ul').show().children('li').show();
newArea = [];
return false;
});
});
define("js/me/suggest", ["jquery","hammer","handlebars","source-map"], function(require, exports, module){
/**
* 个人中心--意见反馈
* @author: chenglong<chenglong.wang@yoho.cn>
* @date: 2015/11/12
*/
var $ = require("jquery"),
Hammer = require("hammer"),
Handlebars = require("handlebars");
var diaLog = require("js/me/dialog");
var $uploadImgList = $('.upload-img-list'),
headerNavHammer,
formHammer,
imgTpl,
imgTemplate,
$likeBtn = $('.suggest-item .like-btn'),
$disLikeBtn = $('.suggest-item .dislike-btn'),
$imgAdd = $('.img-add'),
imgStr = '';
var $uploadImgList = $('.upload-img-list'),
headerNavHammer,
formHammer,
imgTpl,
imgTemplate,
$likeBtn = $('.suggest-item .like-btn'),
$disLikeBtn = $('.suggest-item .dislike-btn'),
$imgAdd = $('.img-add'),
imgStr = '',
uploadImgNum = 0;
require("js/me/jquery.uploadifive");
imgTpl = '{{# imgList}}' +
'<li>' +
'<img src="{{imgUrl}}" />' +
'<span class="upload-img-remove"></span>' +
'{{# imgUrl}}<img src="{{.}}" />' +
'<span class="upload-img-remove"></span>{{/ imgUrl}}' +
'</li>' +
'{{/ imgList}}';
... ... @@ -5523,19 +5624,25 @@ $('#upload-img').uploadifive({
fileSizeLimit: 1024,
height: '100%',
width: '100%',
queueSizeLimit: 1,
multi: false,
onAddQueueItem: function(files) {
//TODO
$uploadImgList.html(imgTemplate({
imgList: true
}));
},
onUploadComplete: function(file, data) {
$uploadImgList.html('');
imgStr = JSON.parse(data).imgList[0].imgRelUrl;
$uploadImgList.html(imgTemplate(JSON.parse(data)));
$imgAdd.hide();
uploadImgNum++;
}
});
lazyLoad();
headerNavHammer = new Hammer(document.getElementById('yoho-header'));
headerNavHammer.on('tap', function(e) {
... ... @@ -5572,6 +5679,7 @@ if (document.getElementById('img-form') !== null) {
if ($(e.target).hasClass('upload-img-remove')) {
$uploadImgList.html('');
imgStr = '';
uploadImgNum--;
setTimeout(function() {
$imgAdd.show();
}, 50);
... ... @@ -5582,6 +5690,7 @@ if (document.getElementById('img-form') !== null) {
// 点赞与取消点赞
$likeBtn.bind('click', function() {
var id = $(this).closest('.suggest-item').attr('data-id'),
$that = $(this);
... ... @@ -5593,21 +5702,22 @@ $likeBtn.bind('click', function() {
}
}).then(function(data) {
if (data.code === 200) {
if ($that.hasClass('active')) {
$that.closest('.suggest-type').removeClass('active')
.prev('.suggest-type').addClass('active');
} else {
$that.closest('.suggest-type').addClass('active')
.next('.suggest-type').removeClass('active');
}
$that.closest('.suggest-type').removeClass('show');
$('.suggest-good').addClass('show');
}
}).fail(function(data) {
//TODO
diaLog.showDialog({
autoHide: true,
dialogText: '网络错误~'
});
});
});
$disLikeBtn.bind('click', function() {
var id = $(this).closest('.suggest-item').attr('data-id'),
$that = $(this);
... ... @@ -5619,11 +5729,17 @@ $disLikeBtn.bind('click', function() {
}
}).then(function(data) {
if (data.code === 200) {
$that.toggleClass('active');
$that.closest('.suggest-type').removeClass('show');
$('.suggest-bad').addClass('show');
}
}).fail(function(data) {
//TODO
diaLog.showDialog({
autoHide: true,
dialogText: '网络错误~'
});
});
});
});
... ... @@ -6503,3 +6619,505 @@ var jQuery = require("jquery");
})(jQuery);
});
define("js/me/index", ["jquery","swiper","index"], function(require, exports, module){
/**
* 个人中心首页
* @author: bikai<kai.bi@yoho.cn>
* @date: 2015/11/12
*/
var $ = require("jquery");
var $userAvatar = $('.user-avatar'),
$listItem = $('.list-item');
var myImage = new Image(),
avatar;
require("js/product/recommend-for-you");
require("js/product/suspend-cart");
// 部分老用户没有头像,显示默认头像
avatar = $userAvatar.data('avatar');
myImage.src = avatar;
myImage.onload = function() {
$userAvatar.css('background-image', 'url(' + avatar + ')');
};
$('.yoho-page').on('touchstart', '.list-item, .type-item', function() {
$listItem.removeClass('highlight');
$(this).addClass('highlight');
}).on('touchend touchcancel', '.list-item, .type-item', function() {
$(this).removeClass('highlight');
});
});
define("js/me/coupons", ["jquery","hammer","mlellipsis"], function(require, exports, module){
var $ = require("jquery"),
Hammer = require("hammer"),
ellipsis = require("mlellipsis"),
loading = require("js/plugin/loading");
var employ,
statu = 0,
page = 1;
ellipsis.init();
function couponAJAX(statu, page) {
loading.showLoadingMask();
$.ajax({
type: 'POST',
url: '/home/couponData',
dataType: 'html',
data: {
statu: statu,
page: page
},
success: function(data) {
$('#employ').append(data);
window.rePosFooter();
loading.hideLoadingMask();
}
});
}
$('.yoho-footer').css('border-top', '1px solid #e0e0e0');
$('.employ span').each(function(index) {
employ = new Hammer($('.employ span')[index]);
employ.on('tap', function(e) {
$('.employ span').removeClass('active').eq(index).addClass('active');
$('#employ').html(' ');
statu = index;
page = 1;
couponAJAX(statu, page);
window.rePosFooter();
});
});
$(window).scroll(function() {
if ($(window).scrollTop() + $(window).height() > $('body').height() - 1) {
page++;
couponAJAX(statu, page);
return;
}
});
couponAJAX(statu, page);
});
define("js/me/online-service", ["jquery"], function(require, exports, module){
/**
* 在线客服
* @author: bikai<kai.bi@yoho.cn>
* @date: 2015/11/16
*/
var $ = require("jquery");
var $questionTab = $('.question-tab .tab-item');
$questionTab.on('touchend', function() {
var clickTab = $(this).data('tab');
clickTab = '[data-tab-name="' + clickTab + '"]';
$questionTab.removeClass('current');
$(this).addClass('current');
$('.question-list').removeClass('current');
$(clickTab).addClass('current');
});
$('.yoho-page').on('touchstart', '.connect-item, .question-item', function() {
$(this).siblings().removeClass('highlight');
$(this).addClass('highlight');
}).on('touchend touchcancel', '.connect-item, .question-item', function() {
$(this).removeClass('highlight');
});
});
define("js/me/address", ["jquery"], function(require, exports, module){
/**
* 地址管理
* @author: bikai<kai.bi@yoho.cn>
* @date: 2015/11/17
*/
var $ = require("jquery"),
tip = require("js/plugin/tip"),
security = require("js/plugin/security"),
loading = require("js/plugin/loading");
var $action = $('.action'),
$addressForm = $('.edit-address'),
$submit = $('.submit'),
$addAddress = $('.add-address'),
$footer = $('#yoho-footer'),
$confim = $('.confim-mask'),
$pageWrap = $('.page-wrap'),
$addressItem = $('.address-item'),
deleteId;
$pageWrap.first().css('min-height', function() {
return $(window).height() - $('#yoho-header').height() - $footer.height();
});
window.rePosFooter();
$confim.on('touchend', '.cancel', function() {
deleteId = null;
$confim.hide();
}).on('touchend', '.confim', function() {
loading.showLoadingMask();
$.ajax({
method: 'POST',
url: '/home/delAddress',
data: {
id: deleteId
}
}).then(function(res) {
if ($.type(res) !== 'object') {
res = {};
}
if (res.code !== 200) {
tip.show(res.message || '网络出了点问题~');
} else {
window.location.reload();
}
}).fail(function() {
tip.show('网络出了点问题~');
}).always(function() {
deleteId = null;
$confim.hide();
loading.hideLoadingMask();
});
});
// 添加地址
if ($addressItem.length < 5) {
$addAddress.attr('href', $addAddress.data('href'));
}
$addAddress.on('touchend', function() {
if ($addressItem.length >= 5) {
tip.show('您最多添加5个收货地址');
return false;
}
});
// 删除
$action.on('touchend', '.del', function() {
deleteId = $(this).data('id');
$confim.show();
});
$submit.on('touchend', function() {
if (security.hasDangerInput(false)) {
return false;
}
$addressForm.submit();
return false;
}).on('touchstart', function() {
$(this).addClass('highlight');
}).on('touchend touchcancel', function() {
$(this).removeClass('highlight');
});
});
define("js/me/browse-record", ["jquery","lazyload","handlebars","source-map","hammer"], function(require, exports, module){
/**
* 浏览记录
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/11/28
*/
var $ = require("jquery");
var lazyLoad = require("lazyload");
var load = require("js/plugin/loading");
var dialog = require("js/me/dialog");
var $page = $('.records');
var $loadMore = $('.load-more'),
$more = $loadMore.children('.more'),
$noMore = $loadMore.children('.no-more');
var page = 0;
var end = false,
loading = false;
var winH = $(window).height();
load.init();
function moreRecord(cb) {
var count = $page.children('.browse-record-good').length;
if (loading) {
return;
}
if (page === 1) {
$loadMore.removeClass('hide');
}
loading = true;
$.ajax({
type: 'GET',
url: '/home/recordContent',
data: {
page: page + 1
},
success: function(data) {
if (data === ' ') {
end = true;
$more.addClass('hide');
$noMore.removeClass('hide');
} else {
if (count === 0) {
$page.html(data);
lazyLoad();
} else {
$page.append(data);
lazyLoad($page.find('.browse-record-good:gt(' + (count - 1) + ') .lazy'));
}
page++;
if (cb) {
cb();
}
}
},
complete: function() {
loading = false;
}
});
}
load.showLoadingMask();
moreRecord(load.hideLoadingMask);
$(window).scroll(function() {
if (end) {
return;
}
if (winH + $(window).scrollTop() > $(document).height() - 0.25 * $page.height()) {
moreRecord();
}
});
$page.on('touchstart', '.del-icon', function() {
var $good = $(this).closest('.browse-record-good'),
skn = $good.data('skn');
dialog.showDialog({
dialogText: '确定删除此条浏览记录吗?',
hasFooter: {
leftBtnText: '取消',
rightBtnText: '确定'
}
}, function() {
$.ajax({
type: 'GET',
url: '/home/delRecord',
data: {
skn: skn
},
success: function(data) {
if (data.code === 200) {
window.history.go(0);
}
},
complete: function() {
dialog.hideDialog(); //隐藏dialog
}
});
});
});
});
define("js/me/address-act", ["jquery","hammer"], function(require, exports, module){
/**
* 修改地址
* @author: bikai<kai.bi@yoho.cn>
* @date: 2015/11/30
*/
var $ = require("jquery"),
Hammer = require("hammer"),
tip = require("js/plugin/tip"),
security = require("js/plugin/security"),
loading = require("js/plugin/loading");
var $addressForm = $('.edit-address'),
$submit = $('.submit'),
$editAddressPage = $('.my-edit-address-page'),
$addressListPage = $('.my-address-list-page'),
$area = $('.area'),
$footer = $('#yoho-footer'),
$backBtn = $('.nav-back'),
$navTitle = $('.nav-title'),
navTitle = $navTitle.html(),
isSubmiting,
currentPage = 'edit',
newArea = [];
$($editAddressPage, $addressListPage).css('min-height', function() {
return $(window).height() - $('#yoho-header').height();
});
// 清除返回按钮原有链接
$backBtn.attr('href', 'javascript:void(0);');
// 自定义返回按钮事件
$backBtn.on('touchend', function(e) {
if (currentPage === 'list') {
$addressListPage.hide();
$editAddressPage.show();
e.preventDefault();
currentPage = 'edit';
$navTitle.html(navTitle);
// 恢复默认的三级选择
$addressListPage.hide();
$addressListPage.find('ul').hide();
$addressListPage.children('ul').show().children('li').show();
newArea = [];
} else {
window.history.go(-1);
}
});
// 提交表单请求
$addressForm.on('submit', function() {
if (isSubmiting) {
return false;
}
if (security.hasDangerInput(false)) {
return false;
}
// 简单的表单校验
if (!$(this).find('[name="consignee"]').val()) {
tip.show('收件人不能为空');
return false;
}
if (!$(this).find('[name="mobile"]').val()) {
tip.show('手机号不能为空');
return false;
}
if (!$(this).find('[name="area_code"]').val() || !$(this).find('[name="area"]').val()) {
tip.show('省市区不能为空');
return false;
}
if (!$(this).find('[name="address"]').val()) {
tip.show('地址不能为空');
return false;
}
isSubmiting = true;
loading.showLoadingMask();
$.ajax({
method: 'POST',
url: '/home/saveAddress',
data: $(this).serialize()
}).then(function(res) {
if ($.type(res) !== 'object') {
res = {};
}
if (res.code !== 200) {
tip.show(res.message || '网络出了点问题~');
isSubmiting = false;
loading.hideLoadingMask();
} else {
window.location.href = '/home/address';
}
}).fail(function() {
tip.show('网络出了点问题~');
isSubmiting = false;
});
return false;
});
$submit.on('touchend', function() {
$addressForm.submit();
return false;
}).on('touchstart', function() {
$(this).addClass('highlight');
}).on('touchend touchcancel', function() {
$(this).removeClass('highlight');
});
// 省市区
$area.on('touchend', function() {
$editAddressPage.hide();
$addressListPage.show(1, function() {
$footer.hide();
});
currentPage = 'list';
$navTitle.html('地区选择');
});
// touchend 在下滑的时候会触发
// 省市区联动
$addressListPage.find('.address').each(function(i, elem) {
var addressHammer = new Hammer(elem);
addressHammer.on('tap', function(e) {
var $this = $(e.target);
newArea.push($this.children('.caption').text());
$this.siblings().hide();
$this.children('ul').show().children('li').show();
$(this).removeClass('highlight');
e.srcEvent.preventDefault();
e.srcEvent.stopPropagation();
});
});
$addressListPage.find('.address-last').each(function(i, elem) {
var addressLastHammer = new Hammer(elem);
addressLastHammer.on('tap', function(e) {
var $this = $(e.target);
// 填结果到 html
newArea.push($this.children('.caption').text());
$('[name="area"]').val(newArea.join(' '));
$('[name="area_code"]').val($this.data('id'));
$editAddressPage.show();
currentPage = 'edit';
$navTitle.html(navTitle);
$footer.show();
// 恢复默认的三级选择
$addressListPage.hide();
$addressListPage.find('ul').hide();
$addressListPage.children('ul').show().children('li').show();
newArea = [];
e.srcEvent.preventDefault();
e.srcEvent.stopPropagation();
});
});
$addressListPage.on('touchstart', 'li', function() {
$(this).addClass('highlight');
}).on('touchend touchcancel', 'li', function() {
$(this).removeClass('highlight');
});
$('input, textarea').on('focus', function() {
$footer.hide();
}).on('blur', function() {
$footer.show();
});
});
... ...
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.