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