chooseProductItem.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <template>
  2. <view class="choose-product-item" :style="{width:width + 'px'}">
  3. <view>
  4. <view class="choose-product-item-img">
  5. <u-image :src="item.productImage+'?x-oss-process=image/resize,p_50'" height="200rpx" width="100%"></u-image>
  6. <view class="back-price" v-if="item.promoRuleValue">返<text>{{item.promoRuleValue}}</text>元</view>
  7. <view class="choose-product-item-left-info-code ellipsis-one">{{item.productCode}}</view>
  8. </view>
  9. <view class="choose-product-item-info">
  10. <view class="choose-product-item-left-info-name ellipsis-two">{{item.productName}}</view>
  11. <view class="choose-product-item-left-info-guige ellipsis-two">{{item.productOrigCode}}</view>
  12. <view class="choose-product-item-left-info-price">
  13. <view class="price-txt">¥<text>{{item.cost}}</text></view>
  14. <view>
  15. <u-number-box v-model="item.qty" :index="item.id" :input-width="60" :input-height="60" size="mini" :min="1" @change="changeQty"></u-number-box>
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. export default {
  24. name: 'chooseProductItem',
  25. props: {
  26. item: {
  27. type: Object,
  28. default: () => {}
  29. },
  30. width: {
  31. type: Number,
  32. default: 730
  33. }
  34. },
  35. data() {
  36. return {
  37. }
  38. },
  39. methods: {
  40. changeQty(e) {
  41. this.$emit('changeQty', e)
  42. }
  43. }
  44. }
  45. </script>
  46. <style lang="less">
  47. .choose-product-item{
  48. display: flex;
  49. align-items: center;
  50. justify-content: space-between;
  51. padding: 20rpx 0;
  52. border-bottom: 1px solid #eee;
  53. .price-txt{
  54. color: red;
  55. text{
  56. font-size: 36rpx;
  57. }
  58. }
  59. > view{
  60. display: flex;
  61. align-items: center;
  62. justify-content: space-between;
  63. flex-grow: 1;
  64. width: 100%;
  65. }
  66. .choose-product-item-img{
  67. margin-right: 20rpx;
  68. width: 35%;
  69. position: relative;
  70. overflow: hidden;
  71. border: 1px solid #eee;
  72. padding: 10rpx;
  73. .back-price{
  74. zoom: calc(0.8);
  75. }
  76. .choose-product-item-left-info-code{
  77. color: #666;
  78. position: absolute;
  79. width: 100%;
  80. left:0;
  81. bottom:0;
  82. background: rgba(255,255,255,0.7);
  83. text-align: center;
  84. }
  85. }
  86. .choose-product-item-info{
  87. margin-right: 10rpx;
  88. width: 65%;
  89. flex-grow: 1;
  90. .choose-product-item-left-info-price{
  91. display: flex;
  92. align-items:center;
  93. justify-content: space-between;
  94. >view{
  95. &:last-child{
  96. display: flex;
  97. align-items:center;
  98. }
  99. }
  100. }
  101. .choose-product-item-left-info-name{
  102. font-size: 28rpx;
  103. font-weight: 900;
  104. color: #666;
  105. }
  106. .choose-product-item-left-info-guige{
  107. color: #2196F3;
  108. margin: 10rpx 0;
  109. text{
  110. margin-right: 10rpx;
  111. }
  112. }
  113. }
  114. }
  115. </style>