goodsList.vue 15 KB

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