chooseProductItemSkline.vue 4.4 KB

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