SonGroup.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <template>
  2. <view class="box">
  3. <view class="mainBox">
  4. <view @click="goModelThree(item)" class="workBox2" v-for="(item,index) in itemList" :key="index">
  5. <view class="leftBox">
  6. <view class="name">{{item.caption}}</view>
  7. <view class="code">{{item.partnum}}</view>
  8. <view class="comment">{{item.name}}</view>
  9. <view class="comment">{{item.group}}</view>
  10. </view>
  11. <image src="../../static/img/rightArrow.png" mode="" style="width: 12rpx; height: 20rpx"></image>
  12. </view>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. data() {
  19. return {
  20. epc_id: '',
  21. token: '',
  22. param: '',
  23. access_time: '',
  24. itemData: {},
  25. itemList: [],
  26. page: 1,
  27. total_page: 1
  28. }
  29. },
  30. onLoad(opt) {
  31. this.epc_id = opt.epc_id;
  32. this.token = opt.token;
  33. this.param = opt.param;
  34. this.access_time = opt.access_time;
  35. this.getItemData();
  36. },
  37. methods: {
  38. // 配件组别
  39. getItemData() {
  40. uni.showLoading({
  41. title: '加载中'
  42. });
  43. this.$http('advancedEpc/findInModel', {
  44. epc_id: this.epc_id,
  45. token: this.token,
  46. param: this.param,
  47. access_time: this.access_time,
  48. page: this.page
  49. }, 'GET').then(res => {
  50. uni.hideLoading();
  51. this.itemData = res.data.result;
  52. this.total_page = res.data.result.total_page;
  53. var list = res.data.result.list;
  54. if (list.length != 0) {
  55. this.itemList = this.itemList.concat(list)
  56. }
  57. });
  58. },
  59. goModelThree(item) {
  60. // console.log('num==',item);
  61. uni.navigateTo({
  62. url: 'modelThree?epc_id=' + this.epc_id + '&token=' + item.token + '&param=' + item.param +
  63. '&access_time=' + this.itemData.access_time
  64. })
  65. }
  66. },
  67. // 下拉刷新 上拉加载更多
  68. onPullDownRefresh() {
  69. // this.page = 1
  70. // this.getItemData()
  71. setTimeout(function() {
  72. uni.stopPullDownRefresh();
  73. }, 1000);
  74. },
  75. onReachBottom() {
  76. if (this.page <= this.total_page) {
  77. this.page++;
  78. this.getItemData()()
  79. }
  80. }
  81. }
  82. </script>
  83. <style>
  84. .box {
  85. min-height: 100vh;
  86. background: #F4F5F7;
  87. padding-top: 20rpx;
  88. padding-bottom: constant(safe-area-inset-bottom);
  89. padding-bottom: env(safe-area-inset-bottom);
  90. }
  91. .mainBox {
  92. background: #FFFFFF;
  93. }
  94. .workBox2 {
  95. background: #FFFFFF;
  96. border-bottom: 1rpx solid #EEEEEE;
  97. padding: 20rpx 24rpx 0rpx;
  98. display: flex;
  99. align-items: center;
  100. }
  101. .leftBox {
  102. width: calc(100vw - 20rpx);
  103. }
  104. .name {
  105. color: #333333;
  106. font-size: 26rpx;
  107. font-weight: bold;
  108. padding-bottom: 15rpx;
  109. }
  110. .comment {
  111. color: #999999;
  112. font-size: 24rpx;
  113. padding-bottom: 15rpx;
  114. }
  115. .code {
  116. color: #3F90F7;
  117. font-size: 24rpx;
  118. padding-bottom: 15rpx;
  119. }
  120. .rightBox {
  121. width: 20rpx;
  122. }
  123. </style>