index.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <template>
  2. <view class='container '>
  3. <view class='content'>
  4. <text class='title'>{{title}}</text>
  5. <view class='item-table' scroll-y v-for="(item,index) in products" :key='index'>
  6. <view class="uni-row table-layout">
  7. <text class='tbhead left'>产品描述</text>
  8. <text class='tbhead right'>{{item['description']}}</text>
  9. </view>
  10. <view class="uni-row table-layout">
  11. <text class='tbbody left'>批次</text>
  12. <text class='tbbody right'>{{item['batch']}}</Text>
  13. </view>
  14. <view class="uni-row table-layout">
  15. <text class='tbbody left'>箱数</text>
  16. <text class='tbbody right'>{{item['cases']}}</Text>
  17. </view>
  18. <view class="uni-row table-layout">
  19. <text class='tbbody left' style="height: 100%;">箱号</text>
  20. <text class='last-tbbody right'>{{item['boxno']}}</text>
  21. </view>
  22. </view>
  23. </view>
  24. <view class='btn uni-row'>
  25. <button class='bottom-btn left-btn'>取消</button>
  26. <button class='bottom-btn right-btn' type="primary">确定接收</button>
  27. </view>
  28. </view>
  29. </template>
  30. <script setup>
  31. import {
  32. ref
  33. } from 'vue'
  34. import {
  35. onLoad,
  36. onReady
  37. } from '@dcloudio/uni-app'
  38. onLoad(() => {
  39. for (let i = 0; i < products.value.length; i++) {
  40. sum.value += parseInt(products.value[i]['cases'].toString());
  41. }
  42. // this.title = '热处理' + this.sum + '箱'
  43. title.value = '热处理' + sum.value + '箱'
  44. })
  45. const title = ref('热处理')
  46. const sum = ref(0)
  47. const products = ref([{
  48. description: '博士_0395614149_15*110.1',
  49. batch: 'DC23727410070',
  50. cases: 5,
  51. boxno: 'X12522、X552222、X15522、J5211、J5112、X12522、X552222、X15522、J5211、J5112'
  52. },
  53. {
  54. description: '博士_0395614149_15*110.1',
  55. batch: 'DC23727410070',
  56. cases: 5,
  57. boxno: 'X12522、X552222、X15522、J5211、J5112'
  58. },
  59. {
  60. description: '博士_0395614149_15*110.1',
  61. batch: 'DC23727410070',
  62. cases: 5,
  63. boxno: 'X12522、X552222、X15522、J5211、J5112'
  64. },
  65. {
  66. description: '博士_0395614149_15*110.1',
  67. batch: 'DC23727410070',
  68. cases: 5,
  69. boxno: 'X12522、X552222、X15522、J5211、J5112'
  70. },
  71. {
  72. description: '博士_0395614149_15*110.1',
  73. batch: 'DC23727410070',
  74. cases: 5,
  75. boxno: 'X12522、X552222、X15522、J5211、J5112'
  76. },
  77. {
  78. description: '博士_0395614149_15*110.1',
  79. batch: 'DC23727410070',
  80. cases: 5,
  81. boxno: 'X12522、X552222、X15522、J5211、J5112'
  82. }
  83. ])
  84. </script>
  85. <style lang="scss">
  86. .container {
  87. height: 100%;
  88. overflow: auto;
  89. background-color: rgba(245, 245, 245, 1);
  90. .content {
  91. width: 94%;
  92. /* height: auto; */
  93. background-color: rgba(255, 255, 255, 1);
  94. margin: 50rpx auto;
  95. padding-bottom: 144rpx;
  96. border-radius: 12rpx;
  97. .title {
  98. margin: 10rpx auto;
  99. width: 90%;
  100. font-size: 36rpx;
  101. font-weight: bold;
  102. }
  103. .item-table {
  104. margin: 10rpx auto;
  105. width: 90%;
  106. .table-layout {
  107. background-color: rgba(236, 245, 255, 1);
  108. align-items: center;
  109. .tbhead {
  110. background-color: rgba(236, 245, 255, 1);
  111. font-size: 28rpx;
  112. height: 56rpx;
  113. line-height: 56rpx;
  114. padding-left: 6rpx;
  115. border-bottom: 1px solid lightgray;
  116. }
  117. .tbbody {
  118. font-size: 28rpx;
  119. background-color: rgba(238, 240, 245, 1);
  120. width: 70%;
  121. height: 56rpx;
  122. line-height: 56rpx;
  123. padding-left: 6rpx;
  124. border-bottom: 1px solid lightgray;
  125. }
  126. .left {
  127. color: rgba(136, 136, 136, 1);
  128. flex: 1;
  129. }
  130. .right {
  131. flex: 3;
  132. }
  133. .last-tbbody {
  134. font-size: 28rpx;
  135. background-color: rgba(238, 240, 245, 1);
  136. width: 70%;
  137. height: 100%;
  138. align-items: center;
  139. border-bottom: 1px solid lightgray;
  140. }
  141. }
  142. }
  143. }
  144. .btn {
  145. position: fixed;
  146. right: 0;
  147. bottom: 0;
  148. left: 0;
  149. height: 100rpx;
  150. padding: 16rpx 24rpx;
  151. align-items: center;
  152. background-color: #FFFFFF;
  153. justify-content: space-between;
  154. .bottom-btn {
  155. flex: 1;
  156. font-size: 28rpx;
  157. color: #FFFFFF;
  158. &.left-btn {
  159. background-color: #a4adb3;
  160. }
  161. &.right-btn {
  162. background-color: #1684fc;
  163. margin-left: 24rpx;
  164. }
  165. }
  166. }
  167. }
  168. </style>