goodsList.vue 13 KB

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