Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
book-app
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
book-app
Commits
47bd586f
提交
47bd586f
authored
3月 05, 2024
作者:
yueweilu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1、图片预览
2、展示优化
上级
d5e98ffd
隐藏空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
247 行增加
和
58 行删除
+247
-58
index.dart
lib/pages/image_view/index.dart
+10
-0
view.dart
lib/pages/image_view/view.dart
+73
-0
index.dart
lib/pages/user_discuss_des/index.dart
+2
-0
discuss.dart
lib/pages/user_discuss_des/widgets/discuss.dart
+48
-24
list.dart
lib/pages/user_discuss_des/widgets/list.dart
+1
-1
list.dart
lib/pages/user_notes_des/widgets/list.dart
+1
-0
note.dart
lib/pages/user_notes_des/widgets/note.dart
+47
-28
controller.dart
lib/pages/user_order_awaiting/controller.dart
+1
-1
controller.dart
lib/pages/user_order_cancel_detail/controller.dart
+1
-1
controller.dart
lib/pages/user_order_coin_awaiting/controller.dart
+1
-1
index.dart
lib/routes/index.dart
+5
-2
routes.dart
lib/routes/routes.dart
+14
-0
transitions.dart
lib/routes/transitions.dart
+43
-0
没有找到文件。
lib/pages/image_view/index.dart
0 → 100644
浏览文件 @
47bd586f
library
image_view
;
import
'package:extended_image/extended_image.dart'
;
import
'package:flutter/material.dart'
;
import
'package:go_router/go_router.dart'
;
part
'view.dart'
;
\ No newline at end of file
lib/pages/image_view/view.dart
0 → 100644
浏览文件 @
47bd586f
part of
image_view
;
class
ImageViewPage
extends
StatefulWidget
{
final
List
<
String
>
images
;
const
ImageViewPage
({
Key
?
key
,
required
this
.
images
})
:
super
(
key:
key
);
@override
State
<
ImageViewPage
>
createState
()
=>
_ImageViewPageState
();
}
class
_ImageViewPageState
extends
State
<
ImageViewPage
>
{
final
List
<
int
>
_cachedIndexes
=
<
int
>[];
void
_preloadImage
(
int
index
)
{
if
(
_cachedIndexes
.
contains
(
index
))
{
return
;
}
if
(
0
<=
index
&&
index
<
widget
.
images
.
length
)
{
final
String
url
=
widget
.
images
[
index
];
precacheImage
(
ExtendedNetworkImageProvider
(
url
,
cache:
true
),
context
);
_cachedIndexes
.
add
(
index
);
}
}
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
extendBody:
true
,
body:
Container
(
color:
Colors
.
black
,
child:
ExtendedImageGesturePageView
.
builder
(
controller:
ExtendedPageController
(
initialPage:
0
,
pageSpacing:
50
,
),
onPageChanged:
(
int
page
)
{
// _preloadImage(page - 1);
// _preloadImage(page + 1);
},
itemCount:
widget
.
images
.
length
,
itemBuilder:
(
BuildContext
context
,
int
index
)
{
return
GestureDetector
(
onTap:
(){
context
.
pop
();
},
child:
ExtendedImage
.
network
(
widget
.
images
[
index
],
fit:
BoxFit
.
contain
,
mode:
ExtendedImageMode
.
gesture
,
initGestureConfigHandler:
(
ExtendedImageState
state
)
{
return
GestureConfig
(
//you must set inPageView true if you want to use ExtendedImageGesturePageView
inPageView:
true
,
initialScale:
1.0
,
maxScale:
5.0
,
animationMaxScale:
6.0
,
initialAlignment:
InitialAlignment
.
center
,
);
},
),
);
},
),
),
);
}
}
lib/pages/user_discuss_des/index.dart
浏览文件 @
47bd586f
...
...
@@ -5,9 +5,11 @@ import 'package:flutter/material.dart';
import
'package:flutter_book/widgets/index.dart'
;
import
'package:flutter_screenutil/flutter_screenutil.dart'
;
import
'package:get/get.dart'
;
import
'package:go_router/go_router.dart'
;
import
'../../apis/index.dart'
;
import
'../../models/index.dart'
;
import
'../../routes/index.dart'
;
import
'../../theme.dart'
;
import
'../../utils/index.dart'
;
import
'../read_web/index.dart'
;
...
...
lib/pages/user_discuss_des/widgets/discuss.dart
浏览文件 @
47bd586f
...
...
@@ -117,7 +117,12 @@ class _BuildDiscussState extends State<BuildDiscuss> {
type
==
0
?
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
_showText
(
model
),
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.5
,
color:
Colours
.
c3
),),
Row
(
children:
[
Text
(
_showText
(
model
),
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.5
,
color:
Colours
.
c3
),),
Text
(
_showStatus
(
model
),
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.5
,
color:
AppTheme
.
primary
),),
],
),
Gaps
.
vGaps10
,
_buildImageGridView
()
],
...
...
@@ -176,20 +181,33 @@ class _BuildDiscussState extends State<BuildDiscuss> {
String
_showText
(
DiscussModel
discussModel
){
String
text
=
''
;
// 是我的
if
(
discussModel
.
isMy
==
1
){
text
=
'
${discussModel.content?.text?.content}
'
;
}
else
{
if
(
discussModel
.
content
?.
text
?.
privacyStatus
==
1
){
text
=
'
${discussModel.content?.text?.content}
'
;
}
}
return
text
;
}
String
_showStatus
(
DiscussModel
discussModel
){
String
text
=
''
;
// 是我的
if
(
discussModel
.
isMy
==
1
){
// 审核中
if
(
discussModel
.
content
?.
text
?.
privacyStatus
==
0
||
discussModel
.
content
?.
text
?.
privacyStatus
==
2
){
text
=
'
${discussModel.content?.text?.content}
(审核中)'
;
text
=
'
(审核中)'
;
}
// 审核未通过
else
if
(
discussModel
.
content
?.
text
?.
privacyStatus
==-
1
){
text
=
'
${discussModel.content?.text?.content}
(审核未通过)'
;
text
=
'(审核未通过)'
;
}
// 审核通过
else
{
text
=
'
${discussModel.content?.text?.content}
'
;
text
=
''
;
}
}
else
{
...
...
@@ -203,7 +221,7 @@ class _BuildDiscussState extends State<BuildDiscuss> {
}
// 审核通过
else
{
text
=
'
${discussModel.content?.text?.content}
'
;
text
=
''
;
}
}
return
text
;
...
...
@@ -233,30 +251,36 @@ class _BuildDiscussState extends State<BuildDiscuss> {
),
itemBuilder:
(
BuildContext
context
,
int
index
)
{
MediaModel
?
mediaModel
=
widget
.
model
.
content
?.
image
?[
index
];
return
Stack
(
children:
[
Positioned
(
left:
0
,
right:
0
,
top:
0
,
bottom:
0
,
child:
CustomImage
.
network
(
url:
mediaModel
?.
content
??
''
,
fit:
BoxFit
.
cover
,)
),
Visibility
(
visible:
mediaModel
?.
privacyStatus
==
0
?
true
:
false
,
child:
Positioned
(
List
<
String
>
images
=
widget
.
model
.
content
?.
image
?.
map
((
MediaModel
model
)
=>
model
.
content
??
''
).
toList
()??[];
return
GestureDetector
(
onTap:
(){
context
.
pushNamed
(
Routes
.
imageView
,
extra:
images
);
},
child:
Stack
(
children:
[
Positioned
(
left:
0
,
right:
0
,
top:
0
,
bottom:
0
,
child:
Container
(
alignment:
Alignment
.
center
,
color:
widget
.
model
.
isMy
==
1
?
Colours
.
c9
.
withOpacity
(
0.5
):
Colours
.
c9
.
withOpacity
(
1
),
child:
Text
(
'(审核中)'
,
style:
TextStyle
(
fontSize:
11
.
w
,
height:
1.5
,
color:
AppTheme
.
primary
),),
)
child:
CustomImage
.
network
(
url:
mediaModel
?.
content
??
''
,
fit:
BoxFit
.
cover
,)
),
),
],
Visibility
(
visible:
mediaModel
?.
privacyStatus
==
0
?
true
:
false
,
child:
Positioned
(
left:
0
,
right:
0
,
top:
0
,
bottom:
0
,
child:
Container
(
alignment:
Alignment
.
center
,
color:
widget
.
model
.
isMy
==
1
?
Colours
.
c9
.
withOpacity
(
0.5
):
Colours
.
c9
.
withOpacity
(
1
),
child:
Text
(
'(审核中)'
,
style:
TextStyle
(
fontSize:
11
.
w
,
height:
1.5
,
color:
AppTheme
.
primary
),),
)
),
),
],
),
);
// return Container(
// color: Colors.red,
...
...
lib/pages/user_discuss_des/widgets/list.dart
浏览文件 @
47bd586f
...
...
@@ -22,7 +22,7 @@ class _BuildListPageState extends State<BuildListPage> with AutomaticKeepAliveCl
init:
UserDiscussDesController
(
widget
.
tag
,
widget
.
model
),
builder:
(
controller
)
=>
CustomPullScrollView
(
controller:
controller
.
refreshController
,
//
onRefresh: controller.onRefresh,
onRefresh:
controller
.
onRefresh
,
onLoading:
controller
.
onLoading
,
child:
ListView
.
builder
(
itemBuilder:
(
BuildContext
context
,
int
index
){
...
...
lib/pages/user_notes_des/widgets/list.dart
浏览文件 @
47bd586f
...
...
@@ -23,6 +23,7 @@ class _BuildListPageState extends State<BuildListPage> with AutomaticKeepAliveCl
builder:
(
controller
)
=>
CustomPullScrollView
(
controller:
controller
.
refreshController
,
onLoading:
controller
.
onLoading
,
onRefresh:
controller
.
onRefresh
,
child:
ListView
.
builder
(
itemBuilder:
(
BuildContext
context
,
int
index
){
NoteModel
model
=
controller
.
notes
[
index
];
...
...
lib/pages/user_notes_des/widgets/note.dart
浏览文件 @
47bd586f
...
...
@@ -72,6 +72,7 @@ class BuildNote extends StatelessWidget {
// color: Colors.red,
color:
Colours
.
c3
),),
Text
(
_showStatus
(
model
),
style:
TextStyle
(
fontSize:
14
.
w
,
height:
1.5
,
color:
AppTheme
.
primary
),),
],
),
Gaps
.
vGaps13
,
...
...
@@ -100,20 +101,33 @@ class BuildNote extends StatelessWidget {
String
_showText
(
NoteModel
discussModel
){
String
text
=
''
;
// 是我的
if
(
discussModel
.
isMy
==
1
){
text
=
'
${discussModel.noteContent?.text?.content}
'
;
}
else
{
if
(
discussModel
.
noteContent
?.
text
?.
privacyStatus
==
1
){
text
=
'
${discussModel.noteContent?.text?.content}
'
;
}
}
return
text
;
}
String
_showStatus
(
NoteModel
discussModel
){
String
text
=
''
;
// 是我的
if
(
discussModel
.
isMy
==
1
){
// 审核中
if
(
discussModel
.
noteContent
?.
text
?.
privacyStatus
==
0
||
discussModel
.
noteContent
?.
text
?.
privacyStatus
==
2
){
text
=
'
${discussModel.noteContent?.text?.content}
(审核中)'
;
text
=
'(审核中)'
;
}
// 审核未通过
else
if
(
discussModel
.
noteContent
?.
text
?.
privacyStatus
==-
1
){
text
=
'
${discussModel.noteContent?.text?.content}
(审核未通过)'
;
text
=
'(审核未通过)'
;
}
// 审核通过
else
{
text
=
'
${discussModel.noteContent?.text?.content}
'
;
text
=
''
;
}
}
else
{
...
...
@@ -127,12 +141,11 @@ class BuildNote extends StatelessWidget {
}
// 审核通过
else
{
text
=
'
${discussModel.noteContent?.text?.content}
'
;
text
=
''
;
}
}
return
text
;
}
// 图片
Widget
_buildImageGridView
(){
return
GridView
.
builder
(
...
...
@@ -147,30 +160,36 @@ class BuildNote extends StatelessWidget {
),
itemBuilder:
(
BuildContext
context
,
int
index
)
{
MediaModel
?
mediaModel
=
model
.
noteContent
?.
image
?[
index
];
return
Stack
(
children:
[
Positioned
(
left:
0
,
right:
0
,
top:
0
,
bottom:
0
,
child:
CustomImage
.
network
(
url:
mediaModel
?.
content
??
''
,
fit:
BoxFit
.
cover
,)
),
Visibility
(
visible:
mediaModel
?.
privacyStatus
==
0
?
true
:
false
,
child:
Positioned
(
left:
0
,
right:
0
,
top:
0
,
bottom:
0
,
child:
Container
(
alignment:
Alignment
.
center
,
color:
model
.
isMy
==
1
?
Colours
.
c9
.
withOpacity
(
0.5
):
Colours
.
c9
.
withOpacity
(
1
),
child:
Text
(
'(审核中)'
,
style:
TextStyle
(
fontSize:
14
.
w
,
height:
1.5
,
color:
AppTheme
.
primary
),),
)
List
<
String
>
images
=
model
.
noteContent
?.
image
?.
map
((
MediaModel
model
)
=>
model
.
content
??
''
).
toList
()??[];
return
GestureDetector
(
onTap:
(){
context
.
pushNamed
(
Routes
.
imageView
,
extra:
images
);
},
child:
Stack
(
children:
[
Positioned
(
left:
0
,
right:
0
,
top:
0
,
bottom:
0
,
child:
CustomImage
.
network
(
url:
mediaModel
?.
content
??
''
,
fit:
BoxFit
.
cover
,)
),
),
],
Visibility
(
visible:
mediaModel
?.
privacyStatus
==
0
?
true
:
false
,
child:
Positioned
(
left:
0
,
right:
0
,
top:
0
,
bottom:
0
,
child:
Container
(
alignment:
Alignment
.
center
,
color:
model
.
isMy
==
1
?
Colours
.
c9
.
withOpacity
(
0.5
):
Colours
.
c9
.
withOpacity
(
1
),
child:
Text
(
'(审核中)'
,
style:
TextStyle
(
fontSize:
14
.
w
,
height:
1.5
,
color:
AppTheme
.
primary
),),
)
),
),
],
),
);
},
itemCount:
model
.
noteContent
?.
image
?.
length
,
...
...
lib/pages/user_order_awaiting/controller.dart
浏览文件 @
47bd586f
...
...
@@ -57,7 +57,7 @@ class UserOrderAwaitingController extends GetxController {
orderAwaitings
=
[
OrderCompletedModel
(
name:
'订单编号'
,
value:
model
.
ordersnum
.
toString
()),
OrderCompletedModel
(
name:
'支付方式'
,
value:
payWay
),
OrderCompletedModel
(
name:
'
支付时间'
,
value:
model
.
pay
Time
.
toString
()),
OrderCompletedModel
(
name:
'
下单时间'
,
value:
model
.
create
Time
.
toString
()),
];
update
();
...
...
lib/pages/user_order_cancel_detail/controller.dart
浏览文件 @
47bd586f
...
...
@@ -38,7 +38,7 @@ class UserOrderCancelDetailController extends GetxController {
double
.
parse
(
model
.
finalTotalPrice
.
toString
())).
toString
()),
OrderCompletedModel
(
name:
'订单编号'
,
value:
model
.
ordersnum
.
toString
()),
OrderCompletedModel
(
name:
'支付方式'
,
value:
payWay
),
OrderCompletedModel
(
name:
'支付时间'
,
value:
model
.
payTime
.
toString
()),
//
OrderCompletedModel(name: '支付时间',value: model.payTime.toString()),
OrderCompletedModel
(
name:
'下单时间'
,
value:
model
.
createTime
.
toString
()),
// OrderCompletedModel(name: '退款时间',value: model.refundTime.toString()),
];
...
...
lib/pages/user_order_coin_awaiting/controller.dart
浏览文件 @
47bd586f
...
...
@@ -119,7 +119,7 @@ class UserOrderCoinAwaitingController extends GetxController {
orderAwaitings
=
[
OrderCompletedModel
(
name:
'订单编号'
,
value:
model
.
ordersnum
.
toString
()),
OrderCompletedModel
(
name:
'支付方式'
,
value:
payWay
),
OrderCompletedModel
(
name:
'
支付时间'
,
value:
model
.
pay
Time
.
toString
()),
OrderCompletedModel
(
name:
'
下单时间'
,
value:
model
.
create
Time
.
toString
()),
];
data
.
add
(
CoinModel
(
identifying:
model
.
goodsId
));
...
...
lib/routes/index.dart
浏览文件 @
47bd586f
...
...
@@ -2,6 +2,7 @@ library routes;
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_book/pages/ad/index.dart'
;
import
'package:flutter_book/pages/answer/index.dart'
;
import
'package:flutter_book/pages/book_detail/index.dart'
;
...
...
@@ -52,6 +53,7 @@ import '../models/index.dart';
import
'../pages/ad_detail/index.dart'
;
import
'../pages/bai_dict/index.dart'
;
import
'../pages/bai_ke/index.dart'
;
import
'../pages/image_view/index.dart'
;
import
'../pages/read_web/index.dart'
;
import
'../pages/user_edit_note/index.dart'
;
import
'../pages/user_order/index.dart'
;
...
...
@@ -65,4 +67,5 @@ import '../store/index.dart';
part
'observers.dart'
;
part
'routes.dart'
;
\ No newline at end of file
part
'routes.dart'
;
part
'transitions.dart'
;
\ No newline at end of file
lib/routes/routes.dart
浏览文件 @
47bd586f
...
...
@@ -130,6 +130,8 @@ abstract class Routes {
static
const
orderRefunded
=
'order_refunded'
;
// 搜索订单
static
const
orderSearch
=
'order_search'
;
// 图片预览
static
const
imageView
=
'image_view'
;
...
...
@@ -689,6 +691,18 @@ abstract class Routes {
)
)
),
GoRoute
(
// 知识测评
path:
'/
$imageView
'
,
name:
imageView
,
pageBuilder:
(
context
,
state
)
=>
BottomToTopTransitionPage
(
name:
state
.
uri
.
toString
(),
key:
state
.
pageKey
,
child:
ImageViewPage
(
images:
state
.
extra
as
List
<
String
>,
)
)
),
]
);
...
...
lib/routes/transitions.dart
0 → 100644
浏览文件 @
47bd586f
/// @Description: 路由动画
/// @Author: 歪脖子
/// @Date: 2023-10-13 13:05
part of
routes
;
class
BottomToTopTransitionPage
<
T
>
extends
CustomTransitionPage
<
T
>
{
BottomToTopTransitionPage
({
super
.
key
,
super
.
name
,
required
super
.
child
,
})
:
super
(
opaque:
true
,
barrierColor:
Colors
.
black
,
barrierDismissible:
true
,
fullscreenDialog:
true
,
transitionsBuilder:
(
context
,
animation
,
secondaryAnimation
,
child
)
{
return
SlideTransition
(
position:
CurveTween
(
curve:
Curves
.
fastOutSlowIn
)
.
animate
(
animation
)
.
drive
<
Offset
>(
Tween
(
begin:
const
Offset
(
0
,
1.0
),
end:
Offset
.
zero
),
),
child:
SafeArea
(
bottom:
false
,
child:
Material
(
type:
MaterialType
.
transparency
,
// clipBehavior: Clip.hardEdge,
// shape: Theme.of(context).bottomSheetTheme.shape,
child:
MediaQuery
.
removePadding
(
context:
context
,
// removeTop: true,
// removeLeft: true,
// removeRight: true,
child:
child
,
),
),
),
);
},
);
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论