SelectCarModel.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449
  1. <template>
  2. <view class="box">
  3. <scroll-view class="scroll-view" :scroll-into-view="toView" scroll-y="true" >
  4. <view class="brand-select">
  5. <template v-for="item in carModelList">
  6. <view :id="item['首字母']" v-if="item['首字母']!='热门'">
  7. <view class="brand-select-title" :id="item['首字母']+'-model'">
  8. <h5 :class="{'brand-select-titleselect':item['首字母']==toView}">{{item['首字母']}}</h5>
  9. </view>
  10. <view class="brand-select-wrapper">
  11. <a class="brand-select-item" v-for="item2 in item['品牌列表']" @click="selectBrand(item2)" :id="item2.brand">
  12. <img :src="item2.logo" class="brand-select-item-icon">
  13. <span>{{item2.brand||item2.name}}</span>
  14. </a>
  15. </view>
  16. </view>
  17. <view :id="'rm'" v-if="item['首字母']=='热门'">
  18. <view class="brand-select-title" :id="item['首字母']+'-model'">
  19. <h5 :class="{'brand-select-titleselect':item['首字母']==toView}">{{item['首字母']}}</h5>
  20. </view>
  21. <view class="brand-select-wrapper">
  22. <a class="brand-select-item" v-for="item2 in item['品牌列表']" @click="selectBrand(item2)" :id="item2.brand">
  23. <img :src="item2.logo" class="brand-select-item-icon">
  24. <span>{{item2.brand||item2.name}}</span>
  25. </a>
  26. </view>
  27. </view>
  28. </template>
  29. </view>
  30. </scroll-view >
  31. </view>
  32. </template>
  33. <script>
  34. export default {
  35. components: {
  36. },
  37. data() {
  38. return {
  39. carList:'',
  40. carModelList:'',
  41. toView:'',
  42. type:'right',
  43. brand:'',
  44. carSeriesList:'',
  45. selectedCarBrand:'',
  46. manufactor:'',
  47. carSeries:'',
  48. displacementList:'',
  49. displacementListShow:false,
  50. selectedCarSeries:'',
  51. displacement:'',
  52. carGroupList:'',
  53. carGroupListShow:false,
  54. type:'',
  55. delId:'',
  56. }
  57. },
  58. onLoad(opt) {
  59. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  60. if(opt.type==2){
  61. this.type=2
  62. }
  63. if(opt.add){
  64. this.addNum=opt.add
  65. }
  66. this.delId=opt.delId;
  67. // this.queryCarModelGroupPackage();
  68. },
  69. methods: {
  70. selectBrand(item){
  71. console.log(item)
  72. this.selectedCarBrand=item;
  73. this.$refs.popup.open("right")
  74. this.popupShow=true;
  75. this.brand=item.brand
  76. this.getbrand()
  77. },
  78. selectCarFactory(manufactor,item){
  79. this.manufactor=manufactor;
  80. this.carSeries=item;
  81. //this.selectedCarSeries=item
  82. this.displacementListShow=true;
  83. this.getdisplacementList()
  84. },
  85. selectDisplacement(item){
  86. this.displacement=item;
  87. this.carGroupListShow=true;
  88. this.getmodelList();
  89. },
  90. getmodelList(){
  91. uni.showLoading({
  92. title: '加载中'
  93. })
  94. this.$http('worldKeepCar/worldHome/queryCarModelGroupPackage', {
  95. brand:this.brand,
  96. manufactor:this.manufactor,
  97. carSeries:this.carSeries,
  98. displacement:this.displacement
  99. },'GET').then(res => {
  100. uni.hideLoading();
  101. this.carGroupList=res.data.carGroupList
  102. })
  103. },
  104. getdisplacementList(){
  105. uni.showLoading({
  106. title: '加载中'
  107. })
  108. this.$http('worldKeepCar/worldHome/queryCarModelGroupPackage', {
  109. brand:this.brand,
  110. manufactor:this.manufactor,
  111. carSeries:this.carSeries
  112. },'GET').then(res => {
  113. uni.hideLoading();
  114. this.displacementList=res.data.displacementList
  115. })
  116. },
  117. queryCarModelGroupPackage(){
  118. uni.showLoading({
  119. title: '加载中'
  120. })
  121. this.$http('worldKeepCar/worldHome/queryCarModelGroupPackage', {
  122. },'GET').then(res => {
  123. uni.hideLoading();
  124. this.carModelList=res.data.brands
  125. })
  126. },
  127. bindToView(item){
  128. console.log(item)
  129. if(item['首字母']=='热门'){
  130. this.toView ='rm'
  131. }else{
  132. this.toView = item['首字母']
  133. }
  134. console.log(this.toView)
  135. //this.scrollTop = 0
  136. },
  137. /* login(){
  138. uni.navigateTo({
  139. url:'../login/login'
  140. })
  141. } */
  142. close(){
  143. this.$refs.popup.close()
  144. },
  145. getbrand(){
  146. uni.showLoading({
  147. title: '加载中'
  148. })
  149. this.$http('worldKeepCar/worldHome/queryCarModelGroupPackage', {
  150. brand:this.brand
  151. },'GET').then(res => {
  152. uni.hideLoading();
  153. this.carSeriesList=res.data.carSeriesList
  154. })
  155. }
  156. }
  157. }
  158. </script>
  159. <style scoped lang="scss">
  160. .box{
  161. min-height: 100vh;
  162. background:#F4F5F7;
  163. padding-bottom: constant(safe-area-inset-bottom);
  164. padding-bottom: env(safe-area-inset-bottom);
  165. }
  166. .baiheibackImg{
  167. width: 70rpx;
  168. height: 44rpx;
  169. }
  170. .gaunbiIMg{
  171. width: 20px;
  172. height: 20px;
  173. padding: 12px;
  174. }
  175. .sltpImg{
  176. width: 704rpx;
  177. height: 353rpx;
  178. }
  179. .sltp{
  180. padding-top: 20rpx;
  181. }
  182. .nodataImg{
  183. width: 400rpx;
  184. padding-top: 100rpx;
  185. }
  186. .noTxt{
  187. font-size: 36rpx;
  188. color: #999999;
  189. padding-top: 50rpx;
  190. }
  191. .nodataBox{
  192. text-align: center;
  193. }
  194. .addBtn{
  195. width: 690rpx;
  196. height: 74rpx;
  197. background: linear-gradient(124deg, #FF8700 0%, #FF4F00 100%);
  198. border-radius: 37rpx;
  199. line-height: 74rpx;
  200. text-align: center;
  201. color: #FFFFFF;
  202. font-size: 30rpx;
  203. position: fixed;
  204. bottom: 23rpx;
  205. left: 30rpx;
  206. }
  207. .carlistBox{
  208. padding-bottom: 120rpx;
  209. }
  210. .tab{
  211. background: #FFFFFF;
  212. display: flex;
  213. justify-content: space-around;
  214. line-height: 93rpx;
  215. color: #3C3C3C;
  216. font-size: 30rpx;
  217. border-bottom: 1px solid #F4F5F7;
  218. }
  219. .activeTab{
  220. color: #FF4F00;text-decoration: underline
  221. }
  222. /* .brand-select-title{
  223. height: 80px;
  224. background:rgba(247,247,247,1);
  225. position: relative;
  226. } */
  227. .brand-select{
  228. .brand-select-title{
  229. height: 80rpx;
  230. background:rgba(247,247,247,1);
  231. position: relative;
  232. h5{
  233. position: absolute;
  234. height:40rpx;
  235. font-size:28rpx;
  236. font-weight:500;
  237. color:rgba(102,102,102,1);
  238. line-height:40rpx;
  239. top: 20rpx;
  240. left: 30rpx;
  241. }
  242. }
  243. .brand-select-wrapper{
  244. display: flex;
  245. flex-wrap: wrap;
  246. background:rgba(255,255,255,1);
  247. width: 100vw;
  248. .brand-select-item{
  249. display: block;
  250. width: 80rpx;
  251. height: 100rpx;
  252. padding: 30rpx;
  253. img{
  254. display: inline-block;
  255. margin-left: 10rpx;
  256. width: 60rpx;
  257. height: 60rpx;
  258. }
  259. span{
  260. display: inline-block;
  261. text-align: center;
  262. height:33rpx;
  263. width: 90rpx;
  264. font-size:24rpx;
  265. font-weight:400;
  266. color:rgba(51,51,51,1);
  267. line-height:33rpx;
  268. }
  269. }
  270. }
  271. }
  272. .fast-navigation{
  273. position: fixed;
  274. text-align: center;
  275. right: 16rpx;
  276. top: 360rpx;
  277. width: 23rpx;
  278. font-size:24rpx;
  279. font-weight:500;
  280. line-height:35rpx;
  281. color: rgb(153, 153, 153);
  282. a{
  283. display: block;
  284. }
  285. .select{
  286. color: #FF4F00;
  287. }
  288. }
  289. .scroll-view{
  290. height: calc(100vh - 93rpx);
  291. }
  292. .popup-height {
  293. width: 200px;
  294. }
  295. .popup-content{
  296. width: 590rpx;
  297. background: #FFFFFF;
  298. height: 100vh;
  299. }
  300. .carModel-nav-title{
  301. height:100rpx;
  302. background: linear-gradient(134deg, #FF8635 0%, #FF4828 100%);
  303. line-height: 100rpx;
  304. display: flex;
  305. z-index: 500;
  306. &.cell-logo{
  307. position: sticky;
  308. top: 0;
  309. background: linear-gradient(134deg, #FF8635 0%, #FF4828 100%);
  310. }
  311. .carModel-nav-title-box{
  312. width: 100%;
  313. display: flex;
  314. }
  315. .carModel-nav-title-img{
  316. margin: 20rpx;
  317. width: 60rpx;
  318. height: 60rpx;
  319. }
  320. .carModel-nav-title-msg{
  321. font-size:30rpx;
  322. font-weight:400;
  323. color:rgba(255,255,255,1);
  324. display: block;
  325. padding-right: 20rpx;
  326. }
  327. }
  328. .cell-item-title{
  329. height:60rpx;
  330. background:rgba(250,250,250,1);
  331. font-size:28rpx;
  332. font-weight:400;
  333. color:rgba(102,102,102,1);
  334. line-height:60rpx;
  335. padding-left: 26rpx;
  336. }
  337. .span-cell{
  338. position: relative;
  339. display: -webkit-box;
  340. display: -webkit-flex;
  341. display: flex;
  342. box-sizing: border-box;
  343. width: 100%;
  344. padding: 6rpx 30rpx;
  345. overflow: hidden;
  346. color: #323233;
  347. font-size: 3.73333vw;
  348. line-height: 82rpx;
  349. height: 82rpx;
  350. background-color: #fff;
  351. border-bottom: 1px solid #ebedf0;
  352. }
  353. .carModel-nav-title{
  354. height:100rpx;
  355. background: linear-gradient(134deg, #FF8635 0%, #FF4828 100%);
  356. line-height: 100rpx;
  357. display: flex;
  358. z-index: 500;
  359. &.cell-logo{
  360. position: sticky;
  361. top: 0;
  362. background: linear-gradient(134deg, #FF8635 0%, #FF4828 100%);
  363. }
  364. .carModel-nav-title-box{
  365. width: 100%;
  366. display: flex;
  367. }
  368. .carModel-nav-title-img{
  369. margin: 20rpx;
  370. width: 60rpx;
  371. height: 60rpx;
  372. }
  373. .carModel-nav-title-msg{
  374. font-size:30rpx;
  375. font-weight:400;
  376. color:rgba(255,255,255,1);
  377. display: block;
  378. padding-right: 20px;
  379. }
  380. }
  381. .displacementListLine{
  382. min-height: 50rpx;
  383. padding: 20rpx 20rpx 20rpx 30rpx;
  384. font-size:28rpx;
  385. font-weight:600;
  386. color:rgba(51,51,51,1);
  387. line-height:50rpx;
  388. border-top: 2rpx solid rgb(238, 238, 238);
  389. background-color: rgb(255, 255, 255);
  390. }
  391. .displacementListBox{
  392. position: fixed;
  393. top: 0;
  394. left: 0;
  395. width: 100vw;
  396. height: 100vh;
  397. background:#F4F5F7 ;
  398. z-index: 11111;
  399. /* #ifdef H5 */
  400. top:44px;
  401. /* #endif */
  402. }
  403. .carGroupListBox{
  404. position: fixed;
  405. top: 0;
  406. left: 0;
  407. width: 100vw;
  408. height: 100vh;
  409. background:#F4F5F7 ;
  410. z-index: 11111;
  411. /* #ifdef H5 */
  412. top:44px;
  413. /* #endif */
  414. }
  415. .brandList{
  416. height: calc(100vh - 250rpx);
  417. }
  418. .brand-select-titleselect{
  419. color: #FF4F00 !important;
  420. }
  421. </style>