<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                [TOC] > 分類輪播用的是swiper組件 ## 展示效果 ![](https://img.kancloud.cn/7b/0d/7b0de757c6361633e602f2fed6afd78c_750x396.jpg) ## test.vue ~~~ <template> <view> <view class="category"> <view class="box"> <swiper class="swiper" duration="300" :style="{ height: categoryHeight }" @change="categoryChange"> <swiper-item v-for="(page, pageindex) in categoryList" :key="pageindex" > <view class="category-list"> <view class="icon" v-for="category in page" :key="category.cat_id" @tap="toCategory(category)"> <image mode="widthFix" :src="category.img" @load="categoryImgLoad"></image> <view>{{ category.title }}</view> </view> </view> </swiper-item> </swiper> <view class="dots"> <view v-for="(page, pageindex) in categoryList" :key="pageindex" :class="{ active: pageindex == currentPageindex }"></view> </view> </view> </view> </view> </template> <script> export default { data(){ return { categoryHeight: '150px', currentPageindex: 0, categoryList: [ [//第一頁 { cat_id: 0, img: '../../static/HM-shophome/category-img/0.png', title: '吹風機' }, { cat_id: 1, img: '../../static/HM-shophome/category-img/1.png', title: '發箍' }, { cat_id: 2, img: '../../static/HM-shophome/category-img/2.png', title: '肥皂' }, { cat_id: 3, img: '../../static/HM-shophome/category-img/3.png', title: '粉餅' }, { cat_id: 4, img: '../../static/HM-shophome/category-img/4.png', title: '化妝鏡' }, { cat_id: 5, img: '../../static/HM-shophome/category-img/5.png', title: '睫毛膏' }, { cat_id: 6, img: '../../static/HM-shophome/category-img/6.png', title: '睫毛夾' }, { cat_id: 7, img: '../../static/HM-shophome/category-img/7.png', title: '精華' }, { cat_id: 8, img: '../../static/HM-shophome/category-img/8.png', title: '口紅' }, { cat_id: 9, img: '../../static/HM-shophome/category-img/9.png', title: '面膜' } ], [//第二頁 { cat_id: 10, img: '../../static/HM-shophome/category-img/10.png', title: '面霜' }, { cat_id: 11, img: '../../static/HM-shophome/category-img/11.png', title: '乳液' }, { cat_id: 12, img: '../../static/HM-shophome/category-img/12.png', title: '梳子' }, { cat_id: 13, img: '../../static/HM-shophome/category-img/13.png', title: '刷子' }, { cat_id: 14, img: '../../static/HM-shophome/category-img/14.png', title: '洗臉儀' }, { cat_id: 15, img: '../../static/HM-shophome/category-img/15.png', title: '洗面奶' }, { cat_id: 16, img: '../../static/HM-shophome/category-img/16.png', title: '香水' } ] ] } }, onLoad() { this.$cache.set('taobaoId', 'xxxx212'); }, methods: { //分類圖片加載完畢 categoryImgLoad(e){ this.categoryImg = this.categoryImg?this.categoryImg+1:1; //完成加載11個分類圖片開始計算分類高度,若分類圖片不足10個則修改此處的10。 if(this.categoryImg==10){ this.getCategoryHeight(); } }, //更新分類高度 getCategoryHeight() { let view = uni.createSelectorQuery().select('.category-list'); view.fields( { size: true }, data => { this.categoryHeight = data.height + 'px'; } ).exec(); }, //更新分類指示器 categoryChange(event) { this.currentPageindex = event.detail.current; }, //分類跳轉 toCategory(e){ uni.showToast({title: e.title}); } } } </script> <style lang="scss"> .category { width: 95%; padding: 2.5vw 2.5vw; background-color: #ff570a; .box { width: 100%; border-radius: 20upx; background-color: #ffffff; .dots { display: flex; justify-content: center; height: 15upx; width: 100%; view{ width: 30upx; height: 5upx; background-color: rgba(0, 0, 0, 0.2); &.active { background-color: #ff570a; } } } .swiper { width: 100%; padding: 10upx 0; .uni-swiper-dot { width: 20upx; } .category-list { width: 100%; height: auto; display: flex; justify-content: flex-start; padding: 10upx 0; flex-flow: wrap; .icon { width: 20%; display: flex; flex-flow: wrap; justify-content: center; font-size: 22upx; color: #666; image { width: 70%; height: 13.3vw; } view{ width: 100%; display: flex; justify-content: center; } } } } } } </style> ~~~ ## 參考文檔: > https://ext.dcloud.net.cn/plugin?id=148
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看