goodsList.vue 15 KB

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