SelectCarModel.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447
  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. }
  164. .baiheibackImg{
  165. width: 70rpx;
  166. height: 44rpx;
  167. }
  168. .gaunbiIMg{
  169. width: 20px;
  170. height: 20px;
  171. padding: 12px;
  172. }
  173. .sltpImg{
  174. width: 704rpx;
  175. height: 353rpx;
  176. }
  177. .sltp{
  178. padding-top: 20rpx;
  179. }
  180. .nodataImg{
  181. width: 400rpx;
  182. padding-top: 100rpx;
  183. }
  184. .noTxt{
  185. font-size: 36rpx;
  186. color: #999999;
  187. padding-top: 50rpx;
  188. }
  189. .nodataBox{
  190. text-align: center;
  191. }
  192. .addBtn{
  193. width: 690rpx;
  194. height: 74rpx;
  195. background: linear-gradient(124deg, #FF8700 0%, #FF4F00 100%);
  196. border-radius: 37rpx;
  197. line-height: 74rpx;
  198. text-align: center;
  199. color: #FFFFFF;
  200. font-size: 30rpx;
  201. position: fixed;
  202. bottom: 23rpx;
  203. left: 30rpx;
  204. }
  205. .carlistBox{
  206. padding-bottom: 120rpx;
  207. }
  208. .tab{
  209. background: #FFFFFF;
  210. display: flex;
  211. justify-content: space-around;
  212. line-height: 93rpx;
  213. color: #3C3C3C;
  214. font-size: 30rpx;
  215. border-bottom: 1px solid #F4F5F7;
  216. }
  217. .activeTab{
  218. color: #FF4F00;text-decoration: underline
  219. }
  220. /* .brand-select-title{
  221. height: 80px;
  222. background:rgba(247,247,247,1);
  223. position: relative;
  224. } */
  225. .brand-select{
  226. .brand-select-title{
  227. height: 80rpx;
  228. background:rgba(247,247,247,1);
  229. position: relative;
  230. h5{
  231. position: absolute;
  232. height:40rpx;
  233. font-size:28rpx;
  234. font-weight:500;
  235. color:rgba(102,102,102,1);
  236. line-height:40rpx;
  237. top: 20rpx;
  238. left: 30rpx;
  239. }
  240. }
  241. .brand-select-wrapper{
  242. display: flex;
  243. flex-wrap: wrap;
  244. background:rgba(255,255,255,1);
  245. width: 100vw;
  246. .brand-select-item{
  247. display: block;
  248. width: 80rpx;
  249. height: 100rpx;
  250. padding: 30rpx;
  251. img{
  252. display: inline-block;
  253. margin-left: 10rpx;
  254. width: 60rpx;
  255. height: 60rpx;
  256. }
  257. span{
  258. display: inline-block;
  259. text-align: center;
  260. height:33rpx;
  261. width: 90rpx;
  262. font-size:24rpx;
  263. font-weight:400;
  264. color:rgba(51,51,51,1);
  265. line-height:33rpx;
  266. }
  267. }
  268. }
  269. }
  270. .fast-navigation{
  271. position: fixed;
  272. text-align: center;
  273. right: 16rpx;
  274. top: 360rpx;
  275. width: 23rpx;
  276. font-size:24rpx;
  277. font-weight:500;
  278. line-height:35rpx;
  279. color: rgb(153, 153, 153);
  280. a{
  281. display: block;
  282. }
  283. .select{
  284. color: #FF4F00;
  285. }
  286. }
  287. .scroll-view{
  288. height: calc(100vh - 93rpx);
  289. }
  290. .popup-height {
  291. width: 200px;
  292. }
  293. .popup-content{
  294. width: 590rpx;
  295. background: #FFFFFF;
  296. height: 100vh;
  297. }
  298. .carModel-nav-title{
  299. height:100rpx;
  300. background: linear-gradient(134deg, #FF8635 0%, #FF4828 100%);
  301. line-height: 100rpx;
  302. display: flex;
  303. z-index: 500;
  304. &.cell-logo{
  305. position: sticky;
  306. top: 0;
  307. background: linear-gradient(134deg, #FF8635 0%, #FF4828 100%);
  308. }
  309. .carModel-nav-title-box{
  310. width: 100%;
  311. display: flex;
  312. }
  313. .carModel-nav-title-img{
  314. margin: 20rpx;
  315. width: 60rpx;
  316. height: 60rpx;
  317. }
  318. .carModel-nav-title-msg{
  319. font-size:30rpx;
  320. font-weight:400;
  321. color:rgba(255,255,255,1);
  322. display: block;
  323. padding-right: 20rpx;
  324. }
  325. }
  326. .cell-item-title{
  327. height:60rpx;
  328. background:rgba(250,250,250,1);
  329. font-size:28rpx;
  330. font-weight:400;
  331. color:rgba(102,102,102,1);
  332. line-height:60rpx;
  333. padding-left: 26rpx;
  334. }
  335. .span-cell{
  336. position: relative;
  337. display: -webkit-box;
  338. display: -webkit-flex;
  339. display: flex;
  340. box-sizing: border-box;
  341. width: 100%;
  342. padding: 6rpx 30rpx;
  343. overflow: hidden;
  344. color: #323233;
  345. font-size: 3.73333vw;
  346. line-height: 82rpx;
  347. height: 82rpx;
  348. background-color: #fff;
  349. border-bottom: 1px solid #ebedf0;
  350. }
  351. .carModel-nav-title{
  352. height:100rpx;
  353. background: linear-gradient(134deg, #FF8635 0%, #FF4828 100%);
  354. line-height: 100rpx;
  355. display: flex;
  356. z-index: 500;
  357. &.cell-logo{
  358. position: sticky;
  359. top: 0;
  360. background: linear-gradient(134deg, #FF8635 0%, #FF4828 100%);
  361. }
  362. .carModel-nav-title-box{
  363. width: 100%;
  364. display: flex;
  365. }
  366. .carModel-nav-title-img{
  367. margin: 20rpx;
  368. width: 60rpx;
  369. height: 60rpx;
  370. }
  371. .carModel-nav-title-msg{
  372. font-size:30rpx;
  373. font-weight:400;
  374. color:rgba(255,255,255,1);
  375. display: block;
  376. padding-right: 20px;
  377. }
  378. }
  379. .displacementListLine{
  380. min-height: 50rpx;
  381. padding: 20rpx 20rpx 20rpx 30rpx;
  382. font-size:28rpx;
  383. font-weight:600;
  384. color:rgba(51,51,51,1);
  385. line-height:50rpx;
  386. border-top: 2rpx solid rgb(238, 238, 238);
  387. background-color: rgb(255, 255, 255);
  388. }
  389. .displacementListBox{
  390. position: fixed;
  391. top: 0;
  392. left: 0;
  393. width: 100vw;
  394. height: 100vh;
  395. background:#F4F5F7 ;
  396. z-index: 11111;
  397. /* #ifdef H5 */
  398. top:44px;
  399. /* #endif */
  400. }
  401. .carGroupListBox{
  402. position: fixed;
  403. top: 0;
  404. left: 0;
  405. width: 100vw;
  406. height: 100vh;
  407. background:#F4F5F7 ;
  408. z-index: 11111;
  409. /* #ifdef H5 */
  410. top:44px;
  411. /* #endif */
  412. }
  413. .brandList{
  414. height: calc(100vh - 250rpx);
  415. }
  416. .brand-select-titleselect{
  417. color: #FF4F00 !important;
  418. }
  419. </style>