Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
book-app
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
book-app
Commits
505fa505
提交
505fa505
authored
1月 04, 2024
作者:
yueweilu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add
上级
9850da9c
显示空白字符变更
内嵌
并排
正在显示
21 个修改的文件
包含
401 行增加
和
24 行删除
+401
-24
project.pbxproj
ios/Runner.xcodeproj/project.pbxproj
+3
-3
Info.plist
ios/Runner/Info.plist
+6
-6
account.dart
lib/apis/account.dart
+1
-0
index.dart
lib/pages/book_category/index.dart
+6
-0
view.dart
lib/pages/book_category/view.dart
+20
-0
controller.dart
lib/pages/book_detail/controller.dart
+24
-0
index.dart
lib/pages/book_detail/index.dart
+25
-0
view.dart
lib/pages/book_detail/view.dart
+113
-0
book.dart
lib/pages/book_detail/widgets/book.dart
+85
-0
study.dart
lib/pages/book_detail/widgets/study.dart
+70
-0
view.dart
lib/pages/course/view.dart
+7
-2
controller.dart
lib/pages/login/controller.dart
+7
-5
view.dart
lib/pages/login/view.dart
+3
-2
index.dart
lib/routes/index.dart
+1
-0
routes.dart
lib/routes/routes.dart
+14
-0
http.dart
lib/services/http.dart
+2
-1
theme.dart
lib/theme.dart
+1
-1
constants.dart
lib/utils/constants.dart
+2
-2
button.dart
lib/widgets/button.dart
+1
-2
pubspec.lock
pubspec.lock
+8
-0
pubspec.yaml
pubspec.yaml
+2
-0
没有找到文件。
ios/Runner.xcodeproj/project.pbxproj
浏览文件 @
505fa505
...
...
@@ -485,7 +485,7 @@
"$(inherited)"
,
"@executable_path/Frameworks"
,
);
PRODUCT_BUNDLE_IDENTIFIER
=
com.zijin.book.flutterBook
;
PRODUCT_BUNDLE_IDENTIFIER
=
com.zijin
g
.book.flutterBook
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
VERSIONING_SYSTEM
=
"apple-generic"
;
};
...
...
@@ -652,7 +652,7 @@
"$(inherited)"
,
"@executable_path/Frameworks"
,
);
PRODUCT_BUNDLE_IDENTIFIER
=
com.zijin.book.flutterBook
;
PRODUCT_BUNDLE_IDENTIFIER
=
com.zijin
g
.book.flutterBook
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
VERSIONING_SYSTEM
=
"apple-generic"
;
};
...
...
@@ -672,7 +672,7 @@
"$(inherited)"
,
"@executable_path/Frameworks"
,
);
PRODUCT_BUNDLE_IDENTIFIER
=
com.zijin.book.flutterBook
;
PRODUCT_BUNDLE_IDENTIFIER
=
com.zijin
g
.book.flutterBook
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
VERSIONING_SYSTEM
=
"apple-generic"
;
};
...
...
ios/Runner/Info.plist
浏览文件 @
505fa505
...
...
@@ -2,8 +2,8 @@
<
!
D
O
C
TYP
E
plist
PU
B
LI
C
"-//
A
ppl
e
//
D
T
D
PLIST
1
.
0
//
E
N"
"http://www.
a
ppl
e
.
c
om/
D
T
D
s/Prop
e
rtyList-
1
.
0
.
d
t
d
"
>
<
plist
v
e
rsion="
1
.
0
"
>
<
d
i
c
t
>
<
k
e
y
>
NSMicrophoneUsageDescription
<
/k
e
y
>
<
string
>
紫金云书需要使用麦克风进行录音
<
/string
>
<
k
e
y
>
CADisableMinimumFrameDurationOnPhone
<
/k
e
y
>
<
tru
e
/
>
<
k
e
y
>
CFBundleDevelopmentRegion
<
/k
e
y
>
<
string
>
$
(
DEVELOPMENT_LANGUAGE
)<
/string
>
<
k
e
y
>
CFBundleDisplayName
<
/k
e
y
>
...
...
@@ -26,6 +26,10 @@
<
string
>
$
(
FLUTTER_BUILD_NUMBER
)<
/string
>
<
k
e
y
>
LSRequiresIPhoneOS
<
/k
e
y
>
<
tru
e
/
>
<
k
e
y
>
NSMicrophoneUsageDescription
<
/k
e
y
>
<
string
>
紫金云书需要使用麦克风进行录音
<
/string
>
<
k
e
y
>
UIApplicationSupportsIndirectInputEvents
<
/k
e
y
>
<
tru
e
/
>
<
k
e
y
>
UILaunchStoryboardName
<
/k
e
y
>
<
string
>
LaunchScreen
<
/string
>
<
k
e
y
>
UIMainStoryboardFile
<
/k
e
y
>
...
...
@@ -45,9 +49,5 @@
<
/
a
rr
a
y
>
<
k
e
y
>
UIViewControllerBasedStatusBarAppearance
<
/k
e
y
>
<
fa
ls
e
/
>
<
k
e
y
>
CADisableMinimumFrameDurationOnPhone
<
/k
e
y
>
<
tru
e
/
>
<
k
e
y
>
UIApplicationSupportsIndirectInputEvents
<
/k
e
y
>
<
tru
e
/
>
<
/
d
i
c
t
>
<
/plist
>
lib/apis/account.dart
浏览文件 @
505fa505
...
...
@@ -16,6 +16,7 @@ abstract class AccountAPI {
'type'
:
type
},
);
print
(
result
.
data
);
if
(
result
.
data
is
!
Map
)
return
UserModel
();
return
UserModel
.
fromJson
(
result
.
data
);
}
...
...
lib/pages/book_category/index.dart
0 → 100644
浏览文件 @
505fa505
library
book_category
;
import
'package:flutter/material.dart'
;
part
'view.dart'
;
\ No newline at end of file
lib/pages/book_category/view.dart
0 → 100644
浏览文件 @
505fa505
part of
book_category
;
class
BookCategoryPage
extends
StatefulWidget
{
const
BookCategoryPage
({
Key
?
key
})
:
super
(
key:
key
);
@override
State
<
BookCategoryPage
>
createState
()
=>
_BookCategoryPageState
();
}
class
_BookCategoryPageState
extends
State
<
BookCategoryPage
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
Container
(
color:
Colors
.
cyan
,
height:
double
.
infinity
,
// height: 100,
);
}
}
lib/pages/book_detail/controller.dart
0 → 100644
浏览文件 @
505fa505
part of
book_detail
;
class
BookDetailController
extends
GetxController
with
GetSingleTickerProviderStateMixin
{
late
TabController
tabController
;
final
PageController
pageController
=
PageController
(
initialPage:
0
);
List
<
Widget
>
tabs
=
[
const
Tab
(
text:
'目录'
,),
const
Tab
(
text:
'简介'
,),
const
Tab
(
text:
'本书信息'
,),
];
@override
void
onInit
()
{
tabController
=
TabController
(
length:
tabs
.
length
,
vsync:
this
);
super
.
onInit
();
}
@override
void
onClose
()
{
super
.
onClose
();
}
}
\ No newline at end of file
lib/pages/book_detail/index.dart
0 → 100644
浏览文件 @
505fa505
library
book_detail
;
import
'package:flutter/material.dart'
;
import
'package:flutter_book/theme.dart'
;
import
'package:flutter_book/utils/index.dart'
;
import
'package:flutter_book/widgets/index.dart'
;
import
'package:flutter_star/star.dart'
;
import
'package:flutter_star/star_score.dart'
;
import
'package:get/get.dart'
;
import
'package:get/get_state_manager/src/simple/get_controllers.dart'
;
import
'package:go_router/go_router.dart'
;
import
'package:ionicons/ionicons.dart'
;
import
'../../routes/index.dart'
;
import
'../book_category/index.dart'
;
import
'../book_shop/index.dart'
;
part
'view.dart'
;
part
'controller.dart'
;
part
'widgets/book.dart'
;
part
'widgets/study.dart'
;
\ No newline at end of file
lib/pages/book_detail/view.dart
0 → 100644
浏览文件 @
505fa505
part of
book_detail
;
class
BookDetailPage
extends
StatefulWidget
{
const
BookDetailPage
({
Key
?
key
})
:
super
(
key:
key
);
@override
State
<
BookDetailPage
>
createState
()
=>
_BookDetailPageState
();
}
class
_BookDetailPageState
extends
State
<
BookDetailPage
>
with
SingleTickerProviderStateMixin
{
@override
Widget
build
(
BuildContext
context
)
{
return
GetBuilder
<
BookDetailController
>(
init:
BookDetailController
(),
builder:
(
controller
)=>
Scaffold
(
appBar:
CustomAppBar
(
backgroundColor:
const
Color
(
0xFFAB1941
).
withOpacity
(
0.02
),
title:
const
Text
(
'详情'
),
actions:
[
CustomButton
.
icon
(
padding:
EdgeInsets
.
zero
,
backgroundColor:
Colors
.
transparent
,
icon:
const
Icon
(
Ionicons
.
timer
),
onPressed:
()
=>
context
.
pushNamed
(
Routes
.
msgs
),
),
CustomButton
.
icon
(
padding:
EdgeInsets
.
zero
,
backgroundColor:
Colors
.
transparent
,
icon:
const
Icon
(
Ionicons
.
timer
),
onPressed:
()
=>
context
.
pushNamed
(
Routes
.
msgs
),
),
],
),
body:
test
()
// Column(
// children: [
// const BuildBook(),
// Container(
// height: 10,
// color: const Color(0xFFF9F9F9),
// ),
// const BuildStudy(),
// Container(
// height: 2,
// color: const Color(0xFFF9F9F9),
// ),
// TabBar(
// labelColor: AppTheme.primary,
// // isScrollable: true,
// labelStyle: const TextStyle(fontSize: 15,height: 1.4,fontWeight: Fonts.medium),
// unselectedLabelColor: Colours.c9,
// unselectedLabelStyle: const TextStyle(fontSize: 15,height: 1.4),
// indicatorSize: TabBarIndicatorSize.label,
// indicatorColor: AppTheme.primary,
// tabs:controller.tabs,
// physics: const NeverScrollableScrollPhysics(),
// controller: controller.tabController,
// ),
// Expanded(
// child: TabBarView(
// controller: controller.tabController,
// children: [
// BookCategoryPage(),
// BookCategoryPage(),
// BookCategoryPage(),
// ],
// ),
// ),
//
// ],
// ),
),
);
}
Widget
test
(){
return
NestedScrollView
(
headerSliverBuilder:
(
BuildContext
context
,
bool
innerBoxIsScrolled
){
return
[
SliverList
(
delegate:
SliverChildListDelegate
([
const
BuildBook
(),
Container
(
height:
10
,
color:
const
Color
(
0xFFF9F9F9
),
),
const
BuildStudy
(),
Container
(
height:
2
,
color:
const
Color
(
0xFFF9F9F9
),
),
])
)
];
},
body:
ListView
.
builder
(
itemCount:
50
,
itemBuilder:
(
BuildContext
context
,
int
index
)
{
return
ListTile
(
title:
Text
(
'Item
$index
'
),
);
},
),
);
}
}
lib/pages/book_detail/widgets/book.dart
0 → 100644
浏览文件 @
505fa505
part of
book_detail
;
class
BuildBook
extends
StatelessWidget
{
const
BuildBook
({
Key
?
key
})
:
super
(
key:
key
);
@override
Widget
build
(
BuildContext
context
)
{
return
Container
(
decoration:
const
BoxDecoration
(
// color: Colors.red,
gradient:
LinearGradient
(
colors:
[
Color
(
0xFFF7F5F5
),
Color
(
0xFFFFFFFF
)],
begin:
Alignment
.
topCenter
,
end:
Alignment
.
bottomCenter
,
),
),
// margin: const EdgeInsets.only(left: 10,right: 10,top: 10),
height:
125
,
child:
Row
(
children:
[
///左侧
Container
(
margin:
const
EdgeInsets
.
only
(
left:
15
,
right:
15
),
child:
Row
(
children:
[
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
cyan
,
borderRadius:
BorderRadius
.
circular
(
3
),
boxShadow:
[
BoxShadow
(
color:
Color
(
0xFF707070
).
withOpacity
(
0.5
),
spreadRadius:
2
,
blurRadius:
5
,
offset:
Offset
(
3
,
0
),
// changes the position of the shadow
),
]
),
// color: Colors.white,
height:
102
,
width:
85
,
child:
Container
(
padding:
EdgeInsets
.
all
(
2
),
child:
Container
(
color:
Colors
.
cyan
,
),
),
)
],
),
),
///右侧
Expanded
(
child:
Container
(
// color: Colors.cyan,
padding:
const
EdgeInsets
.
only
(
top:
12
,
bottom:
10
),
child:
const
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
'一想到还有95%的问题留给人'
,
style:
TextStyle
(
fontSize:
16
,
fontWeight:
Fonts
.
medium
,
color:
Colours
.
c3
),
maxLines:
1
,
overflow:
TextOverflow
.
ellipsis
,),
SizedBox
(
height:
5
,),
Text
(
'威廉·莎士比亚'
,
style:
TextStyle
(
fontSize:
13
,
fontWeight:
FontWeight
.
w400
,
color:
Colours
.
c6
)),
],
),
Row
(
children:
[
Text
(
'¥88'
,
style:
TextStyle
(
fontSize:
14
,
fontWeight:
FontWeight
.
w500
,
color:
AppTheme
.
primary
)),
Gaps
.
hGaps10
,
Text
(
'¥88'
,
style:
TextStyle
(
fontSize:
12
,
color:
Colours
.
c9
)),
],
)
],
),
),
)
],
)
);
}
}
lib/pages/book_detail/widgets/study.dart
0 → 100644
浏览文件 @
505fa505
part of
book_detail
;
class
BuildStudy
extends
StatefulWidget
{
const
BuildStudy
({
Key
?
key
})
:
super
(
key:
key
);
@override
State
<
BuildStudy
>
createState
()
=>
_BuildStudyState
();
}
class
_BuildStudyState
extends
State
<
BuildStudy
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
Container
(
height:
50
,
color:
Colors
.
white
,
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
children:
[
Expanded
(
child:
Container
(
// color: Colors.red,
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Text
(
'4.8'
),
Text
(
'/5.0'
)
],
),
StarScore
(
score:
4.5
,
star:
Star
(
fillColor:
AppTheme
.
primary
,
size:
12
,
emptyColor:
Color
(
0xFFEBEBEB
)),
),
],
),
),
),
Expanded
(
child:
Container
(
// color: Colors.cyan,
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
RichText
(
text:
TextSpan
(
children:
[
TextSpan
(
text:
'110'
,
style:
TextStyle
(
fontSize:
16
,
color:
Colours
.
c3
,
fontWeight:
Fonts
.
medium
,
height:
1.3
)
),
TextSpan
(
text:
'万'
,
style:
TextStyle
(
fontSize:
16
,
color:
Colours
.
c3
,)
)
]
)),
Text
(
'学习次数'
,
style:
TextStyle
(
fontSize:
12
,
color:
Colours
.
c9
,
height:
1.3
)),
],
),
),
)
],
)
,
);
}
}
lib/pages/course/view.dart
浏览文件 @
505fa505
...
...
@@ -69,7 +69,7 @@ class _CoursePageState extends State<CoursePage> {
onRefresh:
controller
.
onRefresh
,
onLoading:
controller
.
onLoading
,
child:
GridView
.
builder
(
padding:
EdgeInsets
.
only
(
left:
13
,
top:
10
),
padding:
const
EdgeInsets
.
only
(
left:
13
,
top:
10
),
gridDelegate:
const
SliverGridDelegateWithFixedCrossAxisCount
(
crossAxisCount:
2
,
crossAxisSpacing:
0
,
...
...
@@ -77,7 +77,12 @@ class _CoursePageState extends State<CoursePage> {
childAspectRatio:
0.85
),
itemBuilder:
(
BuildContext
context
,
int
index
)
{
return
const
Book
();
return
GestureDetector
(
child:
const
Book
(),
onTap:
(){
context
.
pushNamed
(
Routes
.
bookDetail
);
},
);
},
itemCount:
10
,
),
...
...
lib/pages/login/controller.dart
浏览文件 @
505fa505
...
...
@@ -59,7 +59,7 @@ class LoginController extends GetxController {
}
void
setCanClick
(){
if
(
phoneInput
.
text
.
length
==
11
&&
passwordInput
.
text
.
length
==
4
){
if
(
phoneInput
.
text
.
length
==
11
&&
passwordInput
.
text
.
length
==
6
){
_enable
=
true
;
}
else
{
...
...
@@ -103,11 +103,13 @@ class LoginController extends GetxController {
Future
<
bool
>
onLogin
(
GlobalKey
<
FormState
>
key
)
async
{
final
result
=
AccountAPI
.
login
(
phone:
''
,
password:
'password'
,
type:
'type'
print
(
EncryptUtil
.
encodeMd5
(
EncryptUtil
.
encodeMd5
(
passwordInput
.
text
)));
final
result
=
await
AccountAPI
.
login
(
phone:
phoneInput
.
text
,
password:
EncryptUtil
.
encodeMd5
(
EncryptUtil
.
encodeMd5
(
passwordInput
.
text
)),
type:
'1'
);
print
(
result
);
/// 存储账号密码
StorageService
.
to
.
setString
(
kLocalAccount
,
'phone'
);
...
...
lib/pages/login/view.dart
浏览文件 @
505fa505
...
...
@@ -147,9 +147,10 @@ class _LoginPageState extends State<LoginPage> {
const
SizedBox
(
height:
30
,),
CustomGradientButton
(
text:
'立即登录'
,
isEnabled:
!
controller
.
enable
,
isEnabled:
controller
.
enable
,
onPressed:
()
{
print
(
'11111111111111111'
);
controller
.
onLogin
(
_formKey
);
},
)
],
...
...
lib/routes/index.dart
浏览文件 @
505fa505
...
...
@@ -4,6 +4,7 @@ import 'package:flutter/cupertino.dart';
import
'package:flutter/foundation.dart'
;
import
'package:flutter_book/pages/about/index.dart'
;
import
'package:flutter_book/pages/ad/index.dart'
;
import
'package:flutter_book/pages/book_detail/index.dart'
;
import
'package:flutter_book/pages/book_pay/index.dart'
;
import
'package:flutter_book/pages/forget_pwd/index.dart'
;
import
'package:flutter_book/pages/login/index.dart'
;
...
...
lib/routes/routes.dart
浏览文件 @
505fa505
...
...
@@ -46,6 +46,11 @@ abstract class Routes {
static
const
msgs
=
'msgs'
;
/// 课程模块
// 详情
static
const
bookDetail
=
'book_detail'
;
static
final
GoRouter
config
=
GoRouter
(
// initialLocation: '/$login',
initialLocation:
'/'
,
...
...
@@ -178,6 +183,15 @@ abstract class Routes {
child:
const
UserCoinPage
()
)
),
GoRoute
(
path:
'/
$bookDetail
'
,
name:
bookDetail
,
pageBuilder:
(
context
,
state
)
=>
CupertinoPage
(
name:
state
.
uri
.
toString
(),
key:
state
.
pageKey
,
child:
const
BookDetailPage
()
)
),
]
);
...
...
lib/services/http.dart
浏览文件 @
505fa505
...
...
@@ -175,7 +175,7 @@ class _RequestInterceptor extends Interceptor {
@override
void
onError
(
DioException
err
,
ErrorInterceptorHandler
handler
)
{
Console
.
log
(
err
.
type
);
//
Console.log(err.type);
switch
(
err
.
type
)
{
case
DioExceptionType
.
connectionTimeout
:
CustomToast
.
fail
(
'网络连接超时'
);
...
...
@@ -192,6 +192,7 @@ class _RequestInterceptor extends Interceptor {
case
DioExceptionType
.
badResponse
:
final
response
=
err
.
response
;
final
statusCode
=
response
?.
statusCode
;
print
(
'*************
${response?.data}
'
);
// Console.log(response?.data);
final
code
=
int
.
tryParse
(
response
?.
data
[
'code'
]?.
toString
()
??
''
);
var
msg
=
'服务器错误'
;
...
...
lib/theme.dart
浏览文件 @
505fa505
...
...
@@ -141,7 +141,7 @@ abstract class AppTheme {
),
appBarTheme:
AppBarTheme
(
systemOverlayStyle:
SystemUiOverlayStyle
.
dark
,
backgroundColor:
const
Color
(
0x05AB1941
),
backgroundColor:
Color
(
0xFFAB1941
).
withOpacity
(
0.02
),
scrolledUnderElevation:
0
,
elevation:
0
,
centerTitle:
true
,
...
...
lib/utils/constants.dart
浏览文件 @
505fa505
part of
utils
;
// 服务器地址
const
String
kServerUrl
=
'https://app.vning.com'
;
//
const String kServerUrl = 'https://app.vning.com';
const
String
kServerUrl
=
'http://192.168.11.88:81'
;
const
String
kLocalToken
=
'local_token'
;
const
String
kLocalAccount
=
'local_account'
;
...
...
lib/widgets/button.dart
浏览文件 @
505fa505
...
...
@@ -261,8 +261,7 @@ class CustomGradientButton extends StatelessWidget {
borderRadius:
BorderRadius
.
circular
(
21
),
gradient:
LinearGradient
(
colors:
isEnabled
?
[
const
Color
(
0xFFDE2E5E
).
withOpacity
(
0.7
),
const
Color
(
0xFFC31F4C
).
withOpacity
(
0.7
)]
// 可点击时的颜色
:
[
const
Color
(
0xFFDE2E5E
),
const
Color
(
0xFFC31F4C
)],
// 不可点击时的颜色,透明度为0.7
?[
const
Color
(
0xFFDE2E5E
),
const
Color
(
0xFFC31F4C
)]:[
const
Color
(
0xFFDE2E5E
).
withOpacity
(
0.7
),
const
Color
(
0xFFC31F4C
).
withOpacity
(
0.7
)]
,
// 不可点击时的颜色,透明度为0.7
begin:
Alignment
.
centerLeft
,
end:
Alignment
.
centerRight
,
),
...
...
pubspec.lock
浏览文件 @
505fa505
...
...
@@ -219,6 +219,14 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "5.2.0"
flutter_star:
dependency: "direct main"
description:
name: flutter_star
sha256: "7dc10b8b3667ace2aa575a37ea0c00558a7514019cfe7e76322573d85b72a472"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.0"
flutter_test:
dependency: "direct dev"
description: flutter
...
...
pubspec.yaml
浏览文件 @
505fa505
...
...
@@ -75,6 +75,8 @@ dependencies:
badges
:
^3.1.2
# 图片预览 或 banner
carousel_slider
:
4.2.1
# 评星
flutter_star
:
^1.2.0
dev_dependencies
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论