小程序選項(xiàng)卡

wxml


<view?style="background:?#fff;">

??<view?class="swiper-tab">

????<view?class="swiper-tab-item"?data-current="0"?bindtap="clickTab">

??????門店環(huán)境

??????<i?class="?{{currentTab==0?'active':''}}"></i>

????</view>

????<view?class="swiper-tab-item"?data-current="1"?bindtap="clickTab">

??????團(tuán)隊(duì)風(fēng)采

??????<i?class="?{{currentTab==1?'active':''}}"></i>

????</view>

??</view>

??<view?class="{{currentTab==0???'show':'hidden'}}">

????<scroll-view>

??????<view?class="swiperitems">

????????<image?class=""?src="../../images/icon_chaoshi.png"></image>

????????<image?class=""?src="../../images/icon_chaoshi.png"></image>

??????</view>

????</scroll-view>

??</view>

??<view?class="{{currentTab==1???'show':'hidden'}}">

????<scroll-view>

??????<view?class="swiperitems">

????????<image?class=""?src="../../images/icon_ertong.png"></image>

??????</view>

????</scroll-view>

??</view>

</view>

js



data {

currentTab:?0

},

//滑動(dòng)切換

??swiperTab:?function?(e)?{

????var?that?=?this;

????that.setData({

??????currentTab:?e.detail.current

????});

??},

??//點(diǎn)擊切換

??clickTab:?function?(e)?{

????var?that?=?this;

????if?(this.data.currentTab?===?e.target.dataset.current)?{

??????return?false;

????}?else?{

??????that.setData({

????????currentTab:?e.target.dataset.current

??????})

????}

??},

wxss


.swiper-tab-item{

??display:?inline-block;

??width:?50%;

??color:#333;

}

?i.active{

display:?block;

border-bottom:?6rpx?solid?#00B1C5;

width:?60rpx;

margin-left:?62rpx;

}

.about_page{

??margin:?0?10px;

}

.swiper-tab{

??width:?50%;

??/*?border-bottom:?2rpx?solid?#ccc;?*/

??text-align:?center;

??height:?50rpx;

??line-height:?50rpx;

??display:?flex;

??flex-flow:?row;

??justify-content:?space-between;

??color:?#ccc;

??font-size:?16px;

??background:?#fff;

}

.swiper-tab-item{

??width:?50%;?

??color:#333;

}

.juzhong{

??margin:?0?auto;

}

.domain{

??background-color:?#fff;

??height:?100%;

??margin:0?10px;

}

.show{

??display:?block;

??margin:?26rpx?30rpx;

}

.hidden{

??display:?none;

}

.swiperitems?{

background:?#fff;

??margin:?24rpx?40rpx;

}

.swiperitems?image?{

??margin:?0?auto?20rpx;

??width:?100%;

}

效果



?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容