goodsList.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614
  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 style="display: flex; padding-top: 16rpx;">
  13. <view class="vinms">VIN</view>
  14. <view class="vinNum">{{optdata.vin}}</view>
  15. </view>
  16. <view class="copyVin" @click="copyFn(optdata.vin)">复制</view>
  17. </view>
  18. </view>
  19. </view>
  20. <view class="topBtnBox">
  21. <view class="topBtn" @click="goinstallation">电池安装</view>
  22. <view class="topBtn" @click="gopz">车辆详情</view>
  23. </view>
  24. </view>
  25. <view class="goodscont">
  26. <!-- <view class="topBox">
  27. <view class="topLine" @click="goby">
  28. <image src="../../static/img/icon_baoyang.png" mode="" class="toplineImg"></image>
  29. <view class="topName">保养周期</view>
  30. </view>
  31. <view class="topsx"></view>
  32. <view class="topLine" @click="gopz">
  33. <image src="../../static/img/icon_cheliang.png" mode="" class="toplineImg"></image>
  34. <view class="topName">车辆配置</view>
  35. </view>
  36. </view> -->
  37. <!-- <view class="goosLeft">
  38. <view class="goodsLefeLine" :class="{glActive:leftIndex==index}"
  39. @click="leftFn(index,item)" v-for="(item,index) in leftData">
  40. <view class="leftKK" v-if="leftIndex==index"></view>
  41. <view v-else class="leftKK2"></view>
  42. <view class="glName">{{item.name}}</view>
  43. </view>
  44. </view> -->
  45. <view class="jiyouBox">
  46. <view class="brandBox">
  47. <!-- <view class="brandBtn" :class="{brandActive:type==1}" @click="ckBrand(1)">阿诺德</view>
  48. <view class="brandBtn" :class="{brandActive:type==2}" @click="ckBrand(2)">鸿雁</view>
  49. <view class="brandBtn" :class="{brandActive:type==3}" @click="ckBrand(3)">三冠</view>
  50. <view class="brandBtn" :class="{brandActive:type==4}" @click="ckBrand(4)">威斯康</view> -->
  51. <view class="brandBtn" v-for="(item,index) in brandList" :class="{brandActive:item.ck}" @click="ckBrand(item)">{{item.name}}</view>
  52. </view>
  53. <!-- <view class="ckName">
  54. {{componentName}}
  55. </view> -->
  56. <view class="jylineBox" v-if="loading">
  57. <view class="jyline" v-for="(item,index) in MaintainPartList" @click="godetail(item)"><!-- MaintainPartList -->
  58. <view class="jyimgBox">
  59. <image v-if="item.imgs.split(',')[0]" :src="item.imgs.split(',')[0]" mode="aspectFit" class="jyimg"></image>
  60. <image v-else src="../../static/img/noimg.png" mode="aspectFit" class="jyimg"></image>
  61. </view>
  62. <view class="lineRgiht">
  63. <view class="goodsName">{{item.name}}| {{item.partsCode}}</view>
  64. <view class="goodsMs">附属型号:{{item.factoryNumber}} </view>
  65. <view class="goodsMs">电池型号:{{item.specificationModel}} </view>
  66. <view class="goodsMs">系列: <span>{{item.GeneralpurposeName}}</span> <span class="englishname" v-if="item.englishname">{{item.englishname}}</span> </view>
  67. <view class="goodsMs">适用车型:{{item.carmodelremark}} </view>
  68. </view>
  69. </view>
  70. </view>
  71. <nodata v-if="MaintainPartList.length==0"></nodata>
  72. </view>
  73. <!-- <view class="jiyouBox" v-if="loading">
  74. <view class="jiyouTop">
  75. <view class="jiyoutopTitle">原厂售后推荐</view>
  76. </view>
  77. <view class="salesLine">
  78. <view class="salesLeft">建议加注量</view>
  79. <view class="salesRight">{{oilusage}}</view>
  80. </view>
  81. <view class="salesLine">
  82. <view class="salesLeft">规格型号</view>
  83. <view class="salesRight">{{spec}}</view>
  84. </view>
  85. </view> -->
  86. </view>
  87. </view>
  88. </template>
  89. <script>
  90. import nodata from '../../components/nodata/nodata.vue'
  91. import homenav from "../../components/homenav/nav.vue"
  92. export default {
  93. components: {
  94. nodata,homenav
  95. },
  96. data() {
  97. return {
  98. optdata:'',
  99. MaintainPartList:[],
  100. oilusage:'',
  101. iStatusBarHeight:'',
  102. loading:false,
  103. spec:'',
  104. modelRemarkNum:1,
  105. oldMaintainPartList:'',
  106. type:'',
  107. leftIndex:0,
  108. leftData:[
  109. {name:'机油',componentCode:'015001'},
  110. {name:'变速箱油',componentCode:'007005'},
  111. {name:'变速箱滤清器',componentCode:'007004'},
  112. {name:'雨刷',componentCode:'006004'},
  113. ],
  114. // componentCode:'015001',
  115. componentCode:'',
  116. componentName:'机油',
  117. brandList:[
  118. {name:'三冠',id:'fc89e243-3358-4037-80ed-67c5d8c35085',ck:false},
  119. {name:'威斯康',id:'ee21a0d0-f181-42be-990b-73eb692c196d',ck:false},
  120. {name:'阿诺德',id:'a136f3b8-0586-4fe5-ac49-389aa4cc990b',ck:false},
  121. {name:'鸿雁',id:'8fa5f395-86c7-4488-b4ea-ac058c7ae330',ck:false},
  122. ],
  123. brandId:'',
  124. }
  125. },
  126. onLoad(opt) {
  127. console.log(opt)
  128. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  129. this.optdata=opt;
  130. if(opt.scarid){
  131. this.scarid=opt.scarid;
  132. this.queryCarModelGroupInfo()
  133. }else{
  134. if(opt.isVin==1){
  135. this.isVin=1;
  136. this.vin=opt.vin
  137. }
  138. this.saveQueryHistory()
  139. }
  140. if(this.optdata.type){
  141. this.type=this.optdata.type
  142. }
  143. this.queryMaintainPartList()
  144. this.queryOilInfoByGroupID()
  145. },
  146. methods: {
  147. queryCarModelGroupInfo(){
  148. uni.showLoading({ title: '加载中'});
  149. this.$http('matchingByOpen/queryCarModelGroupInfo', {
  150. id:this.scarid,
  151. },'POST').then(res => {
  152. uni.hideLoading();
  153. var data={
  154. value:res.data.value,
  155. id:res.data.id,
  156. nLevelID:res.data.carModelInfo.nLevelID,
  157. logo:res.data.carModelInfo.logo,
  158. }
  159. this.optdata=data;
  160. this.saveQueryHistory()
  161. })
  162. },
  163. saveQueryHistory(){
  164. this.$http2('saveQueryHistory', {
  165. nLevelID:this.optdata.nLevelID,
  166. logo:this.optdata.logo,
  167. title:this.optdata.value,
  168. groupId:this.optdata.id,
  169. isVin:this.isVin,
  170. vin:this.vin
  171. },'POST').then(res => {
  172. })
  173. },
  174. leftFn(index,item){
  175. this.leftIndex=index
  176. this.componentCode=item.componentCode
  177. this.componentName=item.name
  178. this.queryMaintainPartList()
  179. },
  180. ckBrand(item){
  181. item.ck=!item.ck
  182. //this.type=num
  183. var ids=[]
  184. this.brandList.forEach(item=>{
  185. if(item.ck){
  186. ids.push(item.id)
  187. }
  188. })
  189. this.brandId=ids.join(',')
  190. this.queryMaintainPartList()
  191. },
  192. goinstallation(){
  193. uni.navigateTo({
  194. url:'installation?groupIds='+this.optdata.id+'&componentCode='+this.componentCode
  195. })
  196. },
  197. modelRemarkTab(num){
  198. this.modelRemarkNum=num
  199. if(num == 1){
  200. var name='0-10万公里'
  201. var arr=[]
  202. this.oldMaintainPartList.forEach(item=>{
  203. var state=false
  204. item.ruleList.forEach(v=>{
  205. if(v.version == name){
  206. state=true
  207. }
  208. })
  209. if(state){
  210. arr.push(item)
  211. }
  212. })
  213. this.MaintainPartList=arr
  214. //this.MaintainPartList= this.oldMaintainPartList.filter(item => item.modelRemark.includes(name))
  215. }else{
  216. var name='10万公里以上'
  217. var arr=[]
  218. this.oldMaintainPartList.forEach(item=>{
  219. var state=false
  220. item.ruleList.forEach(v=>{
  221. if(v.version == name){
  222. state=true
  223. }
  224. })
  225. if(state){
  226. arr.push(item)
  227. }
  228. })
  229. this.MaintainPartList=arr
  230. //this.MaintainPartList= this.oldMaintainPartList.filter(item => item.modelRemark.includes(name))
  231. }
  232. },
  233. queryMaintainPartList(){
  234. this.loading=false;
  235. uni.showLoading({ title: '加载中'});
  236. if(this.componentCode){
  237. var json={
  238. groupId:this.optdata.id,
  239. componentCode:this.componentCode,
  240. brandId:this.brandId
  241. }
  242. }else{
  243. var json={
  244. groupId:this.optdata.id,
  245. brandId:this.brandId
  246. }
  247. }
  248. this.$http('partsByOpen/queryMaintainPartList', json,'POST').then(res => {
  249. this.loading=true;
  250. uni.hideLoading();
  251. this.MaintainPartList=res.data
  252. this.oldMaintainPartList=res.data
  253. // this.modelRemarkTab(1)
  254. })
  255. },
  256. queryOilInfoByGroupID(){
  257. var that=this;
  258. this.$http('matchingByOpen/queryOilInfoByGroupID', {
  259. // mileage:'30000',
  260. groupId:this.optdata.id,
  261. },'POST').then(res => {
  262. var arr = res.data
  263. arr.forEach(item=>{
  264. if(item[0]=='机油'){
  265. that.oilusage=item[2]
  266. that.spec=item[1]
  267. }
  268. })
  269. console.log(that.oilusage)
  270. })
  271. },
  272. goby(){
  273. uni.navigateTo({
  274. url:'/pages/index/maintenance?nLevelID='+this.optdata.nLevelID+'&id='+this.optdata.id
  275. })
  276. },
  277. godetail(e){
  278. uni.navigateTo({
  279. url:'/pages/index/goodsDetail?id='+e.id
  280. })
  281. },
  282. gopz(){
  283. uni.navigateTo({
  284. url:'/pages/index/carConfiguration?nLevelID='+this.optdata.nLevelID
  285. })
  286. },
  287. copyFn(e){
  288. uni.setClipboardData({
  289. data: e,
  290. success: function () {
  291. uni.showToast({
  292. title: '复制成功',
  293. icon: 'success',
  294. duration: 2000
  295. });
  296. },
  297. fail: function () {
  298. console.log('复制失败');
  299. }
  300. });
  301. }
  302. }
  303. }
  304. </script>
  305. <style scoped>
  306. .goodscont{
  307. display: flex;margin-top: 20rpx;
  308. min-height: calc(100vh - 450rpx);
  309. }
  310. .salesLine{
  311. display: flex;
  312. font-size: 24rpx;
  313. line-height: 30rpx;
  314. padding: 20rpx 0;
  315. }
  316. .goodsLefeLine{
  317. display: flex;justify-content: center;
  318. padding: 22rpx 0;
  319. }
  320. .brandBox {
  321. padding: 30rpx 20rpx;
  322. padding-bottom: 24rpx;
  323. }
  324. .goosLeft{
  325. width: 190rpx;
  326. font-size: 26rpx;
  327. color: #3C3C3C;
  328. background: #F6F6F6;
  329. }
  330. .salesLeft{
  331. width: 200rpx;
  332. color: #999999;
  333. }
  334. .content {
  335. min-height: 100vh;
  336. background: #F4F5F7;
  337. }
  338. .jyimgBox{
  339. border: 1px solid #EEEEEE; width: 90rpx;border-radius: 10rpx;
  340. height: 90rpx;
  341. }
  342. .box {
  343. padding: 0 24rpx;
  344. background: #ffffff;
  345. }
  346. .historylinecarImg{
  347. width: 54rpx;
  348. height: 54rpx;
  349. }
  350. .historyLogoBox{
  351. display: flex;align-items: center;
  352. padding-right: 14rpx;
  353. }
  354. .historylinecar {
  355. font-weight: 500;
  356. font-size: 26rpx;
  357. color: #1A1A1A;
  358. line-height: 46rpx;
  359. width: 636rpx;
  360. }
  361. .historyLine {
  362. display: flex;
  363. padding: 30rpx 0;
  364. /* border-top: 1rpx solid #EEEEEE; */
  365. padding-bottom: 16rpx;
  366. }
  367. .cont {
  368. /* padding: 30rpx 24rpx; */
  369. }
  370. .toplineImg{
  371. width: 35rpx;
  372. height: 34rpx;
  373. }
  374. .topName{
  375. line-height: 34rpx;font-weight: 400;
  376. color: #FFFFFF;font-size: 28rpx;padding-left: 16rpx;
  377. }
  378. .topBox{
  379. width: 702rpx;
  380. height: 98rpx;
  381. background: #FFFFFF linear-gradient(132deg, #FF8635 0%, #FF4828 100%);
  382. border-radius: 16rpx;
  383. display: flex;justify-content: center;
  384. }
  385. .topsx{
  386. width: 2rpx;background: #ffffff;
  387. margin-left: 85rpx;margin-right: 85rpx;
  388. height: 54rpx;margin-top: 22rpx;
  389. }
  390. .topLine{
  391. display: flex;padding-top: 34rpx;
  392. }
  393. .jiyouTop{
  394. display: flex;justify-content: space-between;
  395. }
  396. .jiyouBox{
  397. /* margin-top: 30rpx; */
  398. background: #ffffff;
  399. /* padding: 30rpx; */
  400. /* width: 560rpx; */
  401. }
  402. .jiyoutopTitle{
  403. font-weight: 500;font-size: 28rpx;
  404. color: #1A1A1A;
  405. line-height: 40rpx;
  406. }
  407. .jyzl{
  408. font-weight: 400;line-height: 40rpx;
  409. color: #666666;font-size: 24rpx;
  410. }
  411. .jyimg{
  412. width: 90rpx;
  413. height: 90rpx;
  414. border-radius: 10rpx;
  415. }
  416. .jyline{
  417. padding: 24rpx 20rpx;
  418. display: flex;
  419. border-bottom: 1px solid #EEEEEE;
  420. }
  421. .jyline:last-child{
  422. border: none;
  423. }
  424. .jyName{
  425. font-weight: 400;font-size: 22rpx;
  426. color: #1A1A1A;
  427. line-height:36rpx ;
  428. overflow: hidden;
  429. text-overflow: ellipsis;
  430. display: -webkit-box;
  431. -webkit-box-orient: vertical;
  432. -webkit-line-clamp: 2;
  433. padding-top: 10rpx;
  434. }
  435. .best{
  436. color: #FF4F00;border-radius: 6rpx;
  437. padding: 0 8rpx;border: 1px solid #FF4F00;
  438. }
  439. .jylineBox{
  440. /* display: flex;justify-content: space-between;flex-wrap: wrap; */
  441. }
  442. .historyLineVin{
  443. display: flex;background: #ffffff;justify-content: space-between;
  444. }
  445. .historyLineCar{
  446. display: flex;justify-content: space-between;
  447. }
  448. .vinNum{
  449. font-weight: 400;font-size: 26rpx;padding-left: 10rpx;
  450. color: #999999;line-height: 30rpx;
  451. }
  452. .vinms{
  453. width: 38rpx;
  454. height: 26rpx;
  455. background: linear-gradient(224deg, #FFDA28 0%, #FFBF35 100%);
  456. border-radius: 4rpx;
  457. text-align: center;
  458. line-height: 26rpx;
  459. font-weight: 600;
  460. color: #FFFFFF;
  461. font-size: 18rpx;
  462. margin-top: 2rpx;
  463. }
  464. .ruleListSpan{
  465. font-weight: 400;
  466. font-size: 22rpx;
  467. color: #999999;
  468. line-height: 36rpx;
  469. padding-right: 6rpx;
  470. }
  471. .modelRemarkBox{
  472. display: flex;padding-bottom: 20rpx;
  473. }
  474. .modelRemarkLine{
  475. background: #eee;
  476. padding: 6rpx 20rpx;
  477. border-radius: 6rpx;
  478. margin-right: 30rpx;
  479. font-size: 26rpx;
  480. }
  481. .activeMr{
  482. background: #FFFFFF linear-gradient(132deg, #FF8635 0%, #FF4828 100%);
  483. color: #FFF;
  484. }
  485. .topBtnBox{
  486. display: flex;padding-bottom: 30rpx;
  487. padding-left: 70rpx;
  488. }
  489. .topBtn{
  490. font-weight: 400;
  491. font-size: 26rpx;
  492. color: #254A90;
  493. width: 180rpx;
  494. height: 56rpx;
  495. border-radius: 28rpx;
  496. border: 1px solid #254A90;
  497. line-height: 56rpx;
  498. text-align: center;
  499. margin-right: 30rpx;
  500. }
  501. .copyVin{
  502. font-weight: 400;
  503. font-size: 26rpx;
  504. color:#3F90F7;
  505. width: 62rpx;
  506. height: 34rpx;
  507. line-height: 34rpx;
  508. text-align: right;
  509. padding-top: 16rpx;
  510. }
  511. .brandBox{
  512. display: flex;
  513. }
  514. .brandBtn{
  515. font-size: 26rpx;
  516. color: #3C3C3C;
  517. padding: 10rpx 20rpx;
  518. background: #F6F6F6;
  519. border-radius: 6rpx;
  520. margin-right: 20rpx;
  521. }
  522. .lineRgiht{
  523. padding-left: 16rpx;
  524. }
  525. .goodsName{
  526. font-size: 28rpx;
  527. color: #254A90;
  528. line-height: 40rpx;
  529. }
  530. .goodsMs{
  531. font-size: 24rpx;
  532. color: #222222;
  533. line-height: 33rpx;
  534. padding-top: 10rpx;
  535. }
  536. .brandActive{
  537. background: rgba(255,79,0,0.08);
  538. border-radius: 6rpx;
  539. color: #E60006;
  540. }
  541. .glActive{
  542. background: #ffffff;
  543. }
  544. .glActive .glName{
  545. font-weight: 500;
  546. font-size: 26rpx;
  547. color: #E60006;
  548. /* border-left:4rpx solid #E60006; */
  549. }
  550. .leftKK{
  551. background: #E60006;
  552. width: 6rpx ;
  553. height: 24rpx;
  554. border-radius: 4rpx;
  555. margin-top: 6rpx;
  556. overflow: hidden;
  557. }
  558. .leftKK2{
  559. width: 4rpx ;
  560. }
  561. .glName{
  562. width: 170rpx;text-align: center;
  563. font-size: 26rpx;
  564. }
  565. .ckName{
  566. width: 532rpx;
  567. height: 60rpx;
  568. background: #F6F6F6;
  569. border-radius: 4rpx;
  570. font-size: 26rpx;
  571. color: #3C3C3C;
  572. line-height: 60rpx;
  573. margin-left: 20rpx;
  574. padding-left: 20rpx;
  575. font-weight: 600;
  576. }
  577. .jiyouBox{
  578. width: 100%;
  579. }
  580. .englishname{
  581. padding: 0 6rpx;
  582. border-radius: 8rpx;
  583. border:1px solid #254A90;
  584. margin-left: 10rpx;
  585. display: inline-block;
  586. }
  587. </style>