list.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  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: 750rpx;
  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. }
  139. .listtab{
  140. background: #FFFFFF;
  141. display: flex;
  142. margin-top: 20rpx;
  143. border-bottom: 1px solid #F4F5F7;
  144. padding-left: 30rpx;
  145. }
  146. .listTabline {
  147. color: #333333;
  148. font-size: 28rpx;
  149. line-height: 84rpx;
  150. }
  151. .tabactive{
  152. color: #3F90F7;
  153. border-bottom: 4rpx solid #3F90F7;
  154. }
  155. .listBox{
  156. padding: 0 24rpx;
  157. background: #FFFFFF;
  158. }
  159. .lineIMg{
  160. width: 110rpx;
  161. height: 110rpx;
  162. }
  163. .listLine{
  164. padding: 20rpx 0;
  165. border-bottom: 1px solid #EEEEEE;
  166. display: flex;
  167. }
  168. .listlineRight{
  169. width: 600rpx;
  170. padding-left: 20rpx;
  171. }
  172. .lineName{
  173. color: #3C3C3C;font-size: 28rpx;
  174. }
  175. .linespecificationModel{
  176. color: #999999;font-size: 24rpx;padding-top: 5rpx;
  177. }
  178. .linemodelRemark{
  179. color: #999999;font-size: 24rpx;padding-top: 10rpx;
  180. }
  181. .nodataImg{
  182. width: 452rpx;
  183. }
  184. .nodata{
  185. text-align: center;
  186. height: calc(100vh - 310rpx );
  187. }
  188. .nodataTxt{
  189. color: #999999;
  190. line-height: 40px;
  191. font-size: 28rpx;
  192. padding-top: 12rpx;
  193. }
  194. .vinIcon{
  195. background-color: #F19D01;
  196. width: 50rpx;
  197. height: 30rpx;
  198. color: #FFFFFF;
  199. font-size: 20rpx;
  200. line-height: 30rpx;
  201. text-align: center;
  202. }
  203. .vin{
  204. display: flex;
  205. padding-left: 24rpx;
  206. }
  207. .vinNUm{
  208. line-height: 30rpx;color: #999999;font-size: 24rpx;
  209. padding-left: 10rpx;
  210. }
  211. </style>