Authored by unknown

guang data docs

@@ -584,4 +584,118 @@ @@ -584,4 +584,118 @@
584 name: '衬衫' 584 name: '衬衫'
585 } 585 }
586 }] 586 }]
  587 + }
  588 +
  589 +## 逛详情页
  590 + {
  591 + guangDetailPage: true, //引用逛详情页js
  592 + detail:{
  593 + id: 1, //详情页id
  594 + header: {
  595 + title: '', //大标题
  596 + avatar: '', //作者头像
  597 + name: '' , //作者名字
  598 + authorUrl: '', //作者主页url
  599 + intro: '', //作者简介
  600 + time: '', //时间
  601 + click: '', //点击数
  602 + commentNum: '' //评论数
  603 + },
  604 + content: [
  605 + {
  606 + pic: '' //内容大图
  607 + },
  608 + {
  609 + text: '' //内容文字
  610 + },
  611 + {
  612 + smallPic: [ //内容两张并列小图
  613 + 'http://img02.static.yohobuy.com/cms/2015/06/26/12/027eb72bc880b4fe1aad361296c871c2ea.jpg',
  614 + 'http://img02.static.yohobuy.com/cms/2015/06/26/12/027eb72bc880b4fe1aad361296c871c2ea.jpg'
  615 + ]
  616 + },
  617 + {
  618 + relatedReco: { //相关推荐
  619 + recos: [
  620 + {
  621 + withInfo: {
  622 + thumb: '', //商品图片
  623 + name: '', //商品标题
  624 + price: '', //原价
  625 + salePrice: '', //现价
  626 + tags: [ //商品顶部标签
  627 + {
  628 + isNew: true //新品到着
  629 + },
  630 + {
  631 + isSale: true //折扣
  632 + },
  633 + {
  634 + isLimit: true //限量
  635 + },
  636 + {
  637 + isYohood: true //yohood
  638 + },
  639 + {
  640 + isReNew: false //再到着
  641 + },
  642 + {
  643 + isYearEndPromotion: false //年终大促
  644 + },
  645 + {
  646 + isYearMidPromotion: false //年中大促
  647 + }
  648 + ],
  649 + isFew: true, //单独的即将售罄标志,不显示不写
  650 + url: '' //商品链接
  651 + }
  652 + }
  653 + ...
  654 + ],
  655 + moreReco: '', //标题是否有more,有传url,没有不传
  656 + }
  657 + }
  658 + ],
  659 + brands: [ //相关品牌
  660 + {
  661 + 'thumb' => '', //品牌图片
  662 + 'name' => '004', //品牌名称
  663 + 'url' => '' //品牌url
  664 + }
  665 + ...
  666 + ],
  667 + userInfo: { //用户点赞收藏
  668 + isLike: true, //当前用户是否点赞
  669 + likeNum: 84, //点赞次数
  670 + isCollected: true //当前用户是否收藏
  671 + },
  672 + tag: [ //内容标签
  673 + {
  674 + name: LEE, //标签内容
  675 + url: www.baidu.com //标签链接
  676 + }
  677 + ...
  678 + ],
  679 + relatedPost:[ //相关文章
  680 + {
  681 + url => '', //链接
  682 + thumb => '', //图片
  683 + title => '' //标题
  684 + }
  685 + ...
  686 + ],
  687 + commentInfo: '', //初始内容,用于登陆页跳转回来后的内容不丢失
  688 + comment: {
  689 + commentNum: 4, //如果没有评论,数字为0,list和commentPager可以不传
  690 + list: [ //评论列表
  691 + {
  692 + avatar: '', //评论用户头像
  693 + name: '', //用户名字
  694 + content: '', //评论内容
  695 + time: '' //发表时间
  696 + }
  697 + ...
  698 + ]
  699 + }
  700 + }
587 } 701 }
@@ -53,46 +53,7 @@ @@ -53,46 +53,7 @@
53 {{# recos}} 53 {{# recos}}
54 <div class="commodity-info"> 54 <div class="commodity-info">
55 {{#withInfo}} 55 {{#withInfo}}
56 - <div class="tag-container clearfix">  
57 - {{# tags}}  
58 - {{# isNew}}  
59 - <p class="good-tag new-tag">NEW</p>  
60 - {{/ isNew}}  
61 - {{# isReNew}}  
62 - <p class="good-tag renew-tag">再到着</p>  
63 - {{/ isReNew}}  
64 - {{# isSale}}  
65 - <p class="good-tag sale-tag">SALE</p>  
66 - {{/ isSale}}  
67 - {{# isYohood}}  
68 - <div class="good-tag yohood-tag"></div>  
69 - {{/ isYohood}}  
70 - {{# isLimit}}  
71 - <p class="good-tag limit-tag">限量商品</p>  
72 - {{/ isLimit}}  
73 - {{# isYearEndPromotion}}  
74 - <p class="good-tag yep-tag">年终大促</p>  
75 - {{/ isYearEndPromotion}}  
76 - {{# isYearMidPromotion}}  
77 - <p class="good-tag ymp-tag">年中热促</p>  
78 - {{/ isYearMidPromotion}}  
79 - {{/ tags}}  
80 - </div>  
81 - <div class="info-img">  
82 - <a class="thumb" href="{{url}}">  
83 - <img class="lazy" data-original="{{thumb}}">  
84 - </a>  
85 - {{# isFew}}  
86 - <p class="few-tag">即将售罄</p>  
87 - {{/ isFew}}  
88 - </div>  
89 - <a class="name" href="{{url}}">{{name}}</a>  
90 - <p class="price">  
91 - {{# price}}  
92 - <span class="market-price">¥{{.}}</span>  
93 - {{/ price}}  
94 - <span class="sale-price">¥{{salePrice}}</span>  
95 - </p> 56 + {{> product/good}}
96 {{/ withInfo}} 57 {{/ withInfo}}
97 </div> 58 </div>
98 {{/ recos}} 59 {{/ recos}}
@@ -170,7 +131,7 @@ @@ -170,7 +131,7 @@
170 <li> 131 <li>
171 <a href="{{url}}"> 132 <a href="{{url}}">
172 <span class="bg-img"> 133 <span class="bg-img">
173 - <img src="{{imgUrl}}" alt=""> 134 + <img src="{{thumb}}" alt="">
174 </span> 135 </span>
175 <div class="post-title"> 136 <div class="post-title">
176 <h2>{{title}}</h2> 137 <h2>{{title}}</h2>
@@ -472,109 +472,11 @@ @@ -472,109 +472,11 @@
472 472
473 $commodityWidth: 192px; 473 $commodityWidth: 192px;
474 474
475 -.commodity-info { 475 +.good-info {
476 width: $commodityWidth; 476 width: $commodityWidth;
477 height: 325px; 477 height: 325px;
478 margin-right: 20px; 478 margin-right: 20px;
479 margin-bottom: 20px; 479 margin-bottom: 20px;
480 - float: left;  
481 - font-size: 12px;  
482 -  
483 - * {  
484 - box-sizing: border-box;  
485 - }  
486 - .info-img {  
487 - position: relative;  
488 - }  
489 - .thumb {  
490 - display: block;  
491 - img {  
492 - width: $commodityWidth;  
493 - }  
494 - }  
495 -  
496 - .few-tag {  
497 - position: absolute;  
498 - bottom: 0;  
499 - width: 100%;  
500 - height: 20px;  
501 - background: #ffac5b;  
502 - color: #fff;  
503 - line-height: 20px;  
504 - text-align: center;  
505 - font-size: 12px;  
506 - }  
507 -  
508 - .tag-container {  
509 - height: 20px;  
510 - width: 100%;  
511 - overflow: hidden;  
512 - .good-tag {  
513 - display: block;  
514 - float: left;  
515 - height: 20px;  
516 - font-size: 12px;  
517 - text-align: center;  
518 - line-height: 20px;  
519 - box-sizing: border-box;  
520 - margin-right: 4px;  
521 - &:last-child {  
522 - margin-right: 0;  
523 - }  
524 - }  
525 - .new-tag {  
526 - width: 43px;  
527 - background-color: #78dc7e;  
528 - color: #fff;  
529 - }  
530 - .renew-tag {  
531 - width: 53px;  
532 - background-color: #78dc7e;  
533 - color: #fff;  
534 - }  
535 - .sale-tag {  
536 - width: 43px;  
537 - background-color: #ff575c;  
538 - color: #fff;  
539 - }  
540 - .yohood-tag {  
541 - width: 64px;  
542 - background: image-url('yohood.png') no-repeat;  
543 - background-size: 100% 100%;  
544 - }  
545 - .limit-tag {  
546 - width: 60px;  
547 - line-height: 18px;  
548 - border: 1px solid #000;  
549 - color: #000;  
550 - }  
551 - .yep-tag, .ymp-tag {  
552 - width: 64px;  
553 - background-color: #ff575c;  
554 - color: #fff;  
555 - }  
556 - }  
557 - .name {  
558 - display: block;  
559 - color: #222;  
560 - text-decoration: none;  
561 - max-width: $commodityWidth;  
562 - overflow: hidden;  
563 - white-space: nowrap;  
564 - text-overflow: ellipsis;  
565 - line-height: 36px;  
566 - }  
567 - .price {  
568 - font-weight: bold;  
569 - .market-price {  
570 - margin-right: 5px;  
571 - color: #999;  
572 - text-decoration: line-through;  
573 - }  
574 - .sale-price {  
575 - color: #000;  
576 - }  
577 - }  
578 } 480 }
579 481
580 .share-to .share-a { 482 .share-to .share-a {
@@ -35,7 +35,7 @@ @@ -35,7 +35,7 @@
35 .good-detail-text { 35 .good-detail-text {
36 color: #222; 36 color: #222;
37 font-size: 12px; 37 font-size: 12px;
38 - text-align: center; 38 + text-align: left;
39 39
40 > a { 40 > a {
41 margin-top: 16px; 41 margin-top: 16px;
@@ -86,6 +86,10 @@ @@ -86,6 +86,10 @@
86 &.limit-tag { 86 &.limit-tag {
87 color: #4e4e4e; 87 color: #4e4e4e;
88 border: 1px solid #4e4e4e; 88 border: 1px solid #4e4e4e;
  89 + height: 22px;
  90 + box-sizing: border-box;
  91 + -moz-box-sizing:border-box;
  92 + -webkit-box-sizing:border-box;
89 } 93 }
90 } 94 }
91 } 95 }
@@ -124,10 +124,7 @@ class GuangController extends AbstractAction @@ -124,10 +124,7 @@ class GuangController extends AbstractAction
124 'intro' => '日本设计界宗师', 124 'intro' => '日本设计界宗师',
125 'time' => '2015-03-09 08:26', 125 'time' => '2015-03-09 08:26',
126 'click' => '1128', 126 'click' => '1128',
127 - 'commentNum' => '4',  
128 - 'isLike' => false,  
129 - 'likeNum' => 84,  
130 - 'isCollected' => true, 127 + 'commentNum' => '4'
131 ), 128 ),
132 'content' => array( 129 'content' => array(
133 array( 130 array(
@@ -166,10 +163,10 @@ class GuangController extends AbstractAction @@ -166,10 +163,10 @@ class GuangController extends AbstractAction
166 'isYohood' => false 163 'isYohood' => false
167 ), 164 ),
168 array( 165 array(
169 - 'isReNew' => false 166 + 'isReNew' => true
170 ), 167 ),
171 array( 168 array(
172 - 'isYearEndPromotion' => true 169 + 'isYearEndPromotion' => false
173 ), 170 ),
174 array( 171 array(
175 'isYearMidPromotion' => false 172 'isYearMidPromotion' => false
@@ -279,6 +276,7 @@ class GuangController extends AbstractAction @@ -279,6 +276,7 @@ class GuangController extends AbstractAction
279 ) 276 )
280 ), 277 ),
281 'userInfo' => array( 278 'userInfo' => array(
  279 + 'isLike' => true,
282 'likeNum' => 84, 280 'likeNum' => 84,
283 'isCollected' => true, 281 'isCollected' => true,
284 ), 282 ),
@@ -319,7 +317,7 @@ class GuangController extends AbstractAction @@ -319,7 +317,7 @@ class GuangController extends AbstractAction
319 'relatedPost' => array( 317 'relatedPost' => array(
320 array( 318 array(
321 'url' => 'www.baidu.com', 319 'url' => 'www.baidu.com',
322 - 'imgUrl' => 'http://img11.static.yhbimg.com/yhb-img01/2015/07/27/17/015d433e79035f8e04aeb4f1329418f0e7.jpg?imageView/2/w/250/h/200', 320 + 'thumb' => 'http://img11.static.yhbimg.com/yhb-img01/2015/07/27/17/015d433e79035f8e04aeb4f1329418f0e7.jpg?imageView/2/w/250/h/200',
323 'title' => 'Playboy Special' 321 'title' => 'Playboy Special'
324 ), 322 ),
325 array( 323 array(