RecommendProduct.vue 5.5 KB

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