123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431 |
- <template>
- <view class="box">
- <scroll-view class="scroll-view" :scroll-into-view="toView" scroll-y="true">
- <view class="brand-select">
- <template v-for="item in brandList">
- <view :id="item.titleStr">
- <view class="brand-select-title" :id="item.titleStr">
- <h5 :class="{'brand-select-titleselect':item.titleStr==toView}">{{item.titleStr}}</h5>
- </view>
- <view class="brand-select-wrapper">
- <a class="brand-select-item" v-for="item2 in item.list" @click="selectBrand(item2)"
- :id="item2.brand">
- <img :src="item2.icon" class="brand-select-item-icon">
- <span>{{item2.brand||item2.name}}</span>
- </a>
- </view>
- </view>
-
- </template>
- </view>
- </scroll-view>
- <div class="fast-navigation">
- <a class="fast-navigation-sel" :class="{'select':item.titleStr==toView}" v-for="item in brandList" @tap="bindToView(item)">{{item.titleStr}}</a>
- </div>
- </view>
- </template>
- <script>
- export default {
- components: {
- },
- data() {
- return {
- brandList: [],
- toView: '',
-
-
- }
- },
- onLoad(opt) {
- this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
- this.getItemData();
- },
- methods: {
- //获取品牌
- getItemData() {
- let that = this
- uni.showLoading({
- title: '加载中'
- });
- this.$http('advancedEpc/getBrands', {
- // epc_id: this.epc_id,
- // token: this.token,
- // param: this.param,
- // access_time: this.access_time,
- // page: this.page
- }, 'GET').then(res => {
- uni.hideLoading();
- var list = res.data.result.list;
- var sectionTitle = [];
- var brandList = [];
- list.forEach(item => {
- if (item) {
- sectionTitle.push(item.first_letter);
- }
- })
- sectionTitle.sort();
- sectionTitle = Array.from(new Set(sectionTitle))
-
- sectionTitle.forEach(title => {
- var arr = [];
- list.forEach(item => {
- if (item.first_letter == title) {
- arr.push(item);
- }
- })
- var dic = {
- titleStr: title,
- list: arr
- };
- brandList.push(dic);
- })
- that.brandList = brandList;
- console.log('list==', brandList);
- });
- },
- selectBrand(item) {
- console.log(item)
-
- uni.navigateTo({
- url:'SelectCarTwo?epc_id=' + item.epc_id + '&brand_name=' + item.brand
- })
-
- },
- bindToView(item) {
- console.log(item)
-
- this.toView = item.titleStr
-
- console.log(this.toView)
- //this.scrollTop = 0
- },
- }
- }
- </script>
- <style scoped lang="scss">
- .box {
- height: calc(100vh - 44px);
- background: #F4F5F7;
- padding-bottom: constant(safe-area-inset-bottom);
- padding-bottom: env(safe-area-inset-bottom);
- }
- .baiheibackImg {
- width: 70rpx;
- height: 44rpx;
- }
- .gaunbiIMg {
- width: 20px;
- height: 20px;
- padding: 12px;
- }
- .sltpImg {
- width: 704rpx;
- height: 353rpx;
- }
- .sltp {
- padding-top: 20rpx;
- }
- .nodataImg {
- width: 400rpx;
- padding-top: 100rpx;
- }
- .noTxt {
- font-size: 36rpx;
- color: #999999;
- padding-top: 50rpx;
- }
- .nodataBox {
- text-align: center;
- }
- .addBtn {
- width: 690rpx;
- height: 74rpx;
- background: linear-gradient(124deg, #FF8700 0%, #FF4F00 100%);
- border-radius: 37rpx;
- line-height: 74rpx;
- text-align: center;
- color: #FFFFFF;
- font-size: 30rpx;
- position: fixed;
- bottom: 23rpx;
- left: 30rpx;
- }
- .carlistBox {
- padding-bottom: 120rpx;
- }
- .tab {
- background: #FFFFFF;
- display: flex;
- justify-content: space-around;
- line-height: 93rpx;
- color: #3C3C3C;
- font-size: 30rpx;
- border-bottom: 1px solid #F4F5F7;
- }
- .activeTab {
- color: #FF4F00;
- text-decoration: underline
- }
- /* .brand-select-title{
- height: 80px;
- background:rgba(247,247,247,1);
- position: relative;
- } */
- .brand-select {
- .brand-select-title {
- height: 80rpx;
- background: rgba(247, 247, 247, 1);
- position: relative;
- h5 {
- position: absolute;
- height: 40rpx;
- font-size: 28rpx;
- font-weight: 500;
- color: rgba(102, 102, 102, 1);
- line-height: 40rpx;
- top: 20rpx;
- left: 30rpx;
- }
- }
- .brand-select-wrapper {
- display: flex;
- flex-wrap: wrap;
- background: rgba(255, 255, 255, 1);
- width: 100vw;
- .brand-select-item {
- display: block;
- width: 126rpx;
- height: 120rpx;
- padding: 30rpx;
- img {
- display: inline-block;
- margin-left: 10rpx;
- width: 60rpx;
- height: 60rpx;
- }
- span {
- display: inline-block;
- text-align: center;
- // height: 33rpx;
- width: 106rpx;
- font-size: 24rpx;
- font-weight: 400;
- color: rgba(51, 51, 51, 1);
- // line-height: 33rpx;
- margin-left: -10rpx;
- }
- }
- }
- }
- .fast-navigation {
- position: fixed;
- text-align: center;
- right: 16rpx;
- top: 360rpx;
- width: 23rpx;
- font-size: 24rpx;
- font-weight: 500;
- line-height: 35rpx;
- color: rgb(153, 153, 153);
- a {
- display: block;
- }
- .select {
- color: #FF4F00;
- }
- }
- .scroll-view {
- height: calc(100vh - 93rpx);
- }
- .popup-height {
- width: 200px;
- }
- .popup-content {
- width: 590rpx;
- background: #FFFFFF;
- height: 100vh;
- }
- .carModel-nav-title {
- height: 100rpx;
- background: linear-gradient(134deg, #FF8635 0%, #FF4828 100%);
- line-height: 100rpx;
- display: flex;
- z-index: 500;
- &.cell-logo {
- position: sticky;
- top: 0;
- background: linear-gradient(134deg, #FF8635 0%, #FF4828 100%);
- }
- .carModel-nav-title-box {
- width: 100%;
- display: flex;
- }
- .carModel-nav-title-img {
- margin: 20rpx;
- width: 60rpx;
- height: 60rpx;
- }
- .carModel-nav-title-msg {
- font-size: 30rpx;
- font-weight: 400;
- color: rgba(255, 255, 255, 1);
- display: block;
- padding-right: 20rpx;
- }
- }
- .cell-item-title {
- height: 60rpx;
- background: rgba(250, 250, 250, 1);
- font-size: 28rpx;
- font-weight: 400;
- color: rgba(102, 102, 102, 1);
- line-height: 60rpx;
- padding-left: 26rpx;
- }
- .span-cell {
- position: relative;
- display: -webkit-box;
- display: -webkit-flex;
- display: flex;
- box-sizing: border-box;
- width: 100%;
- padding: 6rpx 30rpx;
- overflow: hidden;
- color: #323233;
- font-size: 3.73333vw;
- line-height: 82rpx;
- height: 82rpx;
- background-color: #fff;
- border-bottom: 1px solid #ebedf0;
- }
- .carModel-nav-title {
- height: 100rpx;
- background: linear-gradient(134deg, #FF8635 0%, #FF4828 100%);
- line-height: 100rpx;
- display: flex;
- z-index: 500;
- &.cell-logo {
- position: sticky;
- top: 0;
- background: linear-gradient(134deg, #FF8635 0%, #FF4828 100%);
- }
- .carModel-nav-title-box {
- width: 100%;
- display: flex;
- }
- .carModel-nav-title-img {
- margin: 20rpx;
- width: 60rpx;
- height: 60rpx;
- }
- .carModel-nav-title-msg {
- font-size: 30rpx;
- font-weight: 400;
- color: rgba(255, 255, 255, 1);
- display: block;
- padding-right: 20px;
- }
- }
- .displacementListLine {
- min-height: 50rpx;
- padding: 20rpx 20rpx 20rpx 30rpx;
- font-size: 28rpx;
- font-weight: 600;
- color: rgba(51, 51, 51, 1);
- line-height: 50rpx;
- border-top: 2rpx solid rgb(238, 238, 238);
- background-color: rgb(255, 255, 255);
- }
- .displacementListBox {
- position: fixed;
- top: 0;
- left: 0;
- width: 100vw;
- height: 100vh;
- background: #F4F5F7;
- z-index: 11111;
- /* #ifdef H5 */
- top: 44px;
- /* #endif */
- }
- .carGroupListBox {
- position: fixed;
- top: 0;
- left: 0;
- width: 100vw;
- height: 100vh;
- background: #F4F5F7;
- z-index: 11111;
- /* #ifdef H5 */
- top: 44px;
- /* #endif */
- }
- .brandList {
- height: calc(100vh - 250rpx);
- }
- .brand-select-titleselect {
- color: #FF4F00 !important;
- }
- </style>
|