SelectCarModel.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431
  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 brandList">
  6. <view :id="item.titleStr">
  7. <view class="brand-select-title" :id="item.titleStr">
  8. <h5 :class="{'brand-select-titleselect':item.titleStr==toView}">{{item.titleStr}}</h5>
  9. </view>
  10. <view class="brand-select-wrapper">
  11. <a class="brand-select-item" v-for="item2 in item.list" @click="selectBrand(item2)"
  12. :id="item2.brand">
  13. <img :src="item2.icon" class="brand-select-item-icon">
  14. <span>{{item2.brand||item2.name}}</span>
  15. </a>
  16. </view>
  17. </view>
  18. </template>
  19. </view>
  20. </scroll-view>
  21. <div class="fast-navigation">
  22. <a class="fast-navigation-sel" :class="{'select':item.titleStr==toView}" v-for="item in brandList" @tap="bindToView(item)">{{item.titleStr}}</a>
  23. </div>
  24. </view>
  25. </template>
  26. <script>
  27. export default {
  28. components: {
  29. },
  30. data() {
  31. return {
  32. brandList: [],
  33. toView: '',
  34. }
  35. },
  36. onLoad(opt) {
  37. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  38. this.getItemData();
  39. },
  40. methods: {
  41. //获取品牌
  42. getItemData() {
  43. let that = this
  44. uni.showLoading({
  45. title: '加载中'
  46. });
  47. this.$http('advancedEpc/getBrands', {
  48. // epc_id: this.epc_id,
  49. // token: this.token,
  50. // param: this.param,
  51. // access_time: this.access_time,
  52. // page: this.page
  53. }, 'GET').then(res => {
  54. uni.hideLoading();
  55. var list = res.data.result.list;
  56. var sectionTitle = [];
  57. var brandList = [];
  58. list.forEach(item => {
  59. if (item) {
  60. sectionTitle.push(item.first_letter);
  61. }
  62. })
  63. sectionTitle.sort();
  64. sectionTitle = Array.from(new Set(sectionTitle))
  65. sectionTitle.forEach(title => {
  66. var arr = [];
  67. list.forEach(item => {
  68. if (item.first_letter == title) {
  69. arr.push(item);
  70. }
  71. })
  72. var dic = {
  73. titleStr: title,
  74. list: arr
  75. };
  76. brandList.push(dic);
  77. })
  78. that.brandList = brandList;
  79. console.log('list==', brandList);
  80. });
  81. },
  82. selectBrand(item) {
  83. console.log(item)
  84. uni.navigateTo({
  85. url:'SelectCarTwo?epc_id=' + item.epc_id + '&brand_name=' + item.brand
  86. })
  87. },
  88. bindToView(item) {
  89. console.log(item)
  90. this.toView = item.titleStr
  91. console.log(this.toView)
  92. //this.scrollTop = 0
  93. },
  94. }
  95. }
  96. </script>
  97. <style scoped lang="scss">
  98. .box {
  99. height: calc(100vh - 44px);
  100. background: #F4F5F7;
  101. padding-bottom: constant(safe-area-inset-bottom);
  102. padding-bottom: env(safe-area-inset-bottom);
  103. }
  104. .baiheibackImg {
  105. width: 70rpx;
  106. height: 44rpx;
  107. }
  108. .gaunbiIMg {
  109. width: 20px;
  110. height: 20px;
  111. padding: 12px;
  112. }
  113. .sltpImg {
  114. width: 704rpx;
  115. height: 353rpx;
  116. }
  117. .sltp {
  118. padding-top: 20rpx;
  119. }
  120. .nodataImg {
  121. width: 400rpx;
  122. padding-top: 100rpx;
  123. }
  124. .noTxt {
  125. font-size: 36rpx;
  126. color: #999999;
  127. padding-top: 50rpx;
  128. }
  129. .nodataBox {
  130. text-align: center;
  131. }
  132. .addBtn {
  133. width: 690rpx;
  134. height: 74rpx;
  135. background: linear-gradient(124deg, #FF8700 0%, #FF4F00 100%);
  136. border-radius: 37rpx;
  137. line-height: 74rpx;
  138. text-align: center;
  139. color: #FFFFFF;
  140. font-size: 30rpx;
  141. position: fixed;
  142. bottom: 23rpx;
  143. left: 30rpx;
  144. }
  145. .carlistBox {
  146. padding-bottom: 120rpx;
  147. }
  148. .tab {
  149. background: #FFFFFF;
  150. display: flex;
  151. justify-content: space-around;
  152. line-height: 93rpx;
  153. color: #3C3C3C;
  154. font-size: 30rpx;
  155. border-bottom: 1px solid #F4F5F7;
  156. }
  157. .activeTab {
  158. color: #FF4F00;
  159. text-decoration: underline
  160. }
  161. /* .brand-select-title{
  162. height: 80px;
  163. background:rgba(247,247,247,1);
  164. position: relative;
  165. } */
  166. .brand-select {
  167. .brand-select-title {
  168. height: 80rpx;
  169. background: rgba(247, 247, 247, 1);
  170. position: relative;
  171. h5 {
  172. position: absolute;
  173. height: 40rpx;
  174. font-size: 28rpx;
  175. font-weight: 500;
  176. color: rgba(102, 102, 102, 1);
  177. line-height: 40rpx;
  178. top: 20rpx;
  179. left: 30rpx;
  180. }
  181. }
  182. .brand-select-wrapper {
  183. display: flex;
  184. flex-wrap: wrap;
  185. background: rgba(255, 255, 255, 1);
  186. width: 100vw;
  187. .brand-select-item {
  188. display: block;
  189. width: 126rpx;
  190. height: 120rpx;
  191. padding: 30rpx;
  192. img {
  193. display: inline-block;
  194. margin-left: 10rpx;
  195. width: 60rpx;
  196. height: 60rpx;
  197. }
  198. span {
  199. display: inline-block;
  200. text-align: center;
  201. // height: 33rpx;
  202. width: 106rpx;
  203. font-size: 24rpx;
  204. font-weight: 400;
  205. color: rgba(51, 51, 51, 1);
  206. // line-height: 33rpx;
  207. margin-left: -10rpx;
  208. }
  209. }
  210. }
  211. }
  212. .fast-navigation {
  213. position: fixed;
  214. text-align: center;
  215. right: 16rpx;
  216. top: 360rpx;
  217. width: 23rpx;
  218. font-size: 24rpx;
  219. font-weight: 500;
  220. line-height: 35rpx;
  221. color: rgb(153, 153, 153);
  222. a {
  223. display: block;
  224. }
  225. .select {
  226. color: #FF4F00;
  227. }
  228. }
  229. .scroll-view {
  230. height: calc(100vh - 93rpx);
  231. }
  232. .popup-height {
  233. width: 200px;
  234. }
  235. .popup-content {
  236. width: 590rpx;
  237. background: #FFFFFF;
  238. height: 100vh;
  239. }
  240. .carModel-nav-title {
  241. height: 100rpx;
  242. background: linear-gradient(134deg, #FF8635 0%, #FF4828 100%);
  243. line-height: 100rpx;
  244. display: flex;
  245. z-index: 500;
  246. &.cell-logo {
  247. position: sticky;
  248. top: 0;
  249. background: linear-gradient(134deg, #FF8635 0%, #FF4828 100%);
  250. }
  251. .carModel-nav-title-box {
  252. width: 100%;
  253. display: flex;
  254. }
  255. .carModel-nav-title-img {
  256. margin: 20rpx;
  257. width: 60rpx;
  258. height: 60rpx;
  259. }
  260. .carModel-nav-title-msg {
  261. font-size: 30rpx;
  262. font-weight: 400;
  263. color: rgba(255, 255, 255, 1);
  264. display: block;
  265. padding-right: 20rpx;
  266. }
  267. }
  268. .cell-item-title {
  269. height: 60rpx;
  270. background: rgba(250, 250, 250, 1);
  271. font-size: 28rpx;
  272. font-weight: 400;
  273. color: rgba(102, 102, 102, 1);
  274. line-height: 60rpx;
  275. padding-left: 26rpx;
  276. }
  277. .span-cell {
  278. position: relative;
  279. display: -webkit-box;
  280. display: -webkit-flex;
  281. display: flex;
  282. box-sizing: border-box;
  283. width: 100%;
  284. padding: 6rpx 30rpx;
  285. overflow: hidden;
  286. color: #323233;
  287. font-size: 3.73333vw;
  288. line-height: 82rpx;
  289. height: 82rpx;
  290. background-color: #fff;
  291. border-bottom: 1px solid #ebedf0;
  292. }
  293. .carModel-nav-title {
  294. height: 100rpx;
  295. background: linear-gradient(134deg, #FF8635 0%, #FF4828 100%);
  296. line-height: 100rpx;
  297. display: flex;
  298. z-index: 500;
  299. &.cell-logo {
  300. position: sticky;
  301. top: 0;
  302. background: linear-gradient(134deg, #FF8635 0%, #FF4828 100%);
  303. }
  304. .carModel-nav-title-box {
  305. width: 100%;
  306. display: flex;
  307. }
  308. .carModel-nav-title-img {
  309. margin: 20rpx;
  310. width: 60rpx;
  311. height: 60rpx;
  312. }
  313. .carModel-nav-title-msg {
  314. font-size: 30rpx;
  315. font-weight: 400;
  316. color: rgba(255, 255, 255, 1);
  317. display: block;
  318. padding-right: 20px;
  319. }
  320. }
  321. .displacementListLine {
  322. min-height: 50rpx;
  323. padding: 20rpx 20rpx 20rpx 30rpx;
  324. font-size: 28rpx;
  325. font-weight: 600;
  326. color: rgba(51, 51, 51, 1);
  327. line-height: 50rpx;
  328. border-top: 2rpx solid rgb(238, 238, 238);
  329. background-color: rgb(255, 255, 255);
  330. }
  331. .displacementListBox {
  332. position: fixed;
  333. top: 0;
  334. left: 0;
  335. width: 100vw;
  336. height: 100vh;
  337. background: #F4F5F7;
  338. z-index: 11111;
  339. /* #ifdef H5 */
  340. top: 44px;
  341. /* #endif */
  342. }
  343. .carGroupListBox {
  344. position: fixed;
  345. top: 0;
  346. left: 0;
  347. width: 100vw;
  348. height: 100vh;
  349. background: #F4F5F7;
  350. z-index: 11111;
  351. /* #ifdef H5 */
  352. top: 44px;
  353. /* #endif */
  354. }
  355. .brandList {
  356. height: calc(100vh - 250rpx);
  357. }
  358. .brand-select-titleselect {
  359. color: #FF4F00 !important;
  360. }
  361. </style>