Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
book-app
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
book-app
Commits
14b30a60
提交
14b30a60
authored
3月 29, 2024
作者:
yueweilu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
点赞、收藏 点击控制
上级
35e6490f
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
37 行增加
和
9 行删除
+37
-9
controller.dart
lib/pages/book_detail/controller.dart
+6
-2
view.dart
lib/pages/book_detail/view.dart
+6
-2
controller.dart
lib/pages/library/controller.dart
+4
-1
content.dart
lib/pages/library/widgets/content.dart
+7
-2
discuss_controller.dart
lib/pages/read_web/discuss_controller.dart
+3
-0
controller.dart
lib/pages/user_discuss_des/controller.dart
+1
-0
discuss.dart
lib/pages/user_discuss_des/widgets/discuss.dart
+10
-2
没有找到文件。
lib/pages/book_detail/controller.dart
浏览文件 @
14b30a60
...
...
@@ -22,6 +22,9 @@ class BookDetailController extends GetxController with GetSingleTickerProviderSt
// 图书
BookDetailModel
bookDetails
=
BookDetailModel
();
// 是否能点击
bool
canTap
=
true
;
@override
void
onInit
()
{
...
...
@@ -147,7 +150,7 @@ class BookDetailController extends GetxController with GetSingleTickerProviderSt
update
();
}
/// 收藏 与 取消收藏
void
love
({
Future
<
void
>
love
({
required
String
bookId
,
required
num
isCollection
})
async
{
...
...
@@ -160,8 +163,9 @@ class BookDetailController extends GetxController with GetSingleTickerProviderSt
bool
result
=
await
CommonAPI
.
love
(
bookId:
bookId
,
love:
isCollection
.
toString
());
if
(
result
)
{
getBookDetails
()
;
bookDetails
.
isCollection
=
isCollection
;
}
update
();
}
// 获取当前的章节id
...
...
lib/pages/book_detail/view.dart
浏览文件 @
14b30a60
...
...
@@ -37,8 +37,12 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid
icon:
Image
.
asset
(
controller
.
bookDetails
.
isCollection
==
0
?
'assets/images/unlove.png'
:
'assets/images/love.png'
,
),
onPressed:
()
{
controller
.
love
(
bookId:
controller
.
bookDetails
.
bookId
.
toString
(),
isCollection:
controller
.
bookDetails
.
isCollection
!);
onPressed:
()
async
{
if
(
controller
.
canTap
==
true
)
{
controller
.
canTap
=
false
;
await
controller
.
love
(
bookId:
controller
.
bookDetails
.
bookId
.
toString
(),
isCollection:
controller
.
bookDetails
.
isCollection
!);
controller
.
canTap
=
true
;
}
},
),
],
...
...
lib/pages/library/controller.dart
浏览文件 @
14b30a60
...
...
@@ -52,6 +52,9 @@ class LibraryController extends GetxController with GetTickerProviderStateMixin{
bool
_show
=
false
;
late
UModel
_getModel
;
// 是否可点击收藏
bool
canTap
=
true
;
bool
get
show
=>
_show
;
void
setShow
(
bool
value
)
{
...
...
@@ -233,7 +236,7 @@ class LibraryController extends GetxController with GetTickerProviderStateMixin{
}
/// 收藏 与 取消收藏
void
love
({
Future
<
void
>
love
({
required
CourseModel
model
})
async
{
...
...
lib/pages/library/widgets/content.dart
浏览文件 @
14b30a60
...
...
@@ -37,9 +37,14 @@ class _LibraryContentPageState extends State<LibraryContentPage> with AutomaticK
onTap:
(){
context
.
pushNamed
(
Routes
.
bookDetail
,
queryParameters:
{
'book_id'
:
model
.
bookId
.
toString
()});
},
child:
LibraryCell
(
model:
model
,
onTap:
(){
child:
LibraryCell
(
model:
model
,
onTap:
()
async
{
if
(
UserStore
.
to
.
isLogin
){
widget
.
controller
.
love
(
model:
model
);
if
(
widget
.
controller
.
canTap
==
true
){
widget
.
controller
.
canTap
=
false
;
await
widget
.
controller
.
love
(
model:
model
);
widget
.
controller
.
canTap
=
true
;
}
}
else
{
context
.
pushNamed
(
Routes
.
login
);
...
...
lib/pages/read_web/discuss_controller.dart
浏览文件 @
14b30a60
...
...
@@ -35,6 +35,9 @@ class DiscussController extends GetxController {
// 搜全文
List
<
SearchAllModel
>
searchALlResults
=
[];
// 是否能点击
bool
canTap
=
true
;
@override
void
onReady
()
{
...
...
lib/pages/user_discuss_des/controller.dart
浏览文件 @
14b30a60
...
...
@@ -23,6 +23,7 @@ class UserDiscussDesController extends GetxController {
// 当前要回复父级的模型
late
DiscussModel
fatherDiscussModel
;
bool
canTap
=
true
;
@override
void
onReady
()
{
...
...
lib/pages/user_discuss_des/widgets/discuss.dart
浏览文件 @
14b30a60
...
...
@@ -188,8 +188,16 @@ class _BuildDiscussState extends State<BuildDiscuss> {
children:
[
GestureDetector
(
onTap:
()
async
{
widget
.
controller
?.
commentLove
(
discussModel:
model
);
widget
.
userDiscussDesController
?.
commentLove
(
discussModel:
model
);
if
(
widget
.
controller
?.
canTap
==
true
)
{
widget
.
controller
?.
canTap
=
false
;
await
widget
.
controller
?.
commentLove
(
discussModel:
model
);
widget
.
controller
?.
canTap
=
true
;
}
if
(
widget
.
userDiscussDesController
?.
canTap
==
true
)
{
widget
.
userDiscussDesController
?.
canTap
=
false
;
await
widget
.
userDiscussDesController
?.
commentLove
(
discussModel:
model
);
widget
.
userDiscussDesController
?.
canTap
=
true
;
}
},
child:
SizedBox
(
height:
20
.
w
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论