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
be64ade2
Commit
be64ade2
authored
May 19, 2023
by
tangfh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
+
parent
68f5dfc1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
42 deletions
+47
-42
base-page.vue
pages/template/base-page.vue
+3
-3
base-tab.vue
pages/template/base-tab.vue
+44
-39
No files found.
pages/template/base-page.vue
View file @
be64ade2
...
...
@@ -40,16 +40,16 @@
channel
:
"ongoning"
}
},
onLoad
()
{
onLoad
(
option
)
{
var
systemInfo
=
uni
.
getSystemInfoSync
();
//scroll-view的高度 = 屏幕高度 -(顶部状态栏高度 + 导航栏高度) -(底部tabBar高度 + 底部安全区域高度)
this
.
scrollViewHeight
=
systemInfo
.
screenHeight
-
(
uni
.
getSystemInfoSync
()
.
statusBarHeight
+
this
.
$refs
.
navBar
.
height
)
-
(
systemInfo
.
safeAreaInsets
.
bottom
)
-
90
/
getApp
().
globalData
.
pxToRpxScale
;
this
.
init
();
this
.
init
(
option
);
},
methods
:
{
init
()
{
init
(
option
)
{
this
.
onRefresh
()
},
onNavBarLeftClick
()
{
...
...
pages/template/base-tab.vue
View file @
be64ade2
...
...
@@ -88,7 +88,7 @@
}
}
},
onLoad
()
{
onLoad
(
option
)
{
var
systemInfo
=
uni
.
getSystemInfoSync
();
//scroll-view的高度 = 屏幕高度 -(顶部状态栏高度 + 导航栏高度) -(底部tabBar高度 + 底部安全区域高度)
this
.
scrollViewHeight
=
systemInfo
.
screenHeight
-
(
uni
.
getSystemInfoSync
()
...
...
@@ -98,46 +98,51 @@
this
.
svHeight
=
this
.
swiperHeight
;
this
.
tabWidth
=
(
getApp
().
globalData
.
screenWidth
-
this
.
tabItemMargin
*
2
)
/
this
.
tabBars
.
length
;
var
_this
=
this
;
setTimeout
(()
=>
{
_this
.
tabBars
.
forEach
((
tabBar
)
=>
{
var
tab
=
{
data
:
[],
isLoading
:
false
,
refreshing
:
false
,
refreshFlag
:
true
,
loadMoreFlag
:
true
,
loadStatus
:
constant
.
LOAD_STATUS
.
loading
,
page
:
1
,
total_pages
:
1
,
loadingText
:
'加载更多...'
,
isRequestComplete
:
false
,
channel
:
""
};
if
(
tabBar
.
type
==
REPAIR_LIST_TYPE
.
wait_alloc
.
type
)
{
tab
.
limit
=
10
;
tab
.
loadStatus
=
constant
.
LOAD_STATUS
.
more
;
tab
.
total_pages
=
1
;
tab
.
data
.
push
([{},{},{}]);
tab
.
channel
=
REPAIR_LIST_TYPE
.
wait_alloc
.
text
}
else
if
(
tabBar
.
type
==
REPAIR_LIST_TYPE
.
alloced
.
type
)
{
tab
.
limit
=
5
;
tab
.
loadStatus
=
constant
.
LOAD_STATUS
.
more
;
tab
.
total_pages
=
1
;
tab
.
data
.
push
([{},{},{},{},{},{}]);
tab
.
channel
=
REPAIR_LIST_TYPE
.
alloced
.
text
}
if
(
tab
.
total_pages
==
1
)
{
tab
.
loadStatus
=
constant
.
LOAD_STATUS
.
noMore
;
tab
.
loadingText
=
_this
.
loadTexts
.
contentnomore
;
}
_this
.
tabList
.
push
(
tab
);
});
_this
.
onRefresh
();
},
350
)
//this.loadTexts = this.$constant.LOAD_TEXTS;
this
.
init
(
option
);
},
methods
:
{
init
(
option
)
{
this
.
initTabBar
();
},
initTabBar
()
{
var
_this
=
this
;
setTimeout
(()
=>
{
_this
.
tabBars
.
forEach
((
tabBar
)
=>
{
var
tab
=
{
data
:
[],
isLoading
:
false
,
refreshing
:
false
,
refreshFlag
:
true
,
loadMoreFlag
:
true
,
loadStatus
:
constant
.
LOAD_STATUS
.
loading
,
page
:
1
,
total_pages
:
1
,
loadingText
:
'加载更多...'
,
isRequestComplete
:
false
,
channel
:
""
};
if
(
tabBar
.
type
==
REPAIR_LIST_TYPE
.
wait_alloc
.
type
)
{
tab
.
limit
=
10
;
tab
.
loadStatus
=
constant
.
LOAD_STATUS
.
more
;
tab
.
total_pages
=
1
;
tab
.
data
.
push
([{},{},{}]);
tab
.
channel
=
REPAIR_LIST_TYPE
.
wait_alloc
.
text
}
else
if
(
tabBar
.
type
==
REPAIR_LIST_TYPE
.
alloced
.
type
)
{
tab
.
limit
=
5
;
tab
.
loadStatus
=
constant
.
LOAD_STATUS
.
more
;
tab
.
total_pages
=
1
;
tab
.
data
.
push
([{},{},{},{},{},{}]);
tab
.
channel
=
REPAIR_LIST_TYPE
.
alloced
.
text
}
if
(
tab
.
total_pages
==
1
)
{
tab
.
loadStatus
=
constant
.
LOAD_STATUS
.
noMore
;
tab
.
loadingText
=
_this
.
loadTexts
.
contentnomore
;
}
_this
.
tabList
.
push
(
tab
);
});
_this
.
onRefresh
();
},
350
)
},
onNavBarLeftClick
()
{
uni
.
navigateBack
();
},
...
...
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