partList.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. <template>
  2. <view class="partList-box">
  3. <view class="partList-title flex align_center justify_between">
  4. <text>配件列表</text>
  5. <view>
  6. {{list.length}}款,共<text>{{totalNums}}</text>件
  7. </view>
  8. </view>
  9. <view class="partList-list">
  10. <view class="partList-list-box" v-for="item in partList" :key="item.id">
  11. <view class="product flex align_center">
  12. <view class="checkbox"><u-checkbox size="40" shape="circle"></u-checkbox></view>
  13. <view class="flex align_center">
  14. <view class="pimgs">
  15. <u-image width="128" height="128" border-radius="10"></u-image>
  16. </view>
  17. <view class="pinfo">
  18. <view class="pname">
  19. 箭牌机油滤清器 10 款进口大众途锐 5.0L V10
  20. </view>
  21. <view class="ptxt flex align_center justify_between">
  22. <view>
  23. <text class="pcode">JB-11066A</text>
  24. </view>
  25. <view>
  26. 调回数量:<text class="pnums">3个</text>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. <view class="ptools flex align_center justify_between">
  33. <view></view>
  34. <view class="pcurnums">
  35. <text>实退数量</text>
  36. <u-number-box :min="1"></u-number-box>
  37. </view>
  38. </view>
  39. </view>
  40. <view class="nodata" v-if="list.length==0">
  41. <u-empty :src="`/static/${$config('themePath')}/def_no_data@3x.png`" icon-size="120" :text="noDataText" img-width="120" mode="list"></u-empty>
  42. </view>
  43. </view>
  44. </view>
  45. </template>
  46. <script>
  47. export default {
  48. props: {
  49. list: {
  50. type: Array,
  51. default: function(){
  52. return []
  53. }
  54. },
  55. noDataText: {
  56. type: String,
  57. default: '暂无配件'
  58. }
  59. },
  60. watch: {
  61. list(newValue, oldValue) {
  62. this.partList = newValue
  63. }
  64. },
  65. computed: {
  66. totalNums() {
  67. let ret = 0
  68. this.list.map(item => {
  69. ret = ret + item.qty
  70. })
  71. return ret
  72. }
  73. },
  74. data() {
  75. return {
  76. partList: this.list
  77. }
  78. },
  79. methods: {
  80. }
  81. }
  82. </script>
  83. <style lang="less" scoped>
  84. .partList-box{
  85. .nodata{
  86. padding: 10vh 0;
  87. }
  88. .partList-title{
  89. padding: 20rpx 0;
  90. > text{
  91. font-size: 32rpx;
  92. color: #222222;
  93. }
  94. > view{
  95. font-size: 32rpx;
  96. text{
  97. color: red;
  98. margin: 0 5rpx;
  99. }
  100. }
  101. }
  102. .partList-list-box{
  103. padding: 10px 0;
  104. border-bottom: 2rpx solid #f5f5f5;
  105. &:last-child{
  106. border:0;
  107. }
  108. .product{
  109. flex-grow: 1;
  110. .pinfo{
  111. flex-grow: 1;
  112. padding-left: 20rpx;
  113. .pname{
  114. font-size: 32rpx;
  115. color: #191919;
  116. font-weight: bold;
  117. margin-bottom: 10rpx;
  118. }
  119. .pno{
  120. background-color: rgba(3, 54, 146, 0.15);
  121. border-radius: 50rpx;
  122. padding: 0 20rpx;
  123. color: #033692;
  124. font-size: 24rpx;
  125. margin-right: 10rpx;
  126. }
  127. .ptxt{
  128. font-size: 28rpx;
  129. color: #999;
  130. .pnums{
  131. color: #222;
  132. }
  133. }
  134. }
  135. }
  136. .ptools{
  137. margin-top: 20rpx;
  138. .pcurnums{
  139. > text{
  140. margin-right: 20rpx;
  141. }
  142. }
  143. }
  144. }
  145. }
  146. </style>