goodsList.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663
  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="goodsName">附属型号:{{item.factoryNumber}} </view>
  65. <view class="goodsMs">电池型号:{{item.specificationModel}} </view>
  66. <view class="goodsMs">系列:{{item.brand}} <span>{{item.GeneralpurposeName}}</span> <span class="englishname" v-if="item.englishname">{{item.englishname}}</span> </view>
  67. <view class="goodsMs" v-if="item.carmodelremark">适用车型:{{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. defaultPic:'../../static/goods-image/defaultPic.png',
  125. isVin:'',
  126. vin:'',
  127. }
  128. },
  129. onLoad(opt) {
  130. console.log(opt)
  131. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  132. this.optdata=opt;
  133. if(this.optdata.type){
  134. this.type=this.optdata.type
  135. }
  136. if(opt.scarid){
  137. this.scarid=opt.scarid;
  138. this.queryCarModelGroupInfo()
  139. }else{
  140. if(opt.isVin==1){
  141. this.isVin=1;
  142. this.vin=opt.vin
  143. }
  144. this.saveQueryHistory()
  145. this.queryMaintainPartList()
  146. this.queryOilInfoByGroupID()
  147. }
  148. },
  149. methods: {
  150. queryCarModelGroupInfo(){
  151. uni.showLoading({ title: '加载中'});
  152. this.$http('matchingByOpen/queryCarModelGroupInfo', {
  153. id:this.scarid,
  154. },'POST').then(res => {
  155. uni.hideLoading();
  156. var data={
  157. value:res.data.value,
  158. id:res.data.id,
  159. nLevelID:res.data.carModelInfo.nLevelID,
  160. logo:res.data.carModelInfo.logo,
  161. }
  162. this.optdata=data;
  163. this.saveQueryHistory();
  164. this.queryMaintainPartList()
  165. })
  166. },
  167. saveQueryHistory(){
  168. this.$http2('saveQueryHistory', {
  169. nLevelID:this.optdata.nLevelID,
  170. logo:this.optdata.logo,
  171. title:this.optdata.value,
  172. groupId:this.optdata.id,
  173. isVin:this.isVin,
  174. vin:this.vin
  175. },'POST').then(res => {
  176. })
  177. },
  178. leftFn(index,item){
  179. this.leftIndex=index
  180. this.componentCode=item.componentCode
  181. this.componentName=item.name
  182. this.queryMaintainPartList()
  183. },
  184. ckBrand(item){
  185. item.ck=!item.ck
  186. //this.type=num
  187. var ids=[]
  188. this.brandList.forEach(item=>{
  189. if(item.ck){
  190. ids.push(item.id)
  191. }
  192. })
  193. this.brandId=ids.join(',')
  194. this.queryMaintainPartList()
  195. },
  196. goinstallation(){
  197. uni.showLoading({ title: '加载中'});
  198. this.$http('partsByOpen/queryCarmodelhelp', {
  199. componentCode:"005001",
  200. groupId:this.optdata.id
  201. },'POST').then(res => {
  202. uni.hideLoading();
  203. //this.imgUrl=res.data.yhzl.imgUrl
  204. var mtList=res.data.yhzl.mtList
  205. if(mtList){
  206. this.goinstallationRouter()
  207. }else{
  208. uni.showToast({
  209. title: '数据待完善',
  210. icon: 'none',
  211. duration: 3000
  212. });
  213. }
  214. }).catch(err=>{
  215. uni.hideLoading();
  216. uni.showToast({
  217. title: '数据待完善',
  218. icon: 'none',
  219. duration: 3000
  220. });
  221. })
  222. },
  223. goinstallationRouter(){
  224. uni.navigateTo({
  225. url:'installation?groupIds='+this.optdata.id+'&componentCode='+this.componentCode
  226. })
  227. },
  228. modelRemarkTab(num){
  229. this.modelRemarkNum=num
  230. if(num == 1){
  231. var name='0-10万公里'
  232. var arr=[]
  233. this.oldMaintainPartList.forEach(item=>{
  234. var state=false
  235. item.ruleList.forEach(v=>{
  236. if(v.version == name){
  237. state=true
  238. }
  239. })
  240. if(state){
  241. arr.push(item)
  242. }
  243. })
  244. this.MaintainPartList=arr
  245. //this.MaintainPartList= this.oldMaintainPartList.filter(item => item.modelRemark.includes(name))
  246. }else{
  247. var name='10万公里以上'
  248. var arr=[]
  249. this.oldMaintainPartList.forEach(item=>{
  250. var state=false
  251. item.ruleList.forEach(v=>{
  252. if(v.version == name){
  253. state=true
  254. }
  255. })
  256. if(state){
  257. arr.push(item)
  258. }
  259. })
  260. this.MaintainPartList=arr
  261. //this.MaintainPartList= this.oldMaintainPartList.filter(item => item.modelRemark.includes(name))
  262. }
  263. },
  264. queryMaintainPartList(){
  265. this.loading=false;
  266. uni.showLoading({ title: '加载中'});
  267. if(this.componentCode){
  268. var json={
  269. groupId:this.optdata.id,
  270. componentCode:this.componentCode,
  271. brandId:this.brandId
  272. }
  273. }else{
  274. var json={
  275. groupId:this.optdata.id,
  276. brandId:this.brandId
  277. }
  278. }
  279. this.$http('partsByOpen/queryMaintainPartList', json,'POST').then(res => {
  280. this.loading=true;
  281. uni.hideLoading();
  282. this.MaintainPartList=res.data
  283. if(this.MaintainPartList.length>1){
  284. this.MaintainPartList.reverse()
  285. }
  286. this.oldMaintainPartList=res.data
  287. // this.modelRemarkTab(1)
  288. })
  289. },
  290. queryOilInfoByGroupID(){
  291. var that=this;
  292. this.$http('matchingByOpen/queryOilInfoByGroupID', {
  293. // mileage:'30000',
  294. groupId:this.optdata.id,
  295. },'POST').then(res => {
  296. var arr = res.data
  297. arr.forEach(item=>{
  298. if(item[0]=='机油'){
  299. that.oilusage=item[2]
  300. that.spec=item[1]
  301. }
  302. })
  303. console.log(that.oilusage)
  304. })
  305. },
  306. goby(){
  307. uni.navigateTo({
  308. url:'/pages/index/maintenance?nLevelID='+this.optdata.nLevelID+'&id='+this.optdata.id
  309. })
  310. },
  311. godetail(e){
  312. uni.navigateTo({
  313. url:'/pages/index/goodsDetail?id='+e.id
  314. })
  315. },
  316. gopz(){
  317. uni.navigateTo({
  318. url:'/pages/index/carConfiguration?nLevelID='+this.optdata.nLevelID
  319. })
  320. },
  321. copyFn(e){
  322. uni.setClipboardData({
  323. data: e,
  324. success: function () {
  325. uni.showToast({
  326. title: '复制成功',
  327. icon: 'success',
  328. duration: 2000
  329. });
  330. },
  331. fail: function () {
  332. console.log('复制失败');
  333. }
  334. });
  335. }
  336. }
  337. }
  338. </script>
  339. <style scoped>
  340. .goodscont{
  341. display: flex;margin-top: 20rpx;
  342. min-height: calc(100vh - 450rpx);
  343. }
  344. .salesLine{
  345. display: flex;
  346. font-size: 24rpx;
  347. line-height: 30rpx;
  348. padding: 20rpx 0;
  349. }
  350. .goodsLefeLine{
  351. display: flex;justify-content: center;
  352. padding: 22rpx 0;
  353. }
  354. .brandBox {
  355. padding: 30rpx 20rpx;
  356. padding-bottom: 24rpx;
  357. }
  358. .goosLeft{
  359. width: 190rpx;
  360. font-size: 26rpx;
  361. color: #3C3C3C;
  362. background: #F6F6F6;
  363. }
  364. .salesLeft{
  365. width: 200rpx;
  366. color: #999999;
  367. }
  368. .content {
  369. min-height: 100vh;
  370. background: #F4F5F7;
  371. }
  372. .jyimgBox{
  373. border: 1px solid #EEEEEE; width: 120rpx;border-radius: 10rpx;
  374. height: 120rpx;
  375. }
  376. .box {
  377. padding: 0 24rpx;
  378. background: #254A90;
  379. }
  380. .historylinecarImg{
  381. width: 90rpx;
  382. height: 90rpx;
  383. }
  384. .historyLogoBox{
  385. display: flex;align-items: center;
  386. padding-right: 14rpx;
  387. }
  388. .historylinecar {
  389. font-weight: 500;
  390. font-size: 28rpx;
  391. color: #FFFFFF;
  392. line-height: 46rpx;
  393. width: 600rpx;
  394. }
  395. .historyLine {
  396. display: flex;
  397. padding: 30rpx 0;
  398. /* border-top: 1rpx solid #EEEEEE; */
  399. padding-bottom: 16rpx;
  400. }
  401. .cont {
  402. /* padding: 30rpx 24rpx; */
  403. }
  404. .toplineImg{
  405. width: 35rpx;
  406. height: 34rpx;
  407. }
  408. .topName{
  409. line-height: 34rpx;font-weight: 400;
  410. color: #FFFFFF;font-size: 28rpx;padding-left: 16rpx;
  411. }
  412. .topBox{
  413. width: 702rpx;
  414. height: 98rpx;
  415. background: #FFFFFF linear-gradient(132deg, #FF8635 0%, #FF4828 100%);
  416. border-radius: 16rpx;
  417. display: flex;justify-content: center;
  418. }
  419. .topsx{
  420. width: 2rpx;background: #ffffff;
  421. margin-left: 85rpx;margin-right: 85rpx;
  422. height: 54rpx;margin-top: 22rpx;
  423. }
  424. .topLine{
  425. display: flex;padding-top: 34rpx;
  426. }
  427. .jiyouTop{
  428. display: flex;justify-content: space-between;
  429. }
  430. .jiyouBox{
  431. /* margin-top: 30rpx; */
  432. background: #ffffff;
  433. /* padding: 30rpx; */
  434. /* width: 560rpx; */
  435. }
  436. .jiyoutopTitle{
  437. font-weight: 500;font-size: 28rpx;
  438. color: #1A1A1A;
  439. line-height: 40rpx;
  440. }
  441. .jyzl{
  442. font-weight: 400;line-height: 40rpx;
  443. color: #666666;font-size: 24rpx;
  444. }
  445. .jyimg{
  446. width: 120rpx;
  447. height: 120rpx;
  448. border-radius: 10rpx;
  449. }
  450. .jyline{
  451. padding: 24rpx 20rpx;
  452. display: flex;
  453. border-bottom: 1px solid #EEEEEE;
  454. }
  455. .jyline:last-child{
  456. border: none;
  457. }
  458. .jyName{
  459. font-weight: 400;font-size: 22rpx;
  460. color: #1A1A1A;
  461. line-height:36rpx ;
  462. overflow: hidden;
  463. text-overflow: ellipsis;
  464. display: -webkit-box;
  465. -webkit-box-orient: vertical;
  466. -webkit-line-clamp: 2;
  467. padding-top: 10rpx;
  468. }
  469. .best{
  470. color: #FF4F00;border-radius: 6rpx;
  471. padding: 0 8rpx;border: 1px solid #FF4F00;
  472. }
  473. .jylineBox{
  474. /* display: flex;justify-content: space-between;flex-wrap: wrap; */
  475. }
  476. .historyLineVin{
  477. display: flex;justify-content: space-between;
  478. }
  479. .historyLineCar{
  480. display: flex;justify-content: space-between;
  481. }
  482. .vinNum{
  483. font-weight: 400;font-size: 26rpx;padding-left: 10rpx;
  484. color: #FFFFFF;line-height: 30rpx;
  485. }
  486. .vinms{
  487. /* width: 38rpx;
  488. height: 26rpx; */
  489. /* background: linear-gradient(224deg, #FFDA28 0%, #FFBF35 100%); */
  490. /* border-radius: 4rpx;
  491. text-align: center;
  492. line-height: 26rpx;
  493. font-weight: 600;
  494. color: #FFFFFF;
  495. font-size: 18rpx;
  496. margin-top: 2rpx; */
  497. /* background: #254A90; */
  498. font-weight: 400;
  499. font-size: 26rpx;
  500. color: #FFFFFF;
  501. line-height: 30rpx;
  502. }
  503. .ruleListSpan{
  504. font-weight: 400;
  505. font-size: 22rpx;
  506. color: #999999;
  507. line-height: 36rpx;
  508. padding-right: 6rpx;
  509. }
  510. .modelRemarkBox{
  511. display: flex;padding-bottom: 20rpx;
  512. }
  513. .modelRemarkLine{
  514. background: #eee;
  515. padding: 6rpx 20rpx;
  516. border-radius: 6rpx;
  517. margin-right: 30rpx;
  518. font-size: 26rpx;
  519. }
  520. .activeMr{
  521. background: #FFFFFF linear-gradient(132deg, #FF8635 0%, #FF4828 100%);
  522. color: #FFF;
  523. }
  524. .topBtnBox{
  525. display: flex;padding-bottom: 30rpx;
  526. padding-left: 90rpx;
  527. }
  528. .topBtn{
  529. font-weight: 400;
  530. font-size: 26rpx;
  531. color: #FFFFFF;
  532. width: 180rpx;
  533. height: 56rpx;
  534. border-radius: 28rpx;
  535. border: 1px solid #FFFFFF;
  536. line-height: 56rpx;
  537. text-align: center;
  538. margin-right: 30rpx;
  539. }
  540. .copyVin{
  541. font-weight: 400;
  542. font-size: 26rpx;
  543. color:#FFFFFF;
  544. width: 62rpx;
  545. height: 34rpx;
  546. line-height: 34rpx;
  547. text-align: right;
  548. padding-top: 16rpx;
  549. }
  550. .brandBox{
  551. display: flex;
  552. }
  553. .brandBtn{
  554. font-size: 26rpx;
  555. color: #3C3C3C;
  556. padding: 10rpx 20rpx;
  557. background: #F6F6F6;
  558. border-radius: 6rpx;
  559. margin-right: 20rpx;
  560. }
  561. .lineRgiht{
  562. padding-left: 16rpx;
  563. }
  564. .goodsName{
  565. font-size: 28rpx;
  566. color: #254A90;
  567. line-height: 40rpx;
  568. }
  569. .goodsMs{
  570. font-size: 24rpx;
  571. color: #222222;
  572. line-height: 33rpx;
  573. padding-top: 10rpx;
  574. }
  575. .brandActive{
  576. background: #254A90;
  577. border-radius: 6rpx;
  578. color: #FFFFFF;
  579. }
  580. .glActive{
  581. background: #ffffff;
  582. }
  583. .glActive .glName{
  584. font-weight: 500;
  585. font-size: 26rpx;
  586. color: #E60006;
  587. /* border-left:4rpx solid #E60006; */
  588. }
  589. .leftKK{
  590. background: #E60006;
  591. width: 6rpx ;
  592. height: 24rpx;
  593. border-radius: 4rpx;
  594. margin-top: 6rpx;
  595. overflow: hidden;
  596. }
  597. .leftKK2{
  598. width: 4rpx ;
  599. }
  600. .glName{
  601. width: 170rpx;text-align: center;
  602. font-size: 26rpx;
  603. }
  604. .ckName{
  605. width: 532rpx;
  606. height: 60rpx;
  607. background: #F6F6F6;
  608. border-radius: 4rpx;
  609. font-size: 26rpx;
  610. color: #3C3C3C;
  611. line-height: 60rpx;
  612. margin-left: 20rpx;
  613. padding-left: 20rpx;
  614. font-weight: 600;
  615. }
  616. .jiyouBox{
  617. width: 100%;
  618. }
  619. .englishname{
  620. padding: 0 6rpx;
  621. border-radius: 8rpx;
  622. /* border:1px solid #254A90; */
  623. margin-left: 10rpx;
  624. display: inline-block;
  625. background: #254A90;
  626. font-size: 22rpx;
  627. color: #ffffff;
  628. }
  629. </style>