Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
U
uni-app-base
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
tangfh
uni-app-base
Commits
a09dbf9c
Commit
a09dbf9c
authored
Jul 14, 2023
by
tangfh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
+
parent
a164207a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
base-tab.vue
pages/template/base-tab.vue
+11
-7
No files found.
pages/template/base-tab.vue
View file @
a09dbf9c
...
@@ -9,14 +9,15 @@
...
@@ -9,14 +9,15 @@
<swiper
:current=
"tabIndex"
class=
"swiper-box"
:duration=
"300"
@
change=
"onTabChange"
<swiper
:current=
"tabIndex"
class=
"swiper-box"
:duration=
"300"
@
change=
"onTabChange"
:style=
"
{height: swiperHeight + 'px'}">
:style=
"
{height: swiperHeight + 'px'}">
<swiper-item
class=
"swiper-item"
v-for=
"(tab,index) in tabBars"
:key=
"index"
>
<swiper-item
class=
"swiper-item"
v-for=
"(tab,index) in tabBars"
:key=
"index"
>
<scroll-view
class=
"scroll-v"
scroll-y
:refresher-enabled=
"tab.content.refresherEnable"
@
refresherrefresh=
"onRefresh()"
<scroll-view
class=
"scroll-v"
scroll-y
:refresher-enabled=
"tab.content.refresherEnable"
:enable-back-to-top=
"true"
:lower-threshold=
"75"
:refresher-triggered=
"tab.content.refreshing"
@
refresherrefresh=
"onRefresh()"
:enable-back-to-top=
"true"
:lower-threshold=
"75"
@
scrolltolower=
"onLoadMore(index)"
:style=
"
{height: (swiperHeight) + 'px'}">
:refresher-triggered=
"tab.content.refreshing"
@
scrolltolower=
"onLoadMore(index)"
:style=
"
{height: (swiperHeight) + 'px'}">
<view
class=
"flex-column"
v-if=
"tab.content.list.length > 0"
<view
class=
"flex-column"
v-if=
"tab.content.list.length > 0"
:style=
"
{'min-height': (swiperHeight + 'px')}">
:style=
"
{'min-height': (swiperHeight + 'px')}">
<view
class=
"view-tmp1 active"
v-for=
"(item2, index2) in tab.content.list"
:index=
"index2"
<view
class=
"view-tmp1 active"
v-for=
"(item2, index2) in tab.content.list"
:index=
"index2"
:key=
"index2"
:item=
"item2"
@
onItemClick=
"onItemClick(item2, index2)"
>
:key=
"index2"
:item=
"item2"
@
onItemClick=
"onItemClick(item2, index2)"
>
<text>
hello
</text>
<text>
hello
</text>
</view>
</view>
</view>
</view>
<c-status-view
v-if=
"tab.content.list.length == 0 && !tab.content.firstRequest"
<c-status-view
v-if=
"tab.content.list.length == 0 && !tab.content.firstRequest"
...
@@ -64,7 +65,7 @@
...
@@ -64,7 +65,7 @@
},
},
loadMoreViewStatus
:
'noMore'
,
loadMoreViewStatus
:
'noMore'
,
cacheTab
:
[],
cacheTab
:
[],
tabIndex
:
0
,
tabIndex
:
0
,
tabBars
:
[
TABBARS
.
apply
,
TABBARS
.
passed
],
tabBars
:
[
TABBARS
.
apply
,
TABBARS
.
passed
],
screen
:
""
,
screen
:
""
,
tabItemMargin
:
30
,
//tabItem第一个margin-left和最后一个margin-right的margin
tabItemMargin
:
30
,
//tabItem第一个margin-left和最后一个margin-right的margin
...
@@ -80,7 +81,7 @@
...
@@ -80,7 +81,7 @@
onLoad
(
option
)
{
onLoad
(
option
)
{
var
systemInfo
=
uni
.
getSystemInfoSync
();
var
systemInfo
=
uni
.
getSystemInfoSync
();
//scroll-view的高度 = 屏幕高度 -(顶部状态栏高度 + 导航栏高度) -(底部tabBar高度 + 底部安全区域高度)
//scroll-view的高度 = 屏幕高度 -(顶部状态栏高度 + 导航栏高度) -(底部tabBar高度 + 底部安全区域高度)
this
.
tabWidth
=
(
getApp
().
globalData
.
screenWidth
-
this
.
tabItemMargin
*
2
)
/
this
.
tabBars
.
length
;
this
.
tabWidth
=
(
getApp
().
globalData
.
screenWidth
-
this
.
tabItemMargin
*
2
)
/
this
.
tabBars
.
length
;
let
contentHeight
=
systemInfo
.
screenHeight
-
(
uni
.
getSystemInfoSync
()
let
contentHeight
=
systemInfo
.
screenHeight
-
(
uni
.
getSystemInfoSync
()
.
statusBarHeight
+
this
.
$refs
.
navBar
.
height
)
-
(
systemInfo
.
safeAreaInsets
.
bottom
);
.
statusBarHeight
+
this
.
$refs
.
navBar
.
height
)
-
(
systemInfo
.
safeAreaInsets
.
bottom
);
...
@@ -103,7 +104,7 @@
...
@@ -103,7 +104,7 @@
var
tab
=
this
.
tabBars
[
this
.
tabIndex
];
var
tab
=
this
.
tabBars
[
this
.
tabIndex
];
setTimeout
(()
=>
{
setTimeout
(()
=>
{
tab
.
content
.
refreshing
=
true
;
tab
.
content
.
refreshing
=
true
;
},
1000
)
},
35
)
},
},
onNavBarLeftClick
()
{
onNavBarLeftClick
()
{
uni
.
navigateBack
();
uni
.
navigateBack
();
...
@@ -138,6 +139,8 @@
...
@@ -138,6 +139,8 @@
if
(
!
url
)
{
if
(
!
url
)
{
return
;
return
;
}
}
var
tab
=
this
.
tabBars
[
this
.
tabIndex
];
tab
.
content
.
refreshFlag
=
false
;
let
param
=
{
let
param
=
{
status
:
this
.
tabBars
[
index
].
type
,
status
:
this
.
tabBars
[
index
].
type
,
screen
:
this
.
screen
,
screen
:
this
.
screen
,
...
@@ -184,6 +187,7 @@
...
@@ -184,6 +187,7 @@
},
},
requestComplete
()
{
requestComplete
()
{
var
tab
=
this
.
tabBars
[
this
.
tabIndex
];
var
tab
=
this
.
tabBars
[
this
.
tabIndex
];
tab
.
content
.
refreshFlag
=
false
;
tab
.
content
.
firstRequest
=
false
;
tab
.
content
.
firstRequest
=
false
;
tab
.
content
.
refreshing
=
false
;
tab
.
content
.
refreshing
=
false
;
tab
.
content
.
isRequestComplete
=
true
;
tab
.
content
.
isRequestComplete
=
true
;
...
...
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