Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ethan
/
appframe
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit 2e3fcdbe
authored
2025-12-20 10:50:33 +0800
by
tanghuan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
开发版和正式版显示区别
1 parent
b3e0e504
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
62 deletions
lib/ui/pages/web_page.dart
lib/ui/pages/web_page.dart
View file @
2e3fcdb
...
@@ -55,19 +55,19 @@ class WebPage extends StatelessWidget {
...
@@ -55,19 +55,19 @@ class WebPage extends StatelessWidget {
children:
[
children:
[
state
.
loaded
state
.
loaded
?
SizedBox
(
?
SizedBox
(
height:
MediaQuery
.
of
(
ctx
).
size
.
height
-
60
,
// 减去100像素留空
height:
MediaQuery
.
of
(
ctx
).
size
.
height
-
60
,
// 减去100像素留空
child:
WebViewWidget
(
controller:
ctx
.
read
<
WebCubit
>().
controller
),
child:
WebViewWidget
(
controller:
ctx
.
read
<
WebCubit
>().
controller
),
)
)
:
const
Center
(
:
const
Center
(
child:
Column
(
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
children:
[
CircularProgressIndicator
(
color:
Color
(
0xFF7691fa
)),
CircularProgressIndicator
(
color:
Color
(
0xFF7691fa
)),
SizedBox
(
height:
16
),
SizedBox
(
height:
16
),
Text
(
'加载中...'
),
Text
(
'加载中...'
),
],
],
),
),
),
),
// 添加升级遮罩层
// 添加升级遮罩层
if
(
state
.
isUpgrading
)
if
(
state
.
isUpgrading
)
Container
(
Container
(
...
@@ -87,34 +87,34 @@ class WebPage extends StatelessWidget {
...
@@ -87,34 +87,34 @@ class WebPage extends StatelessWidget {
),
),
bottomNavigationBar:
state
.
showBottomNavBar
bottomNavigationBar:
state
.
showBottomNavBar
?
BottomNavigationBar
(
?
BottomNavigationBar
(
type:
BottomNavigationBarType
.
fixed
,
type:
BottomNavigationBarType
.
fixed
,
currentIndex:
state
.
selectedIndex
,
currentIndex:
state
.
selectedIndex
,
selectedItemColor:
Color
(
0xFF7691fa
),
selectedItemColor:
Color
(
0xFF7691fa
),
unselectedItemColor:
Color
(
0xFF969799
),
unselectedItemColor:
Color
(
0xFF969799
),
onTap:
(
index
)
{
onTap:
(
index
)
{
// 更新选中索引
// 更新选中索引
ctx
.
read
<
WebCubit
>().
updateSelectedIndex
(
index
);
ctx
.
read
<
WebCubit
>().
updateSelectedIndex
(
index
);
// 根据 index 执行相应的操作
// 根据 index 执行相应的操作
},
},
items:
const
[
items:
const
[
BottomNavigationBarItem
(
BottomNavigationBarItem
(
icon:
Icon
(
Icons
.
home
,
size:
32
),
icon:
Icon
(
Icons
.
home
,
size:
32
),
label:
'我的班级'
,
label:
'我的班级'
,
),
),
BottomNavigationBarItem
(
BottomNavigationBarItem
(
icon:
Icon
(
Icons
.
contact_page
,
size:
32
),
icon:
Icon
(
Icons
.
contact_page
,
size:
32
),
label:
'通讯录'
,
label:
'通讯录'
,
),
),
BottomNavigationBarItem
(
BottomNavigationBarItem
(
icon:
Icon
(
Icons
.
find_in_page
,
size:
32
),
icon:
Icon
(
Icons
.
find_in_page
,
size:
32
),
label:
'发现'
,
label:
'发现'
,
),
),
BottomNavigationBarItem
(
BottomNavigationBarItem
(
icon:
Icon
(
Icons
.
person
,
size:
32
),
icon:
Icon
(
Icons
.
person
,
size:
32
),
label:
'我的'
,
label:
'我的'
,
),
),
],
],
)
)
:
null
,
:
null
,
),
),
);
);
...
@@ -138,26 +138,28 @@ class WebPage extends StatelessWidget {
...
@@ -138,26 +138,28 @@ class WebPage extends StatelessWidget {
AppBar
_buildAppBar
(
BuildContext
ctx
,
WebState
state
)
{
AppBar
_buildAppBar
(
BuildContext
ctx
,
WebState
state
)
{
return
AppBar
(
return
AppBar
(
title:
Text
(
state
.
title
+
state
.
testMsg
,
style:
TextStyle
(
color:
Color
(
state
.
titleColor
),
fontSize:
18
)),
title:
EnvConfig
.
isDev
()
?
Text
(
state
.
title
+
state
.
testMsg
,
style:
TextStyle
(
color:
Color
(
state
.
titleColor
),
fontSize:
18
))
:
Text
(
state
.
title
,
style:
TextStyle
(
color:
Color
(
state
.
titleColor
),
fontSize:
18
)),
centerTitle:
true
,
centerTitle:
true
,
automaticallyImplyLeading:
false
,
automaticallyImplyLeading:
false
,
backgroundColor:
Color
(
state
.
bgColor
),
backgroundColor:
Color
(
state
.
bgColor
),
actionsIconTheme:
IconThemeData
(
color:
Colors
.
white
),
actionsIconTheme:
IconThemeData
(
color:
Colors
.
white
),
leading:
state
.
opIcon
==
'back'
leading:
state
.
opIcon
==
'back'
?
IconButton
(
?
IconButton
(
icon:
const
Icon
(
Icons
.
arrow_back
,
color:
Colors
.
white
),
icon:
const
Icon
(
Icons
.
arrow_back
,
color:
Colors
.
white
),
onPressed:
()
{
onPressed:
()
{
ctx
.
read
<
WebCubit
>().
handleBack
();
ctx
.
read
<
WebCubit
>().
handleBack
();
},
},
)
)
:
(
state
.
opIcon
==
'home'
:
(
state
.
opIcon
==
'home'
?
IconButton
(
?
IconButton
(
icon:
const
Icon
(
Icons
.
home
,
color:
Colors
.
white
),
icon:
const
Icon
(
Icons
.
home
,
color:
Colors
.
white
),
onPressed:
()
{
onPressed:
()
{
ctx
.
read
<
WebCubit
>().
handleHome
();
ctx
.
read
<
WebCubit
>().
handleHome
();
},
},
)
)
:
null
),
:
null
),
);
);
}
}
...
@@ -350,16 +352,18 @@ class WebPage extends StatelessWidget {
...
@@ -350,16 +352,18 @@ class WebPage extends StatelessWidget {
child:
Center
(
child:
Center
(
child:
Column
(
child:
Column
(
children:
[
children:
[
Text
(
if
(
EnvConfig
.
isDev
())
...[
EnvConfig
.
isDev
()
?
'开发版'
:
'正式版'
,
Text
(
style:
TextStyle
(
'开发版'
,
color:
Colors
.
grey
,
style:
TextStyle
(
fontSize:
14
,
color:
Colors
.
grey
,
fontSize:
14
,
),
),
),
),
SizedBox
(
height:
4
),
SizedBox
(
height:
4
)
,
]
,
Text
(
Text
(
'Version
${Constant.appVersion}
-
${state.h5Version}
'
,
'Version
1.0.0
'
,
style:
TextStyle
(
style:
TextStyle
(
color:
Colors
.
grey
,
color:
Colors
.
grey
,
fontSize:
12
,
fontSize:
12
,
...
@@ -373,7 +377,15 @@ class WebPage extends StatelessWidget {
...
@@ -373,7 +377,15 @@ class WebPage extends StatelessWidget {
Text
(
Text
(
'Copyright © 中山班小二科技有限公司'
,
'Copyright © 中山班小二科技有限公司'
,
),
),
SizedBox
(
height:
18
),
SizedBox
(
height:
8
),
Text
(
'
${Constant.appVersion}
-
${state.h5Version}
'
,
style:
TextStyle
(
color:
Colors
.
grey
,
fontSize:
12
,
),
),
SizedBox
(
height:
10
),
],
],
),
),
),
),
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment