Authored by zhangxiaoru

ss

1.13 KB | W: | H:

1.61 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

7.66 KB | W: | H:

670 Bytes | W: | H:

  • 2-up
  • Swipe
  • Onion skin
... ... @@ -59,11 +59,10 @@
.primary-level-trilangle{
float: right;
background: url('product/arrow.png');
margin-top: 14px;
width: 21px;
height: 60px;
background-repeat: no-repeat;
background: url(/product/arrow.png) no-repeat;
margin-top: 22px;
width: 20px;
height: 46px;
}
.trilanglefont {
... ...
... ... @@ -142,8 +142,6 @@
.multi-browse {
margin-top: 50px;
@extend .swiper-container;
}
.brand-img {
... ... @@ -389,10 +387,11 @@
.sub-group {
position: absolute;
background: #fff;
border-right: 1px solid #eaeaea;
border-radius: 5px;
border: 1px solid #eaeaea;
border-radius: 12px;
bottom: 104px;
width: 30%;
width: 40%;
margin-left: 5%;
dl {
width: 80%;
... ... @@ -403,6 +402,9 @@
line-height: 80px;
text-align: center;
border-top: 1px solid #eaeaea;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
dd:first-child {
... ... @@ -413,8 +415,13 @@
.sharp {
position: absolute;
width: 100%;
height: 8px;
background: url('product/sharp.png') no-repeat center center;
height: 14px;
background: resolve('product/sharp.png') no-repeat center center;
}
.foot-list-3 .sub-group {
width: 29%;
margin-left: 2%;
}
}
... ...
... ... @@ -3,7 +3,9 @@
<div class="product-category yoho-page">
<div class="allproduct">
<a href={{allproduct}}>
{{# content}}
<a href={{allproduct}}>
{{/ content}}
全部商品
<i class="arrow-icon iconfont">&#xe614;</i>
</a>
... ...
{{> 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}}
<div class ='shop_introduation'>
<a class="banner">
<img src="{{content.shop_logo}}">
</a>
<div class="descripition">
{{content.shop_intro}}
</div>
<p class="fo">
<span class="iconfont">&#xe649;</span>
100%品牌授权正品
</p>
</div>
{{> layout/footer}}
\ No newline at end of file
<div class="shop-foot-wrapper">
<ul>
<ul{{#if brandList}} class="foot-list-3"{{/if}}>
<li>
{{#if shopCategory.url}}
<a href="{{shopCategory.url}}">商品分类</a>
... ... @@ -8,7 +8,7 @@
<div class="sub-group hide">
<dl>
{{# shopCategory.list}}
<dd><a href="url">{{name}}</a></dd>
<dd><a href="{{url}}">{{name}}</a></dd>
{{/ shopCategory.list}}
</dl>
<div class="sharp"></div>
... ... @@ -25,7 +25,7 @@
<div class="sub-group hide">
<dl>
{{# brandList.list}}
<dd><a href="url">{{brandName}}</a></dd>
<dd><a href="{{url}}">{{brandName}}</a></dd>
{{/ brandList.list}}
</dl>
<div class="sharp"></div>
... ...
... ... @@ -195,7 +195,7 @@ class SearchController extends AbstractAction
$listData = array();
}
if($condition['title']){
if(isset($condition['title'])){
$this->setTitle($condition['title']);
$this->setNavHeader($condition['title'], true, SITE_MAIN);
}
... ...
... ... @@ -15,7 +15,7 @@ use Plugin\Images;
/**
* 商品列表相关的模板数据模型
*
*
* @name ListModel
* @package models/Product
* @copyright yoho.inc
... ... @@ -27,7 +27,7 @@ class ListModel
/**
* 获取品类商品列表数据
*
*
* @param array $condition 条件
* @return array | false
*
... ... @@ -60,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分钟
}
... ... @@ -72,7 +71,7 @@ class ListModel
/**
* 获取品牌信息
*
*
* @param int $id 唯一的ID
* @param int $uid 用户ID
* @param string $title 网站标题
... ... @@ -103,7 +102,7 @@ class ListModel
/**
* 获取品牌商品列表数据
*
*
* @param array $condition 条件参数
* @param string $title 网站标题
* @return array
... ... @@ -143,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分钟
}
... ... @@ -155,7 +153,7 @@ class ListModel
/**
* 根据品牌ID获取品牌LOGO
*
*
* @param int $id 品牌ID
* @param string $title 品牌标题
* @return array | false
... ... @@ -189,8 +187,7 @@ class ListModel
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
if (empty($result)) {
$result = Cache::get($key, 'slave');
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
} // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else {
Cache::set($key, $result); // 缓存1小时
}
... ... @@ -201,7 +198,7 @@ class ListModel
/**
* 根据品牌ID获取品牌LOGO
*
*
* @param int $id 品牌ID
* @param string $title 品牌标题
* @return array | false
... ... @@ -236,8 +233,7 @@ class ListModel
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
if (empty($result)) {
$result = Cache::get($key, 'slave');
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
} // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else {
Cache::set($key, $result); // 缓存1小时
}
... ... @@ -248,7 +244,7 @@ class ListModel
/**
* 获取所有的品牌名称列表
*
*
* @return array(
* 品牌ID => 品牌域名(domain)
* )
... ... @@ -287,8 +283,7 @@ class ListModel
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
if (empty($result)) {
$result = Cache::get($key, 'slave');
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
} // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else {
Cache::set($key, $result);
}
... ... @@ -299,7 +294,7 @@ class ListModel
/**
* 获取所有的品牌名称列表
*
*
* @return array(
* 品牌域名(domain) => 品牌名称(name)
* )
... ... @@ -338,8 +333,7 @@ class ListModel
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
if (empty($result)) {
$result = Cache::get($key, 'slave');
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
} // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else {
Cache::set($key, $result);
}
... ... @@ -354,7 +348,7 @@ class ListModel
* @return array 返回的处理好的数据
* @author chengyao.guo
*/
public static function categoryData($data , $shop_id)
public static function categoryData($data, $shop_id)
{
$result = array();
$result['class'] = array();
... ... @@ -372,9 +366,18 @@ class ListModel
}
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
... ... @@ -382,7 +385,7 @@ class ListModel
* @param $shop_id
* @return mixed
*/
public static function brandData($data,$shop_id)
public static function brandData($data, $shop_id)
{
// 处理图片链接
foreach ($data as &$item) {
... ... @@ -395,6 +398,7 @@ class ListModel
}
return $data;
}
/**
* 新店铺首页
* @param int $shopId 店铺id
... ...
... ... @@ -2,10 +2,9 @@
use Action\AbstractAction;
use LibModels\Wap\Product\SaleData;
use Plugin\Helpers;
use LibModels\Wap\Product\ShopData;
use Plugin\Helpers;
use Product\ListModel;
use Plugin\Mobile;
/**
* 商品列表相关的控制器
... ... @@ -376,7 +375,7 @@ class IndexController extends AbstractAction
if($resource['code'] === 200){
$result = ListModel::brandData($resource['data'],$requestData['shop_id']);
}
if(Mobile::isMobile()){
if($this->isApp()){
$this->setTitle('品牌');
}else{
$this->setNavHeader('品牌', true, SITE_MAIN);
... ... @@ -405,7 +404,7 @@ class IndexController extends AbstractAction
if ($resource['code'] === 200) {
$result = ListModel::categoryData($resource['data'],$requestData['shop_id']);
}
if(Mobile::isMobile()){
if($this->isApp()){
$this->setTitle('品类');
}else{
$this->setNavHeader('品类', true, SITE_MAIN);
... ... @@ -432,9 +431,9 @@ class IndexController extends AbstractAction
$result = array();
$resource = ShopData::getShopIntro($requestData['shop_id']);
if ($resource['code'] === 200) {
$result = $resource['data'];
$result = ListModel::introData($resource['data']);
}
if(Mobile::isMobile()){
if($this->isApp()){
$this->setTitle('店铺简介');
}else{
$this->setNavHeader('店铺简介', true, SITE_MAIN);
... ... @@ -468,6 +467,16 @@ class IndexController extends AbstractAction
}
/**
* 判断是不是APP
*
* @return bool
*/
public function isApp(){
$appVersion = $this->get('app_version');
return !empty($appVersion);
}
/**
* 店铺上新
*/
public function shopNewPro()
... ...
<?php
/**
* Created by PhpStorm.
* User: Targaryen
* Date: 2016/4/21
* Time: 11:11
*/
use Action\AbstractAction;
use LibModels\Wap\Shop\ShopData;
use Plugin\Helpers;
class IndexController extends AbstractAction
{
/**
* 店铺品牌首页
*
* @return mixed
*/
public function brandAction()
{
$result = array();
// 假数据
$result = $this->getCategoryContent();
$result2 = IntroData::getShopIntro(356);
return $this->_view->display('category', array(
'content' => $result,
));
}
/**
* 店铺品牌品类页,需要判断单品店还是多品店
*
* @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 = array();
$resource['category'] = ShopData::getShopCategory($requestData['shop_id'], Helpers::getChannelByCookie(), Helpers::getGenderByCookie());
$resource['brands'] = ShopData::getShopBrands($requestData['shop_id']);
if ($resource['category']['code'] === 200) {
$class = array();
$category = array();
foreach ($resource['category']['data'] as &$item) {
array_push($class, array('name' => $item['category_name']));
foreach ($item['sub'] as &$item2) {
$item2['url'] = Helpers::url(''); // tar mark 还不知道链接是啥样的
}
array_push($category, array('subcategory' => $item['sub']));
}
$result['class'] = $class;
$result['category'] = $category;
}
if ($resource['brands']['code'] === 200) {
$result['brands'] = $resource['brands']['data'];
}
// 处理图片链接
foreach ($result['brands'] as &$item) {
$item['brand_ico'] = \Plugin\Images::getImageUrl($item['brand_ico'], 0, 0);
}
// $result = $this->getCategoryContent();
ShopData::debugOut($result,false);
return $this->_view->display('category', array(
'productCategoryPage' => true,
'content' => $result,
));
}
/**
* 店铺简介页面
*
* @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 = $resource['data'];
}
return $this->_view->display('intro', array(
'content' => $result,
));
}
/**
* 店铺分类品类页数据模拟
*
* @return array
*/
public function getCategoryContent()
{
return array(// 数据模拟
'class' => array(
array(
'name' => '上衣',
),
array(
'name' => '裤装',
),
array(
'name' => '鞋靴',
),
array(
'name' => '包类',
)
),
'category' => array(
array(
'subcategory' => array(
array(
'url' => 'http://img02.yohoboys.com/staticimg/2016/04/20/16/029d5f3c8dcb63249ac9bf42e7cf9c190c.jpg',
'name' => '上衣衣1'
),
array(
'url' => 'http://img02.yohoboys.com/staticimg/2016/04/20/16/029d5f3c8dcb63249ac9bf42e7cf9c190c.jpg',
'name' => '上衣衣2'
),
array(
'url' => 'http://img02.yohoboys.com/staticimg/2016/04/20/16/029d5f3c8dcb63249ac9bf42e7cf9c190c.jpg',
'name' => '上衣衣3'
),
)
),
array(
'subcategory' => array(
array(
'url' => 'http://img02.yohoboys.com/staticimg/2016/04/20/16/029d5f3c8dcb63249ac9bf42e7cf9c190c.jpg',
'name' => '裤装1'
),
array(
'url' => 'http://img02.yohoboys.com/staticimg/2016/04/20/16/029d5f3c8dcb63249ac9bf42e7cf9c190c.jpg',
'name' => '裤装2'
),
array(
'url' => 'http://img02.yohoboys.com/staticimg/2016/04/20/16/029d5f3c8dcb63249ac9bf42e7cf9c190c.jpg',
'name' => '裤装3'
),
)
),
array(
'subcategory' => array(
array(
'url' => 'http://img02.yohoboys.com/staticimg/2016/04/20/16/029d5f3c8dcb63249ac9bf42e7cf9c190c.jpg',
'name' => '鞋靴1'
),
array(
'url' => 'http://img02.yohoboys.com/staticimg/2016/04/20/16/029d5f3c8dcb63249ac9bf42e7cf9c190c.jpg',
'name' => '鞋靴2'
),
array(
'url' => 'http://img02.yohoboys.com/staticimg/2016/04/20/16/029d5f3c8dcb63249ac9bf42e7cf9c190c.jpg',
'name' => '鞋靴3'
)
)
),
array(
'subcategory' => array(
array(
'url' => 'http://img02.yohoboys.com/staticimg/2016/04/20/16/029d5f3c8dcb63249ac9bf42e7cf9c190c.jpg',
'name' => '包类1'
),
array(
'url' => 'http://img02.yohoboys.com/staticimg/2016/04/20/16/029d5f3c8dcb63249ac9bf42e7cf9c190c.jpg',
'name' => '包类2'
),
array(
'url' => 'http://img02.yohoboys.com/staticimg/2016/04/20/16/029d5f3c8dcb63249ac9bf42e7cf9c190c.jpg',
'name' => '包类3'
)
)
)
)
);
}
/**
* 店铺简介数据模拟
*
* @return array
*/
public function getIntroContent()
{
return array(// 数据模拟
);
}
}
\ No newline at end of file