Authored by 杨延青

Merge branch 'feature/mBrandShop' into develop

Conflicts:
	library/Api/Yohobuy.php
	template/m.yohobuy.com/partials/layout/use.phtml
Showing 48 changed files with 3599 additions and 226 deletions
... ... @@ -602,4 +602,14 @@ class AbstractAction extends Controller_Abstract
}
}
/**
* 判断是不是APP
*
* @return bool
*/
public function isApp(){
$appVersion = $this->get('app_version');
return !empty($appVersion);
}
}
... ...
... ... @@ -29,7 +29,9 @@ class Yohobuy
// const API_OLD = 'http://api2.open.yohobuy.com/';
// 测试环境 */
const API_URL = 'http://testapi.yoho.cn:28078/'; // 'http://192.168.102.205:8080/gateway/'
// const API_URL = 'http://testapi.yoho.cn:28078/'; // 'http://192.168.102.205:8080/gateway/'
const API_URL = 'http://devapi.yoho.cn:58078/'; // 'http://192.168.102.205:8080/gateway/'
// const API_URL = 'http://192.168.102.218:8080/gateway/';
const SERVICE_URL = 'http://testservice.yoho.cn:28077/';
const YOHOBUY_URL = 'http://www.yohobuy.com/';
... ... @@ -485,6 +487,7 @@ class Yohobuy
return $result;
}
/**
* 获取用户User-Agent
* @return bool
... ...
... ... @@ -221,6 +221,7 @@ class BrandData
* 通过域名获取品牌LOGO信息
*
* @param int $id 用户ID
* @modify sefon 2016-4-29 01:59:23
* @return array
*/
public static function getBrandLogoByDomain($domain)
... ... @@ -228,4 +229,19 @@ class BrandData
return Yohobuy::yarClient(Yohobuy::SERVICE_URL . '/shops/service/v1/brand', 'getBrandByDomain', array($domain));
}
/**
* 根据品牌域名获取品牌店铺信息
* @param string $domain
* @author sefon 2016-4-28 23:35:28
* @return mixed
*/
public static function getShopInfoByBrandDomain($domain)
{
$param = Yohobuy::param();
$param['method'] = 'web.brand.byDomain';
$param['domain'] = $domain;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
}
... ...
... ... @@ -56,4 +56,95 @@ class ListData
return Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URI_PRODUCT, 'getLessInfoByProductSkcs', array(array('productSkcs' => $skcs)));
}
/**
* 获取店铺装修的所有资源接口
* @param int $shopId 店铺id
* @param int $cache 接口缓存
* @author sefon 2016-4-26 21:17:15
* @return array
*/
public static function getShopDecorator($shopId, $cache = 600)
{
$param = Yohobuy::param();
$param['method'] = 'app.shopsdecorator.getList';
$param['shop_id'] = $shopId;
$param['client_secret'] = Sign::getSign($param);
//TODO
// return Yohobuy::get(Yohobuy::API_URL, $param);
return Yohobuy::get('http://192.168.102.218:8080/gateway/', $param, 0);
}
/**
* 获取店铺信息
* @param int $shopId 店铺id
* @param int $uid 用户id 判断用户是否收藏店铺
* @param int $cache 接口缓存
* @author sefon 2016-4-26 21:32:57
* @return array
*/
public static function getShopInfo($shopId, $uid = 0, $cache = 600)
{
$param = Yohobuy::param();
$param['method'] = 'app.shops.getIntro';
$param['shop_id'] = $shopId;
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
//TODO
// return Yohobuy::get(Yohobuy::API_URL, $param);
return Yohobuy::get('http://192.168.102.218:8080/gateway/', $param, $cache);
}
/**
* 获取店铺下面的所有品牌
* @param int $shopId 店铺id
* @param int $cache 接口缓存
* @author sefon 2016-4-26 21:48:30
* @return array
*/
public static function getShopBrands($shopId, $cache = 600)
{
$param = Yohobuy::param();
$param['method'] = 'app.shops.getShopsBrands';
$param['shop_id'] = $shopId;
$param['client_secret'] = Sign::getSign($param);
//TODO
// return Yohobuy::get(Yohobuy::API_URL, $param);
return Yohobuy::get('http://devapi.yoho.cn:58078/', $param, $cache);
}
/**
* 获取店铺下面的所有分类
* @param int $shopId 店铺id
* @param int $cache 接口缓存
* @author sefon 2016-4-27 21:39:51
* @return array
*/
public static function getShopCategory($shopId, $cache = 600)
{
$param = Yohobuy::param();
$param['method'] = 'app.shop.getSortInfo';
$param['shop_id'] = $shopId;
$param['client_secret'] = Sign::getSign($param);
//TODO
// return Yohobuy::get(Yohobuy::API_URL, $param);
return Yohobuy::get('http://192.168.102.218:8080/gateway/', $param, $cache);
}
/**
* 根据brandid获取相关店铺
* @param int $brandId
* @author sefon 2016-4-28 13:41:09
* @return array
*/
public static function getShopByBrandId($brandId, $cache = 600)
{
$param = Yohobuy::param();
$param['method'] = 'app.shop.queryShopByBrandId';
$param['brand_id'] = $brandId;
$param['client_secret'] = Sign::getSign($param);
//TODO
// return Yohobuy::get(Yohobuy::API_URL, $param);
return Yohobuy::get('http://192.168.102.218:8080/gateway/', $param, $cache);
}
}
... ...
<?php
/**
* Created by PhpStorm.
* User: Targaryen
* Date: 2016/4/21
* Time: 15:55
*/
namespace LibModels\Wap\Product;
use Api\Yohobuy;
use Api\Sign;
class ShopData
{
/**
* 调取店铺简介数据
*
* @param int $shop_id
* @return mixed
* @internal param int $shops_id
* @internal param int|店铺ID $shopId 店铺ID
*/
public static function getShopIntro($shop_id = 0)
{
$param = Yohobuy::param();
$param['method'] = 'app.shops.getIntro';
$param['shop_id'] = $shop_id;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 获取店铺下的所有品类
*
* @param $shop_id
* @param $yhChannel 频道
* @param $gender 性别
* @return mixed
* @internal param $shops_id
* @internal param int $shopId 店铺ID
*/
public static function getShopCategory($shop_id, $yhChannel, $gender)
{
$param = Yohobuy::param();
$param['method'] = 'app.shop.getSortInfo';
$param['shop_id'] = $shop_id;
$param['yh_channel'] = $yhChannel;
$param['gender'] = $gender;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 获取店铺下的所有品牌
*
* @param int $shop_id
* @return mixed
* @internal param int $shops_id
* @internal param int $shopId 店铺ID
*/
public static function getShopBrands($shop_id = 0)
{
$param = Yohobuy::param();
$param['method'] = 'app.shops.getShopsBrands';
$param['shop_id'] = $shop_id;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 获取店铺下所有商品
*
* @param null $shop
* @return mixed
*/
public static function getAllProducts($shop = null)
{
$param = Yohobuy::param();
$param['method'] = 'app.search.li';
$param['shop'] = $shop;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
*
* 辅助方法 Debug 数据输出
*
* @param $data
* @param bool $is_exit 输出后是否中断执行
*/
public static function debugOut($data, $is_exit = true)
{
header("Content-type:text/html;charset=utf-8");
echo '<pre>';
print_r($data);
echo '</pre>';
if ($is_exit) {
exit;
}
}
/**
* 收藏店铺
* @param int $uid
* @param int $shopId
* @param string $gender
* @author sefon 2016-4-28 22:09:30
* @return mixed
*/
public static function shopFav($uid, $shopId, $gender = '')
{
$param = Yohobuy::param();
$param['method'] = 'app.favorite.add';
$param['uid'] = $uid;
$param['id'] = $shopId;
$param['fav_id'] = $shopId;
$param['type'] = 'shop';
if (!empty($gender)) {
$param['gender'] = $gender;
}
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 取消收藏店铺
* @param int $uid
* @param int $shopId
* @param string $gender
* @author sefon 2016-4-28 22:09:30
* @return mixed
*/
public static function cancelShopFav($uid, $shopId, $gender = '')
{
$param = Yohobuy::param();
$param['method'] = 'app.favorite.cancel';
$param['uid'] = $uid;
$param['id'] = $shopId;
$param['fav_id'] = $shopId;
$param['type'] = 'shop';
if ($gender) {
$param['gender'] = $gender;
}
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
}
\ No newline at end of file
... ...
... ... @@ -82,43 +82,43 @@ class SearchData
case 'developer':
default:
if ($type == 'sort') {
return 'http://101.200.31.165/yohosearch/sortgroup.json';
return 'http://192.168.102.216:8087/yohosearch/sortgroup.json';
// return 'http://101.200.31.165/yohosearch/sortgroup.json';
// return 'http://182.92.99.119:8080/yohosearch/sortgroup.json';
}
elseif ($type == 'discount') {
return 'http://101.200.31.165/yohosearch/discount.json';
return 'http://192.168.102.216:8087/yohosearch/discount.json';
// return 'http://101.200.31.165/yohosearch/discount.json';
// return 'http://182.92.99.119:8080/yohosearch/discount.json';
}
elseif ($type == 'recent') {
return 'http://101.200.31.165/yohosearch/recent.json';
return 'http://192.168.102.216:8087/yohosearch/recent.json';
// return 'http://101.200.31.165/yohosearch/recent.json';
// return 'http://182.92.99.119:8080/yohosearch/recent.json';
}
elseif ($type == 'suggest') {
return 'http://101.200.31.165/yohosearch/suggest.json';
return 'http://192.168.102.216:8087/yohosearch/suggest.json';
// return 'http://101.200.31.165/yohosearch/suggest.json';
// return 'http://182.92.99.119:8080/yohosearch/suggest.json';
}
else if($type == 'new-shelve') {
return 'http://101.200.31.165/yohosearch/new-shelve.json';//'http://182.92.99.119:8080/yohosearch/new-shelve.json';
return 'http://192.168.102.216:8087/yohosearch/new-shelve.json';//'http://182.92.99.119:8080/yohosearch/new-shelve.json';
// return 'http://182.92.99.119:8080/yohosearch/new-shelve.json';//'http://182.92.99.119:8080/yohosearch/new-shelve.json';
}
elseif ($type == 'shop') {
return 'http://101.200.31.165/yohosearch/shops.json';
return 'http://192.168.102.216:8087/yohosearch/shops.json';
// return 'http://101.200.31.165/yohosearch/shops.json';
// return 'http://182.92.99.119:8080/yohosearch/shops.json';
}
elseif ($type == 'search') {
return 'http://182.92.99.119:8080/yohosearch/search-once.json';
return 'http://192.168.102.216:8087/yohosearch/search-once.json';
}
elseif ($type == 'brand') {
return 'http://101.200.31.165/yohosearch/brand/list.json';
return 'http://192.168.102.216:8087/yohosearch/brand/list.json';
// return 'http://101.200.31.165/yohosearch/brand/list.json';
// return 'http://182.92.99.119:8080/yohosearch/brand/list.json';
}
return 'http://101.200.31.165/yohosearch/search.json';
return 'http://192.168.102.216:8087/yohosearch/search.json';//支持shop_id
//return 'http://101.200.31.165/yohosearch/search.json';
// return 'http://182.92.99.119:8080/yohosearch/search.json';
}
... ...
<?php
namespace Plugin\DataProcess;
use Plugin\Helpers;
use Plugin\Images;
/**
* 店铺楼层数据处理类
*/
class ShopProcess
{
private static $shopData = array();
private static $shopId = 0;
private static $appVersion = 0;
/**
* 组织店铺页面数据
* @param array $data 接口返回的店铺页所需数据
* @param int $shopId 店铺id
* @param int $appVersion app版本
* @author sefon 2016-4-26 21:56:32
* @return array
*/
public static function formShopData($data, $shopId, $appVersion)
{
self::$shopId = $shopId;
self::$appVersion = $appVersion;
foreach ($data as $key => $val) {
if (empty($val) || !is_callable("self::$key")) {
continue;
}
self::$key($val);
}
return self::$shopData;
}
/**
* 店铺基本信息
* @param $data
* @author sefon 2016-4-29 01:48:50
*/
private static function shopInfo($data)
{
self::$shopData['logoImg'] = Images::getImageUrl($data['data']['shop_logo'], 500, 500, 'shopLogo');
self::$shopData['storeName'] = $data['data']['shop_name'];
//用户是否收藏店铺
self::$shopData['collect'] = $data['data']['is_favorite'] == 'Y' ? true : false;
//店铺id
self::$shopData['shopId'] = self::$shopId;
//店铺简介页地址
self::$shopData['shopIntroHref'] = Helpers::url('/product/index/intro', array('shop_id' => self::$shopId));
//全部商品链接
$appSuffix = '{"action":"go.list","params":{"title":"全部商品", "shop_id":"'.self::$shopId.'","page":"1"}}';
self::$shopData['allGoods'] = Helpers::url('', array('shop_id' => self::$shopId, 'title' => '全部商品', 'yohobuy' => $appSuffix), 'search');
//搜索链接
self::$shopData['url'] = Helpers::url('', array('shop_id' => self::$shopId), 'search');
//人气单品的链接
self::$shopData['more_url'] = Helpers::url('', array('shop_id' => self::$shopId, 'order' => 's_n_d', 'title' => '人气'), 'search');
}
/**
* 组织店铺装修
* @param array $data
* @author sefon 2016-4-26 22:04:04
*/
private static function decorator($data)
{
if (!isset($data['code']) || $data['code'] != 200 || !isset($data['data']['list']) || empty($data['data']['list'])) {
return;
}
foreach ($data['data']['list'] as $val) {
if (empty($val['resource_data']) || !is_callable("self::$val[resource_name]")) {
continue;
}
self::$val['resource_name'](json_decode($val['resource_data'], true));
}
}
/**
* 店铺Banner
* @param array $data
* @author sefon 2016-4-27 08:40:05
*/
private static function shopTopBanner_APP($data)
{
self::$shopData['branerImg'] = $data[0]['shopSrc'];
}
/**
* 资源位小图 接口返回两组,取每组第一张
* @param array $data
* @author sefon 2016-4-27 08:37:30
*/
private static function oneRowTwoColImages_APP($data)
{
foreach ($data as $key => $val) {
if (empty($val['data'])) {
continue;
}
self::$shopData['spring'][$key] = array(
'url' => $val['data'][0]['url'],
'springType' => $val['data'][0]['src']
);
}
}
/**
* 店铺品牌一览
* @param array $data
* @author sefon 2016-4-26 22:04:04
* @return array
*/
private static function brandBrowse($data)
{
$brandNumber = count($data);
//少于2个不展示
if ($brandNumber < 2) {
return;
}
foreach ($data as $val) {
self::$shopData['brandList']['list'][] = array(
'url' => Helpers::url('', '', $val['brandDomain']),
'img' => Images::getImageUrl($val['brandIco'], 640, 400),
'brandName' => $val['brandName']
);
}
//大于5个返回更多品牌链接
if ($brandNumber > 5) {
self::$shopData['brandList']['url'] = Helpers::url('/product/index/allBrand', array('shop_id' => self::$shopId));
}
}
/**
* 资源位大图幻灯
* @param $data
* @author sefon 2016-4-27 16:50:01
*/
private static function largeSlideImg($data)
{
if (empty($data[0]['data'])) {
return;
}
foreach ($data[0]['data'] as $slide) {
self::$shopData['bannerTop']['list'][] = array('url' => $slide['url'], 'img' => $slide['src']);
}
}
/**
* 热门分类
* @param array $data
* @author sefon 2016-4-27 08:38:36
* @return array
*/
private static function recommend($data)
{
self::$shopData['hotCategory']['name'] = '热门品类';
foreach ($data as $cate) {
self::$shopData['hotCategory']['list'][] = array('url' => $cate['url'], 'img' => $cate['src']);
}
return $data;
}
/**
* 人气单品
* @param array $data
* @author sefon 2016-4-27 08:38:36
*/
private static function hotProducts($data)
{
foreach ($data as $val) {
self::$shopData['hotList'][] = array(
'url' => Helpers::getUrlBySkc($val['product_id'], $val['goods_id'], $val['cn_alphabet']),
'img' => Helpers::getImageUrl($val['src'], 235, 314),
'productName' => $val['productName'],
'salesPrice' => '¥'.$val['salesPrice'],
'presentPrice' => '¥'.$val['salesPrice']
);
}
}
/**
* 店铺下面的所有分类
* @author sefon 2016-4-27 21:40:28
*/
private static function shopCategory($data)
{
if (isset($data['code']) && $data['code'] == 200 && !empty($data['data'])) {
$total = count($data['data']);
if ($total > 6) {
self::$shopData['shopCategory']['url'] = Helpers::url('/product/index/category', array('shop_id' => self::$shopId));
return;
}
foreach ($data['data'] as $key => $val) {
self::$shopData['shopCategory']['list'][] = array(
'url' => Helpers::url('', array('shop_id' => self::$shopId), 'search'),
'categoryId' => $val['category_id'],
'name' => $val['category_name']
);
}
}
}
}
\ No newline at end of file
... ...
<?php
/**
* Created by PhpStorm.
* User: haishengshen
* Date: 14-3-6
* Time: 下午1:15
*/
namespace Plugin;
class Mobile
{
/**
* 获取用户User-Agent
* @return bool
*/
public static function getUserAgent()
{
if (!isset($_SERVER['HTTP_USER_AGENT']) || empty($_SERVER['HTTP_USER_AGENT'])) {
return '';
}
return $_SERVER['HTTP_USER_AGENT'];
}
/**
* 获取当前地址
* @return array
*/
public static function getNowUrl()
{
return array('host'=>$_SERVER['HTTP_HOST'], 'uri'=> $_SERVER['REQUEST_URI']);
}
/**
* 获取手机版的对应地址
* @param $host
* @return mixed
*/
public static function newHost($host)
{
if ($host == 'www.yohobuy.com' || $host == 'new.yohobuy.com' || stristr($host, 'new.yohobuy.com')) {
return str_replace(array('www.yohobuy', 'new.yohobuy'), 'm.yohobuy', $host);
}
if ($host == 'huodong.yohobuy.com') {
return str_replace('huodong.yohobuy', 'm.yohobuy', $host);
}
return str_replace('yohobuy.com', 'm.yohobuy.com', $host);
}
public static function match($url, $host, $uri)
{
// //guang.yohobuy.com
// //guang.yohobuy.com/1.html
// $list = array(
// array(
// 'match' => '#^([guang\.]*)yohobuy\.com(\/*)$#',
// ),
// array(
// 'match' => '#([guang\.]*)yohobuy.com/([0-9]+).html#',
// 'to' => 'guang.m.yohobuy.com/info/index?id='.substr($uri,1,(strpos($uri,'.')-1)) ,
// ),
// );
// foreach ($list as $value) {
// if (preg_match($value['match'], $url) && !empty($value['to'])) {
// return $value['to'];
// } else if (preg_match($value['match'], $url)) {
// $newHost = self::newHost($host);
// return $newHost . $uri;
// }
// }
//
// $continueList = array('www', 'list', 'search');
// $hostSplit = explode('.', $host);
// PC 跳 WAP 女生频道对应
if ($uri === '/woman') {
$uri = '/girls';
}
// 首页特殊跳转
if ($host === 'www.yohobuy.com') {
return 'm.yohobuy.com' . $uri;
}
$url = strtr($host, array('.yohobuy.com' => '.m.yohobuy.com')) . $uri;
return $url;
}
/**
* 获取新的URL
* @return string
*/
public static function getNewUrl()
{
$url = self::getNowUrl();
return self::match($url['host'].$url['uri'], $url['host'], $url['uri']);
}
/**
* 判断是否手机
* @return bool
*/
public static function isMobile()
{
$userAgent = self::getUserAgent();
if (stristr($userAgent, 'ipad')) {
return false;
}
$mobileAgents = array('iphone','android',"240x320","acer","acoon","acs-","abacho","ahong","airness","alcatel","amoi","anywhereyougo.com","applewebkit/525","applewebkit/532","asus","audio","au-mic","avantogo","becker","benq","bilbo","bird","blackberry","blazer","bleu","cdm-","compal","coolpad","danger","dbtel","dopod","elaine","eric","etouch","fly ","fly_","fly-","go.web","goodaccess","gradiente","grundig","haier","hedy","hitachi","htc","huawei","hutchison","inno","ipad","ipaq","ipod","jbrowser","kddi","kgt","kwc","lenovo","lg ","lg2","lg3","lg4","lg5","lg7","lg8","lg9","lg-","lge-","lge9","longcos","maemo","mercator","meridian","micromax","midp","mini","mitsu","mmm","mmp","mobi","mot-","moto","nec-","netfront","newgen","nexian","nf-browser","nintendo","nitro","nokia","nook","novarra","obigo","palm","panasonic","pantech","philips","phone","pg-","playstation","pocket","pt-","qc-","qtek","rover","sagem","sama","samu","sanyo","samsung","sch-","scooter","sec-","sendo","sgh-","sharp","siemens","sie-","softbank","sony","spice","sprint","spv","symbian","tablet","talkabout","tcl-","teleca","telit","tianyu","tim-","toshiba","tsm","up.browser","utec","utstar","verykool","virgin","vk-","voda","voxtel","vx","wap","wellco","wig browser","wii","windows ce","wireless","xda","xde","zte");
$isMobile = false;
foreach ($mobileAgents as $device) {
if (stristr($userAgent, $device)) {
$isMobile = true;
break;
}
}
return $isMobile;
}
/**
* 是否转到手机版
* @return bool
*/
public static function isGoMobile()
{
if (empty($_COOKIE['m2w']) && self::isMobile()) {
header("HTTP/1.1 301 Moved Permanently");
header('Location:http://'.self::getNewUrl());
exit();
}
return true;
}
}
\ No newline at end of file
... ...
No preview for this file type
... ... @@ -2,7 +2,7 @@
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>
Created by FontForge 20120731 at Fri Apr 15 10:26:51 2016
Created by FontForge 20120731 at Wed Apr 27 17:15:53 2016
By admin
</metadata>
<defs>
... ... @@ -19,7 +19,7 @@ Created by FontForge 20120731 at Fri Apr 15 10:26:51 2016
bbox="-0.75 -224 3943 896"
underline-thickness="50"
underline-position="-100"
unicode-range="U+0078-E648"
unicode-range="U+0078-E649"
/>
<missing-glyph horiz-adv-x="374"
d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" />
... ... @@ -263,5 +263,8 @@ t94.5 -142t142 -94.5t172.5 -35t172.5 35t142 94.5t94.5 142t35 172.5t-35 172.5t-94
<glyph glyph-name="uniE648" unicode="&#xe648;"
d="M512 798q-101 0 -193.5 -39.5t-159 -106t-106 -159t-39.5 -193.5t39.5 -193.5t106 -159t159 -106t193.5 -39.5t193.5 39.5t159 106t106 159t39.5 193.5t-39.5 193.5t-106 159t-159 106t-193.5 39.5zM512 -166q-95 0 -181 37t-148.5 99.5t-99.5 148.5t-37 181t37 181
t99.5 148.5t148.5 99.5t181 37t181 -37t148.5 -99.5t99.5 -148.5t37 -181t-37 -181t-99.5 -148.5t-148.5 -99.5t-181 -37zM420 133l-156 155l-22 -22l178 -179l361 361l-23 23z" />
<glyph glyph-name="uniE649" unicode="&#xe649;"
d="M875 126l-363 -164l-363 164v610q247 75 363 75t363 -75v-610zM930 808q-34 11 -84.5 26t-159.5 38.5t-174 23.5t-174 -23.5t-159.5 -38.5t-84.5 -26q-14 -4 -22 -15.5t-8 -25.5v-669q0 -27 25 -39l405 -183q9 -3 18 -3t18 3l405 183q25 12 25 39v669q0 14 -8 25.5
t-22 15.5zM751 552v83h-473v-83h206v-298h-72v237h-87v-237h-66v-84h506v84h-193v119h151v83h-151v96h179z" />
</font>
</defs></svg>
... ...
No preview for this file type
No preview for this file type
... ... @@ -14,7 +14,6 @@ var $nav = $('.category-nav'),
var $curContent = $contents.not('.hide');
//初始化container高度
(function() {
var $header = $('.yoho-header'),
$search = $('#search-input');
... ...
... ... @@ -10,4 +10,5 @@ require('./list');
require('./detail/detail');
require('./detail/consultform');
require('./newsale/hot-rank');
require('./product-category');
require('./shop');
\ No newline at end of file
... ...
/**
* 分类
* @author: berry<lixia.zhang@yoho.cn>
* @date: 2016/4/25
*/
var $ = require('jquery');
var $allProductCell = $('.allproduct'),
$categoryContainer = $('.category-container'),
$contents = $categoryContainer.children('.content'),
$subLevelItem = $categoryContainer.find('.sub-level li'),
$trilangle = $categoryContainer.find('.primary-level-trilangle');
//初始化container高度
(function() {
var $header = $('.yoho-header');
var h = $(window).height() - $header.outerHeight() - $allProductCell.outerHeight();
var trilangleRightMargin = $(window).width() * 0.55;
$categoryContainer.css('min-height', h);
$trilangle.css('margin-right', trilangleRightMargin);
$contents.height(h);
}());
$categoryContainer.on('touchend', function(e) {
var $this = $(e.target),
$subLevel,
$cur, index,
$subLevelContainer, $trilangleItem;
$cur = $this.closest('.p-level-item');
$subLevelContainer = $this.closest('.content').find('.sub-level-container');
$subLevelContainer.removeClass('hide');
if ($cur.length > 0) {
index = $cur.index();
$subLevel = $this.closest('.content').find('.sub-level');
$trilangleItem = $this.closest('.content').find('.primary-level-trilangle');
if ($this.hasClass('focus')) {
return;
}
$subLevel.not('.hide').addClass('hide');
$subLevel.eq(index).removeClass('hide');
$trilangleItem.not('.hide').addClass('hide');
$trilangleItem.eq(index).removeClass('hide');
}
});
$categoryContainer.find('.sub-level').on('touchstart', 'li', function() {
$subLevelItem.removeClass('highlight');
$(this).addClass('highlight');
}).on('touchend touchcancel', 'li', function() {
$(this).removeClass('highlight');
});
$allProductCell.on('touchstart', function() {
$(this).addClass('highlight');
}).on('touchend touchcancel', function() {
$(this).removeClass('highlight');
});
\ No newline at end of file
... ...
/**
* 品牌店铺首页
*/
var $ = require('jquery'),
IScroll = require('iscroll/iscroll-probe'),
lazyLoad = require('yoho.lazyload'),
Swiper = require('yoho.iswiper'),
activeTab,
myScroll,
imgH,
nav1H,
main1H,
main1oH,
nav2H,
main2oH,
scH,
$nav1 = $('#pos-nav'),
$nav2 = $('#pos-list'),
sTop,
isIphone = navigator.userAgent.indexOf('iPhone') > 0 ? true : false;//判断浏览器类型
var tip = require('../plugin/tip'),
filter = require('../plugin/filter'),
loading = require('../plugin/loading');
var $subNav = $('.home-sub-nav'),
$goodsContainer = $('#goods-container'),
$goodsChildren = $goodsContainer.children(),
$ngc = $($goodsChildren.get(0)),
$pgc = $($goodsChildren.get(1)),
$dgc = $($goodsChildren.get(2)),
$shopId = $('input[name="shop_id"]').val(),
$appVersion = $('input[name="app_version"]').val();
var winH = $(window).height(),
noResult = '<p class="no-result">未找到相关搜索结果</p>';
//默认筛选条件
var defaultOpt = require('./query-param');
var $listNav = $('#list-nav'),
$posList = $('#pos-list'),
//导航数据信息
navInfo = {
new: {
order: 1,
reload: true,
page: 0,
end: false
},
hot: {
order: 1,
reload: true,
page: 0,
end: false
},
newest: {
order: 1,
reload: true,
page: 0,
end: false
},
price: {
order: 1,
reload: true,
page: 0,
end: false
},
discount: {
order: 1,
reload: true,
page: 0,
end: false
}
},
$pre = $listNav.find('.active'), //纪录进入筛选前的active项,初始为选中项
$lie = $posList.find('.active'),
searching;
var viewType = 1; // 1-首页,2-上新,3-人气
//焦点效果
if ($('.banner-swiper').find('li').size() > 1) {
bannerSwiper = new Swiper('.banner-swiper', {
lazyLoading: true,
lazyLoadingInPrevNext: true,
loop: true,
autoplay: 3000,
autoplayDisableOnInteraction: false,
paginationClickable: true,
slideElement: 'li',
pagination: '.banner-top .pagination-inner'
});
}
if ($('.multi-browse').find('li').size() > 1) {
multiSwiper = new Swiper('.multi-browse', {
lazyLoading: true,
lazyLoadingInPrevNext: true,
lazyLoadingOnTransitionStart: true,
grabCursor: true,
slidesPerView: 'auto',
slideElement: 'li',
watchSlidesVisibility: true
});
}
function tabChange(dom, index) {
var li = dom.eq(index);
dom.removeClass('active');
li.addClass('active');
dom.removeClass('color');
li.addClass('color');
}
//首页导航
$.jqtab = function(nav, posNav, main) {
$(nav + ' li, ' + posNav + ' li').on('touchstart', function() {
var index = $(this).index(),
activeTab = $(this).attr('tab');
$nav1.removeClass('fixed-top');
tabChange($(nav + ' li'), index);
tabChange($(posNav + ' li'), index);
$(main).hide();
$('#' + activeTab).fadeIn();
if(activeTab == 'new-arrival'){
newData();
}else if(activeTab == 'popularity'){
hotData();
} else if (activeTab == 'home-page') {
myScroll && myScroll.refresh();
// setTimeout(function() {
// scH = $('#scroller').outerHeight();
// },1000);
scH = $('#scroller').outerHeight();
$nav1.removeClass('fixed-top');
$nav1.removeClass('absolute');
$nav2.removeClass('fixed-top');
$nav2.removeClass('absolute');
}
myScroll.scrollTo(0,0);
$nav1.addClass('hide');
return false;
});
};
$.jqtab('#nav','#pos-nav','.main');
$('#wrapper').addClass('scroll-wrapper');
lazyLoad($('img.lazy'));
myScroll = new IScroll('#wrapper', {
probeType: 3,
mouseWheel: true,
click: true
});
function getPageGoods(info) {
if (searching) {
return;
}
searching = true;
$.ajax({
type: 'GET',
url: info.url,
data: info.data,
success: function(data) {
info.callBack(data);
$nav1.addClass('hide');
myScroll.scrollTo(0,0);
myScroll.refresh();
scH = $('#scroller').outerHeight();
lazyLoad($('img.lazy'));
searching = false;
},
error: function() {
alert('网络断开连接了~');
searching = false;
}
});
}
function newData() {
var req = {};
req.url = '/index/search/search';
req.data = {
type: 'newest',
order: '1',
page: '1',
shop_id: $shopId
};
req.callBack = function(data) {
$('#new-arrival').append(data);
navInfo.new.page++;
}
getPageGoods(req);
}
function hotData() {
var req = {};
req.url = '/index/search/search';
req.data = {
type: 'sales',
order: '1',
page: '1',
shop_id: $shopId
};
req.callBack = function(data) {
$('#popularity').append(data);
navInfo.hot.page++;
}
getPageGoods(req);
}
myScroll.on('scroll', function() {
sTop = -this.y;
if (sTop + winH * 2 > scH) {
switch(viewType) {
case 2:
newData();
break;
case 3:
hotData();
break;
}
}
if (sTop < imgH) {
if (!$nav1.hasClass('hide')) {
$nav1.addClass('hide');
}
if (!$nav2.hasClass('hide')) {
$nav2.addClass('hide');
} //滑动距离不到导航1
} else if (sTop < imgH + nav1H + main1oH) {
if ($nav1.hasClass('hide')) {
$nav1.removeClass('hide');
}
if (!$nav2.hasClass('hide')) {
$nav2.addClass('hide');
}//滑动距离不到导航2
if (sTop < imgH + main1H) {
if (!$nav1.hasClass('fixed-top')) {
$nav1.addClass('fixed-top')
.removeClass('absolute')
.css({
transform: 'translate(0, ' + (- scH) + 'px)'
});
}
} else if (sTop < imgH + nav1H + main1H) {
if ($('#home-page').is(':hidden')) {
return false;
}
if (!$nav1.hasClass('absolute')) {
$nav1.addClass('absolute')
.removeClass('fixed-top');
}
$nav1.css({
transform: 'translate(0, ' + (imgH + main1H - sTop - scH) + 'px)'
});
}
} else {
if ($('#home-page').is(':hidden')) {
return false;
}
if (!$nav1.hasClass('hide')) {
$nav1.addClass('hide');
}
if ($nav2.hasClass('hide')) {
$nav2.removeClass('hide');
}
if (sTop < scH) {
// console.log(sTop);
// console.log(scH);
if (!$nav2.hasClass('fixed-top')) {
$nav2.addClass('fixed-top')
.removeClass('absolute')
.css({
transform: 'translate(0, ' + (- scH) + 'px)'
});
}
}
}
$("#scroller").trigger('scroll');
});
document.addEventListener('touchmove', function(e) {
e.preventDefault();
}, false);
if (!isIphone) {
return;
}
//window onload 后重新refresh iscroll
$(window).load(function() {
myScroll && myScroll.refresh();
imgH = $('#nav-top').outerHeight();
nav1H = $('#nav').outerHeight();
main1H = $('#nav-main').height();
main1oH = $('#nav-main').outerHeight();
nav2H = $('#list-nav').outerHeight();
main2oH = $('#goods-container').outerHeight();
setTimeout(function(){
scH = $('#scroller').outerHeight();
},1000);
});
function search(opt) {
var setting = {},
ext,
att,
nav, navType,
page;
if (searching) {
return;
}
if (opt) {
//筛选项变更则重置reload为true
for (att in navInfo) {
if (navInfo.hasOwnProperty(att)) {
navInfo[att].reload = true;
}
}
switch (opt.type) {
case 'shop_id':
ext = {
shop_id: opt.id
};
break;
case 'gender':
ext = {
gender: opt.id
};
break;
case 'brand':
ext = {
brand: opt.id
};
break;
case 'sort':
ext = {
sort: opt.id
};
break;
case 'color':
ext = {
color: opt.id
};
break;
case 'size':
ext = {
size: opt.id
};
break;
case 'price':
ext = {
price: opt.id
};
break;
case 'discount':
ext = {
discount: opt.id
};
break;
}
$.extend(defaultOpt, ext); //扩展筛选项
}
//导航类别
if ($pre.hasClass('new')) {
navType = 'newest';
} else if ($pre.hasClass('price')) {
navType = 'price';
} else if ($pre.hasClass('discount')) {
navType = 'discount';
}
nav = navInfo[navType];
page = nav.page + 1;
console.log(page)
if (nav.reload) {
page = 1;
} else if (nav.end) {
//不需要重新加载并且数据请求结束
return;
}
$.extend(setting, defaultOpt, {
type: navType,
order: nav.order,
page: page
});
console.log(page)
searching = true;
loading.showLoadingMask();
$.ajax({
type: 'GET',
url: opt.url ? opt.url : '',
data: setting,
success: function(data) {
var $container,
num;
switch (navType) {
case 'newest':
$container = $ngc;
break;
case 'price':
$container = $pgc;
break;
case 'discount':
$container = $dgc;
break;
}
if (data === ' ') {
nav.end = true;
if (nav.reload) {
$container.html(noResult);
}
} else {
if (nav.reload) {
$container.html(data);
lazyLoad($container.find('.lazy'));
} else {
num = $container.find('.good-info').length;
$container.append(data);
//lazy good-infos who append in
lazyLoad($container.find('.good-info:gt(' + (num - 1) + ') .lazy'));
}
}
nav.reload = false;
nav.page = page;
searching = false;
loading.hideLoadingMask();
window.rePosFooter();
setTimeout(function () {
myScroll.refresh();
scH = $('#scroller').outerHeight();
}, 1000);
},
error: function() {
tip.show('网络断开连接了~');
searching = false;
loading.hideLoadingMask();
}
});
}
$.ajax({
type: 'GET',
url: '/product/newsale/filter',
data: defaultOpt,
success: function(data) {
$goodsContainer.append(data);
setTimeout(function () {
myScroll.refresh();
scH = $('#scroller').outerHeight();
}, 1000);
//初始化filter&注册filter回调
filter.initFilter({
fCbFn: search,
hCbFn: function() {
//切换active状态到$pre上
$pre.addClass('active');
$pre.siblings('.filter').removeClass('active');
},
missStatus: true
});
}
});
$listNav.bind('contextmenu', function(e) {
return false;
});
$posList.bind('contextmenu', function(e) {
return false;
});
$subNav.on('touchend touchcancel', function(e) {
var $this = $(e.target).closest('li'),
cname,
nav,
navType,
$active;
e.preventDefault();
if (typeof $this === 'undefined' || $this.length === 0) {
return;
}
if ($this.hasClass('filter')) {
//筛选面板切换状态
if ($this.hasClass('active')) {
filter.hideFilter();
//点击筛选钱的active项回复active
$pre.addClass('active');
$this.removeClass('active');
} else {
$pre = $this.siblings('.active');
$pre.removeClass('active');
$this.addClass('active');
filter.showFilter();
}
} else {
if ($this.hasClass('new')) {
cname = '.new';
navType = 'newest';
} else if ($this.hasClass('price')) {
cname = '.price';
navType = 'price';
} else if ($this.hasClass('discount')) {
cname = '.discount';
navType = 'discount';
}
nav = navInfo[navType];
if ($this.hasClass('active')) {
//最新无排序切换
if ($this.hasClass('new')) {
return;
}
if ($this.hasClass('price') || $this.hasClass('discount')) {
$this = $subNav.find(cname);
// 价格/折扣切换排序状态
$this.find('.icon > .iconfont').toggleClass('cur');
$pre = $this; //更新pre为当前项
nav.reload = true; //重置reload,HTML会被替换为逆序的HTML
nav.order = nav.order === 0 ? 1 : 0; //切换排序
}
} else {
$active = $subNav.find('.active');
$pre = $this; //$pre为除筛选导航的其他导航项,若当前active的为筛选,则把$pre置为当前点击项
if ($active.hasClass('filter')) {
//若之前active项为筛选,则隐藏筛选面板
filter.hideFilter();
} else {
//切换container显示
$goodsContainer.children('.container:not(.hide)').addClass('hide');
switch (navType) {
case 'newest':
$ngc.removeClass('hide');
break;
case 'price':
$pgc.removeClass('hide');
break;
case 'discount':
$dgc.removeClass('hide');
break;
}
}
$subNav.children().removeClass('active');
$subNav.find(cname).addClass('active');
}
if (nav.reload) {
search({
type: 'shop_id',
id: $shopId,
url: '/index/search/search'
});
}
}
e.stopPropagation();
});
function scrollHandler() {
//当scroll到1/4$goodsContainer高度后继续请求下一页数据
myScroll && myScroll.refresh();
if (sTop + winH > $('#scroller').height() - 0.25 * $goodsContainer.height() - 50){
if ($pre !== undefined) {
search({
type: 'shop_id',
id: $shopId,
url: '/index/search/search'
});
}
}
}
//srcoll to load more
$(window).scroll(function() {
window.requestAnimationFrame(scrollHandler);
});
//初始请求最新第一页数据
search({
type: 'shop_id',
id: $shopId,
url: '/index/search/search'
}
);
$listNav.on('touchstart', 'li', function(e) {
$(this).addClass('bytouch');
}).on('touchend touchcancel', function() {
$listNav.find('li').removeClass('bytouch');
myScroll.refresh();
if (sTop > imgH + nav1H + main1oH) {
myScroll.scrollTo(0,-(imgH + nav1H + main1oH + 10));
}
});
$posList.on('touchstart', 'li', function(e) {
$(this).addClass('bytouch');
}).on('touchend touchcancel', function() {
$posList.find('li').removeClass('bytouch');
myScroll.refresh();
if (sTop > imgH + nav1H + main1oH) {
myScroll.scrollTo(0,-(imgH + nav1H + main1oH + 10));
}
});
//底部导航点击
function fotterClick(group) {
$(group + ' li').on('touchstart', function() {
$('.sub-group').addClass('hide');
if ($(this).find('.sub-group').length > 0){
$(this).find('.sub-group').removeClass('hide');
}
});
};
fotterClick('.shop-foot-wrapper');
function stopPropagation(e) {
if (e.stopPropagation){
e.stopPropagation();
}else {
e.cancelBubble = true; }
}
$(document).bind('touchstart', function(){
$('.sub-group').addClass('hide');
});
$('.shop-foot-wrapper').bind('touchstart',function(e){
stopPropagation(e);
});
//收藏
$('#collect').bind('touchstart', function() {
if ($('#collect').hasClass('alreadyCollect')) {
cancelShop();
}else{
collectShop();
}
});
function postCollect(info) {
var url = '';
if (searching) {
return;
}
searching = true;
$.ajax({
method: 'post',
url: info.url,
data: info.data,
success: function(data) {
if (data.code === 200){
if ($('#collect').hasClass('alreadyCollect')) {
console.log(1)
$('#collect').attr('class', 'notCollect');
}else{
console.log(0)
$('#collect').attr('class', 'alreadyCollect');
}
}
if (data.code === 401) {
url = data.url;
$('body').append('<a href=\'' + url + '\'><span class="jump-login"><span></a>');
$('.jump-login').click();
}
setTimeout(function () {
myScroll.refresh();
scH = $('#scroller').outerHeight();
}, 1000);
searching = false;
},
error: function() {
alert('网络断开连接了~');
searching = false;
}
});
}
function collectShop() {
var qew = {};
qew.url = '/product/index/shopFav';
qew.data = {
shop_id: $shopId,
app_version: $appVersion
};
postCollect(qew);
}
function cancelShop() {
var qew = {};
qew.url = '/product/index/cancelShopFav';
qew.data = {
shop_id: $shopId,
app_version: $appVersion
};
postCollect(qew);
}
... ...
... ... @@ -160,3 +160,4 @@ a {
@import "index/index";
@import "cart/index";
@import "me/index"; //个人中心
@import "shop/index";
... ...
@import "new-arrival", "discount", "list", "detail", "suspend-cart", "hot-rank", "_recommend-for-you.scss", "limit";
@import "new-arrival", "discount", "list", "detail", "suspend-cart", "hot-rank", "_recommend-for-you.scss", "limit", "_shop-index", "product-category", "shop-prodfile";
... ...
... ... @@ -7,3 +7,7 @@
@import "recommend-for-you";
@import "limit";
@import "limit-help";
@import "shop-index";
@import "shop-prodfile";
@import "product-category";
... ...
.limit-good-page {
background-color: #f4f4f4;
color: #444;
.top {
font-size: 0.6rem;
height: 2rem;
line-height: 2.2rem;
margin-bottom: 0.1rem;
background-color: #fff;
padding: 0.2rem 0 0.2rem 0.5rem;
div {
width: 20%;
display: inline-block;
float: left;
img {
width: 1.5rem;
border: 1px solid #ccc;
border-radius: 100%;
position: relative;
top: 0.25rem;
}
}
p {
display: inline-block;
float: left;
width: 80%;
}
}
.detail {
background-color: #fff;
padding: 0.6rem 0.8rem;
border-bottom: 1px solid #e6e6e6;
margin-bottom: 1rem;
.name {
font-size: 0.9rem;
margin-bottom: 0.5rem;
}
.sale-info {
height: 1rem;
line-height: 1rem;
}
.price {
font-size: 0.8rem;
color: #d0021b;
float: left;
}
.date {
font-size: 0.6rem;
float: right;
.text {
position: relative;
top: 0.08rem;
}
}
}
.goodDesc {
padding: 0.5rem;
border-top: 1px solid #e6e6e6;
background-color: #fff;
p {
font-size: 0.6rem;
line-height: 1rem;
text-indent: 2em;
}
img {
margin: 0.3rem 0;
max-width: 100%;
}
}
.bottom {
background-color: #fff;
border-top: 1px solid #e6e6e6;
padding: 0.5rem 2rem 2rem 2rem;
height: 3rem;
width: 12rem;
margin: 0 auto;
.logo {
width: 100;
height: 2.5rem;
background-image: image-url('logo-bottom.png');
background-size: 100%;
background-repeat: no-repeat;
background-position: center;
}
.btn {
font-size: 0.8rem;
background-color: #fff;
border: 1px solid #444;
border-radius: 0.2rem;
padding: 0.3rem 0.6rem;
}
.btn:active {
background-color: #ccc;
}
.left, .right {
display: inline-block;
float: left;
}
.left {
width: 39%;
}
.right {
width: 60%;
font-size: 0.65rem;
span {
display: block;
width: 95%;
margin: 0 auto;
}
}
}
}
.product-category {
font-size: 30px;
background-color: #fff;
.allproduct {
padding: 0px 30px;
display: block;
height: 89px;
line-height: 89px;
&.highlight {
background: #dbdbdb;
}
}
.margin-under-allproduct{
width: 100%;
height: 30px;
background-color: #f0f0f0;
}
.category-container{
border-top: 1px solid #e6e6e6;
}
.arrow-icon {
position: relative;
float: right;
font-size: 30px;
top: 0px;
color: #e1e1e1;
padding: 0px 10px;
}
.allproductParagaraph {
font-size: 18px;
left: 20px;
}
.content {
background: #fff;
&.hide {
display: none;
}
}
.primary-level {
float: left;
box-sizing: border-box;
width: 100%;
position: absolute;
> li {
position:relative;
height: 89px;
line-height: 89px;
box-sizing: border-box;
border-bottom: 1px solid #e6e6e6;
background-color: #fff;
margin-left: 30px;
}
}
.primary-level-trilangle{
float: right;
background: url(/product/arrow.png) no-repeat;
margin-top: 22px;
width: 20px;
height: 46px;
}
.trilanglefont {
font-family: "iconfont" !important;
font-size: 30px;
font-style: normal;
text-decoration: none;
-webkit-font-smoothing: antialiased;
-webkit-text-stroke-width: 0.2px;
-moz-osx-font-smoothing: grayscale;
color: #f4f4f4;
}
.sub-level-container {
float: right;
box-sizing: border-box;
background: #f4f4f4;
width: 55%;
height: 100%;
position: relative;
}
.sub-level {
width: 100%;
&.hide {
display: none;
}
> li {
box-sizing: border-box;
height: 89px;
line-height: 89px;
border-bottom: 1px solid #e6e6e6;
margin-left: 30px;
padding-left: 0;
&.highlight {
background: #dbdbdb;
margin-left: 0;
padding-left: 30px;
}
&:last-child {
border-bottom: none;
}
}
a {
display: block;
height: 100%;
width: 100%;
color: #afafaf;
}
}
}
... ...
.shop-index {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
overflow: hidden;
.branner-top {
width: 100%;
height: 200px;
position: relative;
overflow: hidden;
}
.logo {
position: absolute;
overflow: hidden;
left: 30px;
bottom: 30px;
width: 100px;
height: 100px;
}
.store-name {
color: #fff;
font-size: 28px;
position: absolute;
overflow: hidden;
left: 148px;
bottom: 20px;
}
.collect {
width: 128px;
height: 49px;
position: absolute;
bottom: 30px;
right: 30px;
border-radius: 10px;
text-align: center;
background-size: contain;
}
.alreadyCollect{
width: 128px;
height: 50px;
border-radius: 10px;
background-image: url('/product/already-collect.png') no-repeat;
background-size: contain;
}
.notCollect{
width: 128px;
height: 50px;
border-radius: 10px;
background-image: url('/product/not-collect.png') no-repeat;
background-size: contain;
}
.nav {
width: 100%;
height: 88px;
margin: 0;
padding: 0;
border: 0;
font: inherit;
vertical-align: baseline;
list-style: none;
font-size: 28px;
background: #fff;
overflow: hidden;
border-sizing: border-box;
border-bottom: 1px solid #e1e1e1;
li{
color: #b1b1b1;
display: block;
height: 28px;
float: left;
line-height: 28px;
width: 24%;
text-align: center;
border-left: 1px solid #e1e1e1;
margin-top: 30px;
border-sizing: border-box;
color: #b1b1b1;
&:first-child {
border-left: none;
}
a {
color: #b1b1b1;
}
}
.color {
color: #000;
}
}
.main {
background: #f0f0f0;
padding-bottom: 40px;
overflow: hidden;
}
.banner-area {
@extend .banner-top;
.banner-swiper ul {
height: 260px;
}
.swiper-pagination {
bottom: 60px;
}
}
.hide {
display: hidden;
}
.coupon {
width: 100%;
padding: 30px 0;
overflow: hidden;
img {
width: 245px;
height: 120px;
vertical-align: top;
margin-left: 30px;
float: left;
}
}
.multi-brands {
width: 100%;
height: 270px;
background: #fff;
border: 1px solid #e1e1e1;
border-top: none;
font-size: 20px;
text-align: center;
padding-top: 25px;
margin-bottom: 30px;
overflow: hidden;
p {
font-size: 30px;
}
}
.multi-browse {
margin-top: 50px;
}
.brand-img {
margin-left: 30px;
width: 30%;
height: 150px;
overflow: hidden;
padding-bottom: 20px;
float: left;
p {
font-size: 25px;
color: #b1b1b1;
padding-top: 10px;
}
img {
height: 70%;
}
}
.spring {
margin: 0;
overflow: hidden;
li {
width: 50%;
float: left;
text-align: center;
list-style: none;
display: list-item;
img {
width: 90%;
border-radius: 10px;
vertical-align: top;
}
}
}
.popularity-title {
background: #fff;
border-bottom: 1px solid #e8e8e8;
text-align: center;
line-height: 98px;
font-size: 32px;
margin-top: 40px;
position: relative;
}
.more {
position: absolute;
right: 30px;
top: 0;
bottom: 0;
color: #b0b0b0;
font-size: 50px;
font-family: "iconfont" !important;
font-style: normal;
text-decoration: none;
}
.product-list {
margin: 0;
padding: 0 0 30px 30px;
overflow: hidden;
background: #fff;
border-bottom: 30px solid #f0f0f0;
li {
width: 275px;
height: 368px;
margin-top: 50px;
margin-right: 30px;
float: left;
text-align: center;
list-style: none;
img {
width: 100%;
vertical-align: top;
}
}
}
.list-price {
height: 60px;
background: #ABACAC;
color: #FFFFFF;
font-size: 22px;
margin-top: -60px;
position: relative;
opacity: 0.7;
padding-left: 15px;
p {
margin: 0;
line-height: 32px;
text-align: left;
}
}
.red {
color: red;
}
.icon {
position: relative;
i {
position: absolute;
}
.up {
top: -5px;
left: 8px;
}
.down {
top: 8px;
left: 8px;
}
}
.iconfont {
color: #b1b1b1;
}
.goods-container {
position: relative;
min-height: 440px;
padding-left: 15px;
padding-top: 20px;
border-bottom: 1px solid #e0e0e0;
}
.discount-area {
@extend .discount-page;
.list-nav li {
display: block;
height: 28px;
float: left;
line-height: 28px;
width: 24%;
text-align: center;
border-left: 1px solid #e1e1e1;
margin-top: 30px;
margin-bottom: 30px;
border-sizing: border-box;
span {
font-size: 28px;
}
&:first-child {
border-left: none;
}
}
.active {
.cur {
color: #000;
}
}
.list-nav .icon .up {
top: -6px;
}
.list-nav .icon .down {
top: 8px;
}
.goods-container {
padding-top: 30px;
padding-bottom: 100px;
}
/*.active a{
}*/
}
.search-area {
@extend .search-page;
}
.hide {
display: none;
}
.shop-foot-wrapper {
position: absolute;
bottom: 0;
display: table;
width: 100%;
height: 88px;
line-height: 88px;
font-size: 28px;
background: #fff;
border-top: 1px solid #eaeaea;
ul {
display: table-row;
}
li {
display: table-cell;
text-align: center;
.wall {
width: 0;
height: 28px;
margin-top: 30px;
float: right;
border-right: 1px solid #eaeaea;
display: inline-block;
}
}
.sub-group {
position: absolute;
background: #fff;
border: 1px solid #eaeaea;
border-radius: 12px;
bottom: 104px;
width: 40%;
margin-left: 5%;
dl {
width: 80%;
margin: 0 auto;
}
dd {
line-height: 80px;
text-align: center;
border-top: 1px solid #eaeaea;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
dd:first-child {
border-top: 0;
}
}
.sharp {
position: absolute;
width: 100%;
height: 14px;
background: resolve('product/sharp.png') no-repeat center center;
}
.foot-list-3 .sub-group {
width: 29%;
margin-left: 2%;
}
}
.bytouch{
background:#eee;
}
.new-arrival {
padding-top: 30px;
overflow: hidden;
padding-left: 15px;
background: #fff;
}
.popularity {
padding-top: 30px;
overflow: hidden;
padding-left: 15px;
background: #fff;
}
.pos-list {
@extend .discount-page;
li {
display: block;
height: 28px;
float: left;
line-height: 28px;
width: 24%;
text-align: center;
border-left: 1px solid #e1e1e1;
margin-top: 30px;
margin-bottom: 30px;
border-sizing: border-box;
span {
font-size: 28px;
}
&:first-child {
border-left: none;
}
}
.active .cur {
color: #000;
}
.active a {
color: #000;
}
.iconfont {
font-weight: bold;
}
}
}
\ No newline at end of file
... ...
.shop-introduce-page{
.banner {
margin: 30px auto;
width: auto;
height: auto;
display: block;
background-size: 100%;
}
.descripition {
margin: 40px 20px 0px 20px;
font-size: 22px;
line-height: 36px;
padding: 40px 20px 40px 20px;
border-top: 1px solid #e6e6e6;
border-bottom: 1px solid #e6e6e6;
text-indent: 2em;
}
.sign-icon {
font-size: 32px;
height: 80px;
line-height: 80px;
text-align: center;
font-weight: 100;
}
.sign-icon > span {
width:auto;
}
}
.brand-shop-page{
.brand-list{
margin-left: 20px;
font-size: 36px;
border-bottom: 1px solid #e6e6e6;
text-align: left;
height: 90px;
line-height: 90px;
vertical-align:middle;
display: block;
width: 100%;
}
}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="search-page yoho-page">
{{# search}}
{{# search}}
<div id="search-input" class="search-input">
<form id="search-form" action={{url}} method="get">
<i class="search-icon iconfont">&#xe60f;</i>
... ...
{{> layout/header}}
<div class="good-list-page yoho-page">
{{> product/list}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="brand-shop-page">
{{# content}}
<a class="brand-list" href="{{url}}">
{{brand_name}}
</a>
{{/ content}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="product-category yoho-page">
{{# content}}
<a class="allproduct" href="{{allproduct}}">
全部商品
<span class="arrow-icon iconfont">
&#xe614;
</span>
</a>
<div class="margin-under-allproduct">
</div>
<div class="category-container clearfix">
<div class="content">
<ul class="primary-level">
{{# class}}
<li class="p-level-item">{{name}}
<div class="primary-level-trilangle hide"></div>
</li>
{{/ class}}
</ul>
<div class="sub-level-container hide">
{{# category}}
<ul class="sub-level">
{{# subcategory}}
<li>
<a href={{url}}>
{{category_name}}
</a>
</li>
{{/ subcategory}}
</ul>
{{/ category}}
</div>
</div>
</div>
{{/ content}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="shop-introduce-page">
<a class="banner">
<img src="{{content.shop_logo}}">
</a>
<div class="descripition">
{{content.shop_intro}}
</div>
<p class="sign-icon">
<span class="iconfont">&#xe649;</span>
100%品牌授权正品
</p>
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{# shopIndex}}
<div class="shop-index yoho-page" id="wrapper">
<div id="scroller">
<div id="nav-top">
{{> layout/header}}
{{#if appVersion}}
<input type="hidden" name="app_version" value="{{appVersion}}">
{{else}}
<div class="search-area">
<div id="search-input" class="search-input">
<form id="search-form" action={{url}} method="get">
<i class="search-icon iconfont">&#xe60f;</i>
<input type="text" placeholder="搜索店铺内潮品" name="query">
<input type="hidden" name="shop_id" value="{{shopId}}">
<input type="hidden" name="app_version" value="{{appVersion}}">
<i class="clear-input iconfont hide">&#xe626;</i>
<button id="search" class="search" type="submit">搜索</button>
</form>
</div>
</div>
{{/if}}
<div class="branner-top">
<img src="{{branerImg}}">
<img class="logo" src="{{logoImg}}">
<p class="store-name">{{storeName}}</p>
<div class="collect">
{{#if collect}}
<div class="alreadyCollect" id="collect"></div>
{{else}}
<div class="notCollect" id="collect"></div>
{{/if}}
</div>
</div>
</div>
<ul id="nav" class="nav">
<li class="active color" tab="home-page">首页</li>
<li tab="new-arrival">上新</li>
<li tab="popularity">人气</li>
<li>
<a href="{{allGoods}}" target="_blank">全部商品</a>
</li>
</ul>
<div id="home-page" class="main">
<div id="nav-main" >
{{#if brandList}}
<div class="multi-brands">
<p>品牌一览</p>
<div class="multi-browse">
<ul class="swiper-wrapper">
{{#each brandList.list}}
<li class="swiper-slide brand-img">
<a href="{{url}}">
<img src="{{img}}">
</a>
<p>{{brandName}}</p>
</li>
{{/each}}
</ul>
</div>
</div>
{{/if}}
<div class="banner-area">
{{# bannerTop}}
{{> home/banner_top}}
{{/ bannerTop}}
</div>
<ul class="spring">
{{#each spring}}
<li>
<a href="{{url}}">
<img src="{{springType}}">
</a>
</li>
{{/each}}
</ul>
{{! 热门品类}}
{{# hotCategory}}
{{> home/hot_category}}
{{/ hotCategory}}
<div class="popularity-title">
人气单品
<a class="more" href="{{more_url}}">&#xe618;</a>
</div>
<ul class="product-list">
{{#each hotList}}
<li>
<a href="{{url}}">
<img src="{{listUrl}}">
</a>
<div class="list-price">
<p>{{productName}}</p>
<p><span class="red">{{originalPrice}}</span>
<span>{{presentPrice}}</span>
</p>
</div>
</li>
{{/each}}
</ul>
</div>
<div class="discount-area">
{{> product/goods-nav-top}}
</div>
</div>
<div id="new-arrival" class="new-arrival main"></div>
<div id="popularity" class="popularity main"></div>
</div>
{{#unless appVersion}}
{{> product/shop-footer}}
{{/unless}}
<ul id="pos-nav" class="nav hide">
<li class="active color" tab="home-page">首页</li>
<li tab="new-arrival">上新</li>
<li tab="popularity">人气</li>
<li>
<a href="{{allGoods}}" target="_blank">全部商品</a>
</li>
</ul>
<ul id="pos-list" class="home-sub-nav pos-list nav hide">
<li class="new active">
<a href="javascript:void(0);">
<span class="spanTest">最新</span>
<span class="iconfont cur">&#xe616;</span>
</a>
</li>
<li class="price">
<a href="javascript:void(0);">
<span class="spanTest">价格</span>
<span class="icon">
<i class="iconfont up cur">&#xe615;</i>
<i class="iconfont down">&#xe616;</i>
</span>
</a>
</li>
<li class="discount">
<a href="javascript:void(0);">
<span class="spanTest">折扣</span>
<span class="icon">
<i class="iconfont up cur">&#xe615;</i>
<i class="iconfont down">&#xe616;</i>
</span>
</a>
</li>
<li class="filter">
<a href="javascript:void(0);">
<span class="spanTest">筛选</span>
<span class="iconfont cur">&#xe613;</span>
</a>
</li>
</ul>
</div>
{{/ shopIndex}}
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/header}}
{{# brands}}
<a class="brand-list" href="{{url}}">
{{brandname}}
</a>
{{/ brands}}
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="product-category yoho-page">
<div id="allproduct" class="allproduct">
<a href={{allproduct}}>
<p class="allproductParagaraph">全部商品</p>
<i class="arrow-icon iconfont">&#xe614;</i>
</a>
</div>
<div class="margin-under-allproduct">
</div>
<div class="category-container clearfix">
<div class="content">
{{# content}}
<ul class="primary-level">
{{# class}}
<li class="p-level-item">{{name}}
<div class="primary-level-trilangle trilanglefont hide">&#xe64a;</div>
</li>
{{/ class}}
</ul>
<div class="sub-level-container hide">
{{# category}}
<ul class="sub-level">
{{# subcategory}}
<li>
<a href={{url}}>
{{category_name}}
</a>
</li>
{{/ subcategory}}
</ul>
{{/ category}}
</div>
{{/ content}}
</div>
</div>
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/header}}
{{# shopIndex}}
<div class="shop-index yoho-page" id="wrapper">
<div id="scroller">
<div id="nav-top">
{{# headerBanner}}
{{> product/banner-swipe-and-single}}
{{/ headerBanner}}
<div class="search-area">
<div id="search-input" class="search-input">
<form id="search-form" action={{url}} method="get">
<i class="search-icon iconfont">&#xe60f;</i>
<input type="text" placeholder="搜索店铺内潮品" name="query">
<input type="hidden" name="from" value="search">
<i class="clear-input iconfont hide">&#xe626;</i>
<span id="search" class="search" type="submit">搜索</span>
</form>
</div>
</div>
<div class="branner-top">
<img src="{{branerImg}}">
<img class="logo" src=""></div>
<p class="name">Vans专营店</p>
<div class="collect"></div>
</div>
</div>
<ul id="nav" class="nav">
<li class="active color" tab="home-page">首页</li>
<li tab="new-arrival">上新</li>
<li tab="popularity">人气</li>
<li>
<a href="#" target="_blank">全部商品</a>
</li>
</ul>
<div id="home-page">
<div id="nav-main" class="main">
{{#unless brands}}
<div class="multi-brands">
<h2>品牌一览</h2>
<div class="multi-browse">
<ul class="swiper-wrapper">
{{#each multiList}}
<li class="swiper-slide brand-img">
<a href="{{url}}">
<img src="{{img}}">
</a>
<p>{{brandName}}</p>
</li>
{{/each}}
</ul>
</div>
</div>
{{/unless}}
<div class="banner-area">
{{# bannerTop}}
{{> home/banner_top}}
{{/ bannerTop}}
</div>
<ul class="spring">
{{#each spring}}
<li>
<a href="{{url}}">
<img src="{{springType}}">
</a>
</li>
{{/each}}
</ul>
{{! 热门品类}}
{{# hotCategory}}
{{> home/hot_category}}
{{/ hotCategory}}
<div class="popularity-title">
人气单品
<a class="more" href="{{more_url}}">&#xe618;</a>
</div>
<ul class="product-list">
{{#each hotList}}
<li>
<a href="{{url}}">
<img src="{{listUrl}}">
</a>
<div class="list-price">
<p>VANS AP M BERZE</p>
<p><span class="red">{{originalPrice}}</span>
<span>{{presentPrice}}</span>
</p>
</div>
</li>
{{/each}}
</ul>
</div>
<div class="discount-area">
{{> product/goods-nav-top}}
</div>
</div>
<div id="new-arrival" class=""></div>
<div id="popularity" class=""></div>
</div>
{{> product/shop-footer}}
<ul id="pos-nav" class="nav hide">
<li class="active color">首页</li>
<li>上新</li>
<li>人气</li>
<li>
<a href="#" target="_blank">全部商品</a>
</li>
</ul>
<ul id="pos-list " class="list-nav hide">
<li class="new active">
<a href="javascript:void(0);">
<span class="spanTest">最新</span>
<span class="iconfont cur">&#xe616;</span>
</a>
</li>
<li class="price">
<a href="javascript:void(0);">
<span class="spanTest">价格</span>
<span class="icon">
<i class="iconfont up cur">&#xe615;</i>
<i class="iconfont down">&#xe616;</i>
</span>
</a>
</li>
<li class="discount">
<a href="javascript:void(0);">
<span class="spanTest">折扣</span>
<span class="icon">
<i class="iconfont up cur">&#xe615;</i>
<i class="iconfont down">&#xe616;</i>
</span>
</a>
</li>
<li class="filter">
<a href="javascript:void(0);">
<span class="spanTest">筛选</span>
<span class="iconfont cur">&#xe613;</span>
</a>
</li>
</ul>
</div>
{{/ shopIndex}}
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="shop-introduce">
<a class="banner">
<img src="{{content.shop_logo}}">
</a>
<div class="descripition">
{{content.shop_intro}}
</div>
<p class="sign-icon">
<span class="iconfont">&#xe649;</span>
100%品牌授权正品
</p>
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -339,7 +339,6 @@
seajs.use('js/me/currency');
</script>
{{/if}}
{{#if currencyPage}}
<script>
seajs.use('js/me/currency-new');
... ... @@ -390,3 +389,17 @@
seajs.use('js/cart/jit-detail');
</script>
{{/if}}
{{!-- 品牌分类 --}}
{{#if productCategoryPage}}
<script>
seajs.use('js/product/product-category');
</script>
{{/if}}
{{!-- 品牌店铺首页 --}}
{{#if shopPage}}
<script>
seajs.use('js/product/shop');
</script>
{{/if}}
... ...
<ul id="list-nav" class="home-sub-nav list-nav clearfix">
<li class="new active">
<a href="javascript:void(0);">
<span class="spanTest">最新</span>
<span class="iconfont cur">&#xe616;</span>
</a>
</li>
<li class="price">
<a href="javascript:void(0);">
<span class="spanTest">价格</span>
<span class="icon">
<i class="iconfont up cur">&#xe615;</i>
<i class="iconfont down">&#xe616;</i>
</span>
</a>
</li>
<li class="discount">
<a href="javascript:void(0);">
<span class="spanTest">折扣</span>
<span class="icon">
<i class="iconfont up cur">&#xe615;</i>
<i class="iconfont down">&#xe616;</i>
</span>
</a>
</li>
<li class="filter">
<a href="javascript:void(0);">
<span class="spanTest">筛选</span>
<span class="iconfont cur">&#xe613;</span>
</a>
</li>
</ul>
<div id="goods-container" class="goods-container">
<div class="new-goods container clearfix">
{{# goods}}
{{> good}}
{{/ goods}}
</div>
<div class="price-goods container hide clearfix"></div>
<div class="discount-goods container hide clearfix"></div>
{{> filter}}
</div>
\ No newline at end of file
... ...
<div class="shop-foot-wrapper">
<ul{{#if brandList}} class="foot-list-3"{{/if}}>
<li>
{{#if shopCategory.url}}
<a href="{{shopCategory.url}}">商品分类</a>
{{^}}
商品分类
<div class="sub-group hide">
<dl>
{{# shopCategory.list}}
<dd><a href="{{url}}">{{name}}</a></dd>
{{/ shopCategory.list}}
</dl>
<div class="sharp"></div>
</div>
{{/if}}
<div class="wall"></div>
</li>
{{#if brandList}}
<li>
{{#if brandList.url}}
<a href="{{shopCategory.url}}">品牌一览</a>
{{^}}
品牌一览
<div class="sub-group hide">
<dl>
{{# brandList.list}}
<dd><a href="{{url}}">{{brandName}}</a></dd>
{{/ brandList.list}}
</dl>
<div class="sharp"></div>
</div>
{{/if}}
<div class="wall"></div>
</li>
{{/if}}
<li>
<a href="{{shopIntroHref}}">店铺简介</a>
</li>
</ul>
</div>
\ No newline at end of file
... ...
<?php
use Action\AbstractAction;
// use LibModels\Wap\Product\SearchData;
// use Plugin\DataProcess\ListProcess;
use LibModels\Wap\Product\SearchData;
use Plugin\DataProcess\ListProcess;
use Plugin\Helpers;
/**
... ... @@ -29,11 +29,17 @@ class SearchController extends AbstractAction
/**
* 搜索列表页
*
* tar mark
*/
public function listAction()
{
// 过滤请求参数
$condition = filter_input_array(INPUT_GET, array(
'shop' => FILTER_DEFAULT,
'categoryId' => FILTER_DEFAULT,
'subCategoryId' => FILTER_DEFAULT,
'title' => FILTER_DEFAULT,
'query' => FILTER_DEFAULT,
'brand' => FILTER_DEFAULT,
'sort' => FILTER_DEFAULT,
... ... @@ -101,9 +107,9 @@ class SearchController extends AbstractAction
// 跳转到品牌商品列表页
if ($domain !== null) {
$url = Helpers::url('', array(
'from' => 'search',
'query' => $query
), $domain);
'from' => 'search',
'query' => $query
), $domain);
$this->go($url);
}
}
... ... @@ -117,7 +123,7 @@ class SearchController extends AbstractAction
if (empty($classNames)) {
break;
}
/* 精确查一级品类 */
$sorts = array_keys($classNames['first'], $query, true);
if (isset($sorts[0])) {
... ... @@ -146,13 +152,11 @@ class SearchController extends AbstractAction
if ($isQueryFirstClass) {
$this->setTitle('全部' . $query);
$this->setNavHeader('全部' . $query, true, SITE_MAIN);
}
// 搜索是二级品类
} // 搜索是二级品类
elseif ($isQuerySecondClass) {
$this->setTitle($query);
$this->setNavHeader($query, true, SITE_MAIN);
}
// 搜索其它内容
} // 搜索其它内容
else {
$from = $this->get('from');
if ($haveQuery || $from) {
... ... @@ -171,25 +175,30 @@ class SearchController extends AbstractAction
// 显示页面底部登录信息
$data['pageFooter'] = true;
// // 查询数据
// if (!isset($condition['query'])) {
// $data['goodList'] += Product\ListModel::getClassData($condition);
// } else {
// $listData = SearchData::searchByCondition($condition);
// // 处理返回的数据
// if (!empty($listData['data']['brand'])) {
// $brandData = $listData['data']['brand'];
// $data['brandWay'] = array(
// 'url' => 'http://' . $brandData['brand_domain'] . SUB_DOMAIN,
// 'thumb' => Helpers::getImageUrl($brandData['brand_ico'], 75, 40),
// 'name' => $brandData['brand_name']
// );
// // 设置品牌默认值
// $data['goodList']['brand'] = $brandData['id'];
// $data['goodList'] += ListProcess::getListData($listData['data']);
// }
// $listData = array();
// }
// 查询数据
if (!isset($condition['query'])) {
$data['goodList'] += Product\ListModel::getClassData($condition);
} else {
$listData = SearchData::searchByCondition($condition);
// 处理返回的数据
if (!empty($listData['data']['brand'])) {
$brandData = $listData['data']['brand'];
$data['brandWay'] = array(
'url' => 'http://' . $brandData['brand_domain'] . SUB_DOMAIN,
'thumb' => Helpers::getImageUrl($brandData['brand_ico'], 75, 40),
'name' => $brandData['brand_name']
);
// 设置品牌默认值
$data['goodList']['brand'] = $brandData['id'];
$data['goodList'] += ListProcess::getListData($listData['data']);
}
$listData = array();
}
if(isset($condition['title'])){
$this->setTitle($condition['title']);
$this->setNavHeader($condition['title'], true, SITE_MAIN);
}
$this->_view->display('list', $data);
}
... ... @@ -258,8 +267,7 @@ class SearchController extends AbstractAction
// 为了兼容现在运营在用的p_d
if (isset($condition['p_d'])) {
$condition['p_d'] = rawurldecode($condition['p_d']);
}
// 转换折扣
} // 转换折扣
elseif (isset($condition['discount'])) {
$condition['p_d'] = rawurldecode($condition['discount']);
unset($condition['discount']);
... ... @@ -349,8 +357,7 @@ class SearchController extends AbstractAction
// 为了兼容现在运营在用的p_d
if (isset($condition['p_d'])) {
$condition['p_d'] = rawurldecode($condition['p_d']);
}
// 转换折扣
} // 转换折扣
elseif (isset($condition['discount'])) {
$condition['p_d'] = rawurldecode($condition['discount']);
unset($condition['discount']);
... ...
... ... @@ -5,13 +5,17 @@ namespace Product;
use Configs\CacheConfig;
use LibModels\Wap\Category\ClassData;
use LibModels\Wap\Category\BrandData;
use LibModels\Wap\Product\ListData;
use LibModels\Wap\Product\ShopData;
use Plugin\DataProcess\ListProcess;
use Plugin\DataProcess\ShopProcess;
use Plugin\Helpers;
use Plugin\Cache;
use Plugin\Images;
/**
* 商品列表相关的模板数据模型
*
*
* @name ListModel
* @package models/Product
* @copyright yoho.inc
... ... @@ -23,9 +27,11 @@ class ListModel
/**
* 获取品类商品列表数据
*
*
* @param array $condition 条件
* @return array | false
*
* tar mark
*/
public static function getClassData($condition)
{
... ... @@ -54,8 +60,7 @@ class ListModel
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
if (empty($result)) {
$result = Cache::get($key, 'slave');
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
} // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else {
Cache::set($key, $result, 1800); // 缓存30分钟
}
... ... @@ -66,7 +71,7 @@ class ListModel
/**
* 获取品牌信息
*
*
* @param int $id 唯一的ID
* @param int $uid 用户ID
* @param string $title 网站标题
... ... @@ -97,7 +102,7 @@ class ListModel
/**
* 获取品牌商品列表数据
*
*
* @param array $condition 条件参数
* @param string $title 网站标题
* @return array
... ... @@ -137,8 +142,7 @@ class ListModel
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
if (empty($result)) {
$result = Cache::get($key, 'slave');
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
} // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else {
Cache::set($key, $result, 1800); // 缓存30分钟
}
... ... @@ -149,7 +153,7 @@ class ListModel
/**
* 根据品牌ID获取品牌LOGO
*
*
* @param int $id 品牌ID
* @param string $title 品牌标题
* @return array | false
... ... @@ -169,8 +173,6 @@ class ListModel
// 调用接口查询数据
$brandLogo = BrandData::getBrandLogo($id);
var_dump($brandLogo);
exit;
// 处理返回的数据
if (isset($brandLogo['data'][0])) {
$result = array(
... ... @@ -185,8 +187,7 @@ class ListModel
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
if (empty($result)) {
$result = Cache::get($key, 'slave');
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
} // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else {
Cache::set($key, $result); // 缓存1小时
}
... ... @@ -197,9 +198,10 @@ class ListModel
/**
* 根据品牌ID获取品牌LOGO
*
*
* @param int $id 品牌ID
* @param string $title 品牌标题
* @modify sefon 2016-4-29 01:57:14 添加shopId / type
* @return array | false
*/
public static function getBrandLogoByDomain($domain, &$title)
... ... @@ -216,7 +218,8 @@ class ListModel
}
// 调用接口查询数据
$brandLogo = BrandData::getBrandLogoByDomain($domain);
// $brandLogo = BrandData::getBrandLogoByDomain($domain);
$brandLogo = BrandData::getShopInfoByBrandDomain($domain); // TODO 获取品牌店铺信息
// 处理返回的数据
if (isset($brandLogo['data'])) {
$result = array(
... ... @@ -224,6 +227,8 @@ class ListModel
'url' => Helpers::url('', null, $brandLogo['data']['brand_domain']),
'thumb' => Helpers::getImageUrl($brandLogo['data']['brand_ico'], 75, 40),
'name' => $brandLogo['data']['brand_name'],
'shopId' => isset($brandLogo['data']['shop_id']) ? $brandLogo['data']['shop_id'] : 0,//店铺id
'type' => isset($brandLogo['data']['type']) ? $brandLogo['data']['type'] : 0,
);
$title = $result['name'];
}
... ... @@ -232,8 +237,7 @@ class ListModel
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
if (empty($result)) {
$result = Cache::get($key, 'slave');
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
} // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else {
Cache::set($key, $result); // 缓存1小时
}
... ... @@ -244,7 +248,7 @@ class ListModel
/**
* 获取所有的品牌名称列表
*
*
* @return array(
* 品牌ID => 品牌域名(domain)
* )
... ... @@ -283,8 +287,7 @@ class ListModel
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
if (empty($result)) {
$result = Cache::get($key, 'slave');
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
} // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else {
Cache::set($key, $result);
}
... ... @@ -295,7 +298,7 @@ class ListModel
/**
* 获取所有的品牌名称列表
*
*
* @return array(
* 品牌域名(domain) => 品牌名称(name)
* )
... ... @@ -334,8 +337,7 @@ class ListModel
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
if (empty($result)) {
$result = Cache::get($key, 'slave');
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
} // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else {
Cache::set($key, $result);
}
... ... @@ -344,4 +346,105 @@ class ListModel
return $result;
}
/**
* @param $data
* @param $shop_id
* @return array 返回的处理好的数据
* @author chengyao.guo
*/
public static function categoryData($data, $shop_id)
{
$result = array();
$result['class'] = array();
$result['category'] = array();
foreach ($data as &$item) {
array_push($result['class'], array('name' => $item['category_name']));
foreach ($item['sub'] as &$item2) {
$item2['url'] = Helpers::url('/search/list', array(
'shop' => $shop_id,
'categoryId' => $item['category_id'],
'subCategoryId' => $item2['category_id'],
'title' => $item2['category_name'],
'query' => $item2['category_name'],
));
}
array_push($result['category'], array('subcategory' => $item['sub']));
}
$result['allproduct'] = Helpers::url('/search/list', array(
'shop' => $shop_id,
));
return $result;
}
public static function introData(&$data)
{
$data['shop_logo'] = Images::getImageUrl($data['shop_logo'], 640, 480);
return $data;
}
/**
* 店铺所有品牌信息处理
* @author chengyao.guo
* @param $data
* @param $shop_id
* @return mixed
*/
public static function brandData($data, $shop_id)
{
// 处理图片链接
foreach ($data as &$item) {
$item['brand_ico'] = Images::getImageUrl($item['brand_ico'], 0, 0);
$item['url'] = Helpers::url('/search/list', array(
'shop' => $shop_id,
'brand' => $item['brand_id'],
'title' => $item['brand_name'],
));
}
return $data;
}
/**
* 新店铺首页
* @param int $shopId 店铺id
* @param int $uid 用户id
* @param string $appVersion app版本
* @author sefon 2016-4-26 21:09:35
* @return array
*/
public static function shopData($shopId, $uid, $appVersion = '')
{
$data = array();
//店铺信息
$data['shopInfo'] = ListData::getShopInfo($shopId, $uid);
//店铺分类
$data['shopCategory'] = ListData::getShopCategory($shopId);
//店铺装修资源数据
$data['decorator'] = ListData::getShopDecorator($shopId);
//组织楼层数据
$result = ShopProcess::formShopData($data, $shopId, $appVersion);
return $result;
}
/**
* 根据brandId 获取相关店铺列表
* @param int $brandId
* @author sefon 2016-4-28 13:38:23
* @return array
*/
public static function brandShop($brandId)
{
$brandShop = ListData::getShopByBrandId($brandId);
// print_r($brandShop); exit;
}
/**
* 根据brand domain查询店铺信息
* @param string $domain
* @author sefon 2016-4-28 23:39:04
* @return array
*/
public static function getShopInfo($domain)
{
return ShopData::getShopInfoByBrandDomain($domain);
}
}
... ...
... ... @@ -2,7 +2,9 @@
use Action\AbstractAction;
use LibModels\Wap\Product\SaleData;
use LibModels\Wap\Product\ShopData;
use Plugin\Helpers;
use Product\ListModel;
/**
* 商品列表相关的控制器
... ... @@ -14,13 +16,13 @@ class IndexController extends AbstractAction
/**
* 品类商品列表页
*
* @param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部
* @param integer $brand 品牌Id
* @param integer $sort 品类查询sort参数
* @param integer $color 颜色Id
* @param integer $size 尺码Id
* @param string $price 价格
* @param string $p_d 折扣
* @param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部
* @param integer $brand 品牌Id
* @param integer $sort 品类查询sort参数
* @param integer $color 颜色Id
* @param integer $size 尺码Id
* @param string $price 价格
* @param string $p_d 折扣
*/
public function indexAction()
{
... ... @@ -38,6 +40,10 @@ class IndexController extends AbstractAction
'gender' => FILTER_DEFAULT,
'p_d' => FILTER_DEFAULT,), false);
// 转义店铺
if (isset($condition['shop_id'])) {
$condition['shop_id'] = rawurldecode($condition['shop_id']);
}
// 转义品牌
if (isset($condition['brand'])) {
$condition['brand'] = rawurldecode($condition['brand']);
... ... @@ -110,32 +116,44 @@ class IndexController extends AbstractAction
/**
* 品牌商品列表页
*
* @param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部
* @param integer $sort 品类查询sort参数
* @param integer $color 颜色Id
* @param integer $size 尺码Id
* @param string $price 价格
* @param string $p_d 折扣
* @param string $gender "1,3"表示男, "2,3"表示女, "1,2,3"表示全部
* @param integer $sort 品类查询sort参数
* @param integer $color 颜色Id
* @param integer $size 尺码Id
* @param string $price 价格
* @param string $p_d 折扣
*/
public function brandAction()
{
/* 品牌域名参数 @see Bootstrap.php */
$domain = $this->param('named');
$domain = 'andybrier';
if (empty($domain)) {
$this->go(SITE_MAIN);
}
// 当前的登录用户UID
$uid = $this->getUid();
// 存标题信息
$title = '';
//TODO 如果是app,可直接获取shopId
// $appShopId = $this->get('shop_id');
// if ($this->isApp() && !empty($appShopId)) {
// $this->shop($appShopId);
// }
$brandLogo = Product\ListModel::getBrandLogoByDomain($domain, $title);
//TODO 无店铺:0--->品牌页 无单品店有多品店:1--->搜索页 有单品店:2--->店铺页面
//TODO 通过品牌域名获取店铺shopId 先固定shopId = 672
$brandLogo['shopId'] = 672;
$brandLogo['type'] = 2;
if ($brandLogo['type'] == 2 && !empty($brandLogo['shopId'])) {
$this->shop($brandLogo['shopId'], $uid);
exit;
}
$brandId = 0;
if ($brandLogo && isset($brandLogo['id'])) {
$brandId = $brandLogo['id'];
}
// 当前的登录用户UID
$uid = $this->getUid();
/* 搜索框相关 */
$from = $this->get('from');
$query = $this->get('query');
... ... @@ -153,6 +171,10 @@ class IndexController extends AbstractAction
'gender' => FILTER_DEFAULT,
'p_d' => FILTER_DEFAULT,), false);
$condition['brand'] = $brandId;
// 转义店铺
if (isset($condition['shop_id'])) {
$condition['shop_id'] = rawurldecode($condition['shop_id']);
}
// 转义分类
if (isset($condition['sort'])) {
$condition['sort'] = rawurldecode($condition['sort']);
... ... @@ -209,8 +231,7 @@ class IndexController extends AbstractAction
$data['goodList']['brandWay'] = $brandLogo;
$data['goodList']['search']['default'] = $query;
$data['goodList']['search']['url'] = Helpers::url('', null, 'search');
}
// 品牌一览过来的展示品牌介绍和LOGO
} // 品牌一览过来的展示品牌介绍和LOGO
elseif ($brandId !== 0) {
$data['brandHome'] = \Product\ListModel::getBrandIntro($brandId, $uid, $title);
$data['goodList'] = array();
... ... @@ -231,7 +252,7 @@ class IndexController extends AbstractAction
}
/**
* 活动专区
* 活动专区
*
* @param int channel 1:男生,2:女生,3:潮童,4:创意生活
*/
... ... @@ -346,4 +367,465 @@ class IndexController extends AbstractAction
'pageFooter' => true,
));
}
/**
* 店铺全部品牌页面
* @author chengyao.guo
* @return mixed
*/
public function allBrandAction()
{
$requestData = filter_input_array(INPUT_GET, array(
'shop_id' => FILTER_DEFAULT,
));
if (empty($requestData['shop_id'])) {
$this->go(SITE_MAIN);
}
$result = array();
$resource = ShopData::getShopBrands($requestData['shop_id']);
if($resource['code'] === 200){
$result = ListModel::brandData($resource['data'],$requestData['shop_id']);
}
if($this->isApp()){
$this->setTitle('品牌');
}else{
$this->setNavHeader('品牌', true, SITE_MAIN);
}
return $this->_view->display('brand', array(
'content' => $result,
));
}
/**
*
* 店铺品类页面
* @author chengyao.guo
* @return mixed
*/
public function categoryAction()
{
$requestData = filter_input_array(INPUT_GET, array(
'shop_id' => FILTER_DEFAULT,
));
if (empty($requestData['shop_id'])) {
$this->go(SITE_MAIN);
}
$result = array();
$resource = ShopData::getShopCategory($requestData['shop_id'], Helpers::getChannelByCookie(), Helpers::getGenderByCookie());
if ($resource['code'] === 200) {
$result = ListModel::categoryData($resource['data'],$requestData['shop_id']);
}
if($this->isApp()){
$this->setTitle('品类');
}else{
$this->setNavHeader('品类', true, SITE_MAIN);
}
return $this->_view->display('category', array(
'productCategoryPage' => true,
'content' => $result,
));
}
/**
* 店铺简介页面
* @author chengyao.guo
* @return mixed
*/
public function introAction()
{
$requestData = filter_input_array(INPUT_GET, array(
'shop_id' => FILTER_DEFAULT,
));
if (empty($requestData['shop_id'])) {
$this->go(SITE_MAIN);
}
$result = array();
$resource = ShopData::getShopIntro($requestData['shop_id']);
if ($resource['code'] === 200) {
$result = ListModel::introData($resource['data']);
}
if($this->isApp()){
$this->setTitle('店铺简介');
}else{
$this->setNavHeader('店铺简介', true, SITE_MAIN);
}
return $this->_view->display('intro', array(
'content' => $result,
));
}
/**
* 店铺首页
* @param int $shopId
* @author sefon 2016-4-26 20:50:58
*/
private function shop($shopId)
{
$appVersion = $this->get('app_version');
if (empty($appVersion)) {
$this->setNavHeader('', true, SITE_MAIN);
$uid = $this->getUid(true);
}
//app环境
else {
$data['appVersion'] = $appVersion;
$uid = $this->get('uid');
$this->setSession('appUid', $uid);
}
$data = ListModel::shopData($shopId, $uid, $appVersion);
$this->_view->display('shop', array(
'shopIndex' => $data,
'shopPage' => true
));
}
/**
* 店铺收藏
* @author sefon 2016-4-28 23:00:11
*/
public function shopFavAction()
{
$data = array();
$shopId = $this->post('shop_id', 0);
$appVersion = $this->post('app_version', 0);
if (!empty($appVersion)){
$uid = $this->getSession('appUid');
} else {
$uid = $this->getUid();
}
do {
if (!$this->isAjax()) {
break;
}
if (empty($uid)) {
$data['code'] = 401;
//TODO app登陆地址
$refer = urlencode($_SERVER['HTTP_REFERER']);
$toUrl = Helpers::url('/signin.html')."?refer=".$refer;
if (!empty($appVersion)){
$toUrl .= '&yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"'.$refer.'","param":{}},"requesturl":{"param":{},"url":""},"priority":"Y"}}';
}
$data['url'] = $toUrl;
break;
}
if (!empty($shopId) && !empty($uid)) {
$data = ShopData::shopFav($uid, $shopId);
}
} while(false);
$this->echoJson($data);
}
/**
* 取消店铺收藏
* @author sefon 2016-4-28 23:01:43
*/
public function cancelShopFavAction()
{
$data = array();
$shopId = $this->post('shop_id', 0);
$uid = $this->getUid();
do {
if (!$this->isAjax()) {
break;
}
if (!empty($shopId) && !empty($uid)) {
$data = ShopData::cancelShopFav($uid, $shopId);
}
} while(false);
$this->echoJson($data);
}
/**
* 店铺品牌首页
*
* @return mixed
*/
public function testAction()
{
$data = array(
'shopId' => '104',
'appVersion' => '123',
'branerImg' => 'http://img12.static.yhbimg.com/yhb-img01/2016/04/18/05/026e96d1b403d28407650c7228bb4ca405.jpg?imageView2/2/w/640/h/200',
'logoImg' => '',
'storeName' => 'Vans专营店',
'collect' => false,
'alreadyCollect' => 'product/collect.png',
'notCollect' => '',
'allGoods' => '',
'goodList' => 'http://www.baidu.com',
'brandList' => array(
'list' => array(
array(
'url' => '',
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/04/18/05/026b9aee5b7d2ec33e8db877c3d87b3386.jpg?imageView2/2/w/640/h/403',
'brandName' => '123re34456556900'
),
array(
'url' => '',
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/04/18/05/026b9aee5b7d2ec33e8db877c3d87b3386.jpg?imageView2/2/w/640/h/403',
'brandName' => '123re34456556900'
),
array(
'url' => '',
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/04/18/05/026b9aee5b7d2ec33e8db877c3d87b3386.jpg?imageView2/2/w/640/h/403',
'brandName' => '123re344565'
),
array(
'url' => '',
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/04/18/05/026b9aee5b7d2ec33e8db877c3d87b3386.jpg?imageView2/2/w/640/h/403',
'brandName' => '123re34456556900'
),
array(
'url' => '',
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/04/18/05/026b9aee5b7d2ec33e8db877c3d87b3386.jpg?imageView2/2/w/640/h/403',
'brandName' => '123re34456556900'
),
array(
'url' => '',
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/04/18/05/026b9aee5b7d2ec33e8db877c3d87b3386.jpg?imageView2/2/w/640/h/403',
'brandName' => '123re344565'
),
array(
'url' => '',
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/04/18/05/026b9aee5b7d2ec33e8db877c3d87b3386.jpg?imageView2/2/w/640/h/403',
'brandName' => '123re344565'
)
),
'url' => ''
),
'bannerTop' => array(
'list' => array(
array(
'url' => '',
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/01/19/11/02039485d87cc1b100b883244cf386e62d.jpg?imageView/2/w/640/h/200',
),
array(
'url' => '',
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/01/19/11/02039485d87cc1b100b883244cf386e62d.jpg?imageView/2/w/640/h/200',
),
)
),
'spring' => array(
array(
'url' => '',
'springType' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/01ea96f5fd2ea8ef99d37d00f39d8e57f0.jpg?imageView/2/w/275/h/160'
),
array(
'url' => '',
'springType' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160'
)
),
'hotCategory' => array(
'name' => '热门品类',
'list' => array(
array(
'url' => '',
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/04/27/03/02727a01918939223937019a3f9114ee19.jpg?imageView/2/w/140/h/140',
),
array(
'url' => 'http://img12.static.yhbimg.com/yhb-img01/2016/04/27/03/02727a01918939223937019a3f9114ee19.jpg?imageView/2/w/140/h/140',
'img' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160',
),
array(
'url' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160',
'img' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160',
),
array(
'url' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160',
'img' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160',
),
array(
'url' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160',
'img' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160',
),
array(
'url' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160',
'img' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160',
),
array(
'url' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160',
'img' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160',
),
array(
'url' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160',
'img' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160',
)
)
),
'hotList' => array(
array(
'url' => '',
'listUrl' => 'http://img11.static.yhbimg.com/goodsimg/2016/04/07/07/0147c904336407bb9f4008bfda7920b9bd.jpg?imageMogr2/thumbnail/276x366/extent/276x366/background/d2hpdGU=/position/center/quality/80',
'productName' => 'Vans专营店',
'originalPrice' => '¥599.00',
'presentPrice' => '¥399.00'
),
array(
'url' => '',
'listUrl' => 'http://img11.static.yhbimg.com/goodsimg/2016/04/07/07/0147c904336407bb9f4008bfda7920b9bd.jpg?imageMogr2/thumbnail/276x366/extent/276x366/background/d2hpdGU=/position/center/quality/80',
'productName' => 'Vans专营店',
'originalPrice' => '¥599',
'presentPrice' => '¥399'
),
array(
'url' => '',
'listUrl' => 'http://img11.static.yhbimg.com/goodsimg/2016/04/07/07/0147c904336407bb9f4008bfda7920b9bd.jpg?imageMogr2/thumbnail/276x366/extent/276x366/background/d2hpdGU=/position/center/quality/80',
'productName' => 'Vans专营店',
'originalPrice' => '¥599',
'presentPrice' => '¥399'
),
array(
'url' => '',
'listUrl' => 'http://img11.static.yhbimg.com/goodsimg/2016/04/07/07/0147c904336407bb9f4008bfda7920b9bd.jpg?imageMogr2/thumbnail/276x366/extent/276x366/background/d2hpdGU=/position/center/quality/80',
'productName' => 'Vans专营店',
'originalPrice' => '¥599',
'presentPrice' => '¥399'
),
array(
'url' => '',
'listUrl' => 'http://img11.static.yhbimg.com/goodsimg/2016/04/07/07/0147c904336407bb9f4008bfda7920b9bd.jpg?imageMogr2/thumbnail/276x366/extent/276x366/background/d2hpdGU=/position/center/quality/80',
'productName' => 'Vans专营店',
'originalPrice' => '¥599.00',
'presentPrice' => '¥399.00'
),
array(
'url' => '',
'listUrl' => 'http://img11.static.yhbimg.com/goodsimg/2016/04/07/07/0147c904336407bb9f4008bfda7920b9bd.jpg?imageMogr2/thumbnail/276x366/extent/276x366/background/d2hpdGU=/position/center/quality/80',
'productName' => 'Vans专营店',
'originalPrice' => '¥599',
'presentPrice' => '¥399'
),
array(
'url' => '',
'listUrl' => 'http://img11.static.yhbimg.com/goodsimg/2016/04/07/07/0147c904336407bb9f4008bfda7920b9bd.jpg?imageMogr2/thumbnail/276x366/extent/276x366/background/d2hpdGU=/position/center/quality/80',
'productName' => 'Vans专营店',
'originalPrice' => '¥599',
'presentPrice' => '¥399'
),
array(
'url' => '',
'listUrl' => 'http://img11.static.yhbimg.com/goodsimg/2016/04/07/07/0147c904336407bb9f4008bfda7920b9bd.jpg?imageMogr2/thumbnail/276x366/extent/276x366/background/d2hpdGU=/position/center/quality/80',
'productName' => 'Vans专营店',
'originalPrice' => '¥599',
'presentPrice' => '¥399'
)
),
'goods' => array(
array(
'url' => 'http://m.yohobuy.com/product/pro_320421_412063/SYSTAGYuanLingWeiYiSYSA601HC09.html',
'thumb' => 'http://img10.static.yhbimg.com/goodsimg/2015/12/07/09/01ced0e2ed6a4f2a6d95be70cd0a6c5a56.jpg?imageView/2/w/235/h/314',
'name' => 'NEFF ONE OF US RAGLAN L/S 男款森林风连帽卫衣',
'salePrice' => '759.00',
'price' => '799.00',
'tags' => array(
'is_new' => false,
'is_advance' => true,
'is_discount' => false,
'is_yohoood' => false,
'is_limited' => false
),
'is_soon_sold_out' => false
),
array(
'url' => 'http://m.yohobuy.com/product/pro_320421_412063/SYSTAGYuanLingWeiYiSYSA601HC09.html',
'thumb' => 'http://img10.static.yhbimg.com/goodsimg/2015/12/07/09/01ced0e2ed6a4f2a6d95be70cd0a6c5a56.jpg?imageView/2/w/235/h/314',
'name' => 'NEFF ONE OF US RAGLAN L/S 男款森林风连帽卫衣',
'salePrice' => '759.00',
'price' => '799.00',
'tags' => array(
'is_new' => true,
'is_advance' => false,
'is_discount' => false,
'is_yohoood' => false,
'is_limited' => false
),
'is_soon_sold_out' => false
),
array(
'url' => 'http://m.yohobuy.com/product/pro_320421_412063/SYSTAGYuanLingWeiYiSYSA601HC09.html',
'thumb' => 'http://img10.static.yhbimg.com/goodsimg/2015/12/07/09/01ced0e2ed6a4f2a6d95be70cd0a6c5a56.jpg?imageView/2/w/235/h/314',
'name' => 'NEFF ONE OF US RAGLAN L/S 男款森林风连帽卫衣',
'salePrice' => '759.00',
'price' => '799.00',
'tags' => array(
'is_new' => true,
'is_advance' => false,
'is_discount' => false,
'is_yohoood' => false,
'is_limited' => false
),
'is_soon_sold_out' => false
),
array(
'url' => 'http://m.yohobuy.com/product/pro_320421_412063/SYSTAGYuanLingWeiYiSYSA601HC09.html',
'thumb' => 'http://img10.static.yhbimg.com/goodsimg/2015/12/07/09/01ced0e2ed6a4f2a6d95be70cd0a6c5a56.jpg?imageView/2/w/235/h/314',
'name' => 'NEFF ONE OF US RAGLAN L/S 男款森林风连帽卫衣',
'salePrice' => '759.00',
'price' => '799.00',
'tags' => array(
'is_new' => true,
'is_advance' => false,
'is_discount' => false,
'is_yohoood' => false,
'is_limited' => false
),
'is_soon_sold_out' => false
),
array(
'url' => 'http://m.yohobuy.com/product/pro_320421_412063/SYSTAGYuanLingWeiYiSYSA601HC09.html',
'thumb' => 'http://img10.static.yhbimg.com/goodsimg/2015/12/07/09/01ced0e2ed6a4f2a6d95be70cd0a6c5a56.jpg?imageView/2/w/235/h/314',
'name' => 'NEFF ONE OF US RAGLAN L/S 男款森林风连帽卫衣',
'salePrice' => '759.00',
'price' => '799.00',
'tags' => array(
'is_new' => true,
'is_advance' => false,
'is_discount' => false,
'is_yohoood' => false,
'is_limited' => false
),
'is_soon_sold_out' => false
),
array(
'url' => 'http://m.yohobuy.com/product/pro_320421_412063/SYSTAGYuanLingWeiYiSYSA601HC09.html',
'thumb' => 'http://img10.static.yhbimg.com/goodsimg/2015/12/07/09/01ced0e2ed6a4f2a6d95be70cd0a6c5a56.jpg?imageView/2/w/235/h/314',
'name' => 'NEFF ONE OF US RAGLAN L/S 男款森林风连帽卫衣',
'salePrice' => '759.00',
'price' => '799.00',
'tags' => array(
'is_new' => true,
'is_advance' => false,
'is_discount' => false,
'is_yohoood' => false,
'is_limited' => false
),
'is_soon_sold_out' => false
)
),
'filter' => array(
'classify' => array(
array(
'default' => true,
'title' => 'aaa',
'name' => 'name',
'dataType' => '1',
'subs' => array(
'chosed' => true,
'dataId' => '1',
'name' => 'bbb',
)
)
)
)
);
return $this->_view->display('shop', array(
'shopIndex' => $data,
'shopPage' => true
));
}
}
... ...
... ... @@ -6,3 +6,245 @@
* and open the template in the editor.
*/
use Action\AbstractAction;
class ShopController extends AbstractAction
{
/**
* 店铺品牌首页
*
* @return mixed
*/
public function indexAction()
{
$data = array(
'branerImg' => 'http://img12.static.yhbimg.com/yhb-img01/2016/04/18/05/026e96d1b403d28407650c7228bb4ca405.jpg?imageView2/2/w/640/h/200',
'goodList' => 'http://www.baidu.com',
'brands' => false,
'multiList' => array(
array(
'url' => '',
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/04/18/05/026b9aee5b7d2ec33e8db877c3d87b3386.jpg?imageView2/2/w/640/h/403',
'brandName' => '123re34456556900'
),
array(
'url' => '',
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/04/18/05/026b9aee5b7d2ec33e8db877c3d87b3386.jpg?imageView2/2/w/640/h/403',
'brandName' => '123re344565'
),
array(
'url' => '',
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/04/18/05/026b9aee5b7d2ec33e8db877c3d87b3386.jpg?imageView2/2/w/640/h/403',
'brandName' => '123re344565'
)
),
'bannerTop' => array(
'list' => array(
array(
'url' => '',
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/01/19/11/02039485d87cc1b100b883244cf386e62d.jpg?imageView/2/w/640/h/200',
),
array(
'url' => '',
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/01/19/11/02039485d87cc1b100b883244cf386e62d.jpg?imageView/2/w/640/h/200',
),
)
),
'spring' => array(
array(
'url' => '',
'springType' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/01ea96f5fd2ea8ef99d37d00f39d8e57f0.jpg?imageView/2/w/275/h/160'
),
array(
'url' => '',
'springType' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160'
)
),
'hotCategory' => array(
'name' => '热门品类',
'list' => array(
array(
'url' => 'http://img12.static.yhbimg.com/yhb-img01/2016/04/15/02/0295b83dc3bcef5bd59f339841f9ee92d1.jpg?imageView2/2/w/640/h/403',
'img' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160',
),
array(
'url' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160',
'img' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160',
),
array(
'url' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160',
'img' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160',
),
array(
'url' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160',
'img' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160',
),
array(
'url' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160',
'img' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160',
),
array(
'url' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160',
'img' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160',
),
array(
'url' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160',
'img' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160',
),
array(
'url' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160',
'img' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160',
)
)
),
'hotList' => array(
array(
'url' => '',
'listUrl' => 'http://img11.static.yhbimg.com/goodsimg/2016/04/07/07/0147c904336407bb9f4008bfda7920b9bd.jpg?imageMogr2/thumbnail/276x366/extent/276x366/background/d2hpdGU=/position/center/quality/80',
'originalPrice' => '¥599.00',
'presentPrice' => '¥399.00'
),
array(
'url' => '',
'listUrl' => 'http://img11.static.yhbimg.com/goodsimg/2016/04/07/07/0147c904336407bb9f4008bfda7920b9bd.jpg?imageMogr2/thumbnail/276x366/extent/276x366/background/d2hpdGU=/position/center/quality/80',
'originalPrice' => '¥599',
'presentPrice' => '¥399'
),
array(
'url' => '',
'listUrl' => 'http://img11.static.yhbimg.com/goodsimg/2016/04/07/07/0147c904336407bb9f4008bfda7920b9bd.jpg?imageMogr2/thumbnail/276x366/extent/276x366/background/d2hpdGU=/position/center/quality/80',
'originalPrice' => '¥599',
'presentPrice' => '¥399'
),
array(
'url' => '',
'listUrl' => 'http://img11.static.yhbimg.com/goodsimg/2016/04/07/07/0147c904336407bb9f4008bfda7920b9bd.jpg?imageMogr2/thumbnail/276x366/extent/276x366/background/d2hpdGU=/position/center/quality/80',
'originalPrice' => '¥599',
'presentPrice' => '¥399'
),
array(
'url' => '',
'listUrl' => 'http://img11.static.yhbimg.com/goodsimg/2016/04/07/07/0147c904336407bb9f4008bfda7920b9bd.jpg?imageMogr2/thumbnail/276x366/extent/276x366/background/d2hpdGU=/position/center/quality/80',
'originalPrice' => '¥599.00',
'presentPrice' => '¥399.00'
),
array(
'url' => '',
'listUrl' => 'http://img11.static.yhbimg.com/goodsimg/2016/04/07/07/0147c904336407bb9f4008bfda7920b9bd.jpg?imageMogr2/thumbnail/276x366/extent/276x366/background/d2hpdGU=/position/center/quality/80',
'originalPrice' => '¥599',
'presentPrice' => '¥399'
),
array(
'url' => '',
'listUrl' => 'http://img11.static.yhbimg.com/goodsimg/2016/04/07/07/0147c904336407bb9f4008bfda7920b9bd.jpg?imageMogr2/thumbnail/276x366/extent/276x366/background/d2hpdGU=/position/center/quality/80',
'originalPrice' => '¥599',
'presentPrice' => '¥399'
),
array(
'url' => '',
'listUrl' => 'http://img11.static.yhbimg.com/goodsimg/2016/04/07/07/0147c904336407bb9f4008bfda7920b9bd.jpg?imageMogr2/thumbnail/276x366/extent/276x366/background/d2hpdGU=/position/center/quality/80',
'originalPrice' => '¥599',
'presentPrice' => '¥399'
)
),
'goods' => array(
array(
'url' => 'http://m.yohobuy.com/product/pro_320421_412063/SYSTAGYuanLingWeiYiSYSA601HC09.html',
'thumb' => 'http://img10.static.yhbimg.com/goodsimg/2015/12/07/09/01ced0e2ed6a4f2a6d95be70cd0a6c5a56.jpg?imageView/2/w/235/h/314',
'name' => 'NEFF ONE OF US RAGLAN L/S 男款森林风连帽卫衣',
'salePrice' => '759.00',
'price' => '799.00',
'tags' => array(
'is_new' => false,
'is_advance' => true,
'is_discount' => false,
'is_yohoood' => false,
'is_limited' => false
),
'is_soon_sold_out' => false
),
array(
'url' => 'http://m.yohobuy.com/product/pro_320421_412063/SYSTAGYuanLingWeiYiSYSA601HC09.html',
'thumb' => 'http://img10.static.yhbimg.com/goodsimg/2015/12/07/09/01ced0e2ed6a4f2a6d95be70cd0a6c5a56.jpg?imageView/2/w/235/h/314',
'name' => 'NEFF ONE OF US RAGLAN L/S 男款森林风连帽卫衣',
'salePrice' => '759.00',
'price' => '799.00',
'tags' => array(
'is_new' => true,
'is_advance' => false,
'is_discount' => false,
'is_yohoood' => false,
'is_limited' => false
),
'is_soon_sold_out' => false
),
array(
'url' => 'http://m.yohobuy.com/product/pro_320421_412063/SYSTAGYuanLingWeiYiSYSA601HC09.html',
'thumb' => 'http://img10.static.yhbimg.com/goodsimg/2015/12/07/09/01ced0e2ed6a4f2a6d95be70cd0a6c5a56.jpg?imageView/2/w/235/h/314',
'name' => 'NEFF ONE OF US RAGLAN L/S 男款森林风连帽卫衣',
'salePrice' => '759.00',
'price' => '799.00',
'tags' => array(
'is_new' => true,
'is_advance' => false,
'is_discount' => false,
'is_yohoood' => false,
'is_limited' => false
),
'is_soon_sold_out' => false
),
array(
'url' => 'http://m.yohobuy.com/product/pro_320421_412063/SYSTAGYuanLingWeiYiSYSA601HC09.html',
'thumb' => 'http://img10.static.yhbimg.com/goodsimg/2015/12/07/09/01ced0e2ed6a4f2a6d95be70cd0a6c5a56.jpg?imageView/2/w/235/h/314',
'name' => 'NEFF ONE OF US RAGLAN L/S 男款森林风连帽卫衣',
'salePrice' => '759.00',
'price' => '799.00',
'tags' => array(
'is_new' => true,
'is_advance' => false,
'is_discount' => false,
'is_yohoood' => false,
'is_limited' => false
),
'is_soon_sold_out' => false
),
array(
'url' => 'http://m.yohobuy.com/product/pro_320421_412063/SYSTAGYuanLingWeiYiSYSA601HC09.html',
'thumb' => 'http://img10.static.yhbimg.com/goodsimg/2015/12/07/09/01ced0e2ed6a4f2a6d95be70cd0a6c5a56.jpg?imageView/2/w/235/h/314',
'name' => 'NEFF ONE OF US RAGLAN L/S 男款森林风连帽卫衣',
'salePrice' => '759.00',
'price' => '799.00',
'tags' => array(
'is_new' => true,
'is_advance' => false,
'is_discount' => false,
'is_yohoood' => false,
'is_limited' => false
),
'is_soon_sold_out' => false
),
array(
'url' => 'http://m.yohobuy.com/product/pro_320421_412063/SYSTAGYuanLingWeiYiSYSA601HC09.html',
'thumb' => 'http://img10.static.yhbimg.com/goodsimg/2015/12/07/09/01ced0e2ed6a4f2a6d95be70cd0a6c5a56.jpg?imageView/2/w/235/h/314',
'name' => 'NEFF ONE OF US RAGLAN L/S 男款森林风连帽卫衣',
'salePrice' => '759.00',
'price' => '799.00',
'tags' => array(
'is_new' => true,
'is_advance' => false,
'is_discount' => false,
'is_yohoood' => false,
'is_limited' => false
),
'is_soon_sold_out' => false
)
)
);
return $this->_view->display('index', array(
'shopIndex' => $data,
'shopPage' => true
));
}
}
\ No newline at end of file
... ...
... ... @@ -4,7 +4,7 @@ application.directory = APPLICATION_PATH "/application"
;;website library
application.library = ROOT_PATH "/library"
;;模块配置
application.modules = "Index,Category,Channel,Guang,Passport,Product,Cart,Shopping"
application.modules = "Index,Category,Channel,Guang,Passport,Product,Cart,Shopping,Shop"
;;加载
application.bootstrap = APPLICATION_PATH "/application/Bootstrap.php"
;;view文件的扩展名
... ...