goodsList.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520
  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">复制</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="glName">{{item.name}}</view>
  41. </view>
  42. </view>
  43. <view class="jiyouBox">
  44. <view class="brandBox">
  45. <!-- <view class="brandBtn" :class="{brandActive:type==1}" @click="ckBrand(1)">阿诺德</view>
  46. <view class="brandBtn" :class="{brandActive:type==2}" @click="ckBrand(2)">鸿雁</view>
  47. <view class="brandBtn" :class="{brandActive:type==3}" @click="ckBrand(3)">三冠</view>
  48. <view class="brandBtn" :class="{brandActive:type==4}" @click="ckBrand(4)">威斯康</view> -->
  49. <view class="brandBtn" v-for="(item,index) in brandList" :class="{brandActive:item.ck}" @click="ckBrand(item)">{{item.name}}</view>
  50. </view>
  51. <view class="ckName">
  52. {{componentName}}
  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 v-else src="../../static/img/noimg.png" mode="aspectFit" class="jyimg"></image>
  59. </view>
  60. <view class="lineRgiht">
  61. <view class="goodsName">{{item.name}}| {{item.partsCode}}</view>
  62. <view class="goodsMs">{{item.specificationModel}} </view>
  63. </view>
  64. </view>
  65. </view>
  66. <nodata v-if="MaintainPartList.length==0"></nodata>
  67. </view>
  68. <!-- <view class="jiyouBox" v-if="loading">
  69. <view class="jiyouTop">
  70. <view class="jiyoutopTitle">原厂售后推荐</view>
  71. </view>
  72. <view class="salesLine">
  73. <view class="salesLeft">建议加注量</view>
  74. <view class="salesRight">{{oilusage}}</view>
  75. </view>
  76. <view class="salesLine">
  77. <view class="salesLeft">规格型号</view>
  78. <view class="salesRight">{{spec}}</view>
  79. </view>
  80. </view> -->
  81. </view>
  82. </view>
  83. </template>
  84. <script>
  85. import nodata from '../../components/nodata/nodata.vue'
  86. import homenav from "../../components/homenav/nav.vue"
  87. export default {
  88. components: {
  89. nodata,homenav
  90. },
  91. data() {
  92. return {
  93. optdata:'',
  94. MaintainPartList:[],
  95. oilusage:'',
  96. iStatusBarHeight:'',
  97. loading:false,
  98. spec:'',
  99. modelRemarkNum:1,
  100. oldMaintainPartList:'',
  101. type:'',
  102. leftIndex:0,
  103. leftData:[
  104. {name:'机油',componentCode:'015001'},
  105. {name:'变速箱油',componentCode:'007005'},
  106. {name:'变速箱滤清器',componentCode:'007004'},
  107. {name:'雨刷',componentCode:'006004'},
  108. ],
  109. componentCode:'015001',
  110. componentName:'机油',
  111. brandList:[
  112. {name:'欧洲维修',id:'69c6828c-8994-4d2e-8c25-a89c05e13b18',ck:false},
  113. {name:'美孚',id:'05897c44-8852-449a-8165-ba7a8675a16c',ck:false},
  114. {name:'嘉实多',id:'2f0b65aa-4945-4962-b794-7e2cd35685a8',ck:false},
  115. ],
  116. brandId:'',
  117. }
  118. },
  119. onLoad(opt) {
  120. console.log(opt)
  121. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  122. this.optdata=opt;
  123. if(this.optdata.type){
  124. this.type=this.optdata.type
  125. }
  126. this.queryMaintainPartList()
  127. this.queryOilInfoByGroupID()
  128. },
  129. methods: {
  130. leftFn(index,item){
  131. this.leftIndex=index
  132. this.componentCode=item.componentCode
  133. this.componentName=item.name
  134. this.queryMaintainPartList()
  135. },
  136. ckBrand(item){
  137. item.ck=!item.ck
  138. //this.type=num
  139. var ids=[]
  140. this.brandList.forEach(item=>{
  141. if(item.ck){
  142. ids.push(item.id)
  143. }
  144. })
  145. this.brandId=ids.join(',')
  146. this.queryMaintainPartList()
  147. },
  148. goinstallation(){
  149. uni.navigateTo({
  150. url:'installation?groupIds='+this.optdata.id+'&componentCode='+this.componentCode
  151. })
  152. },
  153. modelRemarkTab(num){
  154. this.modelRemarkNum=num
  155. if(num == 1){
  156. var name='0-10万公里'
  157. var arr=[]
  158. this.oldMaintainPartList.forEach(item=>{
  159. var state=false
  160. item.ruleList.forEach(v=>{
  161. if(v.version == name){
  162. state=true
  163. }
  164. })
  165. if(state){
  166. arr.push(item)
  167. }
  168. })
  169. this.MaintainPartList=arr
  170. //this.MaintainPartList= this.oldMaintainPartList.filter(item => item.modelRemark.includes(name))
  171. }else{
  172. var name='10万公里以上'
  173. var arr=[]
  174. this.oldMaintainPartList.forEach(item=>{
  175. var state=false
  176. item.ruleList.forEach(v=>{
  177. if(v.version == name){
  178. state=true
  179. }
  180. })
  181. if(state){
  182. arr.push(item)
  183. }
  184. })
  185. this.MaintainPartList=arr
  186. //this.MaintainPartList= this.oldMaintainPartList.filter(item => item.modelRemark.includes(name))
  187. }
  188. },
  189. queryMaintainPartList(){
  190. this.loading=false;
  191. uni.showLoading({ title: '加载中'});
  192. if(this.componentCode){
  193. var json={
  194. groupId:this.optdata.id,
  195. componentCode:this.componentCode,
  196. brandId:this.brandId
  197. }
  198. }else{
  199. var json={
  200. groupId:this.optdata.id,
  201. brandId:this.brandId
  202. }
  203. }
  204. this.$http('partsByOpen/queryMaintainPartList', json,'POST').then(res => {
  205. this.loading=true;
  206. uni.hideLoading();
  207. this.MaintainPartList=res.data
  208. this.oldMaintainPartList=res.data
  209. // this.modelRemarkTab(1)
  210. })
  211. },
  212. queryOilInfoByGroupID(){
  213. var that=this;
  214. this.$http('matchingByOpen/queryOilInfoByGroupID', {
  215. // mileage:'30000',
  216. groupId:this.optdata.id,
  217. },'POST').then(res => {
  218. var arr = res.data
  219. arr.forEach(item=>{
  220. if(item[0]=='机油'){
  221. that.oilusage=item[2]
  222. that.spec=item[1]
  223. }
  224. })
  225. console.log(that.oilusage)
  226. })
  227. },
  228. goby(){
  229. uni.navigateTo({
  230. url:'/pages/index/maintenance?nLevelID='+this.optdata.nLevelID+'&id='+this.optdata.id
  231. })
  232. },
  233. godetail(e){
  234. uni.navigateTo({
  235. url:'/pages/index/goodsDetail?id='+e.id
  236. })
  237. },
  238. gopz(){
  239. uni.navigateTo({
  240. url:'/pages/index/carConfiguration?nLevelID='+this.optdata.nLevelID
  241. })
  242. }
  243. }
  244. }
  245. </script>
  246. <style scoped>
  247. .goodscont{
  248. display: flex;margin-top: 20rpx;
  249. }
  250. .salesLine{
  251. display: flex;
  252. font-size: 24rpx;
  253. line-height: 30rpx;
  254. padding: 20rpx 0;
  255. }
  256. .goodsLefeLine{
  257. display: flex;justify-content: center;
  258. padding: 22rpx 0;
  259. }
  260. .brandBox {
  261. padding: 30rpx 20rpx;
  262. }
  263. .goosLeft{
  264. width: 160rpx;
  265. font-size: 26rpx;
  266. color: #3C3C3C;
  267. }
  268. .salesLeft{
  269. width: 200rpx;
  270. color: #999999;
  271. }
  272. .content {
  273. min-height: 100vh;
  274. background: #F4F5F7;
  275. }
  276. .jyimgBox{
  277. border: 1px solid #EEEEEE; width: 90rpx;border-radius: 10rpx;
  278. height: 90rpx;
  279. }
  280. .box {
  281. padding: 0 24rpx;
  282. background: #ffffff;
  283. }
  284. .historylinecarImg{
  285. width: 54rpx;
  286. height: 54rpx;
  287. }
  288. .historyLogoBox{
  289. display: flex;align-items: center;
  290. padding-right: 14rpx;
  291. }
  292. .historylinecar {
  293. font-weight: 500;
  294. font-size: 26rpx;
  295. color: #1A1A1A;
  296. line-height: 46rpx;
  297. width: 636rpx;
  298. }
  299. .historyLine {
  300. display: flex;
  301. padding: 30rpx 0;
  302. /* border-top: 1rpx solid #EEEEEE; */
  303. padding-bottom: 16rpx;
  304. }
  305. .cont {
  306. /* padding: 30rpx 24rpx; */
  307. }
  308. .toplineImg{
  309. width: 35rpx;
  310. height: 34rpx;
  311. }
  312. .topName{
  313. line-height: 34rpx;font-weight: 400;
  314. color: #FFFFFF;font-size: 28rpx;padding-left: 16rpx;
  315. }
  316. .topBox{
  317. width: 702rpx;
  318. height: 98rpx;
  319. background: #FFFFFF linear-gradient(132deg, #FF8635 0%, #FF4828 100%);
  320. border-radius: 16rpx;
  321. display: flex;justify-content: center;
  322. }
  323. .topsx{
  324. width: 2rpx;background: #ffffff;
  325. margin-left: 85rpx;margin-right: 85rpx;
  326. height: 54rpx;margin-top: 22rpx;
  327. }
  328. .topLine{
  329. display: flex;padding-top: 34rpx;
  330. }
  331. .jiyouTop{
  332. display: flex;justify-content: space-between;
  333. }
  334. .jiyouBox{
  335. /* margin-top: 30rpx; */
  336. background: #ffffff;
  337. /* padding: 30rpx; */
  338. width: 590rpx;
  339. }
  340. .jiyoutopTitle{
  341. font-weight: 500;font-size: 28rpx;
  342. color: #1A1A1A;
  343. line-height: 40rpx;
  344. }
  345. .jyzl{
  346. font-weight: 400;line-height: 40rpx;
  347. color: #666666;font-size: 24rpx;
  348. }
  349. .jyimg{
  350. width: 90rpx;
  351. height: 90rpx;
  352. border-radius: 10rpx;
  353. }
  354. .jyline{
  355. padding: 24rpx 20rpx;
  356. display: flex;
  357. border-bottom: 1px solid #EEEEEE;
  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;justify-content: space-between;
  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: #F19D01;
  428. width: 180rpx;
  429. height: 56rpx;
  430. border-radius: 28rpx;
  431. border: 1px solid #F19D01;
  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:#3F90F7;
  440. width: 62rpx;
  441. height: 34rpx;
  442. line-height: 34rpx;
  443. text-align: right;
  444. }
  445. .brandBox{
  446. display: flex;
  447. }
  448. .brandBtn{
  449. font-size: 26rpx;
  450. color: #3C3C3C;
  451. padding: 10rpx 20rpx;
  452. background: #F6F6F6;
  453. border-radius: 6rpx;
  454. margin-right: 20rpx;
  455. }
  456. .lineRgiht{
  457. padding-left: 24rpx;
  458. }
  459. .goodsName{
  460. font-size: 28rpx;
  461. color: #3C3C3C;
  462. line-height: 40rpx;
  463. }
  464. .goodsMs{
  465. font-size: 24rpx;
  466. color: #999999;
  467. line-height: 33rpx;
  468. padding-top: 10rpx;
  469. }
  470. .brandActive{
  471. background: rgba(255,79,0,0.08);
  472. border-radius: 6rpx;
  473. color: #FF4F00;
  474. }
  475. .glActive{
  476. background: #ffffff;
  477. }
  478. .glActive .glName{
  479. font-weight: 500;
  480. font-size: 26rpx;
  481. color: #E60006;
  482. border-left:4rpx solid #E60006;
  483. }
  484. .glName{
  485. padding: 0 16rpx;
  486. }
  487. .ckName{
  488. width: 532rpx;
  489. height: 60rpx;
  490. background: #F6F6F6;
  491. border-radius: 4rpx;
  492. font-size: 24rpx;
  493. color: #3C3C3C;
  494. line-height: 60rpx;
  495. margin-left: 20rpx;
  496. padding-left: 20rpx;
  497. }
  498. </style>