list.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <template>
  2. <view class="listcontent">
  3. <view style="height: 20rpx;"></view>
  4. <view class="carContTop">
  5. <img :src="cardata.logo" alt="" class="carimg">
  6. <view class="carContTopRight">
  7. <view class="cardataName">{{cardata.value}}</view>
  8. <view class="vin" v-if="urlData.vin">
  9. <view class="vinIcon">VIN</view>
  10. <view class="vinNUm">{{urlData.vin}}</view>
  11. </view>
  12. </view>
  13. </view>
  14. <view class="listtab">
  15. <view class="listTabline tabactive">
  16. 保养件
  17. </view>
  18. </view>
  19. <view class="listBox">
  20. <view class="listLine" v-for="(item,index) in byjList" @click="godetail(item)">
  21. <img :src="item.imgs.split(',')[0]|| require('../../static/img/pic_def_bj.png')" alt="图片加载失败" class="lineIMg">
  22. <view class="listlineRight">
  23. <view class="lineName">{{ item.brand }} {{ item.name }}</view>
  24. <view class="linespecificationModel">{{ item.specificationModel }} | {{ item.factoryNumber }}</view>
  25. <view class="linemodelRemark">备注:{{ item.modelRemark||'--' }}</view>
  26. </view>
  27. </view>
  28. <view class="nodata" v-if="!byjList.length&&!loading">
  29. <img src="../../static/img/pic_empty_def.png" alt="" class="nodataImg">
  30. <view class="nodataTxt">暂无匹配商品</view>
  31. </view>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. export default {
  37. data() {
  38. return {
  39. tabIndex:1,
  40. urlData:'',
  41. cardata:'',
  42. byjList:[],
  43. loading:true,
  44. }
  45. },
  46. onLoad(opt) {
  47. //console.log(opt);
  48. this.urlData=opt;
  49. if(opt.type==2){
  50. this.getData2()
  51. }else{
  52. //console.log(this.$store.state.listId);
  53. this.getData()
  54. }
  55. },
  56. methods: {
  57. getData2(){
  58. uni.showLoading({ title: '加载中'});
  59. this.$http('matchingByOpen/queryCarModelGroupInfo', {
  60. id:this.urlData.id,
  61. },'post').then(res => {
  62. // uni.hideLoading();
  63. var obj={
  64. logo:res.data.carModelInfo.logo,
  65. value:res.data.value
  66. }
  67. this.cardata=obj;
  68. this.loading = true
  69. this.$http('partsByOpen/queryMaintainPartList', {
  70. groupId:res.data.id,
  71. componentCode: '001001,001002,001003,001004',
  72. },'post').then(res2 => {
  73. this.loading = false
  74. this.byjList=res2.data
  75. uni.hideLoading();
  76. })
  77. //this.carGroupList=res.data.carGroupList
  78. })
  79. },
  80. getData(){
  81. uni.showLoading({ title: '加载中'});
  82. this.$http('matchingByOpen/queryCarModelBynLevelID', {
  83. nLevelIDs:this.urlData.nLevelID,
  84. },'post').then(res => {
  85. uni.hideLoading();
  86. this.cardata=res.data
  87. this.cardata.value=this.urlData.name
  88. //this.carGroupList=res.data.carGroupList
  89. })
  90. this.loading = true
  91. this.$http('partsByOpen/queryMaintainPartList', {
  92. groupId:this.urlData.id,
  93. componentCode: '001001,001002,001003,001004',
  94. },'post').then(res => {
  95. this.loading = false
  96. this.byjList=res.data
  97. //this.carGroupList=res.data.carGroupList
  98. })
  99. },
  100. godetail(item){
  101. uni.navigateTo({
  102. url:'datail?id='+item.id
  103. })
  104. }
  105. }
  106. }
  107. </script>
  108. <style scoped>
  109. .listcontent{
  110. min-height: 100vh;
  111. background: #F4F5F7;
  112. }
  113. .carContTop{
  114. width: 690rpx;
  115. padding: 30rpx 24rpx;
  116. background: #FFFFFF;
  117. display: flex;
  118. }
  119. .carimg{
  120. width: 72rpx;
  121. height: 72rpx;
  122. }
  123. .cardataName{
  124. font-size: 28rpx;
  125. font-weight: 500;
  126. color: #333333;
  127. line-height: 36rpx;
  128. width: 600rpx;
  129. text-overflow: -o-ellipsis-lastline;
  130. overflow: hidden;
  131. text-overflow: ellipsis;
  132. display: -webkit-box;
  133. -webkit-line-clamp: 2;
  134. line-clamp: 2;
  135. -webkit-box-orient: vertical;
  136. height: 72rpx;
  137. padding-left: 24rpx;
  138. display: flex;
  139. justify-content: center;
  140. flex-direction: column;
  141. }
  142. .listtab{
  143. background: #FFFFFF;
  144. display: flex;
  145. margin-top: 20rpx;
  146. border-bottom: 1px solid #F4F5F7;
  147. padding-left: 30rpx;
  148. }
  149. .listTabline {
  150. color: #333333;
  151. font-size: 28rpx;
  152. line-height: 84rpx;
  153. }
  154. .tabactive{
  155. color: #3F90F7;
  156. border-bottom: 4rpx solid #3F90F7;
  157. }
  158. .listBox{
  159. padding: 0 24rpx;
  160. background: #FFFFFF;
  161. }
  162. .lineIMg{
  163. width: 110rpx;
  164. height: 110rpx;
  165. }
  166. .listLine{
  167. padding: 20rpx 0;
  168. border-bottom: 1px solid #EEEEEE;
  169. display: flex;
  170. }
  171. .listlineRight{
  172. width: 600rpx;
  173. padding-left: 20rpx;
  174. }
  175. .lineName{
  176. color: #3C3C3C;font-size: 28rpx;
  177. }
  178. .linespecificationModel{
  179. color: #999999;font-size: 24rpx;padding-top: 5rpx;
  180. }
  181. .linemodelRemark{
  182. color: #999999;font-size: 24rpx;padding-top: 10rpx;
  183. overflow: hidden;
  184. text-overflow: ellipsis;
  185. white-space: nowrap;
  186. width: 550rpx;
  187. }
  188. .nodataImg{
  189. width: 452rpx;
  190. }
  191. .nodata{
  192. text-align: center;
  193. height: calc(100vh - 310rpx );
  194. }
  195. .nodataTxt{
  196. color: #999999;
  197. line-height: 40px;
  198. font-size: 28rpx;
  199. padding-top: 12rpx;
  200. }
  201. .vinIcon{
  202. background-color: #F19D01;
  203. width: 50rpx;
  204. height: 30rpx;
  205. color: #FFFFFF;
  206. font-size: 20rpx;
  207. line-height: 30rpx;
  208. text-align: center;
  209. border-radius: 5rpx;
  210. }
  211. .vin{
  212. display: flex;
  213. padding-left: 24rpx;
  214. }
  215. .vinNUm{
  216. line-height: 30rpx;color: #999999;font-size: 24rpx;
  217. padding-left: 10rpx;
  218. }
  219. </style>