chooseProductItemSkline.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  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 class="flex align_center rebate-tag" v-if="isLogin&&item.shopProductSubsidy&&item.shopProductSubsidy.subsidyAmount<item.price&&!item.shopPromoProduct">
  39. 可抵扣<text>¥{{item.shopProductSubsidy.subsidyAmount}}</text>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. <view class="flex align_center justify_center">
  45. <uni-icons type="arrowright" size="20" color="#999"></uni-icons>
  46. </view>
  47. </view>
  48. </block>
  49. </template>
  50. <script>
  51. export default {
  52. name: 'chooseProductItemSkline',
  53. props: {
  54. index: {
  55. type: Number,
  56. default: 0
  57. },
  58. list: {
  59. type: Array,
  60. default: () => []
  61. },
  62. edit: {
  63. type: Boolean,
  64. default: false
  65. },
  66. isLogin:{
  67. type: Boolean,
  68. default: false
  69. }
  70. },
  71. data() {
  72. return {
  73. }
  74. },
  75. methods: {
  76. toDetail(item){
  77. this.$emit('toDetail',item)
  78. }
  79. }
  80. }
  81. </script>
  82. <style lang="less">
  83. @import '/flex.css';
  84. .choose-product-item{
  85. display: flex;
  86. align-items: center;
  87. justify-content: space-between;
  88. padding: 10px;
  89. border-bottom: 1px solid #eee;
  90. .price-txt{
  91. color: red;
  92. display: flex;
  93. align-items: baseline;
  94. font-size: 12px;
  95. text{
  96. font-size: 36rpx;
  97. }
  98. }
  99. > view{
  100. display: flex;
  101. align-items: center;
  102. justify-content: space-between;
  103. &::first-child{
  104. flex-grow: 1;
  105. }
  106. }
  107. .choose-product-item-img{
  108. margin-right: 20rpx;
  109. width: 30%;
  110. height: 180rpx;
  111. position: relative;
  112. overflow: hidden;
  113. border: 1px solid #f8f8f8;
  114. border-radius: 5px;
  115. padding: 10rpx;
  116. .back-price{
  117. zoom: calc(0.8);
  118. padding: 6rpx 65rpx;
  119. position: absolute;
  120. top: 18rpx;
  121. right: -45rpx;
  122. z-index: 2;
  123. font-size: 20rpx;
  124. text-align: center;
  125. transform: rotate(40deg);
  126. display: flex;
  127. align-items: center;
  128. text{
  129. font-size: 28rpx;
  130. margin: 0 5rpx;
  131. }
  132. }
  133. .xiajia{
  134. background: #ececec;
  135. color: #5f5f5f;
  136. }
  137. .fantext{
  138. background: rgba(255 ,87 ,34 , 1);
  139. color: #fff;
  140. font-size: 8px;
  141. }
  142. .choose-product-item-left-info-code{
  143. color: #666;
  144. position: absolute;
  145. width: 100%;
  146. left:0;
  147. bottom:0;
  148. background: rgba(255,255,255,0.7);
  149. text-align: center;
  150. }
  151. }
  152. .choose-product-item-info{
  153. margin-right: 10rpx;
  154. width: 70%;
  155. flex-grow: 1;
  156. .choose-product-item-left-info-price{
  157. display: flex;
  158. align-items:center;
  159. .rebate-tag{
  160. background: #ffe7df;
  161. color: #E91E63;
  162. padding: 2px 5px;
  163. font-size: 10px;
  164. border-radius: 3px;
  165. margin-left: 6px;
  166. }
  167. .tejia-tag{
  168. color: #E91E63;
  169. margin-left: 6px;
  170. font-size: 12px;
  171. text{
  172. font-size: 12px;
  173. color: #999;
  174. margin-left: 5px;
  175. text-decoration: line-through;
  176. }
  177. }
  178. }
  179. .choose-product-item-left-info-name{
  180. font-size: 28rpx;
  181. color: #666;
  182. }
  183. .choose-product-item-left-info-guige{
  184. color: #2196F3;
  185. margin: 10rpx 0;
  186. text{
  187. margin-right: 10rpx;
  188. }
  189. }
  190. }
  191. }
  192. </style>