RecommendProduct.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. <template>
  2. <div id="recommend-fragment" v-if="commodities && commodities.length > 0">
  3. <div class="recommend-list">
  4. <ul>
  5. <li ng-repeat="commodity in commodities">
  6. <div class="img"><a href="javascript:void(0);"><img ng-src="commodity.comImg"/></a></div>
  7. <div class="content">
  8. <p ng-bind="commodity.comCode">MRFE6S9045NF001</p>
  9. <p class="color666" ng-bind="commodity.brandNameCn">PANFAEFQ</p>
  10. <p class="price" ng-if="commodity.minPriceRMB">¥ commodity.minPriceRMB</p>
  11. <p class="price" ng-if="!commodity.minPriceRMB">$ commodity.minPriceUSD || 0</p>
  12. </div>
  13. <div class="hover-show" ng-href="commodity.batchCode ? 'store/' + storeInfo.uuid + '#/batchInfo/' + commodity.batchCode : ''">
  14. <a ng-href="commodity.batchCode ? 'store/' + storeInfo.uuid + '#/batchInfo/' + commodity.batchCode : ''" class="href">
  15. <div class="title" ng-bind="commodity.comCode">MRFE6S9045NF001</div>
  16. <div class="type" ng-bind="commodity.brandNameCn">PANFAEFQ</div>
  17. <div class="hr"><span>抢购价</span></div>
  18. <div class="price" ng-if="commodity.minPriceRMB">¥ commodity.minPriceRMB</div>
  19. <div class="price" ng-if="!commodity.minPriceRMB">$ commodity.minPriceUSD || 0</div>
  20. </a>
  21. <div class="by-cart"><button title="加入购物车" ng-click="addToCart(commodity, false, commodity.minBuyQty, commodity.currency)"><img src="static/img/icon/cart-blue.png"/></button></div>
  22. <div class="buy-now"><button title="立即购买" ng-click="addToCart(commodity, true, commodity.minBuyQty, commodity.currency)">立即购买</button></div>
  23. </div>
  24. </li>
  25. </ul>
  26. </div>
  27. </div>
  28. </template>
  29. <script>
  30. export default {
  31. name: 'recommend-product',
  32. computed: {
  33. commodities () {
  34. return this.$store.state.shop.recommend.products.data
  35. }
  36. }
  37. }
  38. </script>
  39. <style scoped>
  40. #recommend-fragment{
  41. width: 1190px;
  42. margin: 0 auto;
  43. }
  44. .recommend-list{
  45. width: 100%;
  46. margin: 0 auto;
  47. display: inline-block;
  48. }
  49. #recommend-fragment ul{
  50. width: 100%;
  51. margin: 0 auto;
  52. display: inline-block;
  53. -webkit-padding-start: 0;
  54. }
  55. #recommend-fragment ul li{
  56. float: left;
  57. width: 218px;
  58. height: 260px;
  59. border: #d2d2d2 1px solid;
  60. position: relative;
  61. overflow: hidden;
  62. margin-right: 25px;
  63. margin-bottom: 20px;
  64. }
  65. #recommend-fragment ul li:nth-child(5n){
  66. margin-right: 0;
  67. }
  68. #recommend-fragment ul li .img{
  69. height: 175px;
  70. text-align: center;
  71. line-height: 170px;
  72. }
  73. #recommend-fragment ul li .img img{
  74. max-width: 120px;
  75. max-height: 120px;
  76. }
  77. #recommend-fragment ul li .content{
  78. width: 100%;
  79. margin: 0 auto;
  80. }
  81. #recommend-fragment ul li .content p{
  82. width: 90%;
  83. display: inline-block;
  84. line-height: 22px;
  85. font-size: 14px;
  86. overflow: hidden;
  87. text-overflow: ellipsis;
  88. white-space: nowrap;
  89. margin-bottom: 0;
  90. padding-left: 10px;
  91. }
  92. #recommend-fragment ul li .content p.price{
  93. color: #ff9000;
  94. font-size: 16px;
  95. font-weight: bold;
  96. }
  97. .color666{
  98. color: #666;
  99. }
  100. #recommend-fragment ul li .hover-show{
  101. width: 100%;
  102. height: 100%;
  103. position: absolute;
  104. top: 100%;
  105. left: 0;
  106. background: rgba(80,120,203,.85);
  107. padding: 30px 10px;
  108. }
  109. #recommend-fragment ul li:hover .hover-show{
  110. top: 0;
  111. transition: top .5s ease-in;
  112. }
  113. #recommend-fragment ul li .hover-show div{
  114. width: 100%;
  115. margin: 0 auto;
  116. text-align: left;
  117. color: #fff;
  118. line-height: 25px;
  119. }
  120. #recommend-fragment ul li .hover-show .title{
  121. font-size: 18px;
  122. margin-top: 8px;
  123. text-overflow: ellipsis;
  124. white-space: nowrap;
  125. overflow: hidden;
  126. margin-bottom: 0;
  127. }
  128. #recommend-fragment ul li .hover-show .type{
  129. font-size: 14px;
  130. }
  131. #recommend-fragment ul li .hover-show .hr{
  132. text-align: center;
  133. margin-top: 5px;
  134. }
  135. #recommend-fragment ul li .hover-show .hr span{
  136. font-size: 16px;
  137. position: relative;
  138. }
  139. #recommend-fragment ul li .hover-show .hr span:before,#recommend-fragment ul li .hover-show .hr span:after{
  140. content: '';
  141. position: absolute;
  142. display: inline-block;
  143. width: 65px;
  144. height: 1px;
  145. background: #fff;
  146. top: 10px;
  147. }
  148. #recommend-fragment ul li .hover-show .hr span:before{
  149. left: 53px;
  150. }
  151. #recommend-fragment ul li .hover-show .hr span:after{
  152. right: 53px;
  153. }
  154. #recommend-fragment ul li .hover-show .price{
  155. font-size: 20px;
  156. text-align: center;
  157. line-height: 48px;
  158. }
  159. #recommend-fragment ul li .hover-show .by-cart,#recommend-fragment ul li .hover-show .buy-now{
  160. text-align: center;
  161. position: absolute;
  162. }
  163. #recommend-fragment ul li .hover-show .by-cart{
  164. bottom: 50px;
  165. }
  166. #recommend-fragment ul li .hover-show .buy-now{
  167. bottom: 15px;
  168. }
  169. #recommend-fragment ul li .hover-show .by-cart button{
  170. display: inline-block;
  171. width: 38px;
  172. height: 38px;
  173. border-radius: 100%;
  174. background: #fff;
  175. line-height: 38px;
  176. margin-bottom: 5px;
  177. cursor: pointer;
  178. border: none;
  179. z-index: 100;
  180. position: relative;
  181. }
  182. #recommend-fragment ul li .hover-show .buy-now button{
  183. display: inline-block;
  184. width: 90px;
  185. height: 34px;
  186. text-align: center;
  187. font-size: 14px;
  188. border-radius: 4px;
  189. background: #df1b0f;
  190. line-height: 34px;
  191. color: #fff;
  192. cursor: pointer;
  193. border: none;
  194. z-index: 100;
  195. position: relative;
  196. }
  197. #recommend-fragment ul li .hover-show .buy-now button:hover{
  198. background: #f00;
  199. }
  200. #recommend-fragment ul li a.href{
  201. display: inline-block;
  202. position: relative;
  203. z-index: 10;
  204. width: 100%;
  205. text-align: center;
  206. height: 260px;
  207. }
  208. </style>