productItemSkline.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <template>
  2. <view
  3. class="product-list"
  4. >
  5. <view
  6. class="product-item"
  7. :style="{width:itemWidth+'px',marginTop:gap+'px'}"
  8. v-for="(item,index) in list"
  9. :key="item.id"
  10. @click="toDetail(item)">
  11. <view>
  12. <image mode="aspectFit" :src="item.productImage ? item.productImage+'?x-oss-process=image/resize,p_30':'/static/def_imgs.png'" style="height: 140px;width: 100%;"></image>
  13. <view class="back-price xiajia" v-if="item.status==0||!item.status">下架</view>
  14. <view class="back-price xiajia" v-else-if="item.dealerScopeFlag==0">售罄</view>
  15. <view class="product-code"><text :max-lines="1" overflow="ellipsis">{{item.productCode}}</text></view>
  16. </view>
  17. <view>
  18. <view class="product-name"><text :max-lines="2" overflow="ellipsis">{{item.productName}}</text></view>
  19. <view class="product-guige"><text :max-lines="2" overflow="ellipsis">{{item.productOrigCode}}</text></view>
  20. <view class="product-button">
  21. <view class="price-txt">
  22. ¥<text>{{item.priceStr[0]}}</text>.{{item.priceStr[1]}}
  23. </view>
  24. <view class="flex align_center rebate-tag" v-if="item.promoType=='BUY_PROD_GIVE_VALID'">
  25. 返<text>{{item.resultValue}}</text>元
  26. </view>
  27. <view class="flex align_center rebate-tag" v-if="item.promoType=='BUY_PROD_GIVE_PROD'">
  28. 买{{item.conditionValue}}赠{{item.resultValue}}
  29. </view>
  30. <view class="flex align_center tejia-tag" v-if="item.promoType=='PROMO_PROD'">
  31. 特价<text>¥{{item.orginPrice}}</text>
  32. </view>
  33. <view class="flex align_center tejia-tag" v-if="item.shopProductSubsidy&&item.shopProductSubsidy.subsidyAmount<item.price&&!item.shopPromoProduct&&showBalanceAuth">
  34. 可抵扣<text>¥{{item.shopProductSubsidy.subsidyAmount}}</text>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. </template>
  41. <script>
  42. export default {
  43. name: 'productItemSkline',
  44. props: {
  45. list: {
  46. type: Array,
  47. default: () => []
  48. },
  49. index:{
  50. type: [Number,String],
  51. default: 0
  52. },
  53. gap:{
  54. type: [Number,String],
  55. default: 10
  56. },
  57. itemWidth:{
  58. type: [Number,String],
  59. default: 0
  60. }
  61. },
  62. data() {
  63. return {
  64. }
  65. },
  66. computed:{
  67. // 抵扣余额支付是否可用
  68. showBalanceAuth(){
  69. return this.$store.state.vuex_showBalanceAuth
  70. },
  71. },
  72. methods: {
  73. toDetail(item){
  74. this.$emit('detail',item)
  75. }
  76. },
  77. }
  78. </script>
  79. <style lang="less">
  80. .product-list{
  81. display:flex;
  82. flex-wrap: wrap;
  83. justify-content: space-between;
  84. padding: 0 2%;
  85. }
  86. .product-item{
  87. background: #ffffff;
  88. border-radius: 10upx;
  89. box-shadow: 1px 1px 3px #EEEEEE;
  90. width: 48%;
  91. margin: 10px 0 0 0;
  92. display: flex;
  93. flex-direction: column;
  94. .price-txt{
  95. color: red;
  96. display: flex;
  97. align-items: baseline;
  98. font-size: 12px;
  99. text{
  100. font-size: 36rpx;
  101. }
  102. }
  103. .back-price{
  104. zoom: calc(0.8);
  105. padding: 6rpx 65rpx;
  106. position: absolute;
  107. top: 18rpx;
  108. right: -45rpx;
  109. z-index: 2;
  110. font-size: 20rpx;
  111. text-align: center;
  112. transform: rotate(40deg);
  113. display: flex;
  114. align-items: center;
  115. text{
  116. font-size: 28rpx;
  117. margin: 0 5rpx;
  118. }
  119. }
  120. .xiajia{
  121. background: #ececec;
  122. color: #5f5f5f;
  123. }
  124. .fantext{
  125. background: rgba(255 ,87 ,34 , 1);
  126. color: #fff;
  127. font-size: 8px;
  128. }
  129. > view{
  130. &:first-child{
  131. position: relative;
  132. overflow: hidden;
  133. .product-code{
  134. color: #666;
  135. position: absolute;
  136. width: 100%;
  137. left:0;
  138. bottom:0;
  139. background: rgba(255,255,255,0.7);
  140. text-align: center;
  141. }
  142. }
  143. &:last-child{
  144. position: relative;
  145. flex-grow: 1;
  146. padding: 10px 10px 35px;
  147. .product-name{
  148. font-size: 28rpx;
  149. color: #333;
  150. }
  151. .product-guige{
  152. margin: 10rpx 0;
  153. color: #2196F3;
  154. }
  155. }
  156. .product-button{
  157. position: absolute;
  158. left: 5%;
  159. bottom: 0;
  160. width: 90%;
  161. padding: 5px 0 10px;
  162. display: flex;
  163. align-items: center;
  164. .rebate-tag{
  165. background: #ffe7df;
  166. color: #E91E63;
  167. padding: 2px 5px;
  168. font-size: 10px;
  169. border-radius: 3px;
  170. margin-left: 6px;
  171. }
  172. .tejia-tag{
  173. color: #E91E63;
  174. margin-left: 6px;
  175. font-size: 12px;
  176. text{
  177. font-size: 12px;
  178. color: #999;
  179. margin-left: 5px;
  180. text-decoration: line-through;
  181. }
  182. }
  183. }
  184. }
  185. }
  186. </style>