chooseProductItemSkline.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  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&&showBalanceAuth">
  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. computed:{
  76. // 抵扣余额支付是否可用
  77. showBalanceAuth(){
  78. return this.$store.state.vuex_showBalanceAuth
  79. },
  80. },
  81. methods: {
  82. toDetail(item){
  83. this.$emit('toDetail',item)
  84. }
  85. }
  86. }
  87. </script>
  88. <style lang="less">
  89. @import '/flex.css';
  90. .choose-product-item{
  91. display: flex;
  92. align-items: center;
  93. justify-content: space-between;
  94. padding: 10px;
  95. border-bottom: 1px solid #eee;
  96. .price-txt{
  97. color: red;
  98. display: flex;
  99. align-items: baseline;
  100. font-size: 12px;
  101. text{
  102. font-size: 36rpx;
  103. }
  104. }
  105. > view{
  106. display: flex;
  107. align-items: center;
  108. justify-content: space-between;
  109. &::first-child{
  110. flex-grow: 1;
  111. }
  112. }
  113. .choose-product-item-img{
  114. margin-right: 20rpx;
  115. width: 30%;
  116. height: 180rpx;
  117. position: relative;
  118. overflow: hidden;
  119. border: 1px solid #f8f8f8;
  120. border-radius: 5px;
  121. padding: 10rpx;
  122. .back-price{
  123. zoom: calc(0.8);
  124. padding: 6rpx 65rpx;
  125. position: absolute;
  126. top: 18rpx;
  127. right: -45rpx;
  128. z-index: 2;
  129. font-size: 20rpx;
  130. text-align: center;
  131. transform: rotate(40deg);
  132. display: flex;
  133. align-items: center;
  134. text{
  135. font-size: 28rpx;
  136. margin: 0 5rpx;
  137. }
  138. }
  139. .xiajia{
  140. background: #ececec;
  141. color: #5f5f5f;
  142. }
  143. .fantext{
  144. background: rgba(255 ,87 ,34 , 1);
  145. color: #fff;
  146. font-size: 8px;
  147. }
  148. .choose-product-item-left-info-code{
  149. color: #666;
  150. position: absolute;
  151. width: 100%;
  152. left:0;
  153. bottom:0;
  154. background: rgba(255,255,255,0.7);
  155. text-align: center;
  156. }
  157. }
  158. .choose-product-item-info{
  159. margin-right: 10rpx;
  160. width: 70%;
  161. flex-grow: 1;
  162. .choose-product-item-left-info-price{
  163. display: flex;
  164. align-items:center;
  165. .rebate-tag{
  166. background: #ffe7df;
  167. color: #E91E63;
  168. padding: 2px 5px;
  169. font-size: 10px;
  170. border-radius: 3px;
  171. margin-left: 6px;
  172. }
  173. .tejia-tag{
  174. color: #E91E63;
  175. margin-left: 6px;
  176. font-size: 12px;
  177. text{
  178. font-size: 12px;
  179. color: #999;
  180. margin-left: 5px;
  181. text-decoration: line-through;
  182. }
  183. }
  184. }
  185. .choose-product-item-left-info-name{
  186. font-size: 28rpx;
  187. color: #666;
  188. }
  189. .choose-product-item-left-info-guige{
  190. color: #2196F3;
  191. margin: 10rpx 0;
  192. text{
  193. margin-right: 10rpx;
  194. }
  195. }
  196. }
  197. }
  198. </style>