CarModelList.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <template>
  2. <view class="box">
  3. <view class="mainBox">
  4. <view @click="goSonGroup(item)" class="workBox2" v-for="(item,index) in itemList" :key="index">
  5. <view class="leftBox">
  6. <view class="oneBox">
  7. <view class="comtent2">
  8. <view class="left2">名称:</view>
  9. <view class="right2">{{item.caption}}</view>
  10. </view>
  11. <view class="comtent2">
  12. <view class="left2">车型:</view>
  13. <view class="right2">{{item.vin_11}}</view>
  14. </view>
  15. </view>
  16. <view class="oneBox">
  17. <view class="comtent2">
  18. <view class="left2">年份:</view>
  19. <view class="right2">{{item.year}}</view>
  20. </view>
  21. <view class="comtent2">
  22. <view class="left2" style="width: 28%;">发动机:</view>
  23. <view class="right2">{{item.engine_prefix}}</view>
  24. </view>
  25. </view>
  26. <view class="oneBox">
  27. <view class="comtent2">
  28. <view class="left2" style="width: 28%;">变速箱:</view>
  29. <view class="right2">{{item.trans}}</view>
  30. </view>
  31. <view class="comtent2">
  32. <view class="left2">地区:</view>
  33. <view class="right2">{{item.area}}</view>
  34. </view>
  35. </view>
  36. <view class="oneBox">
  37. <view class="comtent2">
  38. <view class="left2">配置:</view>
  39. <view class="right2">{{item.equips}}</view>
  40. </view>
  41. <view class="comtent2">
  42. <view class="left2">级别:</view>
  43. <view class="right2">{{item.grade}}</view>
  44. </view>
  45. </view>
  46. <view class="oneBox">
  47. <view class="comtent2">
  48. <view class="left2" style="width: 35%;">模型代码:</view>
  49. <view class="right2">{{item.model_code}}</view>
  50. </view>
  51. </view>
  52. </view>
  53. <image src="../../static/img/rightArrow.png" mode="" style="width: 12rpx; height: 20rpx"></image>
  54. </view>
  55. </view>
  56. </view>
  57. </template>
  58. <script>
  59. export default {
  60. data() {
  61. return {
  62. epc_id: '',
  63. partnum: '',
  64. itemData: {},
  65. itemList: [],
  66. page: 1,
  67. total_page: 1
  68. }
  69. },
  70. onLoad(opt) {
  71. this.epc_id = opt.epc_id;
  72. this.partnum = opt.partnum;
  73. this.getItemData();
  74. },
  75. methods: {
  76. // 配件车型
  77. getItemData() {
  78. uni.showLoading({
  79. title: '加载中'
  80. });
  81. this.$http('advancedEpc/findApplicableModels', {
  82. epc_id: this.epc_id,
  83. partnum: this.partnum,
  84. page: this.page
  85. }, 'GET').then(res => {
  86. uni.hideLoading();
  87. this.itemData = res.data.result;
  88. var list = res.data.result.list;
  89. this.total_page = res.data.result.total_page;
  90. if (list.length != 0) {
  91. this.itemList = this.itemList.concat(list)
  92. }
  93. });
  94. },
  95. goSonGroup(item) {
  96. uni.navigateTo({
  97. url: 'SonGroup?epc_id=' + this.epc_id + '&token=' + item.token + '&param=' + item.param +
  98. '&access_time=' + this.itemData.access_time
  99. })
  100. },
  101. },
  102. // 下拉刷新 上拉加载更多
  103. onPullDownRefresh() {
  104. // this.page = 1
  105. // this.getItemData()
  106. setTimeout(function() {
  107. uni.stopPullDownRefresh();
  108. }, 1000);
  109. },
  110. onReachBottom() {
  111. console.log('page--total_page', this.page, this.total_page);
  112. if (this.page <= this.total_page) {
  113. this.page++;
  114. this.getItemData()
  115. }
  116. }
  117. }
  118. </script>
  119. <style>
  120. .box {
  121. min-height: 100vh;
  122. background: #F4F5F7;
  123. padding-top: 20rpx;
  124. padding-bottom: constant(safe-area-inset-bottom);
  125. padding-bottom: env(safe-area-inset-bottom);
  126. }
  127. .mainBox {
  128. background: #FFFFFF;
  129. }
  130. .oneBox {
  131. display: flex;
  132. justify-content: space-between;
  133. align-items: baseline;
  134. font-size: 26rpx;
  135. padding-bottom: 20rpx;
  136. }
  137. .comtent2 {
  138. display: flex;
  139. align-items: baseline;
  140. font-size: 26rpx;
  141. width: 50%;
  142. }
  143. .workBox2 {
  144. background: #FFFFFF;
  145. border-bottom: 1rpx solid #EEEEEE;
  146. padding: 20rpx 24rpx 0rpx;
  147. display: flex;
  148. align-items: center;
  149. }
  150. .leftBox {
  151. width: calc(100vw - 20rpx);
  152. }
  153. .rightBox {
  154. width: 20rpx;
  155. }
  156. .left2 {
  157. width: 20%;
  158. color: #999999;
  159. white-space: nowrap;
  160. }
  161. .right2 {
  162. width: 80%;
  163. color: #333333;
  164. margin-right: 20rpx;
  165. }
  166. </style>