Authored by Rock Zhang

修改限购商品分享详情页的逻辑

Code Review By Rock Zhang
... ... @@ -20,28 +20,24 @@
</div>
</div>
{{# attaches}}
<div class="goodDesc">
{{#mainImg}}
<img class="lazy" src="{{mainImg}}" alt="">
{{/mainImg}}
{{#img}}
<img src="{{attachUrl}}" alt="{{attachName}}">
{{/img}}
{{#goodDescription}}
<p class="desc">{{goodDescription}}</p>
{{/goodDescription}}
{{#text}}
<p class="desc">{{intro}}</p>
{{/text}}
{{#imgList}}
<img class="lazy" src="{{img}}" alt="">
{{/imgList}}
{{#vedio}}
{{#video}}
<video poster="{{img}}" controls="controls" controls="controls" preload="metadata" loop="loop" width="100%" name="media">
{{#list}}
<source src="{{src}}" type="video/ogg;codecs=" theora,vorbis"" media="screen" />
<source src="{{src}}"/>
{{/list}}
<source src="{{attachUrl}}" type="video/ogg;codecs=" theora,vorbis"" media="screen" />
<source src="{{attachUrl}}"/>
</video>
{{/vedio}}
{{/video}}
</div>
{{/attaches}}
<div class="bottom">
<div class="logo"></div>
... ...
... ... @@ -762,39 +762,6 @@ class DetailModel
}
$productData = DetailData::limitProductData($uid, $productCode);
/*$product = array(
"activityId" => null,
"attachment" => array(
array(
"attachName" => "",
"attachType" => 1,
"attachUrl" => "http://img10.static.yhbimg.com/yhb-img01/2016/03/03/17/012ddf849c5bd975452063594f36d21c37.png",
"id" => 445,
"intro" => "",
"isDefault" => 1,
"orderBy" => 0,
"productId" => 197,
"status" => 0
)
),
"batchNo" => "20160303171415",
"createTime" => 1456996513,
"dayFlag" => 1,
"description" => "",
"hotFlag" => 1,
"id" => 197,
"lastUpdateTime" => 1456998239,
"limitProductCode" => "2016030317150854",
"limitProductType" => 1,
"notSaleOrderBy" => 0,
"orderBy" => 72,
"price" => "¥65.00",
"productName" => "damao-已开售-码已发完-已售罄",
"productSkn" => 51147512,
"saleTime" => 1454342400,
"showFlag" => 1,
"status" => 1
);*/
if (empty($productData)) {
break;
... ... @@ -812,7 +779,7 @@ class DetailModel
// 附件
if (isset($product['attachment'])) {
foreach ($product['attachment'] as $item) {
$result['attach'][] = self::procLimitProductAttach($item);
$result['attaches'][] = self::procLimitProductAttach($item);
}
}
... ... @@ -833,13 +800,24 @@ class DetailModel
switch(intval($attachment['attachType'])) {
case 1: // 大图文字
$result['mainImg'] = $attachment['attachUrl'];
$result['goodDescription'] = $attachment['intro'];
$result['orderBy'] = $attachment['orderBy'];
$result['img'] = array(
'attachUrl' => $attachment['attachUrl'],
'attachName' => $attachment['attachName'],
'intro' => $attachment['intro'],
'orderBy' => $attachment['orderBy']
);
break;
case 2: // 图片列表
case 2: // 视频
$result['video'] = array(
'attachUrl' => $attachment['attachUrl'],
'orderBy' => $attachment['orderBy']
);
break;
case 3: // 视频
case 3: // 文本类型
$result['text'] = array(
'intro' => $attachment['intro'],
'orderBy' => $attachment['orderBy']
);
break;
default:
break;
... ...
... ... @@ -334,7 +334,7 @@ class DetailController extends AbstractAction
)
);*/
$productCode = $this->get('code', '2016030711270231');
$productCode = $this->get('code', '2016030711453248');
$uid = $this->getUid();
$data = DetailModel::getLimitProductData($uid, $productCode);
... ...