Authored by Rock Zhang

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

Code Review By Rock Zhang
@@ -20,28 +20,24 @@ @@ -20,28 +20,24 @@
20 </div> 20 </div>
21 </div> 21 </div>
22 22
  23 + {{# attaches}}
23 <div class="goodDesc"> 24 <div class="goodDesc">
24 - {{#mainImg}}  
25 - <img class="lazy" src="{{mainImg}}" alt="">  
26 - {{/mainImg}} 25 + {{#img}}
  26 + <img src="{{attachUrl}}" alt="{{attachName}}">
  27 + {{/img}}
27 28
28 - {{#goodDescription}}  
29 - <p class="desc">{{goodDescription}}</p>  
30 - {{/goodDescription}} 29 + {{#text}}
  30 + <p class="desc">{{intro}}</p>
  31 + {{/text}}
31 32
32 - {{#imgList}}  
33 - <img class="lazy" src="{{img}}" alt="">  
34 - {{/imgList}}  
35 -  
36 - {{#vedio}} 33 + {{#video}}
37 <video poster="{{img}}" controls="controls" controls="controls" preload="metadata" loop="loop" width="100%" name="media"> 34 <video poster="{{img}}" controls="controls" controls="controls" preload="metadata" loop="loop" width="100%" name="media">
38 - {{#list}}  
39 - <source src="{{src}}" type="video/ogg;codecs=" theora,vorbis"" media="screen" />  
40 - <source src="{{src}}"/>  
41 - {{/list}} 35 + <source src="{{attachUrl}}" type="video/ogg;codecs=" theora,vorbis"" media="screen" />
  36 + <source src="{{attachUrl}}"/>
42 </video> 37 </video>
43 - {{/vedio}} 38 + {{/video}}
44 </div> 39 </div>
  40 + {{/attaches}}
45 41
46 <div class="bottom"> 42 <div class="bottom">
47 <div class="logo"></div> 43 <div class="logo"></div>
@@ -762,39 +762,6 @@ class DetailModel @@ -762,39 +762,6 @@ class DetailModel
762 } 762 }
763 763
764 $productData = DetailData::limitProductData($uid, $productCode); 764 $productData = DetailData::limitProductData($uid, $productCode);
765 - /*$product = array(  
766 - "activityId" => null,  
767 - "attachment" => array(  
768 - array(  
769 - "attachName" => "",  
770 - "attachType" => 1,  
771 - "attachUrl" => "http://img10.static.yhbimg.com/yhb-img01/2016/03/03/17/012ddf849c5bd975452063594f36d21c37.png",  
772 - "id" => 445,  
773 - "intro" => "",  
774 - "isDefault" => 1,  
775 - "orderBy" => 0,  
776 - "productId" => 197,  
777 - "status" => 0  
778 - )  
779 - ),  
780 - "batchNo" => "20160303171415",  
781 - "createTime" => 1456996513,  
782 - "dayFlag" => 1,  
783 - "description" => "",  
784 - "hotFlag" => 1,  
785 - "id" => 197,  
786 - "lastUpdateTime" => 1456998239,  
787 - "limitProductCode" => "2016030317150854",  
788 - "limitProductType" => 1,  
789 - "notSaleOrderBy" => 0,  
790 - "orderBy" => 72,  
791 - "price" => "¥65.00",  
792 - "productName" => "damao-已开售-码已发完-已售罄",  
793 - "productSkn" => 51147512,  
794 - "saleTime" => 1454342400,  
795 - "showFlag" => 1,  
796 - "status" => 1  
797 - );*/  
798 765
799 if (empty($productData)) { 766 if (empty($productData)) {
800 break; 767 break;
@@ -812,7 +779,7 @@ class DetailModel @@ -812,7 +779,7 @@ class DetailModel
812 // 附件 779 // 附件
813 if (isset($product['attachment'])) { 780 if (isset($product['attachment'])) {
814 foreach ($product['attachment'] as $item) { 781 foreach ($product['attachment'] as $item) {
815 - $result['attach'][] = self::procLimitProductAttach($item); 782 + $result['attaches'][] = self::procLimitProductAttach($item);
816 } 783 }
817 } 784 }
818 785
@@ -833,13 +800,24 @@ class DetailModel @@ -833,13 +800,24 @@ class DetailModel
833 800
834 switch(intval($attachment['attachType'])) { 801 switch(intval($attachment['attachType'])) {
835 case 1: // 大图文字 802 case 1: // 大图文字
836 - $result['mainImg'] = $attachment['attachUrl'];  
837 - $result['goodDescription'] = $attachment['intro'];  
838 - $result['orderBy'] = $attachment['orderBy']; 803 + $result['img'] = array(
  804 + 'attachUrl' => $attachment['attachUrl'],
  805 + 'attachName' => $attachment['attachName'],
  806 + 'intro' => $attachment['intro'],
  807 + 'orderBy' => $attachment['orderBy']
  808 + );
839 break; 809 break;
840 - case 2: // 图片列表 810 + case 2: // 视频
  811 + $result['video'] = array(
  812 + 'attachUrl' => $attachment['attachUrl'],
  813 + 'orderBy' => $attachment['orderBy']
  814 + );
841 break; 815 break;
842 - case 3: // 视频 816 + case 3: // 文本类型
  817 + $result['text'] = array(
  818 + 'intro' => $attachment['intro'],
  819 + 'orderBy' => $attachment['orderBy']
  820 + );
843 break; 821 break;
844 default: 822 default:
845 break; 823 break;
@@ -334,7 +334,7 @@ class DetailController extends AbstractAction @@ -334,7 +334,7 @@ class DetailController extends AbstractAction
334 ) 334 )
335 );*/ 335 );*/
336 336
337 - $productCode = $this->get('code', '2016030711270231'); 337 + $productCode = $this->get('code', '2016030711453248');
338 $uid = $this->getUid(); 338 $uid = $this->getUid();
339 $data = DetailModel::getLimitProductData($uid, $productCode); 339 $data = DetailModel::getLimitProductData($uid, $productCode);
340 340