Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
book-app
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
book-app
Commits
047a73da
提交
047a73da
authored
2月 27, 2024
作者:
maodou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
订单评价
上级
54488db0
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
168 行增加
和
5 行删除
+168
-5
controller.dart
lib/pages/user_order_evaluate/controller.dart
+13
-5
view.dart
lib/pages/user_order_evaluate/view.dart
+0
-0
input.dart
lib/widgets/input.dart
+155
-0
没有找到文件。
lib/pages/user_order_evaluate/controller.dart
浏览文件 @
047a73da
...
@@ -3,10 +3,11 @@ part of user_order_evaluate;
...
@@ -3,10 +3,11 @@ part of user_order_evaluate;
/// 订单评价
/// 订单评价
class
UserOrderEvaluateController
extends
GetxController
{
class
UserOrderEvaluateController
extends
GetxController
{
OrderInfoModel
orderInfoModel
;
late
OrderInfoModel
orderInfoModel
=
OrderInfoModel
()
;
String
orderNum
;
String
orderNum
;
UserOrderEvaluateController
(
this
.
orderNum
,
this
.
orderInfoModel
);
// 已完成订单
UserOrderEvaluateController
(
this
.
orderNum
);
// 已完成订单
final
TextEditingController
commentsInput
=
TextEditingController
();
final
FocusNode
_focusNode
=
FocusNode
();
// 按钮是否可用
// 按钮是否可用
bool
_enable
=
false
;
bool
_enable
=
false
;
bool
get
enable
=>
_enable
;
bool
get
enable
=>
_enable
;
...
@@ -33,8 +34,8 @@ class UserOrderEvaluateController extends GetxController {
...
@@ -33,8 +34,8 @@ class UserOrderEvaluateController extends GetxController {
}
}
}
}
void
setCanClick
(
num
double
){
void
setCanClick
(
{
num
double
=
0
}
){
if
(
double
>
0
){
if
(
double
>
0
||
commentsInput
.
text
!=
''
){
_enable
=
true
;
_enable
=
true
;
}
}
else
{
else
{
...
@@ -42,4 +43,11 @@ class UserOrderEvaluateController extends GetxController {
...
@@ -42,4 +43,11 @@ class UserOrderEvaluateController extends GetxController {
}
}
update
();
update
();
}
}
@override
void
onClose
()
{
commentsInput
.
dispose
();
_focusNode
.
dispose
();
super
.
onClose
();
}
}
}
lib/pages/user_order_evaluate/view.dart
浏览文件 @
047a73da
差异被折叠。
点击展开。
lib/widgets/input.dart
浏览文件 @
047a73da
...
@@ -433,4 +433,159 @@ class CustomInputSearch extends StatelessWidget {
...
@@ -433,4 +433,159 @@ class CustomInputSearch extends StatelessWidget {
}
}
}
}
class
CustomInputCommands
extends
StatelessWidget
{
final
TextEditingController
?
controller
;
final
String
?
label
;
final
String
?
helper
;
final
String
?
hintText
;
final
String
?
error
;
final
bool
required
;
final
bool
readOnly
;
final
bool
obscureText
;
final
Widget
?
iconData
;
final
int
?
minLines
;
final
int
?
maxLines
;
final
void
Function
()?
onTap
;
final
void
Function
()?
onIcon
;
final
ValueChanged
<
String
>?
onChanged
;
final
InputDecoration
decoration
;
final
TextInputType
?
keyboardType
;
final
bool
autofocus
;
final
FocusNode
focusNode
;
final
List
<
TextInputFormatter
>?
inputFormatters
;
const
CustomInputCommands
({
Key
?
key
,
this
.
controller
,
this
.
label
,
this
.
helper
,
this
.
hintText
,
this
.
error
,
this
.
required
=
false
,
this
.
readOnly
=
false
,
this
.
obscureText
=
false
,
this
.
onTap
,
this
.
onIcon
,
this
.
iconData
,
this
.
onChanged
,
this
.
decoration
=
const
InputDecoration
(),
this
.
minLines
,
this
.
maxLines
=
1
,
this
.
keyboardType
,
this
.
autofocus
=
false
,
this
.
inputFormatters
,
required
this
.
focusNode
,
})
:
super
(
key:
key
);
@override
Widget
build
(
BuildContext
context
)
{
final
theme
=
Theme
.
of
(
context
);
final
decorationTheme
=
theme
.
inputDecorationTheme
;
return
Column
(
mainAxisSize:
MainAxisSize
.
min
,
crossAxisAlignment:
CrossAxisAlignment
.
stretch
,
children:
[
if
(
label
!=
null
||
required
)
Padding
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
(
decorationTheme
.
contentPadding
?.
horizontal
??
0
)
/
2
,
vertical:
10
.
w
,
).
copyWith
(
top:
0
),
child:
RichText
(
text:
TextSpan
(
text:
label
,
style:
decorationTheme
.
labelStyle
,
children:
[
if
(
required
)
TextSpan
(
text:
label
!=
null
?
' *'
:
'*'
,
style:
const
TextStyle
(
color:
AppTheme
.
error
),
),
],
),
),
),
DecoratedBox
(
decoration:
const
BoxDecoration
(
boxShadow:
[
// BoxShadow(
// color: theme.colorScheme.shadow,
// offset: Offset(0, 20.w),
// blurRadius: 10.w,
// spreadRadius: -10.w,
// ),
],
),
child:
TextField
(
focusNode:
focusNode
,
autofocus:
autofocus
,
controller:
controller
,
readOnly:
readOnly
,
onTap:
onTap
,
obscureText:
obscureText
,
onChanged:
onChanged
,
minLines:
minLines
,
maxLines:
maxLines
,
inputFormatters:
inputFormatters
,
keyboardType:
keyboardType
,
style:
TextStyle
(
// fontFamily: 'Sans',
fontSize:
15
.
w
,
height:
1.2
,
// fontWeight: FontWeight.w600,
),
decoration:
decoration
.
copyWith
(
hintText:
hintText
,
hintStyle:
const
TextStyle
(
fontWeight:
FontWeight
.
normal
,
color:
Colours
.
c9
,
fontSize:
13
),
suffixIconConstraints:
const
BoxConstraints
(),
suffixIcon:
_suffixIcon
(
decorationTheme
),
),
),
),
AnimatedSize
(
duration:
const
Duration
(
milliseconds:
180
),
alignment:
Alignment
.
topCenter
,
child:
error
!=
null
?
Padding
(
padding:
EdgeInsets
.
only
(
top:
10
.
w
),
// child: CustomAlert.error(
// size: CustomAlertSize.mini,
// text: Text(error!),
// ),
)
:
const
SizedBox
.
shrink
(),
),
if
(
helper
!=
null
)
Padding
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
(
decorationTheme
.
contentPadding
?.
horizontal
??
0
)
/
2
,
vertical:
10
.
w
,
).
copyWith
(
bottom:
0
),
child:
Text
(
helper
!,
style:
decorationTheme
.
helperStyle
,
),
)
],
);
}
Widget
?
_suffixIcon
(
InputDecorationTheme
decorationTheme
)
{
if
(
iconData
==
null
)
return
null
;
return
Padding
(
padding:
EdgeInsetsDirectional
.
only
(
end:
(
decorationTheme
.
contentPadding
?.
horizontal
??
0
)
/
2
,
),
child:
GestureDetector
(
onTap:
onIcon
,
child:
SizedBox
(
width:
24
,
height:
24
,
child:
iconData
,
)
),
);
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论