chooseProductItem.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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. {{item.qty}}
  16. <!-- <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> -->
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. export default {
  25. name: 'chooseProductItem',
  26. props: {
  27. item: {
  28. type: Object,
  29. default: () => {}
  30. },
  31. width: {
  32. type: Number,
  33. default: 730
  34. }
  35. },
  36. data() {
  37. return {
  38. }
  39. },
  40. methods: {
  41. changeQty(e) {
  42. this.$emit('changeQty', e)
  43. }
  44. }
  45. }
  46. </script>
  47. <style lang="less">
  48. .choose-product-item{
  49. display: flex;
  50. align-items: center;
  51. justify-content: space-between;
  52. padding: 20rpx 0;
  53. border-bottom: 1px solid #eee;
  54. > view{
  55. display: flex;
  56. align-items: center;
  57. justify-content: space-between;
  58. flex-grow: 1;
  59. width: 100%;
  60. }
  61. .choose-product-item-img{
  62. margin-right: 20rpx;
  63. width: 35%;
  64. position: relative;
  65. overflow: hidden;
  66. border: 1px solid #eee;
  67. padding: 10rpx;
  68. .back-price{
  69. zoom: calc(0.8);
  70. }
  71. .choose-product-item-left-info-code{
  72. color: #666;
  73. position: absolute;
  74. width: 100%;
  75. left:0;
  76. bottom:0;
  77. background: rgba(255,255,255,0.7);
  78. text-align: center;
  79. }
  80. }
  81. .choose-product-item-info{
  82. margin-right: 10rpx;
  83. width: 65%;
  84. flex-grow: 1;
  85. .choose-product-item-left-info-price{
  86. display: flex;
  87. align-items:center;
  88. justify-content: space-between;
  89. >view{
  90. &:last-child{
  91. display: flex;
  92. align-items:center;
  93. }
  94. }
  95. }
  96. .choose-product-item-left-info-name{
  97. font-size: 28rpx;
  98. font-weight: 900;
  99. color: #666;
  100. }
  101. .choose-product-item-left-info-guige{
  102. color: #2196F3;
  103. margin: 10rpx 0;
  104. text{
  105. margin-right: 10rpx;
  106. }
  107. }
  108. }
  109. }
  110. </style>