goodsList.vue 16 KB

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