Authored by hf

code review by hf: do modify my home page code to change check user is login and fixes bugs

<?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
... ...
framework @ 75bbc3b0
Subproject commit e9d066dd88a8e7e37103021c427a205a5cfcdcec
Subproject commit 75bbc3b075de19f239532f60c5995d06c5f814e2
... ...
... ... @@ -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) {
... ...
... ... @@ -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,7 +18,8 @@ class OrderData
* and open the template in the editor.
*/
static function getOrderData($type, $page, $limit, $gender, $yh_channel, $uid) {
static function getOrderData($type, $page, $limit, $gender, $yh_channel, $uid)
{
//构建必传参数
$param = Yohobuy::param();
$param['gender'] = $gender;
... ... @@ -45,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);
... ... @@ -64,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;
... ... @@ -83,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';
... ... @@ -91,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;
... ... @@ -114,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,418 +17,418 @@ use Api\Yohobuy;
class UserData
{
/**
* 个人详情数据
*
* @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);
}
/**
* 个人中心页面优惠券,收藏的商品等的数目数据
*
* @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);
}
/**
* 个人详情数据
*
* @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);
}
}
... ...
... ... @@ -16,12 +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';
/**
* 商品基本信息
*
... ... @@ -31,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)
));
}
/**
* 商品尺码信息
*
... ... @@ -44,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)));
}
/**
* 咨询内容列表
*
... ... @@ -58,13 +58,13 @@ 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
... ... @@ -75,12 +75,12 @@ class DetailData
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),
) );
'productId' => intval($productId),
'pageNum' => intval($pageNum),
'pageSize' => intval($pageSize),
));
}
/**
* 为你优选的商品列表
*
... ... @@ -88,14 +88,33 @@ class DetailData
* @param int $productSkn 商品SKN号
* @return array
*/
public static function preference($productSkn)
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);
}
}
... ...
... ... @@ -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
... ...
... ... @@ -106,6 +106,20 @@ function rePosFooter() {
}
}
/**
*
* add extra margin-bottom for footer to show yoho copyright when there is fixed bottom element on page
* @param {String} The jquery selecor of the fixed bottom element
* @return undefined
*/
function reMarginFooter(fixedElement) {
var fixedElH = $(fixedElement).outerHeight();
if (fixedElement) {
$footer.css('margin-bottom', fixedElH + 'px');
}
}
//页面通用底部位置及status设置
(function() {
var $op = $footer.children('.op-row');
... ... @@ -213,3 +227,5 @@ window.getUid = getUid;
window.getShoppingKey = getShoppingKey;
window.rePosFooter = rePosFooter;
window.reMarginFooter = reMarginFooter;
... ...
... ... @@ -69,7 +69,7 @@ $('.overlay').on('touchstart', function(e) {
});
//点击一级导航,弹出二级导航
$sideNav.on('touchstart', 'li', function (e) {
$sideNav.on('touchstart', 'li', function(e) {
if ($(this).find('.sub-nav').size() > 0) {
$('.sub-nav').removeClass('show');
$(this).find('.sub-nav').addClass('show');
... ... @@ -82,8 +82,8 @@ $sideNav.on('touchstart', 'li', function (e) {
});
//返回一级导航,收起二级导航
$subNav.each(function () {
$(this).find('li').eq(0).on('touchstart', function (e) {
$subNav.each(function() {
$(this).find('li').eq(0).on('touchstart', function(e) {
$('.sub-nav').removeClass('show');
e.stopPropagation();
return false;
... ... @@ -145,7 +145,7 @@ if ($('.trend-topic-swiper').find('li').size() > 1) {
}
//潮流上装/经典裤装等轮播
$('.category-swiper').each(function (i, index) {
$('.category-swiper').each(function(i, index) {
swiperClass = 'category-swiper' + i;
$(this).addClass(swiperClass);
if ($('.' + swiperClass).find('.swiper-slide').size() > 1) {
... ... @@ -161,7 +161,7 @@ $('.category-swiper').each(function (i, index) {
});
//logo动画
requestFrame = (function () {
requestFrame = (function() {
var tempFunc = null,
prefixList = ['webkit', 'moz', 'ms'];
... ... @@ -174,11 +174,11 @@ requestFrame = (function () {
}
if (supportCss3) {
return function (callback) {
return function(callback) {
window[tempFunc](callback);
};
}
return function (callback) {
return function(callback) {
window.setTimeout(callback, 67);
};
})();
... ... @@ -205,7 +205,7 @@ function tsAnimate() {
if (start % 360 === 0) {
window.setTimeout(tsAnimate, 60 * 1000);
} else {
requestFrame(function () {
requestFrame(function() {
tsAnimate();
});
}
... ... @@ -221,9 +221,7 @@ $('.home-header .iconfont').on('touchstart', function() {
});
// 底部留出tab 的高度
$('#yoho-footer').css({
'margin-bottom': '2.5rem'
});
window.reMarginFooter('.footer-tab');
//set cookie
exports.set = function(c) {
... ... @@ -231,4 +229,4 @@ exports.set = function(c) {
expires: 365,
domain: '.m.yohobuy.com'
});
};
\ No newline at end of file
};
... ...
... ... @@ -15,7 +15,8 @@ var goodsSwiper,
require('./desc');
require('./comments-consults');
//add extra marign-bottom for footer to show the yoho copyright
window.reMarginFooter('.cart-bar');
lazyLoad($('img.lazy'));
... ... @@ -46,4 +47,4 @@ $('.goodsDiscount .dropdown').on('click', function() {
$discountFolder.slideUp();
}
});
require('./like');
\ No newline at end of file
require('./like');
... ...
$vip: sprite-map("me/vip/*.png", $spacing: 10px);
$fav: sprite-map("me/fav/*.png", $spacing: 5px);
@import "home", "vip-grade", "order", "order-detail", "coupons", "personal-details", "yoho-coin", "fav", "suggest", "address", "online-service", "my-guang", "ihelp", "browse-record", "logistic";
@import "home", "vip-grade", "order", "order-detail", "coupons", "personal-details", "yoho-coin", "fav", "suggest", "address", "online-service", "my-guang", "ihelp", "browse-record";
... ...
... ... @@ -48,18 +48,34 @@
// width: 100%;
// border-bottom:1px solid $borderC;
img {
position:absolute;
top:0;
bottom:0;
left:0;
position:absolute;
top:0;
bottom:0;
left:0;
margin:auto;
width: pxToRem(90px);
//width: pxToRem(90px);
height: auto;
padding-right: pxToRem(20px);
}
.material-image {
display: inline-block;
width: 23%;
min-height: pxToRem(136px);
float: left;
//background-size: 100%;
background-position-x: center;
background-repeat: no-repeat;
}
.material-desc {
padding-left:pxToRem(120px);
//padding-left:pxToRem(120px);
font-size: pxToRem(24px);
text-align: left;
display: inline-block;
width: 75%;
padding-left: 2%;
height: auto;
line-height: pxToRem(40px);
color: #4b4b4b;
}
&:last-child{
border-bottom: none;
... ... @@ -68,13 +84,13 @@
}
}
.wash-tips{
padding-top:pxToRem(18px);
padding-top:pxToRem(18px);
&.page-block{
// border-top: 0px;
padding-left: pxToRem(15px);
padding-right: pxToRem(15px);
}
// padding-bottom:pxToRem(18px);
// padding-bottom:pxToRem(18px);
.tip{
display: inline-block;
width: 16.6%;
... ... @@ -83,7 +99,7 @@
img{
width: pxToRem(48px);
height: pxToRem(48px);
margin-bottom: pxToRem(10px);
margin-bottom: pxToRem(10px);
}
.caption{
display: block;
... ... @@ -93,7 +109,7 @@
margin-bottom: pxToRem(18px);
}
}
}
.product-detail {
.detail {
... ... @@ -150,4 +166,4 @@
}
}
}
}
\ No newline at end of file
}
... ...
{{#coupons}}
<div class="employ-main">
<div class="employ-main" style="background:url('{{coupon_pic}}')">
<span>{{ money}}</span>
<p class="coupon-name">{{ coupon_name}}</p>
<p>{{ couponValidity}}</p>
... ... @@ -13,4 +13,4 @@
<p>您还没有优惠券!</p>
<a href="{{topURL}}">随便逛逛</a>
</div>
{{/ noRecord}}
\ No newline at end of file
{{/ noRecord}}
... ...
{{> layout/header}}
<div class="consult-form-page">
<form class="consult-form">
<textarea>这款衣服有WS吗?</textarea>
<a href="" type="submit">提交</a>
</form>
<form class="consult-form" url="{{formUrl}}">
<textarea id="content" name="content">请输入咨询内容</textarea>
<input type="hidden" id="product_id" value="{{productId}}">
<a type="submit">提交</a>
</form>
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -277,11 +277,14 @@
</script>
{{/if}}
{{#if browseRecordPage}}
<<<<<<< HEAD
<script>
seajs.use('js/me/browse-record');
</script>
{{/if}}
{{#if logisticInfoPage}}
=======
>>>>>>> feature/hf
<script>
seajs.use('js/me/logistic');
</script>
... ...
... ... @@ -69,10 +69,10 @@
{{#list}}
{{#if @first}}
<div class="swiper-slide first-group" >
{{#params}}
{{#params}}
{{#if @first}}
{{else}}
<img class="avatar lazy" data-original="{{param}}" alt="">
{{else}}
<img class="avatar lazy" data-original="{{param}}" alt="">
{{/if}}
{{/params}}
</div>
... ... @@ -101,10 +101,14 @@
<div class="detail">
{{#list}}
<div class="material-item">
<img class="lazy" data-original="{{img}}" alt="">
<!-- <img class="lazy" data-original="{{img}}" alt="">
<p class="material-desc">
{{desc}}
</p>
</p>-->
<div class="material-image" style="background-image:url({{img}})"></div>
<div class="material-desc">
{{desc}}
</div>
</div>
{{/list}}
</div>
... ... @@ -137,4 +141,4 @@
{{/list}}
</div>
</div>
{{/productDetail}}
\ No newline at end of file
{{/productDetail}}
... ...
... ... @@ -32,36 +32,39 @@ class SearchController extends AbstractAction
*/
public function listAction()
{
// 过滤请求参数
$condition = filter_input_array(INPUT_GET, array(
'query' => FILTER_DEFAULT,
'brand' => FILTER_DEFAULT,
'sort' => FILTER_DEFAULT,
'msort' => FILTER_DEFAULT,
'misort' => FILTER_DEFAULT,
'color' => FILTER_DEFAULT,
'size' => FILTER_DEFAULT,
'style' => FILTER_DEFAULT,
'price' => FILTER_DEFAULT,
'discount' => FILTER_DEFAULT,
'gender' => FILTER_DEFAULT,
'p_d' => FILTER_DEFAULT,), false);
$query = empty($condition['query']) ? null : strtolower(trim($condition['query']));
if (isset($condition['discount'])) {
$condition['p_d'] = rawurldecode($condition['discount']);
// unset($condition['discount']); 为了兼容js中传参的discount
}
// 为了兼容现在运营在用的p_d
if (isset($condition['p_d'])) {
$condition['discount'] = rawurldecode($condition['p_d']);
}
if (isset($condition['query'])) {
$condition['query'] = rawurlencode($condition['query']);
}
// // 过滤请求参数
// $condition = filter_input_array(INPUT_GET, array(
// 'query' => FILTER_DEFAULT,
// 'brand' => FILTER_DEFAULT,
// 'sort' => FILTER_DEFAULT,
// 'msort' => FILTER_DEFAULT,
// 'misort' => FILTER_DEFAULT,
// 'color' => FILTER_DEFAULT,
// 'size' => FILTER_DEFAULT,
// 'style' => FILTER_DEFAULT,
// 'price' => FILTER_DEFAULT,
// 'discount' => FILTER_DEFAULT,
// 'gender' => FILTER_DEFAULT,
// 'p_d' => FILTER_DEFAULT,), false);
//
// $query = empty($condition['query']) ? null : strtolower(trim($condition['query']));
// if (isset($condition['discount'])) {
// $condition['p_d'] = rawurldecode($condition['discount']);
// // unset($condition['discount']); 为了兼容js中传参的discount
// }
// // 为了兼容现在运营在用的p_d
// if (isset($condition['p_d'])) {
// $condition['discount'] = rawurldecode($condition['p_d']);
// }
// if (isset($condition['query'])) {
// $condition['query'] = rawurlencode($condition['query']);
// }
$query = $this->get('query', '');
$query = is_string($query) ? '' : strtolower(trim($query));
// 标识用户是否有输入搜索内容
$haveQuery = $query !== null;
$haveQuery = $query !== '';
// 标识用户搜的是不是一级品类
$isQueryFirstClass = false;
// 标识用户搜的是不是二级品类
... ... @@ -129,13 +132,14 @@ class SearchController extends AbstractAction
} while (false);
$classNames = array();
} else {
$condition['query'] = '';
}
}
// else {
// $condition['query'] = '';
// }
$data = array();
$data['goodListPage'] = true;
$data['goodList'] = $condition;
//$data['goodList'] = $condition;
$data['query'] = $query;
// 搜索是一级品类
if ($isQueryFirstClass) {
... ... @@ -229,6 +233,10 @@ class SearchController extends AbstractAction
if (isset($condition['misort'])) {
$condition['misort'] = rawurldecode($condition['misort']);
}
// 转义颜色
if (isset($condition['color'])) {
$condition['color'] = rawurldecode($condition['color']);
}
// 转义价格
if (isset($condition['price'])) {
$condition['price'] = rawurldecode($condition['price']);
... ... @@ -237,8 +245,12 @@ class SearchController extends AbstractAction
if (isset($condition['style'])) {
$condition['style'] = rawurldecode($condition['style']);
}
// 为了兼容现在运营在用的p_d
if (isset($condition['p_d'])) {
$condition['p_d'] = rawurldecode($condition['p_d']);
}
// 转换折扣
if (isset($condition['discount'])) {
elseif (isset($condition['discount'])) {
$condition['p_d'] = rawurldecode($condition['discount']);
unset($condition['discount']);
}
... ... @@ -312,8 +324,24 @@ class SearchController extends AbstractAction
if (isset($condition['sort'])) {
$condition['sort'] = rawurldecode($condition['sort']);
}
// 转义分类
if (isset($condition['msort'])) {
$condition['msort'] = rawurldecode($condition['msort']);
}
// 转义分类
if (isset($condition['misort'])) {
$condition['misort'] = rawurldecode($condition['misort']);
}
// 转义颜色
if (isset($condition['color'])) {
$condition['color'] = rawurldecode($condition['color']);
}
// 为了兼容现在运营在用的p_d
if (isset($condition['p_d'])) {
$condition['p_d'] = rawurldecode($condition['p_d']);
}
// 转换折扣
if (isset($condition['discount'])) {
elseif (isset($condition['discount'])) {
$condition['p_d'] = rawurldecode($condition['discount']);
unset($condition['discount']);
}
... ...
... ... @@ -15,110 +15,111 @@ class GradeModel
/*
* 获取个人中心-会员等级数据
*/
public static function getGrade($gender, $channel, $uid)
{
$result = array();
if (USE_CACHE) {
// 先尝试获取一级缓存(master), 有数据则直接返回.
$result = Cache::get(CacheConfig::KEY_ACTION_HOME_GRADE, 'master');
if (!empty($result)) {
return $result;
}
}
//调用接口获取数据
$data = GradeData::getGradeData($channel, $uid);
if (!empty($data['grade'])) {
switch (intval($data['grade']['current_vip_level'])) {
case 0://普通会员
$result['vipGrade']['vip0'] = true;
break;
case 1://银卡会员
$result['vipGrade']['vip1'] = true;
break;
case 2://金卡会员
$result['vipGrade']['vip2'] = true;
break;
case 3://白金会员
$result['vipGrade']['vip3'] = true;
break;
}
//今年总消费
$result['vipGrade']['costOfThisYear'] = $data['grade']['current_year_cost'];
//升级下一等级会员的进度;
if($data['grade']['next_need_cost'] == 0){
//当vip等级升至顶级时,进度条满格
$result['vipGrade']['percent'] = 100;
}else{
$result['vipGrade']['percent'] = 100 * (round($data['grade']['current_total_cost'] / $data['grade']['next_need_cost'], 2));
}
//距离升级所需消费金额
if ($data['grade']['current_vip_level'] != 3) {
$result['vipGrade']['costGap'] = $data['grade']['upgrade_need_cost'];
}
//消费总计
$result['vipGrade']['sumCost'] = $data['grade']['current_total_cost'];
//username 调用获取用户基本信息数据,获得username;
//$userProfile = GradeData::getUserProfileData($gender,$uid,$channel);
$result['vipGrade']['name'] = !empty($data['userProfile']) ? $data['userProfile']['username'] : '';
//跳转url(会员特权详情)
$result['vipGrade']['allUrl'] = Helpers::url('/home/preferential', null);
//当前vip等级享受的特权
$result['vipGrade']['privilege'] = $data['grade']['enjoy_preferential'];
}
if (USE_CACHE) {
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
if (empty($result)) {
$result = Cache::get(CacheConfig::KEY_ACTION_HOME_GRADE, 'slave');
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else {
Cache::set(CacheConfig::KEY_ACTION_HOME_GRADE, $result);
}
}
return $result;
}
/*
public static function getGrade($gender, $channel, $uid)
{
$result = array();
if (USE_CACHE) {
// 先尝试获取一级缓存(master), 有数据则直接返回.
$result = Cache::get(CacheConfig::KEY_ACTION_HOME_GRADE, 'master');
if (!empty($result)) {
return $result;
}
}
//调用接口获取数据
$data = GradeData::getGradeData($channel, $uid);
if (!empty($data['grade'])) {
switch (intval($data['grade']['current_vip_level'])) {
case 0://普通会员
$result['vipGrade']['vip0'] = true;
break;
case 1://银卡会员
$result['vipGrade']['vip1'] = true;
break;
case 2://金卡会员
$result['vipGrade']['vip2'] = true;
break;
case 3://白金会员
$result['vipGrade']['vip3'] = true;
break;
}
//今年总消费
$result['vipGrade']['costOfThisYear'] = $data['grade']['current_year_cost'];
//升级下一等级会员的进度;
if ($data['grade']['next_need_cost'] == 0) {
//当vip等级升至顶级时,进度条满格
$result['vipGrade']['percent'] = 100;
} else {
$result['vipGrade']['percent'] = 100 * (round($data['grade']['current_total_cost'] / $data['grade']['next_need_cost'], 2));
}
//距离升级所需消费金额
if ($data['grade']['current_vip_level'] != 3) {
$result['vipGrade']['costGap'] = $data['grade']['upgrade_need_cost'];
}
//消费总计
$result['vipGrade']['sumCost'] = $data['grade']['current_total_cost'];
//username 调用获取用户基本信息数据,获得username;
//$userProfile = GradeData::getUserProfileData($gender,$uid,$channel);
$result['vipGrade']['name'] = !empty($data['userProfile']) ? $data['userProfile']['username'] : '';
//跳转url(会员特权详情)
$result['vipGrade']['allUrl'] = Helpers::url('/home/preferential', null);
//当前vip等级享受的特权
$result['vipGrade']['privilege'] = $data['grade']['enjoy_preferential'];
}
if (USE_CACHE) {
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
if (empty($result)) {
$result = Cache::get(CacheConfig::KEY_ACTION_HOME_GRADE, 'slave');
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else {
Cache::set(CacheConfig::KEY_ACTION_HOME_GRADE, $result);
}
}
return $result;
}
/*
* 获取个人中心-会员特权详情页
*/
public static function getPreferential($channel, $uid)
{
$result = array();
if (USE_CACHE) {
// 先尝试获取一级缓存(master), 有数据则直接返回.
$result = Cache::get(CacheConfig::KEY_ACTION_HOME_PREFERENTIAL, 'master');
if (!empty($result)) {
return $result;
}
}
//调取接口获得数据
$data = GradeData::getPreferentialData($channel, $uid);
if (isset($data['code']) && $data['code'] == 200) {
$result['vipGrade']['privilege'] = $data['data'];
}
if (USE_CACHE) {
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
if (empty($result)) {
$result = Cache::get(CacheConfig::KEY_ACTION_HOME_GRADE, 'slave');
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else {
Cache::set(CacheConfig::KEY_ACTION_HOME_PREFERENTIAL, $result);
}
}
return $result;
}
public static function getPreferential($channel, $uid)
{
$result = array();
if (USE_CACHE) {
// 先尝试获取一级缓存(master), 有数据则直接返回.
$result = Cache::get(CacheConfig::KEY_ACTION_HOME_PREFERENTIAL, 'master');
if (!empty($result)) {
return $result;
}
}
//调取接口获得数据
$data = GradeData::getPreferentialData($channel, $uid);
if (isset($data['code']) && $data['code'] == 200) {
$result['vipGrade']['privilege'] = $data['data'];
}
if (USE_CACHE) {
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
if (empty($result)) {
$result = Cache::get(CacheConfig::KEY_ACTION_HOME_GRADE, 'slave');
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else {
Cache::set(CacheConfig::KEY_ACTION_HOME_PREFERENTIAL, $result);
}
}
return $result;
}
}
... ...
... ... @@ -18,11 +18,9 @@ class GuangModel
$result = array();
//调用接口获取数据
$res = GuangData::getGuangInfo($uid, $page, $yh_channel, $gender, $limit);
$result['totalPage']=intval($res['data']['totalPage']);
if (!empty($res['data']['data']))
{
foreach ($res['data']['data'] as $k => $v)
{
$result['totalPage'] = intval($res['data']['totalPage']);
if (!empty($res['data']['data'])) {
foreach ($res['data']['data'] as $k => $v) {
$result[$k] = Helpers::formatArticle($v, true, false, true, $uid);
}
}
... ...
... ... @@ -10,11 +10,11 @@ use Plugin\Helpers;
*/
class OnlineModel
{
/*
* 获取在线帮助分类
* $clientType客户端类型
*/
public static function getOnlineServiceInfo($clientType = 'iphone')
{
//调用接口获取数据
... ... @@ -22,13 +22,10 @@ class OnlineModel
$cateInfo = $res['data'];
$question = array();
$tab = array();
if ($cateInfo)
{
foreach ($cateInfo as $key => $value)
{
if ($cateInfo) {
foreach ($cateInfo as $key => $value) {
//强制截成3个tab
if ($key > 2)
{
if ($key > 2) {
break;
}
$tab[$key]['tabid'] = 'tab' . $value['id'];
... ... @@ -39,12 +36,10 @@ class OnlineModel
$question[$key]['current'] = (!$key) ? TRUE : FALSE;
$sub = $value['sub'];
$qTmp = array();
if ($sub)
{
foreach ($sub as $sk => $sv)
{
if ($sub) {
foreach ($sub as $sk => $sv) {
$qTmp[$sk]['title'] = $sv['category_name'];
$qTmp[$sk]['link'] = Helpers::url('/home/onlineservicedetail',array('cateId'=>$sv['id'],'cateName'=>$sv['category_name']));
$qTmp[$sk]['link'] = Helpers::url('/home/onlineservicedetail', array('cateId' => $sv['id'], 'cateName' => $sv['category_name']));
}
}
$question[$key]['list'] = $qTmp;
... ... @@ -67,22 +62,19 @@ class OnlineModel
* cateId问题分类ID
* clientType客户端
*/
public static function getOnlineServiceDetail($cateId, $clinetType = 'iphone')
{
$result = array();
if (!$cateId)
{
if (!$cateId) {
return $result;
}
$res = OnlineData::getOnlineServiceDetail($cateId, $clinetType);
$questionInfo = $res['data'];
if ($questionInfo)
{
if ($questionInfo) {
$list = array();
if ($questionInfo)
{
foreach ($questionInfo as $qk => $qv)
{
if ($questionInfo) {
foreach ($questionInfo as $qk => $qv) {
$list[$qk]['q'] = $qv['title'];
$list[$qk]['a'] = $qv['content'];
}
... ...
... ... @@ -27,7 +27,9 @@ class OrderModel
/**
* 订单相关数据处理
*/
static function getOrder($type, $page, $limit, $gender, $yh_channel, $uid) {
static function getOrder($type, $page, $limit, $gender, $yh_channel, $uid)
{
$result = array();
if (USE_CACHE) {
$key = CacheConfig::KEY_ACTION_HOME_ORDER_ORDER;
... ... @@ -114,7 +116,8 @@ class OrderModel
}
//格式化订单商品
static function formatOrderGoods($orderGoods) {
static function formatOrderGoods($orderGoods)
{
$arr = array();
foreach ($orderGoods as $key => $vo) {
$arr[$key]['thumb'] = Helpers::getImageUrl($vo['goods_image'], 90, 120);
... ... @@ -134,7 +137,8 @@ class OrderModel
}
//根据type值设置nav属性
static function getNavs($type) {
static function getNavs($type)
{
$nav = array(
array(
'name' => '全部',
... ... @@ -187,7 +191,8 @@ class OrderModel
}
//获得支付链接
static function payment($gender, $yh_channel) {
static function payment($gender, $yh_channel)
{
$code = self::CODE_PAYMENT;
$data = OrderData::paymentData($gender, $yh_channel, $code);
}
... ... @@ -197,7 +202,8 @@ class OrderModel
// OrderData::LogisticsData();
// }
//随便逛逛url获取
static function stroll($gender, $yh_channel) {
static function stroll($gender, $yh_channel)
{
//获取随便逛逛url资源码
$code = self::CODE_STROLL;
//调用接口获得数据
... ...
... ... @@ -19,201 +19,201 @@ use Plugin\Images;
class UserModel
{
/**
* 处理用户个人详情数据
*
* @param int $uid 用户ID
* @return array|mixed 处理之后的个人详情数据
*/
public static function getUserProfileData($uid)
{
$result = array();
// 调用接口获取个人详情
$userData = UserData::userData($uid);
// 处理个人详情数
if (isset($userData['data']) && !empty($userData['data'])) {
$result = $userData['data'];
$result['gender'] = $result['gender'] == 1 ? '男' : '女';
$result['head_ico'] = Images::getImageUrl($result['head_ico'], 128, 128);
}
return $result;
}
/**
* 处理个人中心页面优惠券,收藏的商品等的数目数据
*
* @param int $uid 用户ID
* @return array|mixed 处理之后的个人中心页面优惠券,收藏的商品等的数目数据
*/
public static function getInfoNumData($uid)
{
$result = array();
// 调用接口获取个人中心页面优惠券,收藏的商品等的数目数据
$infoNumData = UserData::infoNum($uid);
// 处理个人中心页面优惠券,收藏的商品等的数目数据
if (isset($infoNumData['data']) && !empty($infoNumData['data'])) {
$transArr = array(
'brand_favorite_total',
'product_favorite_total',
'product_browse',
'dueInGoodsCount',
'dueOutGoodsCount',
'pendingPaymentCount',
'refundGoodsCount'
);
foreach ($infoNumData['data'] as $key => &$val) {
if (empty($val)) {
// 把没有数据的条目设置为0
$val = 0;
} else if (in_array($key, $transArr) && intval($val) > 99) {
$val = '99+';
}
}
$result = $infoNumData['data'];
// 默认没有返回用户地址的数据,添加这块儿数据
$result['address_num'] = count(self::getAddressData($uid));
}
return $result;
}
/**
* 处理个人中心页面优选新品数据
*
* @param int $yh_channel 频道,1代表男生,2代表女生,3代表潮童,4代表创意生活
* @return array|mixed 处理之后的个人中心页面优选新品数据
*/
public static function getPreferenceData($yh_channel)
{
$result = array();
// 调用接口获取个人中心页面优选新品数据
$preferenceData = UserData::preference($yh_channel);
// 处理个人中心页面优选新品数据
if (isset($preferenceData['data']) && !empty($preferenceData['data'])) {
foreach ($preferenceData['data'] as $val) {
$result['recommendList'][] = Helpers::formatProduct($val, false, true, true, 299, 388, false, false);
}
}
return $result;
}
/**
* 处理用户订单数据
*
* @param int $uid 用户ID
* @param int $type 订单类型,1表示全部,2表示待付款,3表示待发货,4表示待收货,5表示待评价
* @return array|mixed 处理之后的个人详情数据
*/
public static function getUserOrderData($uid, $type)
{
$result = array();
// 调用接口获取用户订单数据
$orderData = UserData::orderData($uid, $type);
// 处理用户订单数据
if (isset($orderData['data']) && !empty($orderData['data'])) {
$oneOrder = array();
foreach ($orderData['data']['order_list'] as $val) {
$oneOrder = array();
$oneOrder['orderNum'] = $val['order_code'];
$oneOrder['tradingStatus'] = $val['status_str'];
$oneOrder['count'] = count($val['order_goods']);
$oneOrder['sumCost'] = $val['amount'];
$oneOrder['unpaid'] = !$val['payment'];
// 处理订单商品
$oneGoods = array();
foreach ($val['order_goods'] as $goods) {
$oneGoods = array();
$oneGoods['id'] = 1;
$oneGoods['thumb'] = Helpers::getImageUrl($goods['goods_image'], 60, 80);
$oneGoods['name'] = $goods['product_name'];
$oneGoods['color'] = $goods['color_name'];
$oneGoods['size'] = $goods['size_name'];
$oneGoods['price'] = $goods['goods_price'];
$oneGoods['count'] = $goods['buy_number'];
$oneOrder[] = $oneGoods;
}
$result['orders'][] = $oneOrder;
}
}
return $result;
}
/**
* 处理用户收藏的商品数据
*
* @param int $uid 用户ID
* @param int $page 第几页
* @param int $limit 限制读取的数目,默认10
* @return array|mixed 处理之后的收藏的商品数据
*/
public static function getFavProductData($uid, $page, $limit)
{
$result = array();
// 调用接口获取用户收藏的商品数据
$favProduct = UserData::favoriteProductData($uid, $page, $limit);
// 处理用户收藏的商品数据
if (isset($favProduct['data']) && !empty($favProduct['data']['product_list'])) {
$datas = array();
$product = array();
foreach ($favProduct['data']['product_list'] as $val) {
$product = array();
$product['fav_id'] = $val['product_id'];
$product['link'] = isset($val['goodsId']) ? Helpers::url('/product/pro_' . $val['product_skn'] . '_' . $val['goodsId'] . '/' . $val['cnAlphabet'] . '.html') : '';
$product['imgUrl'] = Helpers::getImageUrl($val['image'], 447, 596);;
$product['title'] = $val['product_name'];
$product['price'] = !empty($val['market_price']) ? '¥'.$val['market_price'] . '.00' : 0;
$product['discountPrice'] = ($val['market_price'] - $val['sales_price'] > 0) ? '¥' . $val['sales_price'] . '.00' : false;
$product['savePrice'] = ($val['price_down'] > 0) ? '¥'.$val['price_down'] . '.00' : false;
$product['sellOut'] = ($val['storage'] <= 0);
$datas[] = $product;
}
/**
* 处理用户个人详情数据
*
* @param int $uid 用户ID
* @return array|mixed 处理之后的个人详情数据
*/
public static function getUserProfileData($uid)
{
$result = array();
// 调用接口获取个人详情
$userData = UserData::userData($uid);
// 处理个人详情数
if (isset($userData['data']) && !empty($userData['data'])) {
$result = $userData['data'];
$result['gender'] = $result['gender'] == 1 ? '男' : '女';
$result['head_ico'] = Images::getImageUrl($result['head_ico'], 128, 128);
}
return $result;
}
/**
* 处理个人中心页面优惠券,收藏的商品等的数目数据
*
* @param int $uid 用户ID
* @return array|mixed 处理之后的个人中心页面优惠券,收藏的商品等的数目数据
*/
public static function getInfoNumData($uid)
{
$result = array();
// 调用接口获取个人中心页面优惠券,收藏的商品等的数目数据
$infoNumData = UserData::infoNum($uid);
// 处理个人中心页面优惠券,收藏的商品等的数目数据
if (isset($infoNumData['data']) && !empty($infoNumData['data'])) {
$transArr = array(
'brand_favorite_total',
'product_favorite_total',
'product_browse',
'dueInGoodsCount',
'dueOutGoodsCount',
'pendingPaymentCount',
'refundGoodsCount'
);
foreach ($infoNumData['data'] as $key => &$val) {
if (empty($val)) {
// 把没有数据的条目设置为0
$val = 0;
} else if (in_array($key, $transArr) && intval($val) > 99) {
$val = '99+';
}
}
$result = $infoNumData['data'];
// 默认没有返回用户地址的数据,添加这块儿数据
$result['address_num'] = count(self::getAddressData($uid));
}
return $result;
}
/**
* 处理个人中心页面优选新品数据
*
* @param int $yh_channel 频道,1代表男生,2代表女生,3代表潮童,4代表创意生活
* @return array|mixed 处理之后的个人中心页面优选新品数据
*/
public static function getPreferenceData($yh_channel)
{
$result = array();
// 调用接口获取个人中心页面优选新品数据
$preferenceData = UserData::preference($yh_channel);
// 处理个人中心页面优选新品数据
if (isset($preferenceData['data']) && !empty($preferenceData['data'])) {
foreach ($preferenceData['data'] as $val) {
$result['recommendList'][] = Helpers::formatProduct($val, false, true, true, 299, 388, false, false);
}
}
return $result;
}
/**
* 处理用户订单数据
*
* @param int $uid 用户ID
* @param int $type 订单类型,1表示全部,2表示待付款,3表示待发货,4表示待收货,5表示待评价
* @return array|mixed 处理之后的个人详情数据
*/
public static function getUserOrderData($uid, $type)
{
$result = array();
// 调用接口获取用户订单数据
$orderData = UserData::orderData($uid, $type);
// 处理用户订单数据
if (isset($orderData['data']) && !empty($orderData['data'])) {
$oneOrder = array();
foreach ($orderData['data']['order_list'] as $val) {
$oneOrder = array();
$oneOrder['orderNum'] = $val['order_code'];
$oneOrder['tradingStatus'] = $val['status_str'];
$oneOrder['count'] = count($val['order_goods']);
$oneOrder['sumCost'] = $val['amount'];
$oneOrder['unpaid'] = !$val['payment'];
// 处理订单商品
$oneGoods = array();
foreach ($val['order_goods'] as $goods) {
$oneGoods = array();
$oneGoods['id'] = 1;
$oneGoods['thumb'] = Helpers::getImageUrl($goods['goods_image'], 60, 80);
$oneGoods['name'] = $goods['product_name'];
$oneGoods['color'] = $goods['color_name'];
$oneGoods['size'] = $goods['size_name'];
$oneGoods['price'] = $goods['goods_price'];
$oneGoods['count'] = $goods['buy_number'];
$oneOrder[] = $oneGoods;
}
$result['orders'][] = $oneOrder;
}
}
return $result;
}
/**
* 处理用户收藏的商品数据
*
* @param int $uid 用户ID
* @param int $page 第几页
* @param int $limit 限制读取的数目,默认10
* @return array|mixed 处理之后的收藏的商品数据
*/
public static function getFavProductData($uid, $page, $limit)
{
$result = array();
// 调用接口获取用户收藏的商品数据
$favProduct = UserData::favoriteProductData($uid, $page, $limit);
// 处理用户收藏的商品数据
if (isset($favProduct['data']) && !empty($favProduct['data']['product_list'])) {
$datas = array();
$product = array();
foreach ($favProduct['data']['product_list'] as $val) {
$product = array();
$product['fav_id'] = $val['product_id'];
$product['link'] = isset($val['goodsId']) ? Helpers::url('/product/pro_' . $val['product_skn'] . '_' . $val['goodsId'] . '/' . $val['cnAlphabet'] . '.html') : '';
$product['imgUrl'] = Helpers::getImageUrl($val['image'], 447, 596);
;
$product['title'] = $val['product_name'];
$product['price'] = !empty($val['market_price']) ? '¥' . $val['market_price'] . '.00' : 0;
$product['discountPrice'] = ($val['market_price'] - $val['sales_price'] > 0) ? '¥' . $val['sales_price'] . '.00' : false;
$product['savePrice'] = ($val['price_down'] > 0) ? '¥' . $val['price_down'] . '.00' : false;
$product['sellOut'] = ($val['storage'] <= 0);
$datas[] = $product;
}
!empty($datas) && $result['hasFavProduct'] = $datas;
} else if ($page > 1 && isset($favProduct['code']) && $favProduct['code'] === 500){
$result['end'] = true;
}
return $result;
}
/**
* 处理用户收藏的品牌数据
*
* @param int $uid 用户ID
* @param string $gender 性别 1,3表示男,2,3表示女,1,2,3表示全部
} else if ($page > 1 && isset($favProduct['code']) && $favProduct['code'] === 500) {
$result['end'] = true;
}
return $result;
}
/**
* 处理用户收藏的品牌数据
*
* @param int $uid 用户ID
* @param string $gender 性别 1,3表示男,2,3表示女,1,2,3表示全部
* @param int $page 第几页
* @param int $limit 限制读取的数目
* @return array|mixed 处理之后的收藏的品牌数据
*/
public static function getFavBrandData($uid, $gender, $page, $limit)
{
$result = array();
* @return array|mixed 处理之后的收藏的品牌数据
*/
public static function getFavBrandData($uid, $gender, $page, $limit)
{
$result = array();
// 调用接口获取户收藏的品牌数据
$favBrand = UserData::favoriteBrandData($uid, $gender, $page, $limit);
// 调用接口获取户收藏的品牌数据
$favBrand = UserData::favoriteBrandData($uid, $gender, $page, $limit);
// 处理用户收藏的品牌数据
if (isset($favBrand['data']) && !empty($favBrand['data']['brand_list'])) {
// 处理用户收藏的品牌数据
if (isset($favBrand['data']) && !empty($favBrand['data']['brand_list'])) {
if ($page > $favBrand['data']['page_total']) {
$result['end'] = true;
... ... @@ -223,509 +223,506 @@ class UserModel
$datas = array();
$brand = array();
foreach ($favBrand['data']['brand_list'] as $val) {
$brand = array();
$brand['id'] = $val['brand_id'];
$brand['brandImg'] = !empty($val['brand_ico']) ? Images::getImageUrl($val['brand_ico'], 47, 47) : '';
$brand['brandName'] = $val['brand_name'];
$brand['update'] = $val['new_product_num'];
$brand['discount'] = $val['product_discount_num'];
$brand['link'] = Helpers::url('', array('query' => $val['brand_name']), 'search');
// 处理品牌产品
$product = array();
foreach ($val['new_product'] as $one) {
$product = array();
$product['imgUrl'] = Images::getImageUrl($one['default_images'], 235, 314);
$product['price'] = !empty($one['market_price']) ? '¥'.$one['market_price'] . '.00' : 0;
$product['discount'] = !empty($one['sales_price']) ? '¥'.$one['sales_price'] . '.00' : 0;
$brand['productList'][] = $product;
}
$datas[] = $brand;
}
foreach ($favBrand['data']['brand_list'] as $val) {
$brand = array();
$brand['id'] = $val['brand_id'];
$brand['brandImg'] = !empty($val['brand_ico']) ? Images::getImageUrl($val['brand_ico'], 47, 47) : '';
$brand['brandName'] = $val['brand_name'];
$brand['update'] = $val['new_product_num'];
$brand['discount'] = $val['product_discount_num'];
$brand['link'] = Helpers::url('', array('query' => $val['brand_name']), 'search');
// 处理品牌产品
$product = array();
foreach ($val['new_product'] as $one) {
$product = array();
$product['imgUrl'] = Images::getImageUrl($one['default_images'], 235, 314);
$product['price'] = !empty($one['market_price']) ? '¥' . $one['market_price'] . '.00' : 0;
$product['discount'] = !empty($one['sales_price']) ? '¥' . $one['sales_price'] . '.00' : 0;
$brand['productList'][] = $product;
}
$datas[] = $brand;
}
!empty($datas) && $result['hasFavBrand'] = $datas;
} else if ($page > 1 && isset($favBrand['code']) && $favBrand['code'] === 500) {
$result['end'] = true;
}
return $result;
}
public static function favoriteDelete($uid, $fav_id)
{
$result = array();
if (empty($fav_id)) {
$result['code'] = 400;
$result['message'] = '取消的商品不可用';
} else {
$result = UserData::favoriteDelete($uid, $fav_id);
}
return $result;
}
/**
* 处理浏览记录数据
*
* @param int $uid 用户ID
* @param int $udid 客户端唯一标识
* @param int $page 第几页,默认为1
* @param int $limit 限制多少条,默认100
* @return array 处理之后的数据
*/
public static function browserRecord($uid, $udid, $page, $limit)
{
$result = array();
$records = UserData::browseRecord($uid, $udid, $page, $limit);
if (!$records) {
$result['walkwayUrl'] = '/product/new';
$result['noRecord'] = true;
return $result;
}
// 处理数据
if (isset($records['data']['product_list'])) {
// 不能再查到结果了
if ($page == 1 && $records['data']['total'] === 0) {
$result['walkwayUrl'] = '/product/new';
$result['noRecord'] = true;
} else {
$data = $records['data']['product_list'];
foreach ($data as &$val) {
$val['image'] = Helpers::getImageUrl($val['image'], 140, 140);
$val['sales_price'] = !empty($val['sales_price']) ? $val['sales_price'] . '.00' : 0;
$val['market_price'] = !empty($val['market_price']) ? $val['market_price'] . '.00' : 0;
}
!empty($data) && $result['browseRecord'] = $data;
}
}
return $result;
}
/**
* 删除浏览记录数据
*
* @param int $uid 用户ID
* @param int $skn 商品SKN
* @return array 处理之后的数据
*/
public static function delRecord($uid, $skn)
{
$result = array('code' => 400, 'message' => '出错啦~');
$record = UserData::delRecord($uid, $skn);
// 处理数据
if ($record && isset($record['code'])) {
$result['code'] = $record['code'];
$result['message'] = $record['message'];
}
return $result;
}
/**
* 处理YOHO币数据
*
* @param int $uid 用户ID
* @return array|mixed 处理之后的YOHO币数据
*/
public static function getYohoCoinData($uid)
{
$result = array();
// 调用接口获取YOHO币
$yohoCoin = UserData::yohoCoinData($uid);
// 处理YOHO币数据
if (isset($yohoCoin['data']) && !empty($yohoCoin['data'])) {
$result['yohoCoin']['coinNum'] = $yohoCoin['data']['total'];
}
return $result;
}
/**
* 处理优惠券数据
*
* @param int $uid 用户ID
* @param int $status 优惠券状态,0表示未使用,1表示已使用
* @param int $page 第几页
* @return array|mixed 处理之后的优惠券数据
*/
public static function getCouponData($uid, $status, $page)
{
$result = array();
// 调用接口获取优惠券数据
$coupons = UserData::couponData($uid, $status, $page);
// 没有获取到优惠券时
if (!$coupons) {
$result['topURL'] = '/product/new';
$result['noRecord'] = true;
return $result;
}
// 处理优惠券数据
if (isset($coupons['data'])) {
// 不能再查到结果了
if ($page == 1 && $coupons['data']['total'] === 0) {
$result['walkwayUrl'] = '/product/new';
$result['noRecord'] = true;
} else {
$couponArr = array();
isset($coupons['data']['info']) && $couponArr = $coupons['data']['info'];
foreach ($couponArr as &$val) {
// 处理已使用的优惠券
if ($status == 1) {
$val['used'] = true;
}
}
!empty($couponArr) && $result['coupons'] = $couponArr;
}
}
return $result;
}
/**
* 处理地址数据
*
* @param int $uid 用户ID
* @return array|mixed 处理之后的地址数据
*/
public static function getAddressData($uid)
{
$result = array();
// 调用接口获取地址数据
$address = UserData::addressData($uid);
// 处理地址数据
if (isset($address['data']) && !empty($address['data'])) {
$result = $address['data'];
}
return $result;
}
/**
* 处理地址列表数据
*
* @param int $uid 用户ID
* @return array|mixed 处理之后的地址列表数据
*/
public static function getAddressListData($uid)
{
$result = array();
if (USE_CACHE) {
$key = CacheConfig::KEY_ACTION_ADDRESS_LIST_DATA;
// 先尝试获取一级缓存(master), 有数据则直接返回.
$result = Cache::get($key, 'master');
if (!empty($result)) {
return $result;
}
}
// 调用接口获取地址列表数据
$address = UserData::addressListData($uid);
// 处理地址数据
if (isset($address['data']) && !empty($address['data'])) {
$result = $address['data'];
}
if (USE_CACHE) {
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
if (empty($result)) {
$result = Cache::get($key, 'slave');
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else {
Cache::set($key, $result, 1800); // 缓存30分钟
}
}
return $result;
}
/**
* 根据用户id和地址id获取地址数据
*
* @param int $uid 用户ID
* @param int $id 地址ID
* @return array|mixed 地址数据
*/
public static function getAddressDataById($uid, $id)
{
$result = array();
// 调用接口获取地址数据
$address = self::getAddressData($uid);
// 处理地址数据
foreach ($address as $val) {
if ($val['address_id'] == $id) {
$result = $val;
break;
}
}
return $result;
}
/**
* 保存地址数据
*
* @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|mixed 处理之后的地址列表数据
*/
public static function saveAddressData($uid, $address, $area_code, $consignee, $email, $id, $mobile, $zip_code)
{
$result = array();
// 参数验证
if (empty($uid)) {
$result['code'] = 400;
$result['message'] = '用户不可用';
} else if (empty($address)) {
$result['code'] = 401;
$result['message'] = '请输入可用的地址信息';
} else if (empty($area_code)) {
$result['code'] = 402;
$result['message'] = '地区码不可用';
} else if (empty($consignee)) {
$result['code'] = 403;
$result['message'] = '请输入收件人姓名';
} else if (!empty($email) && !Helpers::verifyEmail($email)) {
$result['code'] = 404;
$result['message'] = '输入的邮箱地址格式不正确';
} else if (!empty($mobile) && !Helpers::verifyMobile($mobile)) {
$result['code'] = 404;
$result['message'] = '输入的手机号码格式不正确';
} else {
// 调用接口保存地址数据
$address = UserData::saveAddressData($uid, $address, $area_code, $consignee, $email, $id, $mobile, $zip_code);
// 处理返回结果
if (isset($address['code']) && $address['code'] == 200) {
$result['code'] = $address['code'];
$result['message'] = $address['message'];
}
}
return $result;
}
/**
* 设置默认地址
*
* @param int $uid 用户ID
* @param int $id 地址唯一标识符id
* @return array|mixed 处理之后的返回数据
*/
public static function setDefaultAddress($uid, $id)
{
$result = array('code' => 400, 'message' => '错误');
// 调用接口设置默认地址
$address = UserData::setDefaultAddress($uid, $id);
// 处理返回结果
if ($address && isset($address['code'])) {
$result = $address;
}
return $result;
}
/**
* 删除地址
*
* @param int $uid 用户ID
* @param int $id 地址唯一标识符id
* @return array|mixed 处理之后的返回数据
*/
public static function deleteAddress($uid, $id)
{
$result = array('code' => 400, 'message' => '错误');
// 调用接口删除地址
$address = UserData::deleteAddress($uid, $id);
// 处理返回结果
if ($address && isset($address['code'])) {
$result = $address;
}
return $result;
}
/**
* 处理意见反馈数据
*
* @param string $udid 客户端唯一标识
* @param int $page 第几页,默认1
* @param int $limit 限制读取的数目,默认10
* @return array|mixed 处理之后的意见反馈数据
*/
public static function getSuggestData($udid, $page, $limit)
{
$result = array();
// 调用接口获取地址数据
$suggest = UserData::suggestData($udid, $page, $limit);
// 处理意见反馈数据
if (isset($suggest['data']) && !empty($suggest['data'])) {
$one = array();
foreach ($suggest['data']['list'] as $val) {
$one = array();
$one['suggest_id'] = $val['id'];
$one['imgUrl'] = !empty($val['cover_image']) ? Images::getSourceUrl($val['cover_image'], 'suggest') : '';
$one['title'] = $val['filter_content'];
$one['content'] = $val['reply_content'];
$one['good'] = ($val['is_reliable'] == 1);
$one['bad'] = ($val['is_reliable'] == 2);
$one['none'] = ($val['is_reliable'] == 0);
$result[] = $one;
}
}
return $result;
}
/**
* 图片上传
*
* @return array|mixed 保存意见反馈数据之后的返回
*/
public static function saveSuggestImg($filename)
{
$result = array();
if (!isset($_FILES[$filename])) {
$result['code'] = 400;
$result['message'] = '文件上传错误';
} else {
$result = Images::saveImage($filename);
}
return $result;
}
/**
* 保存意见反馈数据
*
* @param int $uid 用户ID
* @param string $content 意见内容
* @param mixed $image 图片地址
* @param int $suggest_type 意见类型
* @return array|mixed 保存意见反馈数据之后的返回
*/
public static function saveSuggestData($uid, $content, $image, $suggest_type)
{
$result = array('code' => 400, 'message' => '保存出错');
// 调用接口保存意见反馈数据
$save = UserData::savesuggestData($uid, $content, $image, $suggest_type);
if (isset($save['code']) && $save['code'] == 200) {
$result['code'] = 200;
$result['message'] = '谢谢您的反馈';
}
return $result;
}
/**
* 处理意见靠谱,不靠谱接口返回结果
*
* @param int $uid 用户ID
* @param string $udid 客户端唯一标识
* @param int $suggest_id 意见id
* @param int $reliable 是否靠谱,1表示靠谱,2表示不靠谱
* @return array|mixed 处理之后的数据
*/
public static function upAndDown($uid, $udid, $suggest_id, $reliable)
{
$result = array('code' => 400, 'message' => '出错啦');
if (empty($suggest_id)) {
$result['code'] = 401;
$result['message'] = '指定意见不存在';
} else {
// 调用接口
$save = UserData::upAndDown($uid, $udid, $suggest_id, $reliable);
if (isset($save['code']) && $save['code'] == 200) {
$result['code'] = 200;
$result['message'] = '操作成功';
}
}
return $result;
}
/**
* 处理我的消息数据
*
* @param int $uid 用户ID
* @param int $page 获取第一页,默认是0
* @param int $size 获取数目,默认是10
* @return array|mixed 处理之后的返回
*/
public static function getMessageData($uid, $page, $size)
{
$result = array();
$messageData = UserData::messageData($uid, $page, $size);
// 处理我的消息数据
if (isset($messageData['data']) && !empty($messageData['data'])) {
$result = $messageData['data'];
}
return $result;
}
/**
* 处理在线客服数据
*
* @return array|mixed 处理之后的返回
*/
public static function getOnlineServiceData()
{
$result = array();
$serviceData = UserData::onlineServiceData();
// 处理在线客服数据
if (isset($serviceData['data']) && !empty($serviceData['data'])) {
$result = $serviceData['data'];
}
return $result;
}
} else if ($page > 1 && isset($favBrand['code']) && $favBrand['code'] === 500) {
$result['end'] = true;
}
return $result;
}
public static function favoriteDelete($uid, $fav_id)
{
$result = array();
if (empty($fav_id)) {
$result['code'] = 400;
$result['message'] = '取消的商品不可用';
} else {
$result = UserData::favoriteDelete($uid, $fav_id);
}
return $result;
}
/**
* 处理浏览记录数据
*
* @param int $uid 用户ID
* @param int $udid 客户端唯一标识
* @param int $page 第几页,默认为1
* @param int $limit 限制多少条,默认100
* @return array 处理之后的数据
*/
public static function browserRecord($uid, $udid, $page, $limit)
{
$result = array();
$records = UserData::browseRecord($uid, $udid, $page, $limit);
if (!$records) {
$result['walkwayUrl'] = '/product/new';
$result['noRecord'] = true;
return $result;
}
// 处理数据
if (isset($records['data']['product_list'])) {
// 不能再查到结果了
if ($page == 1 && $records['data']['total'] === 0) {
$result['walkwayUrl'] = '/product/new';
$result['noRecord'] = true;
} else {
$data = $records['data']['product_list'];
foreach ($data as &$val) {
$val['image'] = Helpers::getImageUrl($val['image'], 140, 140);
$val['sales_price'] = !empty($val['sales_price']) ? $val['sales_price'] . '.00' : 0;
$val['market_price'] = !empty($val['market_price']) ? $val['market_price'] . '.00' : 0;
}
!empty($data) && $result['browseRecord'] = $data;
}
}
return $result;
}
/**
* 删除浏览记录数据
*
* @param int $uid 用户ID
* @param int $skn 商品SKN
* @return array 处理之后的数据
*/
public static function delRecord($uid, $skn)
{
$result = array('code' => 400, 'message' => '出错啦~');
$record = UserData::delRecord($uid, $skn);
// 处理数据
if ($record && isset($record['code'])) {
$result['code'] = $record['code'];
$result['message'] = $record['message'];
}
return $result;
}
/**
* 处理YOHO币数据
*
* @param int $uid 用户ID
* @return array|mixed 处理之后的YOHO币数据
*/
public static function getYohoCoinData($uid)
{
$result = array();
// 调用接口获取YOHO币
$yohoCoin = UserData::yohoCoinData($uid);
// 处理YOHO币数据
if (isset($yohoCoin['data']) && !empty($yohoCoin['data'])) {
$result['yohoCoin']['coinNum'] = $yohoCoin['data']['total'];
}
return $result;
}
/**
* 处理优惠券数据
*
* @param int $uid 用户ID
* @param int $status 优惠券状态,0表示未使用,1表示已使用
* @param int $page 第几页
* @return array|mixed 处理之后的优惠券数据
*/
public static function getCouponData($uid, $status, $page)
{
$result = array();
// 调用接口获取优惠券数据
$coupons = UserData::couponData($uid, $status, $page);
// 没有获取到优惠券时
if (!$coupons) {
$result['topURL'] = '/product/new';
$result['noRecord'] = true;
return $result;
}
// 处理优惠券数据
if (isset($coupons['data'])) {
// 不能再查到结果了
if ($page == 1 && $coupons['data']['total'] === 0) {
$result['walkwayUrl'] = '/product/new';
$result['noRecord'] = true;
} else {
$couponArr = array();
isset($coupons['data']['info']) && $couponArr = $coupons['data']['info'];
foreach ($couponArr as &$val) {
// 处理已使用的优惠券
if ($status == 1) {
$val['used'] = true;
}
}
!empty($couponArr) && $result['coupons'] = $couponArr;
}
}
return $result;
}
/**
* 处理地址数据
*
* @param int $uid 用户ID
* @return array|mixed 处理之后的地址数据
*/
public static function getAddressData($uid)
{
$result = array();
// 调用接口获取地址数据
$address = UserData::addressData($uid);
// 处理地址数据
if (isset($address['data']) && !empty($address['data'])) {
$result = $address['data'];
}
return $result;
}
/**
* 处理地址列表数据
*
* @param int $uid 用户ID
* @return array|mixed 处理之后的地址列表数据
*/
public static function getAddressListData($uid)
{
$result = array();
if (USE_CACHE) {
$key = CacheConfig::KEY_ACTION_ADDRESS_LIST_DATA;
// 先尝试获取一级缓存(master), 有数据则直接返回.
$result = Cache::get($key, 'master');
if (!empty($result)) {
return $result;
}
}
// 调用接口获取地址列表数据
$address = UserData::addressListData($uid);
// 处理地址数据
if (isset($address['data']) && !empty($address['data'])) {
$result = $address['data'];
}
if (USE_CACHE) {
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
if (empty($result)) {
$result = Cache::get($key, 'slave');
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else {
Cache::set($key, $result, 1800); // 缓存30分钟
}
}
return $result;
}
/**
* 根据用户id和地址id获取地址数据
*
* @param int $uid 用户ID
* @param int $id 地址ID
* @return array|mixed 地址数据
*/
public static function getAddressDataById($uid, $id)
{
$result = array();
// 调用接口获取地址数据
$address = self::getAddressData($uid);
// 处理地址数据
foreach ($address as $val) {
if ($val['address_id'] == $id) {
$result = $val;
break;
}
}
return $result;
}
/**
* 保存地址数据
*
* @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|mixed 处理之后的地址列表数据
*/
public static function saveAddressData($uid, $address, $area_code, $consignee, $email, $id, $mobile, $zip_code)
{
$result = array();
// 参数验证
if (empty($uid)) {
$result['code'] = 400;
$result['message'] = '用户不可用';
} else if (empty($address)) {
$result['code'] = 401;
$result['message'] = '请输入可用的地址信息';
} else if (empty($area_code)) {
$result['code'] = 402;
$result['message'] = '地区码不可用';
} else if (empty($consignee)) {
$result['code'] = 403;
$result['message'] = '请输入收件人姓名';
} else if (!empty($email) && !Helpers::verifyEmail($email)) {
$result['code'] = 404;
$result['message'] = '输入的邮箱地址格式不正确';
} else if (!empty($mobile) && !Helpers::verifyMobile($mobile)) {
$result['code'] = 404;
$result['message'] = '输入的手机号码格式不正确';
} else {
// 调用接口保存地址数据
$address = UserData::saveAddressData($uid, $address, $area_code, $consignee, $email, $id, $mobile, $zip_code);
// 处理返回结果
if (isset($address['code']) && $address['code'] == 200) {
$result['code'] = $address['code'];
$result['message'] = $address['message'];
}
}
return $result;
}
/**
* 设置默认地址
*
* @param int $uid 用户ID
* @param int $id 地址唯一标识符id
* @return array|mixed 处理之后的返回数据
*/
public static function setDefaultAddress($uid, $id)
{
$result = array('code' => 400, 'message' => '错误');
// 调用接口设置默认地址
$address = UserData::setDefaultAddress($uid, $id);
// 处理返回结果
if ($address && isset($address['code'])) {
$result = $address;
}
return $result;
}
/**
* 删除地址
*
* @param int $uid 用户ID
* @param int $id 地址唯一标识符id
* @return array|mixed 处理之后的返回数据
*/
public static function deleteAddress($uid, $id)
{
$result = array('code' => 400, 'message' => '错误');
// 调用接口删除地址
$address = UserData::deleteAddress($uid, $id);
// 处理返回结果
if ($address && isset($address['code'])) {
$result = $address;
}
return $result;
}
/**
* 处理意见反馈数据
*
* @param string $udid 客户端唯一标识
* @param int $page 第几页,默认1
* @param int $limit 限制读取的数目,默认10
* @return array|mixed 处理之后的意见反馈数据
*/
public static function getSuggestData($udid, $page, $limit)
{
$result = array();
// 调用接口获取地址数据
$suggest = UserData::suggestData($udid, $page, $limit);
// 处理意见反馈数据
if (isset($suggest['data']) && !empty($suggest['data'])) {
$one = array();
foreach ($suggest['data']['list'] as $val) {
$one = array();
$one['suggest_id'] = $val['id'];
$one['imgUrl'] = !empty($val['cover_image']) ? Images::getSourceUrl($val['cover_image'], 'suggest') : '';
$one['title'] = $val['filter_content'];
$one['content'] = $val['reply_content'];
$one['good'] = ($val['is_reliable'] == 1);
$one['bad'] = ($val['is_reliable'] == 2);
$one['none'] = ($val['is_reliable'] == 0);
$result[] = $one;
}
}
return $result;
}
/**
* 图片上传
*
* @return array|mixed 保存意见反馈数据之后的返回
*/
public static function saveSuggestImg($filename)
{
$result = array();
if (!isset($_FILES[$filename])) {
$result['code'] = 400;
$result['message'] = '文件上传错误';
} else {
$result = Images::saveImage($filename);
}
return $result;
}
/**
* 保存意见反馈数据
*
* @param int $uid 用户ID
* @param string $content 意见内容
* @param mixed $image 图片地址
* @param int $suggest_type 意见类型
* @return array|mixed 保存意见反馈数据之后的返回
*/
public static function saveSuggestData($uid, $content, $image, $suggest_type)
{
$result = array('code' => 400, 'message' => '保存出错');
// 调用接口保存意见反馈数据
$save = UserData::savesuggestData($uid, $content, $image, $suggest_type);
if (isset($save['code']) && $save['code'] == 200) {
$result['code'] = 200;
$result['message'] = '谢谢您的反馈';
}
return $result;
}
/**
* 处理意见靠谱,不靠谱接口返回结果
*
* @param int $uid 用户ID
* @param string $udid 客户端唯一标识
* @param int $suggest_id 意见id
* @param int $reliable 是否靠谱,1表示靠谱,2表示不靠谱
* @return array|mixed 处理之后的数据
*/
public static function upAndDown($uid, $udid, $suggest_id, $reliable)
{
$result = array('code' => 400, 'message' => '出错啦');
if (empty($suggest_id)) {
$result['code'] = 401;
$result['message'] = '指定意见不存在';
} else {
// 调用接口
$save = UserData::upAndDown($uid, $udid, $suggest_id, $reliable);
if (isset($save['code']) && $save['code'] == 200) {
$result['code'] = 200;
$result['message'] = '操作成功';
}
}
return $result;
}
/**
* 处理我的消息数据
*
* @param int $uid 用户ID
* @param int $page 获取第一页,默认是0
* @param int $size 获取数目,默认是10
* @return array|mixed 处理之后的返回
*/
public static function getMessageData($uid, $page, $size)
{
$result = array();
$messageData = UserData::messageData($uid, $page, $size);
// 处理我的消息数据
if (isset($messageData['data']) && !empty($messageData['data'])) {
$result = $messageData['data'];
}
return $result;
}
/**
* 处理在线客服数据
*
* @return array|mixed 处理之后的返回
*/
public static function getOnlineServiceData()
{
$result = array();
$serviceData = UserData::onlineServiceData();
// 处理在线客服数据
if (isset($serviceData['data']) && !empty($serviceData['data'])) {
$result = $serviceData['data'];
}
return $result;
}
}
... ...
... ... @@ -234,6 +234,15 @@ class DetailModel
// 商品信息
if (isset($sizeInfo['productDescBo']['erpProductId'])) {
$sex = '通用';
switch ($sizeInfo['productDescBo']['gender']) {
case 1:
$sex = '男款';
break;
case 2:
$sex = '女款';
break;
}
$result['goodsDescription'] = array(
'title' => '商品信息',
'enTitle' => 'PRODUCT INFO',
... ... @@ -241,6 +250,7 @@ class DetailModel
'list' => array(
array('param' => '编号:' . $sizeInfo['productDescBo']['erpProductId']),
array('param' => '颜色:' . $sizeInfo['productDescBo']['colorName']),
array('param' => '性别:' . $sex),
)
),
);
... ... @@ -281,7 +291,7 @@ class DetailModel
}
// 测量方式
if (isset($sizeInfo['sizeImage'])) {
if (!empty($sizeInfo['sizeImage'])) {
$result['measurementMethod'] = array(
'title' => '测量方式',
'enTitle' => 'MEASUREMENT METHOD',
... ... @@ -296,6 +306,11 @@ class DetailModel
'enTitle' => 'REFERENCE',
'detail' => array('list' => array()),
);
// 控制是否显示备注
$showRemark = false;
$remarkList = array(0 => array('param' => '备注'));
$result['reference']['detail']['list'][0]['params'] = array(0 => array('param' => '')); // 头像列表
$result['reference']['detail']['list'][1]['params'] = array(0 => array('param' => '模特')); // 模特名字列表
$result['reference']['detail']['list'][2]['params'] = array(0 => array('param' => '身高')); // 身高列表
... ... @@ -303,6 +318,7 @@ class DetailModel
$result['reference']['detail']['list'][4]['params'] = array(0 => array('param' => '三围')); // 三围列表
$result['reference']['detail']['list'][5]['params'] = array(0 => array('param' => '吊牌尺码')); // 吊牌尺码
$result['reference']['detail']['list'][6]['params'] = array(0 => array('param' => '试穿描述')); // 试穿描述
foreach ($sizeInfo['modelBos'] as $value) {
$result['reference']['detail']['list'][0]['params'][] = array('param' => $value['avatar']);
$result['reference']['detail']['list'][1]['params'][] = array('param' => $value['modelName']);
... ... @@ -311,6 +327,17 @@ class DetailModel
$result['reference']['detail']['list'][4]['params'][] = array('param' => $value['vitalStatistics']);
$result['reference']['detail']['list'][5]['params'][] = array('param' => $value['fitModelBo']['fit_size']);
$result['reference']['detail']['list'][6]['params'][] = array('param' => $value['fitModelBo']['feel']);
if (!empty($value['fitModelBo']['fit_remark'])) {
$showRemark = true;
$remarkList[] = array('param' => $value['fitModelBo']['fit_remark']);
} else {
$remarkList[] = array('param' => '');
}
}
// 显示模特备注
if ($showRemark) {
$result['reference']['detail']['list'][7]['params'] = $remarkList;
}
}
... ...
... ... @@ -2,6 +2,7 @@
use Action\AbstractAction;
use Plugin\Helpers;
use LibModels\Wap\Product\DetailData;
/**
* 商品详情的控制器
... ... @@ -126,15 +127,47 @@ class DetailController extends AbstractAction
}
/**
* 我要咨询
* 我要咨询表单
*/
public function consultformAction()
{
$uid = $this->getUid();
if (!$uid) {
$this->go(Helpers::url('/signin.html', array('refer' => $this->server('HTTP_REFERER', '/'))));
}
$this->setTitle('我要咨询');
$this->setNavHeader('我要咨询');
$productId = $this->get('product_id', 0);
// 渲染模板
$this->_view->display('consultform', array('consultform' => true));
$this->_view->display('consultform', array(
'consultform' => true,
'productId' => $productId,
'formUrl' => Helpers::url('/product/detail/consultsubmit'),
));
}
/**
* 添加咨询操作
*
* @param int product_id 商品ID
* @param string content 咨询内容
* @return json
*/
public function consultsubmitAction()
{
$result = array('code' => 400, 'message' => '请输入咨询内容', 'data' => '');
if ($this->isAjax()) {
$uid = $this->getUid();
$productId = $this->post('product_id', 0);
$content = $this->post('content');
$result = DetailData::addConsult($uid, $productId, $content);
}
$this->echoJson($result);
}
/**
... ...
... ... @@ -23,66 +23,66 @@ class IndexController extends AbstractAction
*/
public function indexAction()
{
// 过滤请求参数
$condition = filter_input_array(INPUT_GET, array(
'brand' => FILTER_DEFAULT,
'sort' => FILTER_DEFAULT,
'msort' => FILTER_DEFAULT,
'misort' => FILTER_DEFAULT,
'color' => FILTER_DEFAULT,
'size' => FILTER_DEFAULT,
'style' => FILTER_DEFAULT,
'price' => FILTER_DEFAULT,
'discount' => FILTER_DEFAULT,
'gender' => FILTER_DEFAULT,
'p_d' => FILTER_DEFAULT,), false);
// 转义品牌
if (isset($condition['brand'])) {
$condition['brand'] = rawurldecode($condition['brand']);
}
// 转义分类
if (isset($condition['sort'])) {
$condition['sort'] = rawurldecode($condition['sort']);
}
// 转义一级分类
if (isset($condition['msort'])) {
$condition['msort'] = rawurldecode($condition['msort']);
}
// 转义二级分类
if (isset($condition['misort'])) {
$condition['misort'] = rawurldecode($condition['misort']);
}
// 转义颜色
if (isset($condition['color'])) {
$condition['color'] = rawurldecode($condition['color']);
}
// 转义尺码
if (isset($condition['size'])) {
$condition['size'] = rawurldecode($condition['size']);
}
// 转义风格
if (isset($condition['style'])) {
$condition['style'] = rawurldecode($condition['style']);
}
// 转义价格
if (isset($condition['price'])) {
$condition['price'] = rawurldecode($condition['price']);
}
// 转换折扣
if (isset($condition['discount'])) {
$condition['p_d'] = rawurldecode($condition['discount']);
}
// 为了兼容现在运营在用的p_d
if (isset($condition['p_d'])) {
$condition['discount'] = rawurldecode($condition['p_d']);
}
// 性别参数,不传则从COOKIE获取
if (!isset($condition['gender'])) {
$condition['gender'] = Helpers::getGenderByCookie();
} else {
$condition['gender'] = rawurldecode($condition['gender']);
}
// // 过滤请求参数
// $condition = filter_input_array(INPUT_GET, array(
// 'brand' => FILTER_DEFAULT,
// 'sort' => FILTER_DEFAULT,
// 'msort' => FILTER_DEFAULT,
// 'misort' => FILTER_DEFAULT,
// 'color' => FILTER_DEFAULT,
// 'size' => FILTER_DEFAULT,
// 'style' => FILTER_DEFAULT,
// 'price' => FILTER_DEFAULT,
// 'discount' => FILTER_DEFAULT,
// 'gender' => FILTER_DEFAULT,
// 'p_d' => FILTER_DEFAULT,), false);
//
// // 转义品牌
// if (isset($condition['brand'])) {
// $condition['brand'] = rawurldecode($condition['brand']);
// }
// // 转义分类
// if (isset($condition['sort'])) {
// $condition['sort'] = rawurldecode($condition['sort']);
// }
// // 转义一级分类
// if (isset($condition['msort'])) {
// $condition['msort'] = rawurldecode($condition['msort']);
// }
// // 转义二级分类
// if (isset($condition['misort'])) {
// $condition['misort'] = rawurldecode($condition['misort']);
// }
// // 转义颜色
// if (isset($condition['color'])) {
// $condition['color'] = rawurldecode($condition['color']);
// }
// // 转义尺码
// if (isset($condition['size'])) {
// $condition['size'] = rawurldecode($condition['size']);
// }
// // 转义风格
// if (isset($condition['style'])) {
// $condition['style'] = rawurldecode($condition['style']);
// }
// // 转义价格
// if (isset($condition['price'])) {
// $condition['price'] = rawurldecode($condition['price']);
// }
// // 转换折扣
// if (isset($condition['discount'])) {
// $condition['p_d'] = rawurldecode($condition['discount']);
// }
// // 为了兼容现在运营在用的p_d
// if (isset($condition['p_d'])) {
// $condition['discount'] = rawurldecode($condition['p_d']);
// }
// // 性别参数,不传则从COOKIE获取
// if (!isset($condition['gender'])) {
// $condition['gender'] = Helpers::getGenderByCookie();
// } else {
// $condition['gender'] = rawurldecode($condition['gender']);
// }
// 品类名称参数, 不传则默认为全部
$name = $this->get('sort_name');
... ... @@ -92,16 +92,13 @@ class IndexController extends AbstractAction
$this->setTitle($name);
$this->setNavHeader($name, true, SITE_MAIN);
if (!$condition) {
$condition = array();
}
$goodList = $condition;
// if (!$condition) {
// $condition = array();
// }
// $goodList = $condition;
$goodList = array();
$goodList['cartUrl'] = Helpers::url('/cart/index/index', null);
// $goodList = Product\ListModel::getClassData($condition);
// if (!empty($condition) && !empty($goodList)) {
// $goodList = array_merge($goodList, $condition);
// }
$this->_view->display('index', array(
'goodListPage' => true,
'showDownloadApp' => true,
... ... @@ -150,64 +147,64 @@ class IndexController extends AbstractAction
$from = $this->get('from');
$query = $this->get('query');
/* 过滤请求参数 */
$condition = filter_input_array(INPUT_GET, array(
'sort' => FILTER_DEFAULT,
'msort' => FILTER_DEFAULT,
'misort' => FILTER_DEFAULT,
'color' => FILTER_DEFAULT,
'size' => FILTER_DEFAULT,
'style' => FILTER_DEFAULT,
'price' => FILTER_DEFAULT,
'discount' => FILTER_DEFAULT,
'gender' => FILTER_DEFAULT,
'p_d' => FILTER_DEFAULT,), false);
$condition['brand'] = $brandId;
// 转义分类
if (isset($condition['sort'])) {
$condition['sort'] = rawurldecode($condition['sort']);
}
// 转义一级分类
if (isset($condition['msort'])) {
$condition['msort'] = rawurldecode($condition['msort']);
}
// 转义二级分类
if (isset($condition['misort'])) {
$condition['misort'] = rawurldecode($condition['misort']);
}
// 转义颜色
if (isset($condition['color'])) {
$condition['color'] = rawurldecode($condition['color']);
}
// 转义尺码
if (isset($condition['size'])) {
$condition['size'] = rawurldecode($condition['size']);
}
// 转义风格
if (isset($condition['style'])) {
$condition['style'] = rawurldecode($condition['style']);
}
// 转义价格
if (isset($condition['price'])) {
$condition['price'] = rawurldecode($condition['price']);
}
// 转换折扣
if (isset($condition['discount'])) {
$condition['p_d'] = rawurldecode($condition['discount']);
}
// 为了兼容现在运营在用的p_d
if (isset($condition['p_d'])) {
$condition['discount'] = rawurldecode($condition['p_d']);
}
if ($brandId === 0) {
$condition['query'] = $domain;
}
if (isset($condition['gender'])) {
$condition['gender'] = rawurldecode($condition['gender']);
} else {
$condition['gender'] = Helpers::getGenderByCookie();
}
// /* 过滤请求参数 */
// $condition = filter_input_array(INPUT_GET, array(
// 'sort' => FILTER_DEFAULT,
// 'msort' => FILTER_DEFAULT,
// 'misort' => FILTER_DEFAULT,
// 'color' => FILTER_DEFAULT,
// 'size' => FILTER_DEFAULT,
// 'style' => FILTER_DEFAULT,
// 'price' => FILTER_DEFAULT,
// 'discount' => FILTER_DEFAULT,
// 'gender' => FILTER_DEFAULT,
// 'p_d' => FILTER_DEFAULT,), false);
// $condition['brand'] = $brandId;
// // 转义分类
// if (isset($condition['sort'])) {
// $condition['sort'] = rawurldecode($condition['sort']);
// }
// // 转义一级分类
// if (isset($condition['msort'])) {
// $condition['msort'] = rawurldecode($condition['msort']);
// }
// // 转义二级分类
// if (isset($condition['misort'])) {
// $condition['misort'] = rawurldecode($condition['misort']);
// }
// // 转义颜色
// if (isset($condition['color'])) {
// $condition['color'] = rawurldecode($condition['color']);
// }
// // 转义尺码
// if (isset($condition['size'])) {
// $condition['size'] = rawurldecode($condition['size']);
// }
// // 转义风格
// if (isset($condition['style'])) {
// $condition['style'] = rawurldecode($condition['style']);
// }
// // 转义价格
// if (isset($condition['price'])) {
// $condition['price'] = rawurldecode($condition['price']);
// }
// // 转换折扣
// if (isset($condition['discount'])) {
// $condition['p_d'] = rawurldecode($condition['discount']);
// }
// // 为了兼容现在运营在用的p_d
// if (isset($condition['p_d'])) {
// $condition['discount'] = rawurldecode($condition['p_d']);
// }
// if ($brandId === 0) {
// $condition['query'] = $domain;
// }
//
// if (isset($condition['gender'])) {
// $condition['gender'] = rawurldecode($condition['gender']);
// } else {
// $condition['gender'] = Helpers::getGenderByCookie();
// }
$data = array();
$data['goodListPage'] = true;
... ... @@ -228,7 +225,7 @@ class IndexController extends AbstractAction
// 右下角的购物车链接
$data['goodList']['cartUrl'] = Helpers::url('/cart/index/index', null);
$data['goodList'] += $condition;
//$data['goodList'] += $condition;
$data['pageFooter'] = true;
if ($title === '') {
... ...