Commit 761a0221 by 李嘉林

横向标签铺满样式调整

parent 2eed8a7b
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
:class="[ :class="[
'defaultTabsStyle', 'defaultTabsStyle',
'defaultTabsStyle' + componentIndex, 'defaultTabsStyle' + componentIndex,
tabStyle == 1 ? 'tabStyle1' : 'tabStyle2', 'tabStyle' + tabStyle,
stickyTop ? 'stickyTop' : '', stickyTop ? 'stickyTop' : '',
'tabLayout' + tabLayout, 'tabLayout' + tabLayout,
]" ]"
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
<banner :datas="item1"></banner> <banner :datas="item1"></banner>
</div> </div>
<div v-else-if="item1.componentCode=='goods-list' && item1.componentInfo.visible == 1" style="height:100%;"> <div v-else-if="item1.componentCode=='goods-list' && item1.componentInfo.visible == 1" style="height:100%;">
<goods-list :class="['goodsListItem']" :datas="item1"></goods-list> <goods-list class="goodsListItem" :datas="item1"></goods-list>
</div> </div>
<div v-else-if="item1.componentCode == 'area-navigation' && item1.componentInfo.visible == 1"> <div v-else-if="item1.componentCode == 'area-navigation' && item1.componentInfo.visible == 1">
<area-navigation :datas="item1" :changeLocation="changeLocation"></area-navigation> <area-navigation :datas="item1" :changeLocation="changeLocation"></area-navigation>
...@@ -569,11 +569,8 @@ export default { ...@@ -569,11 +569,8 @@ export default {
.tabStyle1 { .tabStyle1 {
.van-tabs__line { .van-tabs__line {
height: auto; height: 30px;
bottom: 4px; bottom: 6px;
top:4px;
left: 8px;
right: 8px;
border-radius: 38px; border-radius: 38px;
} }
} }
...@@ -614,8 +611,8 @@ export default { ...@@ -614,8 +611,8 @@ export default {
content: ""; content: "";
position:absolute; position:absolute;
bottom: 4px; bottom: 4px;
left: 8px; left: 0;
right: 8px; right: 0;
top: 4px; top: 4px;
border-radius: 34px; border-radius: 34px;
background: var(--default-tab-background-bolor); background: var(--default-tab-background-bolor);
...@@ -635,8 +632,8 @@ export default { ...@@ -635,8 +632,8 @@ export default {
content: ""; content: "";
position:absolute; position:absolute;
bottom: 4px; bottom: 4px;
left: 8px; left: 0;
right: 8px; right: 0;
height: 4px; height: 4px;
background: var(--default-tab-underline-color); background: var(--default-tab-underline-color);
z-index: -1; z-index: -1;
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
style="{{ color ? 'border-color: ' + color : '' }}" style="{{ color ? 'border-color: ' + color : '' }}"
> >
<view class="{{ utils.bem('tabs__nav', [type, { complete: !ellipsis }]) }} nav-class" style="{{ computed.navStyle(color, type) }}"> <view class="{{ utils.bem('tabs__nav', [type, { complete: !ellipsis }]) }} nav-class" style="{{ computed.navStyle(color, type) }}">
<view wx:if="{{ type === 'line' }}" class="van-tabs__line" style="{{ computed.lineStyle({ color, lineOffsetLeft, lineHeight, skipTransition, duration, lineWidth }) }}" /> <view wx:if="{{ type === 'line' }}" class="van-tabs__line" style="{{ computed.lineStyle(linePosition,{ color, lineOffsetLeft, lineHeight, skipTransition, duration, lineWidth }) }}" />
<view <view
wx:for="{{ tabs }}" wx:for="{{ tabs }}"
wx:key="index" wx:key="index"
......
...@@ -57,11 +57,14 @@ function trackStyle(data) { ...@@ -57,11 +57,14 @@ function trackStyle(data) {
}); });
} }
function lineStyle(data) { function lineStyle(linePosition,data) {
// 横向标签平铺模式缩短宽度
var lineWidth = linePosition == 3?(data.lineWidth - 32):data.lineWidth
var lineOffsetLeft = linePosition == 3 ? (data.lineOffsetLeft + 16) : data.lineOffsetLeft
return style({ return style({
width: utils.addUnit(data.lineWidth - 32), width: utils.addUnit(lineWidth),
transform: 'translateX(' + (data.lineOffsetLeft +16) + 'px)', transform: 'translateX(' + lineOffsetLeft + 'px)',
'-webkit-transform': 'translateX(' + (data.lineOffsetLeft + 16) + 'px)', '-webkit-transform': 'translateX(' + lineOffsetLeft + 'px)',
'background-color': data.color, 'background-color': data.color,
height: data.lineHeight !== -1 ? utils.addUnit(data.lineHeight) : null, height: data.lineHeight !== -1 ? utils.addUnit(data.lineHeight) : null,
'border-radius': 'border-radius':
...@@ -80,5 +83,3 @@ module.exports = { ...@@ -80,5 +83,3 @@ module.exports = {
lineStyle: lineStyle, lineStyle: lineStyle,
navStyle: navStyle, navStyle: navStyle,
}; };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment