goodsList.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494
  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 5" @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">名称 规格型号</view>
  62. <view class="goodsMs">出厂编码</view>
  63. <view class="goodsMs">长了就换行显示,不要省略,长了就换行显示,不要省略,长了就换行显示,不要省略</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. </view>
  84. </template>
  85. <script>
  86. import nodata from '../../components/nodata/nodata.vue'
  87. import homenav from "../../components/homenav/nav.vue"
  88. export default {
  89. components: {
  90. nodata,homenav
  91. },
  92. data() {
  93. return {
  94. optdata:'',
  95. MaintainPartList:[],
  96. oilusage:'',
  97. iStatusBarHeight:'',
  98. loading:false,
  99. spec:'',
  100. modelRemarkNum:1,
  101. oldMaintainPartList:'',
  102. type:'',
  103. componentCode:'',
  104. leftData:[
  105. {name:'全部',componentCode:''},
  106. {name:'点火线圈',componentCode:'003001'},
  107. {name:'火花塞',componentCode:'003003'},
  108. ],
  109. leftIndex:0,
  110. }
  111. },
  112. onLoad(opt) {
  113. console.log(opt)
  114. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  115. this.optdata=opt;
  116. if(this.optdata.type){
  117. this.type=this.optdata.type
  118. }
  119. this.queryMaintainPartList()
  120. this.queryOilInfoByGroupID()
  121. },
  122. methods: {
  123. leftFn(index,item){
  124. this.leftIndex=index
  125. this.componentCode=item.componentCode
  126. this.componentName=item.name
  127. this.queryMaintainPartList()
  128. },
  129. ckBrand(num){
  130. this.type=num
  131. },
  132. goinstallation(){
  133. uni.navigateTo({
  134. url:'installation?groupIds='+this.optdata.id+'&componentId='
  135. })
  136. },
  137. modelRemarkTab(num){
  138. this.modelRemarkNum=num
  139. if(num == 1){
  140. var name='0-10万公里'
  141. var arr=[]
  142. this.oldMaintainPartList.forEach(item=>{
  143. var state=false
  144. item.ruleList.forEach(v=>{
  145. if(v.version == name){
  146. state=true
  147. }
  148. })
  149. if(state){
  150. arr.push(item)
  151. }
  152. })
  153. this.MaintainPartList=arr
  154. //this.MaintainPartList= this.oldMaintainPartList.filter(item => item.modelRemark.includes(name))
  155. }else{
  156. var name='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. }
  172. },
  173. queryMaintainPartList(){
  174. this.loading=false;
  175. uni.showLoading({ title: '加载中'});
  176. this.$http('partsByOpen/queryMaintainPartList', {
  177. groupId:this.optdata.id,
  178. componentCode:this.componentCode,
  179. },'POST').then(res => {
  180. this.loading=true;
  181. uni.hideLoading();
  182. this.MaintainPartList=res.data
  183. this.oldMaintainPartList=res.data
  184. // this.modelRemarkTab(1)
  185. })
  186. },
  187. queryOilInfoByGroupID(){
  188. var that=this;
  189. this.$http('matchingByOpen/queryOilInfoByGroupID', {
  190. // mileage:'30000',
  191. groupId:this.optdata.id,
  192. },'POST').then(res => {
  193. var arr = res.data
  194. arr.forEach(item=>{
  195. if(item[0]=='机油'){
  196. that.oilusage=item[2]
  197. that.spec=item[1]
  198. }
  199. })
  200. console.log(that.oilusage)
  201. })
  202. },
  203. goby(){
  204. uni.navigateTo({
  205. url:'/pages/index/maintenance?nLevelID='+this.optdata.nLevelID+'&id='+this.optdata.id
  206. })
  207. },
  208. godetail(e){
  209. uni.navigateTo({
  210. url:'/pages/index/goodsDetail?id='+e.id
  211. })
  212. },
  213. gopz(){
  214. uni.navigateTo({
  215. url:'/pages/index/carConfiguration?nLevelID='+this.optdata.nLevelID
  216. })
  217. }
  218. }
  219. }
  220. </script>
  221. <style scoped>
  222. .salesLine{
  223. display: flex;
  224. font-size: 24rpx;
  225. line-height: 30rpx;
  226. padding: 20rpx 0;
  227. }
  228. .salesLeft{
  229. width: 200rpx;
  230. color: #999999;
  231. }
  232. .content {
  233. min-height: 100vh;
  234. background: #F4F5F7;
  235. }
  236. .jyimgBox{
  237. border: 1px solid #EEEEEE; width: 90rpx;border-radius: 10rpx;
  238. height: 90rpx;
  239. }
  240. .box {
  241. padding: 0 24rpx;
  242. background: #ffffff;
  243. }
  244. .historylinecarImg{
  245. width: 54rpx;
  246. height: 54rpx;
  247. }
  248. .historyLogoBox{
  249. display: flex;align-items: center;
  250. padding-right: 14rpx;
  251. }
  252. .historylinecar {
  253. font-weight: 500;
  254. font-size: 26rpx;
  255. color: #1A1A1A;
  256. line-height: 46rpx;
  257. width: 636rpx;
  258. }
  259. .historyLine {
  260. display: flex;
  261. padding: 30rpx 0;
  262. /* border-top: 1rpx solid #EEEEEE; */
  263. padding-bottom: 16rpx;
  264. }
  265. .cont {
  266. /* padding: 30rpx 24rpx; */
  267. }
  268. .toplineImg{
  269. width: 35rpx;
  270. height: 34rpx;
  271. }
  272. .topName{
  273. line-height: 34rpx;font-weight: 400;
  274. color: #FFFFFF;font-size: 28rpx;padding-left: 16rpx;
  275. }
  276. .topBox{
  277. width: 702rpx;
  278. height: 98rpx;
  279. background: #FFFFFF linear-gradient(132deg, #FF8635 0%, #FF4828 100%);
  280. border-radius: 16rpx;
  281. display: flex;justify-content: center;
  282. }
  283. .topsx{
  284. width: 2rpx;background: #ffffff;
  285. margin-left: 85rpx;margin-right: 85rpx;
  286. height: 54rpx;margin-top: 22rpx;
  287. }
  288. .topLine{
  289. display: flex;padding-top: 34rpx;
  290. }
  291. .jiyouTop{
  292. display: flex;justify-content: space-between;
  293. }
  294. .jiyouBox{
  295. /* margin-top: 30rpx; */
  296. background: #ffffff;
  297. padding: 30rpx;
  298. width: 590rpx;
  299. }
  300. .jiyoutopTitle{
  301. font-weight: 500;font-size: 28rpx;
  302. color: #1A1A1A;
  303. line-height: 40rpx;
  304. }
  305. .jyzl{
  306. font-weight: 400;line-height: 40rpx;
  307. color: #666666;font-size: 24rpx;
  308. }
  309. .jyimg{
  310. width: 90rpx;
  311. height: 90rpx;
  312. border-radius: 10rpx;
  313. }
  314. .jyline{
  315. padding-top: 30rpx;
  316. display: flex;
  317. }
  318. .jyName{
  319. font-weight: 400;font-size: 22rpx;
  320. color: #1A1A1A;
  321. line-height:36rpx ;
  322. overflow: hidden;
  323. text-overflow: ellipsis;
  324. display: -webkit-box;
  325. -webkit-box-orient: vertical;
  326. -webkit-line-clamp: 2;
  327. padding-top: 10rpx;
  328. }
  329. .best{
  330. color: #FF4F00;border-radius: 6rpx;
  331. padding: 0 8rpx;border: 1px solid #FF4F00;
  332. }
  333. .jylineBox{
  334. /* display: flex;justify-content: space-between;flex-wrap: wrap; */
  335. }
  336. .historyLineVin{
  337. display: flex;background: #ffffff;
  338. }
  339. .historyLineCar{
  340. display: flex;justify-content: space-between;
  341. }
  342. .vinNum{
  343. font-weight: 400;font-size: 22rpx;padding-left: 10rpx;
  344. color: #999999;line-height: 30rpx;
  345. }
  346. .vinms{
  347. width: 38rpx;
  348. height: 26rpx;
  349. background: linear-gradient(224deg, #FFDA28 0%, #FFBF35 100%);
  350. border-radius: 4rpx;
  351. text-align: center;
  352. line-height: 26rpx;
  353. font-weight: 600;
  354. color: #FFFFFF;
  355. font-size: 18rpx;
  356. margin-top: 2rpx;
  357. }
  358. .ruleListSpan{
  359. font-weight: 400;
  360. font-size: 22rpx;
  361. color: #999999;
  362. line-height: 36rpx;
  363. padding-right: 6rpx;
  364. }
  365. .modelRemarkBox{
  366. display: flex;padding-bottom: 20rpx;
  367. }
  368. .modelRemarkLine{
  369. background: #eee;
  370. padding: 6rpx 20rpx;
  371. border-radius: 6rpx;
  372. margin-right: 30rpx;
  373. font-size: 26rpx;
  374. }
  375. .activeMr{
  376. background: #FFFFFF linear-gradient(132deg, #FF8635 0%, #FF4828 100%);
  377. color: #FFF;
  378. }
  379. .topBtnBox{
  380. display: flex;padding-bottom: 30rpx;
  381. padding-left: 70rpx;
  382. }
  383. .topBtn{
  384. font-weight: 400;
  385. font-size: 26rpx;
  386. color: #F19D01;
  387. width: 180rpx;
  388. height: 56rpx;
  389. border-radius: 28rpx;
  390. border: 1px solid #F19D01;
  391. line-height: 56rpx;
  392. text-align: center;
  393. margin-right: 30rpx;
  394. }
  395. .copyVin{
  396. font-weight: 400;
  397. font-size: 22rpx;
  398. color: #3C3C3C;
  399. width: 62rpx;
  400. height: 34rpx;
  401. background: #F4F5F7;
  402. border-radius: 4rpx;
  403. line-height: 34rpx;
  404. text-align: center;
  405. margin-left: 16rpx;
  406. }
  407. .brandBox{
  408. display: flex;
  409. }
  410. .brandBtn{
  411. font-size: 26rpx;
  412. color: #3C3C3C;
  413. padding: 10rpx 20rpx;
  414. background: #F6F6F6;
  415. border-radius: 6rpx;
  416. margin-right: 20rpx;
  417. }
  418. .lineRgiht{
  419. padding-left: 24rpx;
  420. }
  421. .goodsName{
  422. font-size: 28rpx;
  423. color: #3C3C3C;
  424. line-height: 40rpx;
  425. }
  426. .goodsMs{
  427. font-size: 24rpx;
  428. color: #999999;
  429. line-height: 33rpx;
  430. padding-top: 10rpx;
  431. }
  432. .brandActive{
  433. background: rgba(255,79,0,0.08);
  434. border-radius: 6rpx;
  435. color: #FF4F00;
  436. }
  437. .goosLeft{
  438. width: 190rpx;
  439. font-size: 26rpx;
  440. color: #3C3C3C;
  441. background: #F6F6F6;
  442. }
  443. .goodscont{
  444. display: flex;margin-top: 20rpx;
  445. min-height: calc(100vh - 450rpx);
  446. }
  447. .goodsLefeLine{
  448. display: flex;justify-content: center;
  449. padding: 22rpx 0;
  450. }
  451. .glActive{
  452. background: #ffffff;
  453. }
  454. .glActive .glName{
  455. font-weight: 500;
  456. font-size: 26rpx;
  457. color: #E60006;
  458. /* border-left:4rpx solid #E60006; */
  459. }
  460. .leftKK{
  461. background: #E60006;
  462. width: 6rpx ;
  463. height: 24rpx;
  464. border-radius: 4rpx;
  465. margin-top: 6rpx;
  466. overflow: hidden;
  467. }
  468. .leftKK2{
  469. width: 4rpx ;
  470. }
  471. .glName{
  472. width: 170rpx;text-align: center;
  473. font-size: 26rpx;
  474. }
  475. </style>