goodsList.vue 17 KB

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