goodsList.vue 15 KB

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