Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
book-app
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
book-app
Commits
47be8d3d
提交
47be8d3d
authored
2月 23, 2024
作者:
yueweilu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1、默认账号密码
2、百度字典
上级
36f5cc28
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
76 行增加
和
5 行删除
+76
-5
index.dart
lib/pages/bai_dict/index.dart
+11
-0
view.dart
lib/pages/bai_dict/view.dart
+31
-0
controller.dart
lib/pages/login/controller.dart
+1
-1
view.dart
lib/pages/read_web/view.dart
+17
-1
index.dart
lib/routes/index.dart
+1
-0
routes.dart
lib/routes/routes.dart
+13
-1
validator.dart
lib/utils/validator.dart
+2
-2
没有找到文件。
lib/pages/bai_dict/index.dart
0 → 100644
浏览文件 @
47be8d3d
library
bai_dict
;
import
'package:flutter/material.dart'
;
import
'package:flutter_book/utils/index.dart'
;
import
'package:flutter_inappwebview/flutter_inappwebview.dart'
;
import
'package:flutter_screenutil/flutter_screenutil.dart'
;
part
'view.dart'
;
\ No newline at end of file
lib/pages/bai_dict/view.dart
0 → 100644
浏览文件 @
47be8d3d
part of
bai_dict
;
class
BaiDictPage
extends
StatefulWidget
{
final
String
keyword
;
const
BaiDictPage
({
Key
?
key
,
required
this
.
keyword
})
:
super
(
key:
key
);
@override
State
<
BaiDictPage
>
createState
()
=>
_BaiKePageState
();
}
class
_BaiKePageState
extends
State
<
BaiDictPage
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
AppBar
(
centerTitle:
false
,
title:
Text
(
'
$widget
.keyword'
,
style:
TextStyle
(
fontSize:
14
.
w
,
fontWeight:
Fonts
.
medium
,
color:
Colours
.
c3
),),
),
body:
InAppWebView
(
initialUrlRequest:
URLRequest
(
url:
Uri
.
parse
(
'https://hanyu.baidu.com/hanyu-page/zici/s?from=aladdin&query=
${widget.keyword}
&srcid=51368&wd=
${widget.keyword}
&ptype=zici'
),
),
),
);
}
}
\ No newline at end of file
lib/pages/login/controller.dart
浏览文件 @
47be8d3d
...
@@ -89,7 +89,7 @@ class LoginController extends GetxController {
...
@@ -89,7 +89,7 @@ class LoginController extends GetxController {
/// 测试账号
/// 测试账号
if
(
kDebugMode
)
{
if
(
kDebugMode
)
{
phoneInput
.
text
=
'13521054068'
;
phoneInput
.
text
=
'13521054068'
;
passwordInput
.
text
=
'123456'
;
passwordInput
.
text
=
'
zj
123456'
;
}
}
super
.
onInit
();
super
.
onInit
();
}
}
...
...
lib/pages/read_web/view.dart
浏览文件 @
47be8d3d
...
@@ -53,6 +53,8 @@ class _ReadPageState extends State<ReadPage> {
...
@@ -53,6 +53,8 @@ class _ReadPageState extends State<ReadPage> {
onTap:
(){
onTap:
(){
readController
.
setShowChat
(
true
);
readController
.
setShowChat
(
true
);
readController
.
setChatType
(
0
);
readController
.
setChatType
(
0
);
context
.
pushNamed
(
Routes
.
baiDict
,
queryParameters:
{
'keyword'
:
'蹦'
});
},
},
child:
Image
.
asset
(
'assets/images/chat.png'
),
child:
Image
.
asset
(
'assets/images/chat.png'
),
):
null
,
):
null
,
...
@@ -102,6 +104,7 @@ class _ReadPageState extends State<ReadPage> {
...
@@ -102,6 +104,7 @@ class _ReadPageState extends State<ReadPage> {
// 监听笔记回调
// 监听笔记回调
controller
.
addJavaScriptHandler
(
handlerName:
'noteCallBack'
,
callback:
(
args
){
controller
.
addJavaScriptHandler
(
handlerName:
'noteCallBack'
,
callback:
(
args
){
Console
.
log
(
'监听笔记回调------------------------------------------------
$args
'
);
readController
.
noteTitle
=
args
.
first
;
readController
.
noteTitle
=
args
.
first
;
readController
.
setShowChat
(
true
);
readController
.
setShowChat
(
true
);
readController
.
setChatType
(
1
);
readController
.
setChatType
(
1
);
...
@@ -110,11 +113,24 @@ class _ReadPageState extends State<ReadPage> {
...
@@ -110,11 +113,24 @@ class _ReadPageState extends State<ReadPage> {
// 监听百科回调
// 监听百科回调
controller
.
addJavaScriptHandler
(
handlerName:
'baikeCallBack'
,
callback:
(
args
){
controller
.
addJavaScriptHandler
(
handlerName:
'baikeCallBack'
,
callback:
(
args
){
Console
.
log
(
'监听百科回调------------------------------------------------
$args
'
);
context
.
pushNamed
(
Routes
.
baiKe
,
queryParameters:
{
'keyword'
:
args
.
first
});
context
.
pushNamed
(
Routes
.
baiKe
,
queryParameters:
{
'keyword'
:
args
.
first
});
});
});
// 监听字典回调
controller
.
addJavaScriptHandler
(
handlerName:
'dicCallBack'
,
callback:
(
args
){
Console
.
log
(
'监听百科回调------------------------------------------------
$args
'
);
context
.
pushNamed
(
Routes
.
baiDict
,
queryParameters:
{
'keyword'
:
args
.
first
});
});
// 监听朗读回调
controller
.
addJavaScriptHandler
(
handlerName:
'readCallBack'
,
callback:
(
args
){
Console
.
log
(
'监听朗读回调------------------------------------------------
$args
'
);
});
// 监听讨论回调
// 监听讨论回调
controller
.
addJavaScriptHandler
(
handlerName:
'discussCallBack'
,
callback:
(
args
){
controller
.
addJavaScriptHandler
(
handlerName:
'discussCallBack'
,
callback:
(
args
){
Console
.
log
(
'监听讨论回调------------------------------------------------
$args
'
);
readController
.
setShowChat
(
true
);
readController
.
setShowChat
(
true
);
readController
.
setChatType
(
0
);
readController
.
setChatType
(
0
);
readController
.
titleInput
.
text
=
args
.
first
.
toString
();
readController
.
titleInput
.
text
=
args
.
first
.
toString
();
...
@@ -122,7 +138,7 @@ class _ReadPageState extends State<ReadPage> {
...
@@ -122,7 +138,7 @@ class _ReadPageState extends State<ReadPage> {
// 监听 上一节 下一节
// 监听 上一节 下一节
controller
.
addJavaScriptHandler
(
handlerName:
'readCallBack'
,
callback:
(
args
){
controller
.
addJavaScriptHandler
(
handlerName:
'readCallBack'
,
callback:
(
args
){
Console
.
log
(
'监听 上一节 下一节------------------------------------------------
$args
'
);
});
});
},
},
...
...
lib/routes/index.dart
浏览文件 @
47be8d3d
...
@@ -45,6 +45,7 @@ import 'package:go_router/go_router.dart';
...
@@ -45,6 +45,7 @@ import 'package:go_router/go_router.dart';
import
'../models/index.dart'
;
import
'../models/index.dart'
;
import
'../pages/ad_detail/index.dart'
;
import
'../pages/ad_detail/index.dart'
;
import
'../pages/bai_dict/index.dart'
;
import
'../pages/bai_ke/index.dart'
;
import
'../pages/bai_ke/index.dart'
;
import
'../pages/read_web/index.dart'
;
import
'../pages/read_web/index.dart'
;
import
'../pages/user_edit_note/index.dart'
;
import
'../pages/user_edit_note/index.dart'
;
...
...
lib/routes/routes.dart
浏览文件 @
47be8d3d
...
@@ -40,7 +40,8 @@ abstract class Routes {
...
@@ -40,7 +40,8 @@ abstract class Routes {
/// 图书馆模块
/// 图书馆模块
// 百科
// 百科
static
const
baiKe
=
'bai_ke'
;
static
const
baiKe
=
'bai_ke'
;
// 字典
static
const
baiDict
=
'bai_dict'
;
/// 书架模块
/// 书架模块
static
const
creditPoints
=
'credit_points'
;
static
const
creditPoints
=
'credit_points'
;
...
@@ -595,6 +596,17 @@ abstract class Routes {
...
@@ -595,6 +596,17 @@ abstract class Routes {
child:
AdDetailPage
(
adModel:
state
.
extra
as
AdModel
,),
child:
AdDetailPage
(
adModel:
state
.
extra
as
AdModel
,),
)
)
),
),
GoRoute
(
// 字典
path:
'/
$baiDict
'
,
name:
baiDict
,
pageBuilder:
(
context
,
state
)
=>
CupertinoPage
(
name:
state
.
uri
.
toString
(),
key:
state
.
pageKey
,
child:
BaiDictPage
(
keyword:
state
.
uri
.
queryParameters
[
'keyword'
].
toString
(),
)
)
),
]
]
);
);
...
...
lib/utils/validator.dart
浏览文件 @
47be8d3d
...
@@ -91,9 +91,9 @@ class ValidatorTool {
...
@@ -91,9 +91,9 @@ class ValidatorTool {
// 密码
// 密码
static
bool
isValidPassword
(
String
value
)
{
static
bool
isValidPassword
(
String
value
)
{
//
RegExp passwordPattern = RegExp(r'^[A-Za-z0-9!@#\$%^&*()_+{}\[\]:;<>,.?~\\/-]{8,12}$');
RegExp
passwordPattern
=
RegExp
(
r'^[A-Za-z0-9!@#\$%^&*()_+{}\[\]:;<>,.?~\\/-]{8,12}$'
);
// RegExp passwordPattern = RegExp(r'^(?=.*[A-Za-z])(?=.*\d)(?=.*[~@#%$*()_+{}\[\]:;<>,.?\\/-])[A-Za-z0-9~@#%$*()_+{}\[\]:;<>,.?\\/-]{8,12}$');
// RegExp passwordPattern = RegExp(r'^(?=.*[A-Za-z])(?=.*\d)(?=.*[~@#%$*()_+{}\[\]:;<>,.?\\/-])[A-Za-z0-9~@#%$*()_+{}\[\]:;<>,.?\\/-]{8,12}$');
RegExp
passwordPattern
=
RegExp
(
r'^\d{6}$'
);
//
RegExp passwordPattern = RegExp(r'^\d{6}$');
return
passwordPattern
.
hasMatch
(
value
);
return
passwordPattern
.
hasMatch
(
value
);
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论