8 changed files with 63 additions and 47 deletions
Split View
Diff Options
-
14components/tabi/index.js
-
18components/tabi/index.wxml
-
15components/tabi/index.wxss
-
4pages/agent/factory/index.js
-
6pages/agent/fragment/index.js
-
6pages/agent/fragment/index.wxml
-
43pages/moment/theall/index.js
-
4pages/moment/theall/index.wxml
@ -1,10 +1,20 @@ |
|||
<scroll-view class="scroll-view" style="height: {{size}}rpx;" scroll-x="{{scrolling}}" scroll-with-animation="{{scrolling}}" scroll-left="{{scrollLeft}}"> |
|||
<view class="tabs-wrap"> |
|||
<view class="tabs {{scroll ? 'tabs--scroll' : ''}}" style="height: {{size}}rpx"> |
|||
<view class="tabs__item {{index === tabIndex ? 'tabs__item--cur': ''}}" style="height: {{size}}rpx;line-height: {{size}}rpx" wx:for="{{tabData}}" wx:key="*this" bindtap="toggleTab" data-index="{{index}}"> |
|||
<view class="tabs__item-child">{{item}}</view> |
|||
<view class="tabs__item {{index === tabIndex ? 'tabs__item--cur': ''}}" style="height: {{size}}rpx;line-height: {{size}}rpx;padding: 0 {{lineType == 1?4: 30}}rpx;" wx:for="{{tabData}}" wx:key="*this" bindtap="toggleTab" data-index="{{index}}"> |
|||
<view class="tabs__item-child {{lineType == 1?'tabs-type': ''}} {{typeActive(lineType, tabIndex, index)}}">{{item}}</view> |
|||
</view> |
|||
<view class="tabs__line {{needTransition ? 'transition' : ''}}" style="background: {{color}};width: {{lineWidth}}px;transform: translateX({{translateX}}px);height: {{lineHeight}}px"></view> |
|||
<view class="tabs__line {{needTransition ? 'transition' : ''}}" style="background: {{color}};width: {{lineWidth}}px;transform: translateX({{translateX}}px);height: {{lineHeight}}px" wx:if="{{lineType == 0}}"></view> |
|||
</view> |
|||
</view> |
|||
</scroll-view> |
|||
</scroll-view> |
|||
|
|||
<wxs module="typeActive"> |
|||
function typeActive(lineType, tabIndex, index) { |
|||
if (lineType == 0) { |
|||
return '' |
|||
} |
|||
return tabIndex == index ? 'type--cur' : '' |
|||
} |
|||
module.exports = typeActive |
|||
</wxs> |
|||
Write
Preview
Loading…
Cancel
Save