chooseProductItem.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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. > view{
  54. display: flex;
  55. align-items: center;
  56. justify-content: space-between;
  57. flex-grow: 1;
  58. width: 100%;
  59. }
  60. .choose-product-item-img{
  61. margin-right: 20rpx;
  62. width: 35%;
  63. position: relative;
  64. overflow: hidden;
  65. border: 1px solid #eee;
  66. padding: 10rpx;
  67. .back-price{
  68. zoom: calc(0.8);
  69. }
  70. .choose-product-item-left-info-code{
  71. color: #666;
  72. position: absolute;
  73. width: 100%;
  74. left:0;
  75. bottom:0;
  76. background: rgba(255,255,255,0.7);
  77. text-align: center;
  78. }
  79. }
  80. .choose-product-item-info{
  81. margin-right: 10rpx;
  82. width: 65%;
  83. flex-grow: 1;
  84. .choose-product-item-left-info-price{
  85. display: flex;
  86. align-items:center;
  87. justify-content: space-between;
  88. >view{
  89. &:last-child{
  90. display: flex;
  91. align-items:center;
  92. }
  93. }
  94. }
  95. .choose-product-item-left-info-name{
  96. font-size: 28rpx;
  97. font-weight: 900;
  98. color: #666;
  99. }
  100. .choose-product-item-left-info-guige{
  101. color: #2196F3;
  102. margin: 10rpx 0;
  103. text{
  104. margin-right: 10rpx;
  105. }
  106. }
  107. }
  108. }
  109. </style>