Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
self-support
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李俊赕
self-support
Commits
4148b047
Commit
4148b047
authored
Jun 09, 2021
by
Damon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
u-tabs组件修改滑块高亮方式
parent
c277d327
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
12 deletions
+9
-12
complete.vue
src/pages/order/complete.vue
+3
-8
u-tabs.vue
src/uview-ui/components/u-tabs/u-tabs.vue
+6
-4
No files found.
src/pages/order/complete.vue
View file @
4148b047
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<complete-check
:show=
"completeCheck.status"
:list-data=
"completeCheck.result"
:pass=
"pass"
@
close=
"closeCheckResult"
@
confirm=
"confirm"
:confirm-button-text=
"completeCheck.confirmText"
:cancel-button-text=
"completeCheck.cancelText"
></complete-check>
<complete-check
:show=
"completeCheck.status"
:list-data=
"completeCheck.result"
:pass=
"pass"
@
close=
"closeCheckResult"
@
confirm=
"confirm"
:confirm-button-text=
"completeCheck.confirmText"
:cancel-button-text=
"completeCheck.cancelText"
></complete-check>
<view
class=
"com-content"
>
<view
class=
"com-content"
>
<u-navbar
:background=
"
{background: '#2272FF'}" back-icon-color="#fff" :title-size="32" title-color="#fff" :border-bottom="false" :title="list[tabIndex].panelName" title-bold>
</u-navbar>
<u-navbar
:background=
"
{background: '#2272FF'}" back-icon-color="#fff" :title-size="32" title-color="#fff" :border-bottom="false" :title="list[tabIndex].panelName" title-bold>
</u-navbar>
<u-tabs
-swiper
class=
"order-tabs"
ref=
"tabs"
:current=
"current"
:showBar=
"showBar"
name=
"panelName"
:list=
"tabList"
@
change=
"swichMenu"
bg-color=
"#2272FF"
inactive-color=
"#a6c6ff"
active-color=
"#fff"
height=
"80"
font-size=
"32"
></u-tabs-swiper
>
<u-tabs
class=
"order-tabs"
ref=
"tabs"
:current=
"current"
name=
"panelName"
:list=
"tabList"
@
change=
"swichMenu"
bg-color=
"#2272FF"
inactive-color=
"#a6c6ff"
active-color=
"#fff"
height=
"80"
font-size=
"32"
></u-tabs
>
<view
class=
"u-menu-wrap"
>
<view
class=
"u-menu-wrap"
>
<scroll-view
:scroll-top=
"scrollRightTop"
style=
"height: 100%;"
scroll-y
scroll-with-animation
class=
"right-box"
@
scroll=
"rightScroll"
:scroll-into-view=
"itemId"
>
<scroll-view
:scroll-top=
"scrollRightTop"
style=
"height: 100%;"
scroll-y
scroll-with-animation
class=
"right-box"
@
scroll=
"rightScroll"
:scroll-into-view=
"itemId"
>
<u-form
:model=
"form"
ref=
"uForm"
>
<u-form
:model=
"form"
ref=
"uForm"
>
...
@@ -208,7 +208,6 @@
...
@@ -208,7 +208,6 @@
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
showBar
:
false
,
orderId
:
0
,
orderId
:
0
,
categoryId
:
0
,
categoryId
:
0
,
orderServiceType
:
''
,
orderServiceType
:
''
,
...
@@ -382,10 +381,6 @@
...
@@ -382,10 +381,6 @@
this
.
list
=
list
this
.
list
=
list
// this.showTab = this.list.length > 1
// this.showTab = this.list.length > 1
setTimeout
(()
=>
{
this
.
showBar
=
true
this
.
current
=
0
},
1000
)
// 异常单处理
// 异常单处理
if
(
this
.
auditResultsId
)
this
.
checkCompleteError
()
if
(
this
.
auditResultsId
)
this
.
checkCompleteError
()
uni
.
hideLoading
()
uni
.
hideLoading
()
...
@@ -509,8 +504,8 @@
...
@@ -509,8 +504,8 @@
this
.
tabIndex
++
this
.
tabIndex
++
this
.
arr
=
[]
this
.
arr
=
[]
this
.
scrollRightTop
=
0
this
.
scrollRightTop
=
0
this
.
current
=
null
this
.
current
=
0
this
.
itemId
=
''
//
this.itemId = ''
//const itemId = this.list[this.tabIndex].items[0].items[0].fieldsId
//const itemId = this.list[this.tabIndex].items[0].items[0].fieldsId
//this.oldItemId = `item${itemId}`
//this.oldItemId = `item${itemId}`
this
.
$nextTick
(
async
()
=>
{
this
.
$nextTick
(
async
()
=>
{
...
...
src/uview-ui/components/u-tabs/u-tabs.vue
View file @
4148b047
...
@@ -10,8 +10,8 @@
...
@@ -10,8 +10,8 @@
:style=
"[tabItemStyle(index)]"
>
:style=
"[tabItemStyle(index)]"
>
<u-badge
:count=
"item[count] || item['count'] || 0"
:offset=
"offset"
size=
"mini"
></u-badge>
<u-badge
:count=
"item[count] || item['count'] || 0"
:offset=
"offset"
size=
"mini"
></u-badge>
{{
item
[
name
]
||
item
[
'name'
]
}}
{{
item
[
name
]
||
item
[
'name'
]
}}
<view
v-show=
"showBar && currentIndex === index"
class=
"u-tab-bar"
:style=
"[tabBarStyle]"
></view>
</view>
</view>
<view
v-if=
"showBar"
class=
"u-tab-bar"
:style=
"[tabBarStyle]"
></view>
</view>
</view>
</scroll-view>
</scroll-view>
</view>
</view>
...
@@ -197,14 +197,16 @@
...
@@ -197,14 +197,16 @@
tabBarStyle
()
{
tabBarStyle
()
{
let
style
=
{
let
style
=
{
width
:
this
.
barWidth
+
'rpx'
,
width
:
this
.
barWidth
+
'rpx'
,
transform
:
`translate(
${
this
.
scrollBarLeft
}
px, -100%)`
,
//
transform: `translate(${this.scrollBarLeft}px, -100%)`,
// 滑块在页面渲染后第一次滑动时,无需动画效果
// 滑块在页面渲染后第一次滑动时,无需动画效果
'transition-duration'
:
`
${
this
.
barFirstTimeMove
?
0
:
this
.
duration
}
s`
,
//
'transition-duration': `${this.barFirstTimeMove ? 0 : this.duration }s`,
'background-color'
:
this
.
activeColor
,
'background-color'
:
this
.
activeColor
,
height
:
this
.
barHeight
+
'rpx'
,
height
:
this
.
barHeight
+
'rpx'
,
opacity
:
this
.
barFirstTimeMove
?
0
:
1
,
opacity
:
this
.
barFirstTimeMove
?
0
:
1
,
// 设置一个很大的值,它会自动取能用的最大值,不用高度的一半,是因为高度可能是单数,会有小数出现
// 设置一个很大的值,它会自动取能用的最大值,不用高度的一半,是因为高度可能是单数,会有小数出现
'border-radius'
:
`
${
this
.
barHeight
/
2
}
px`
'border-radius'
:
`
${
this
.
barHeight
/
2
}
px`
,
'left'
:
'50%'
,
'margin-left'
:
`-
${
this
.
barWidth
/
2
}
rpx`
};
};
Object
.
assign
(
style
,
this
.
barStyle
);
Object
.
assign
(
style
,
this
.
barStyle
);
return
style
;
return
style
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment