byItem.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. <template>
  2. <view class="content">
  3. <homenav :iStatusBarHeight="iStatusBarHeight" :title="'雨刷'"></homenav>
  4. <view class="box">
  5. <view class="historyLine" >
  6. <view class="historyLogoBox">
  7. <image :src="optdata.logo" mode="" class="historylinecarImg"></image>
  8. </view>
  9. <view>
  10. <view class="historylinecar">{{optdata.value}}</view>
  11. <view class="historyLineVin" v-if="optdata.isVin==1">
  12. <view class="vinms">VIN</view>
  13. <view class="vinNum">{{optdata.vin}}</view>
  14. </view>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="cont">
  19. <view class="topBox">
  20. <view class="topLine" @click="goby">
  21. <image src="../../static/img/icon_baoyang.png" mode="" class="toplineImg"></image>
  22. <view class="topName">保养周期</view>
  23. </view>
  24. <view class="topsx"></view>
  25. <view class="topLine" @click="gopz">
  26. <image src="../../static/img/icon_cheliang.png" mode="" class="toplineImg"></image>
  27. <view class="topName">车辆配置</view>
  28. </view>
  29. </view>
  30. </view>
  31. <view class="listBox">
  32. <view class="jiyouBox" v-if="loading">
  33. <view class="title">前雨刷</view>
  34. <view class="jylineBox">
  35. <view class="jyline" v-for="(item,index) in MaintainPartList" @click="godetail(item)">
  36. <view class="jyimgBox">
  37. <image v-if="item.imgs.split(',')[0]" :src="item.imgs.split(',')[0]" mode="aspectFit" class="jyimg"></image>
  38. <image v-else src="../../static/img/noimg.png" mode="aspectFit" class="jyimg"></image>
  39. </view>
  40. <view class="jyName">
  41. <!-- <span class="best">最佳</span> -->
  42. <span class="jyNametxt">{{item.name}} | {{item.specificationModel}} | {{item.partsCode}} </span>
  43. </view>
  44. </view>
  45. </view>
  46. <nodata v-if="MaintainPartList.length==0"></nodata>
  47. </view>
  48. </view>
  49. </view>
  50. </template>
  51. <script>
  52. import homenav from "../../components/homenav/nav.vue"
  53. import nodata from '../../components/nodata/nodata.vue'
  54. export default {
  55. components: {
  56. homenav,nodata
  57. },
  58. data() {
  59. return {
  60. optdata:'',
  61. isVin:'',
  62. vin:'',
  63. scarid:'',
  64. iStatusBarHeight:'',
  65. loading:false,
  66. MaintainPartList:[],
  67. }
  68. },
  69. onLoad(opt) {
  70. console.log(opt);
  71. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  72. this.optdata=opt;
  73. this.queryMaintainPartList()
  74. if(opt.scarid){
  75. this.scarid=opt.scarid;
  76. this.queryCarModelGroupInfo()
  77. }else{
  78. if(opt.isVin==1){
  79. this.isVin=1;
  80. this.vin=opt.vin
  81. }
  82. this.saveQueryHistory()
  83. }
  84. },
  85. methods: {
  86. queryCarModelGroupInfo(){
  87. uni.showLoading({ title: '加载中'});
  88. this.$http('matchingByOpen/queryCarModelGroupInfo', {
  89. id:this.scarid,
  90. },'POST').then(res => {
  91. uni.hideLoading();
  92. var data={
  93. value:res.data.value,
  94. id:res.data.id,
  95. nLevelID:res.data.carModelInfo.nLevelID,
  96. logo:res.data.carModelInfo.logo,
  97. }
  98. this.optdata=data;
  99. this.saveQueryHistory()
  100. })
  101. },
  102. queryMaintainPartList(){
  103. uni.showLoading({ title: '加载中'});
  104. this.loading=false;
  105. this.$http('partsByOpen/queryMaintainPartList', {
  106. groupId:this.optdata.id,
  107. componentCode:'007005',
  108. },'POST').then(res => {
  109. this.loading=true;
  110. uni.hideLoading();
  111. this.MaintainPartList=res.data
  112. })
  113. },
  114. saveQueryHistory(){
  115. this.$http2('saveQueryHistory', {
  116. nLevelID:this.optdata.nLevelID,
  117. logo:this.optdata.logo,
  118. title:this.optdata.value,
  119. groupId:this.optdata.id,
  120. isVin:this.isVin,
  121. vin:this.vin
  122. },'POST').then(res => {
  123. })
  124. },
  125. goby(){
  126. uni.navigateTo({
  127. url:'/pages/index/maintenance?nLevelID='+this.optdata.nLevelID+'&id='+this.optdata.id
  128. })
  129. },
  130. godetail(e){
  131. uni.navigateTo({
  132. url:'/pages/index/goodsDetail?id='+e.id
  133. })
  134. },
  135. gopz(){
  136. uni.navigateTo({
  137. url:'/pages/index/carConfiguration?nLevelID='+this.optdata.nLevelID
  138. })
  139. }
  140. }
  141. }
  142. </script>
  143. <style scoped>
  144. .content{
  145. min-height: 100vh;
  146. background: #F4F5F7;
  147. }
  148. .box{
  149. padding: 0 24rpx;
  150. background: #ffffff;
  151. }
  152. .historylinecarImg{
  153. width: 54rpx;
  154. height: 54rpx;
  155. }
  156. .historyLogoBox{
  157. display: flex;align-items: center;
  158. padding-right: 14rpx;
  159. }
  160. .historylinecar{
  161. font-weight: 500;font-size: 26rpx;
  162. color: #1A1A1A;
  163. line-height: 46rpx;width: 636rpx;
  164. }
  165. .historyLine{
  166. display: flex;
  167. padding: 30rpx 0;
  168. }
  169. .title{
  170. font-weight: 500;font-size: 28rpx;
  171. color: #1A1A1A;
  172. line-height: 40rpx;
  173. }
  174. .lineBox{
  175. padding: 0 24rpx;
  176. }
  177. .line{
  178. width: 332rpx;
  179. height: 206rpx;
  180. background: #FFFFFF;
  181. border-radius: 16rpx;
  182. }
  183. .lineTitle{
  184. font-weight: 500;font-size: 28rpx;padding-top: 32rpx;
  185. color: #1A1A1A;padding-left: 30rpx;
  186. line-height: 40rpx;
  187. }
  188. .lineEnglish{
  189. font-weight: 400;font-size: 24rpx;
  190. color: #999999;padding-left: 30rpx;
  191. line-height: 34rpx;padding-top: 10rpx;
  192. }
  193. .lineImg1{
  194. width: 82rpx;height: 92rpx;
  195. }
  196. .lineImgbox{
  197. text-align: right;
  198. }
  199. .lineImg2{
  200. width: 106rpx;height: 82rpx; margin-top: 10rpx;
  201. }
  202. .historyLineVin{
  203. display: flex;background: #ffffff;
  204. }
  205. .historyLineCar{
  206. display: flex;justify-content: space-between;
  207. }
  208. .vinNum{
  209. font-weight: 400;font-size: 22rpx;padding-left: 10rpx;
  210. color: #999999;line-height: 30rpx;
  211. }
  212. .vinms{
  213. width: 38rpx;
  214. height: 26rpx;
  215. background: linear-gradient(224deg, #FFDA28 0%, #FFBF35 100%);
  216. border-radius: 4rpx;
  217. text-align: center;
  218. line-height: 26rpx;
  219. font-weight: 600;
  220. color: #FFFFFF;
  221. font-size: 18rpx;
  222. margin-top: 2rpx;
  223. }
  224. .cont {
  225. padding: 30rpx 24rpx;
  226. }
  227. .toplineImg{
  228. width: 35rpx;
  229. height: 34rpx;
  230. }
  231. .topName{
  232. line-height: 34rpx;font-weight: 400;
  233. color: #FFFFFF;font-size: 28rpx;padding-left: 16rpx;
  234. }
  235. .topBox{
  236. width: 702rpx;
  237. height: 98rpx;
  238. background: #FFFFFF linear-gradient(132deg, #FF8635 0%, #FF4828 100%);
  239. border-radius: 16rpx;
  240. display: flex;justify-content: center;
  241. }
  242. .topsx{
  243. width: 2rpx;background: #ffffff;
  244. margin-left: 85rpx;margin-right: 85rpx;
  245. height: 54rpx;margin-top: 22rpx;
  246. }
  247. .topLine{
  248. display: flex;padding-top: 34rpx;
  249. }
  250. .jiyouBox{
  251. border-radius: 16rpx;
  252. background: #ffffff;padding: 30rpx;
  253. }
  254. .jiyoutopTitle{
  255. font-weight: 500;font-size: 28rpx;
  256. color: #1A1A1A;
  257. line-height: 40rpx;
  258. }
  259. .jyzl{
  260. font-weight: 400;line-height: 40rpx;
  261. color: #666666;font-size: 24rpx;
  262. }
  263. .jyimg{
  264. width: 302rpx;
  265. height: 302rpx;
  266. border-radius: 10rpx;
  267. }
  268. .jyline{
  269. width: 302rpx;padding-top: 30rpx;
  270. }
  271. .jyName{
  272. font-weight: 400;font-size: 22rpx;
  273. color: #1A1A1A;
  274. line-height:36rpx ;
  275. overflow: hidden;
  276. text-overflow: ellipsis;
  277. display: -webkit-box;
  278. -webkit-box-orient: vertical;
  279. -webkit-line-clamp: 2;
  280. padding-top: 10rpx;
  281. }
  282. .best{
  283. color: #FF4F00;border-radius: 6rpx;
  284. padding: 0 8rpx;border: 1px solid #FF4F00;
  285. }
  286. .jylineBox{
  287. display: flex;justify-content: space-between;flex-wrap: wrap;
  288. }
  289. .historyLineVin{
  290. display: flex;background: #ffffff;
  291. }
  292. .historyLineCar{
  293. display: flex;justify-content: space-between;
  294. }
  295. .vinNum{
  296. font-weight: 400;font-size: 22rpx;padding-left: 10rpx;
  297. color: #999999;line-height: 30rpx;
  298. }
  299. .vinms{
  300. width: 38rpx;
  301. height: 26rpx;
  302. background: linear-gradient(224deg, #FFDA28 0%, #FFBF35 100%);
  303. border-radius: 4rpx;
  304. text-align: center;
  305. line-height: 26rpx;
  306. font-weight: 600;
  307. color: #FFFFFF;
  308. font-size: 18rpx;
  309. margin-top: 2rpx;
  310. }
  311. .listBox{
  312. padding: 30rpx 24rpx;
  313. padding-top: 0;
  314. }
  315. .jyimgBox{
  316. border: 1px solid #EEEEEE; width: 302rpx;border-radius: 10rpx;
  317. }
  318. </style>