<div class="show-page">
<ol class="breadcrumb">
<li><a href="<%= root_path %>">所有宝贝</a></li>
<li class="active"><%= @product.category.parent.title %></li>
<li><a href="<%= category_path @product.category %>"><%= @product.category.title %></a></li>
<li class="active"><%= @product.title %></li>
</ol>
<!-- Start of product card -->
<div class="container card">
<!-- Start of left card -->
<div class="preview col-md-7 " style="">
<% if @product.product_images.present? %>
<% if @product.product_images.count > 4 %>
<div class="preview-pic tab-content" >
<div class="tab-pane active" id="pic-1"><img src=<%= qiniu_image_path(@product.product_images[0].image.url) %>></div>
<div class="tab-pane" id="pic-2"><img src=<%= qiniu_image_path(@product.product_images[1].image.url) %>></div>
<div class="tab-pane" id="pic-3"><img src=<%= qiniu_image_path(@product.product_images[2].image.url) %>></div>
<div class="tab-pane" id="pic-4"><img src=<%= qiniu_image_path(@product.product_images[3].image.url) %>></div>
<div class="tab-pane" id="pic-5"><img src=<%= qiniu_image_path(@product.product_images[4].image.url) %>></div>
</div>
<ul class="preview-thumbnail nav nav-tabs">
<li class="active"><a data-target="#pic-1" data-toggle="tab"><img src=<%= qiniu_image_path(@product.product_images[0].image.url) %>></li>
<li><a data-target="#pic-2" data-toggle="tab"><img src=<%= qiniu_image_path(@product.product_images[1].image.url) %>></li>
<li><a data-target="#pic-3" data-toggle="tab"><img src=<%= qiniu_image_path(@product.product_images[2].image.url) %>></li>
<li><a data-target="#pic-4" data-toggle="tab"><img src=<%= qiniu_image_path(@product.product_images[3].image.url) %>></li>
<li><a data-target="#pic-5" data-toggle="tab"><img src=<%= qiniu_image_path(@product.product_images[4].image.url) %>></li>
</ul>
<% else %>
<div class="preview-pic tab-content" >
<img src=<%= qiniu_image_path(product.main_product_image.image.url) %>>
</div>
<% end %>
<% else %>
<div class="preview-pic tab-content" >
<%= image_tag("http://placehold.it/200x200&text=No Pic") %>
</div>
<% end %>
</div>
<!-- End of left card -->
<!-- Start of right cart -->
<div class="details col-md-5" style="margin-top:50px;">
<h3 class="product-title"><%= @product.title %></h3>
<div class="price-service">
<p class="price">原价 <span class="rmb">¥ </span><span class="msrp"><%= @product.msrp.to_i %></span> 元</p>
<p class="price">现价 <span class="rmb">¥ </span><span class="price"><%= @product.price %></span> 元</p>
<p class="service">服务 <span class="service-detail">7天无忧退货 | 48小时快速退款 | 正品保证</span></p>
</div>
<div class="quantity-size">
<p class="delivery">运费 <span class="delivery">全场包邮</span></p>
<p class="quantity">库存 <span class="quantity"><%= @product.quantity %></span> 件 </p>
<!-- <p>购买:      <input type="text" style="width:50px" name="quantity" value="1" /> 件</p> -->
</div>
<div class="action">
<div class="col-md-10" >
<% if @product.quantity.present? && @product.quantity > 0 %>
<%= link_to("加入购物车", add_to_cart_product_path(@product), method: :post,
class: "add-to-cart btn btn-block") %>
<% else %>
已销售一空,无法购买
<% end %>
</div>
<div class="col-md-2" >
<% if current_user %>
<% if !current_user.is_fan_of?(@product) %>
<%= link_to favorite_product_path(@product), :class => "like btn btn-default", method: :post do %>
<i class="fa fa-heart fa-lg"></i>
<% end %>
<% else %>
<%= link_to unfavorite_product_path(@product), :class => "unlike btn btn-default", method: :post do %>
<i class="fa fa-heart fa-lg"></i>
<% end %>
<% end %>
<% else %>
<%= link_to favorite_product_path(@product), :class => "like btn btn-default",method: :post do %>
<i class="fa fa-heart fa-lg"></i>
<% end %>
<% end %>
</div>
</div>
<div class="row share">
<hr />
<div class="col-md-6">
<p> 收藏人气(<%= @product.fans.count %>) </p>
</div>
<div class="col-md-6">
<%= link_to like_product_path(@product), method: :put do %>
<div class="pi-thumbs-up">
点赞(<%= @product.get_upvotes.size %>)
</div>
<% end %>
</div>
</div>
<div class="row share">
<div class="col-md-6 ">
<p><i class="fa fa-share-alt" aria-hidden="true"></i> 分享 </p>
</div>
<div class="col-md-6" style="margin-left:-40px;">
<%= social_share_button_tag(@product.title) %><!-- 社交分享 -->
</div>
</div>
</div><!-- End of left card -->
</div><!-- End of product card -->
<!-- Start of product description & reviews -->
<div class="row product_description col-md-12">
<div class="tabs" >
<div class="tabbable-panel">
<div class="tabbable-line">
<ul class="nav nav-tabs">
<li role="presentation" class="active">
<a href="#tab_default_1" data-toggle="tab">宝贝详情</a>
</li>
<li>
<a href="#tab_default_2" data-toggle="tab">宝贝评价(<%= @product.reviews.count %>) </a>
</li>
</ul>
<br />
<div class="tab-content">
<div class="tab-pane active" id="tab_default_1">
<p class="product-description"><%= @product.description.html_safe %></p>
<p class="product-description2 text-center">产品展示</p>
<!--商品大图展示 -->
<div class="row">
<% @product.product_images.each do |product_image| %>
<div class="col-xs-12 col-md-12 product-show-detail">
<img src=<%= qiniu_image_path(product_image.image.url) %>>
</div>
<% end %>
</div>
<div class="faq">
<p class="faq-title text-center">常见问题</p>
<p class="question">使用什么快递发货?</p>
<p class="answer">伴客默认使用顺丰快递发货,配送范围覆盖全国大部分地区(港澳台地区除外)。</p>
<p class="question">如何申请退货?</p>
<p class="answer">
1.自收到商品之日起7日内,顾客可申请无忧退货,退款将原路返还,不同的银行处理时间不同,预计1-5个工作日到账;<br />
2.退货流程:<br />
确认收货-申请退货-客服审核通过-用户寄回商品-仓库签收验货-退款审核-退款完成;<br />
3.因MONSOON产生的退货,如质量问题,退货邮费由MONSOON承担,退款完成后钱款将沿原渠道返还。因客户个人原因产生的退货,购买和寄回运费由客户个人承担。<br />
</p>
<p class="question">如何开具发票?</p>
<p class="answer">如需开具普通发票,请在下单时联系客服办理,我们将虽货物一起快递给您;</p>
</div>
</div><!-- End of tab_default_1 -->
<div class="tab-pane" id="tab_default_2">
<div class="row">
<div class="col-sm-12 ">
<h4>
<%= @product.reviews.count %> Reviews
</h4>
<hr>
<div >
<%= render @product.reviews%>
<%= render "reviews/form"%>
</div>
</div>
</div>
</div><!-- End of tab_default_2 -->
</div><!-- End of tab-content -->
</div><!-- End of tabbable-line -->
</div><!-- End of tabbable-panel -->
</div><!-- End of tabs -->
</div><!-- End of product description & reviews -->
</div><!-- End of product show page -->