Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
book-app
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
book-app
Commits
206717a2
提交
206717a2
authored
2月 27, 2024
作者:
yueweilu
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/test' into test
上级
21a2bd71
98c8b12c
显示空白字符变更
内嵌
并排
正在显示
16 个修改的文件
包含
100 行增加
和
164 行删除
+100
-164
view.dart
lib/pages/course/view.dart
+1
-1
filter.dart
lib/pages/library/widgets/filter.dart
+3
-2
view.dart
lib/pages/login/view.dart
+1
-1
view.dart
lib/pages/mine/view.dart
+1
-1
card.dart
lib/pages/study_report/widgets/card.dart
+4
-4
controller.dart
lib/pages/user_order/controller.dart
+2
-13
view.dart
lib/pages/user_order/view.dart
+3
-55
awaiting.dart
lib/pages/user_order/widgets/awaiting.dart
+9
-5
coin.dart
lib/pages/user_order/widgets/coin.dart
+7
-4
list.dart
lib/pages/user_order/widgets/list.dart
+3
-30
search.dart
lib/pages/user_order/widgets/search.dart
+2
-2
controller.dart
lib/pages/user_order_awaiting/controller.dart
+2
-4
view.dart
lib/pages/user_order_awaiting/view.dart
+38
-24
controller.dart
lib/pages/user_order_coin_awaiting/controller.dart
+3
-5
view.dart
lib/pages/user_order_coin_awaiting/view.dart
+12
-4
view.dart
lib/pages/user_order_evaluate/view.dart
+9
-9
没有找到文件。
lib/pages/course/view.dart
浏览文件 @
206717a2
...
...
@@ -50,7 +50,7 @@ class _CoursePageState extends State<CoursePage> {
badgeStyle:
const
badges
.
BadgeStyle
(
badgeColor:
AppTheme
.
primary
,
shape:
badges
.
BadgeShape
.
circle
,
padding:
EdgeInsets
.
all
(
3
),
padding:
EdgeInsets
.
all
(
2
),
),
child:
CustomButton
.
icon
(
padding:
EdgeInsets
.
zero
,
...
...
lib/pages/library/widgets/filter.dart
浏览文件 @
206717a2
...
...
@@ -126,7 +126,7 @@ class _FilterPageState extends State<FilterPage> {
},
child:
Container
(
height:
27
,
padding:
const
EdgeInsets
.
only
(
left:
15
,
right:
15
,
top:
4
),
padding:
const
EdgeInsets
.
only
(
left:
15
,
right:
15
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
13.5
),
color:
model
.
selected
?
const
Color
(
0xFFC02D55
).
withOpacity
(
0.08
):
Colours
.
cF4
,
...
...
@@ -139,7 +139,8 @@ class _FilterPageState extends State<FilterPage> {
Text
(
model
.
name
??
''
,
style:
TextStyle
(
fontSize:
13
,
height:
1.4
,
color:
model
.
selected
?
AppTheme
.
primary
:
Colours
.
c3
),
textAlign:
TextAlign
.
center
,),
Image
.
asset
(
model
.
selected
?
'assets/images/filter_select.png'
:
'assets/images/filter_unselect.png'
),
],
):
Text
(
model
.
name
??
''
,
style:
TextStyle
(
fontSize:
13
,
height:
1.4
,
color:
model
.
selected
?
AppTheme
.
primary
:
Colours
.
c3
),
textAlign:
TextAlign
.
end
,),
):
Padding
(
padding:
EdgeInsets
.
only
(
top:
4
.
w
),
child:
Text
(
model
.
name
??
''
,
style:
TextStyle
(
fontSize:
13
,
height:
1.4
,
color:
model
.
selected
?
AppTheme
.
primary
:
Colours
.
c3
),
textAlign:
TextAlign
.
end
,),),
),
);
...
...
lib/pages/login/view.dart
浏览文件 @
206717a2
...
...
@@ -199,7 +199,7 @@ class _LoginPageState extends State<LoginPage> {
height:
14
.
w
,
// color: AppTheme.primary,
child:
Image
.
asset
(
controller
.
agree
?
'assets/images/check_box_select.png'
:
'assets/images/uncheck.png'
,
controller
.
agree
?
'assets/images/check_box_select.png'
:
'assets/images/uncheck.png'
,
fit:
BoxFit
.
contain
,
),
),
Gaps
.
hGaps5
,
...
...
lib/pages/mine/view.dart
浏览文件 @
206717a2
...
...
@@ -56,7 +56,7 @@ class _MinePageState extends State<MinePage> {
badgeStyle:
const
badges
.
BadgeStyle
(
badgeColor:
AppTheme
.
primary
,
shape:
badges
.
BadgeShape
.
circle
,
padding:
EdgeInsets
.
all
(
3
),
padding:
EdgeInsets
.
all
(
2
),
),
child:
CustomButton
.
icon
(
padding:
EdgeInsets
.
zero
,
...
...
lib/pages/study_report/widgets/card.dart
浏览文件 @
206717a2
...
...
@@ -33,13 +33,13 @@ class BuildCard extends StatelessWidget {
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
model
.
bookName
??
''
,
style:
TextStyle
(
fontSize:
20
.
w
,
height:
1.4
,
color:
Colors
.
white
,
fontWeight:
Fonts
.
medium
),),
Text
(
model
.
bookName
??
''
,
style:
TextStyle
(
fontSize:
18
.
w
,
height:
1.4
,
color:
Colors
.
white
,
fontWeight:
Fonts
.
boldSemi
),),
Gaps
.
vGaps15
,
Row
(
children:
[
Text
(
'学习总进度'
,
style:
TextStyle
(
fontSize:
15
.
w
,
height:
1.4
,
color:
Colors
.
white
),),
Gaps
.
hGaps15
,
Text
(
model
.
progress
??
''
,
style:
TextStyle
(
fontSize:
16
.
w
,
height:
1.4
,
color:
Colors
.
white
,
fontWeight:
Fonts
.
medium
),),
Text
(
model
.
progress
??
''
,
style:
TextStyle
(
fontSize:
16
.
w
,
height:
1.4
,
color:
Colors
.
white
,
fontWeight:
Fonts
.
boldSemi
),),
]
),
Gaps
.
vGaps10
,
...
...
@@ -47,13 +47,13 @@ class BuildCard extends StatelessWidget {
children:
[
Text
(
'学习总时长'
,
style:
TextStyle
(
fontSize:
15
.
w
,
height:
1.4
,
color:
Colors
.
white
),),
Gaps
.
hGaps15
,
Text
(
'
${model.readSecond??''}
分钟'
,
style:
TextStyle
(
fontSize:
16
.
w
,
height:
1.4
,
color:
Colors
.
white
,
fontWeight:
Fonts
.
medium
),),
Text
(
'
${model.readSecond??''}
分钟'
,
style:
TextStyle
(
fontSize:
16
.
w
,
height:
1.4
,
color:
Colors
.
white
,
fontWeight:
Fonts
.
boldSemi
),),
]
),
Gaps
.
vGaps10
,
Text
(
'上次读到'
,
style:
TextStyle
(
fontSize:
15
.
w
,
height:
1.4
,
color:
Colors
.
white
),),
Gaps
.
vGaps5
,
Text
(
model
.
lastChapter
??
''
,
style:
TextStyle
(
fontSize:
16
.
w
,
height:
1.4
,
color:
Colors
.
white
,
fontWeight:
Fonts
.
medium
),
maxLines:
1
,
overflow:
TextOverflow
.
ellipsis
,),
Text
(
model
.
lastChapter
??
''
,
style:
TextStyle
(
fontSize:
16
.
w
,
height:
1.4
,
color:
Colors
.
white
,
fontWeight:
Fonts
.
boldSemi
),
maxLines:
1
,
overflow:
TextOverflow
.
ellipsis
,),
]
),
),
...
...
lib/pages/user_order/controller.dart
浏览文件 @
206717a2
...
...
@@ -3,18 +3,8 @@ part of user_order;
/// 订单详情
class
UserOrderController
extends
GetxController
with
GetTickerProviderStateMixin
{
int
tag
;
// final List<OrderListModel> models;
UserOrderController
(
this
.
tag
);
/*{
onRefresh();
}*/
/* List<Tab> tabs = [
const Tab(text: '全部',),
const Tab(text: '待支付',),
const Tab(text: '已取消',),
const Tab(text: '已完成',),
const Tab(text: '已退款',),
];*/
final
int
tag
;
UserOrderController
(
this
.
tag
);
List
<
OrderListModel
>
orderList
=
[];
...
...
@@ -44,7 +34,6 @@ class UserOrderController extends GetxController
/// 获取订单列表
Future
<
void
>
_getOrders
({
bool
isRefresh
=
false
,
String
keys
=
''
,
int
?
tabIndex
})
async
{
if
(
tabIndex
!=
null
)
tag
=
tabIndex
;
if
(
isRefresh
)
_page
=
1
;
// 网路请求
final
result
=
await
MineAPI
.
orderList
(
...
...
lib/pages/user_order/view.dart
浏览文件 @
206717a2
...
...
@@ -23,7 +23,7 @@ class _UserOrderState extends State<UserOrderPage> with SingleTickerProviderStat
@override
void
initState
()
{
_tabController
=
TabController
(
length:
5
,
vsync:
this
);
_tabController
=
TabController
(
length:
tabs
.
length
,
vsync:
this
);
super
.
initState
();
// 在这里可以使用 localVariable 进行操作
...
...
@@ -31,52 +31,7 @@ class _UserOrderState extends State<UserOrderPage> with SingleTickerProviderStat
@override
Widget
build
(
BuildContext
context
)
{
return
/*GetBuilder<UserOrderController>(
init: UserOrderController(tab),
builder: (controller) => Scaffold(
appBar: CustomAppBar(
automaticallyImplyLeading: false,
titleSpacing: 0,
title: Padding(
padding: EdgeInsets.symmetric(horizontal: AppTheme.margin),
child: CustomInputSearch(
controller: searchController,
readOnly: false,
hintText: '搜索我的订单',
onTap: () {
// context.pushNamed(Routes.msgs);
},
onEditingComplete: () {
controller._getOrders(
isRefresh: true,
keys: searchController.text,
tabIndex: _tabController.index);
// FocusScope.of(context).unfocus();
FocusNode blankNode = FocusNode();
FocusScope.of(context).requestFocus(blankNode); //指定为空白焦点
},
),
),
actions: [
GestureDetector(
onTap: () {
context.pop();
},
child: Container(
padding: EdgeInsets.only(left: 10.w, top: 10.w, bottom: 10.w),
child: Text(
'取消',
style:
TextStyle(fontSize: 14.w, height: 1.5, color: Colours.c3),
),
),
)
],
),
body: _buildBody(controller),
),
);*/
WillPopScope
(
return
WillPopScope
(
onWillPop:
()
async
{
context
.
pop
(
true
);
return
false
;
...
...
@@ -132,13 +87,6 @@ class _UserOrderState extends State<UserOrderPage> with SingleTickerProviderStat
color:
Colors
.
white
,
height:
35
.
w
,
child:
TabBar
(
indicator:
UnderlineTabIndicator
(
borderRadius:
BorderRadius
.
circular
(
0.75
),
borderSide:
BorderSide
(
width:
1.5
.
w
,
color:
AppTheme
.
primary
),
insets:
EdgeInsets
.
symmetric
(
horizontal:
24
.
w
),
// 设置标签下面指示器的水平内边距
),
labelPadding:
EdgeInsets
.
symmetric
(
horizontal:
15
.
w
),
indicatorSize:
TabBarIndicatorSize
.
label
,
indicatorColor:
AppTheme
.
primary
,
...
...
@@ -147,7 +95,7 @@ class _UserOrderState extends State<UserOrderPage> with SingleTickerProviderStat
color:
AppTheme
.
primary
,
fontSize:
15
.
w
,
height:
1.5
,
fontWeight:
Fonts
.
medium
),
fontWeight:
Fonts
.
boldSemi
),
unselectedLabelColor:
Colours
.
c9
,
unselectedLabelStyle:
TextStyle
(
color:
Colours
.
c9
,
fontSize:
15
.
w
,
height:
1.5
),
...
...
lib/pages/user_order/widgets/awaiting.dart
浏览文件 @
206717a2
part of
user_order
;
/// 待付款item
class
BuiltAwaiting
extends
StatelessWidget
{
final
OrderListModel
model
;
final
UserOrderController
controller
;
const
BuiltAwaiting
({
Key
?
key
,
required
this
.
model
})
:
super
(
key:
key
);
const
BuiltAwaiting
({
Key
?
key
,
required
this
.
model
,
required
this
.
controller
})
:
super
(
key:
key
);
@override
Widget
build
(
BuildContext
context
)
{
return
GestureDetector
(
onTap:
()
{
context
.
pushNamed
(
Routes
.
orderAwaiting
,
onTap:
()
async
{
final
result
=
await
context
.
pushNamed
(
Routes
.
orderAwaiting
,
queryParameters:
{
'orderNum'
:
model
.
ordersnum
});
if
(
result
==
true
)
{
controller
.
onRefresh
();
}
},
child:
Container
(
margin:
EdgeInsets
.
only
(
left:
10
.
w
,
right:
10
.
w
,
top:
10
.
w
),
...
...
@@ -123,8 +128,7 @@ class BuiltAwaiting extends StatelessWidget {
child:
Align
(
alignment:
Alignment
.
center
,
child:
Text
(
'
${30 - (DateTime.now().difference(
DateTime.parse(model.createTime.toString()))).inMinutes}
分钟'
,
'
${30 - (DateTime.now().difference(DateTime.parse(model.createTime.toString()))).inMinutes}
分钟'
,
style:
TextStyle
(
color:
Colours
.
cC31F4C
,
fontSize:
10
.
w
,
...
...
lib/pages/user_order/widgets/coin.dart
浏览文件 @
206717a2
...
...
@@ -2,8 +2,8 @@ part of user_order;
/// 紫荆币item
class
BuiltCoin
extends
StatelessWidget
{
final
OrderListModel
model
;
const
BuiltCoin
({
Key
?
key
,
required
this
.
model
})
:
super
(
key:
key
);
final
UserOrderController
controller
;
const
BuiltCoin
({
Key
?
key
,
required
this
.
model
,
required
this
.
controller
})
:
super
(
key:
key
);
@override
Widget
build
(
BuildContext
context
)
{
...
...
@@ -16,10 +16,13 @@ class BuiltCoin extends StatelessWidget {
status
=
'已完成'
;
}
return
GestureDetector
(
onTap:
()
{
onTap:
()
async
{
if
(
model
.
status
==
1
){
context
.
pushNamed
(
Routes
.
orderCoinAwaiting
,
final
result
=
await
context
.
pushNamed
(
Routes
.
orderCoinAwaiting
,
queryParameters:
{
'orderNum'
:
model
.
ordersnum
});
if
(
result
==
true
){
controller
.
onRefresh
();
}
}
},
child:
Container
(
...
...
lib/pages/user_order/widgets/list.dart
浏览文件 @
206717a2
...
...
@@ -32,7 +32,7 @@ class _BuildListPageState extends State<BuildListPage>
Widget
build
(
BuildContext
context
)
{
return
GetBuilder
<
UserOrderController
>(
tag:
widget
.
tag
.
toString
(),
init:
Get
.
put
(
UserOrderController
(
widget
.
tag
)
),
init:
UserOrderController
(
widget
.
tag
),
builder:
(
controller
)
=>
CustomPullScrollView
(
controller:
controller
.
refreshController
,
onRefresh:
controller
.
onRefresh
,
...
...
@@ -42,10 +42,10 @@ class _BuildListPageState extends State<BuildListPage>
OrderListModel
model
=
controller
.
orderList
[
index
];
// OrderListModel model = widget.models[index];
if
(
model
.
types
==
2
)
{
return
BuiltCoin
(
model:
model
,);
return
BuiltCoin
(
model:
model
,
controller:
controller
,
);
}
else
{
if
(
model
.
status
==
1
)
{
return
BuiltAwaiting
(
model:
model
,);
return
BuiltAwaiting
(
model:
model
,
controller:
controller
,
);
}
else
if
(
model
.
status
==
2
)
{
return
BuiltCanceled
(
model:
model
,);
}
else
if
(
model
.
status
==
3
)
{
...
...
@@ -60,33 +60,6 @@ class _BuildListPageState extends State<BuildListPage>
),
),
);
/*return CustomPullScrollView(
controller: widget.controller.refreshController,
onRefresh: widget.controller.onRefresh,
onLoading: widget.controller.onLoading,
child: ListView.builder(
itemBuilder: (BuildContext context, int index) {
OrderListModel model = widget.controller.orderList[index];
// OrderListModel model = widget.models[index];
if (model.types == 2) {
return BuiltCoin(model: model,);
} else {
if (model.status == 1) {
return BuiltAwaiting(model: model,);
} else if (model.status == 2) {
return BuiltCanceled(model: model,);
} else if (model.status == 3) {
return BuiltCompleted(model: model,);
} else if (model.status == 4) {
return BuiltRefunded(model: model,);
}
}
},
itemCount: widget.controller.orderList.length,
// itemCount: widget.models.length,
),
);*/
}
@override
...
...
lib/pages/user_order/widgets/search.dart
浏览文件 @
206717a2
...
...
@@ -56,10 +56,10 @@ class _SearchPageState extends State<OrderSearchPage> {
OrderListModel
model
=
controller
.
orderList
[
index
];
// OrderListModel model = widget.models[index];
if
(
model
.
types
==
2
)
{
return
BuiltCoin
(
model:
model
,);
return
BuiltCoin
(
model:
model
,
controller:
UserOrderController
(
0
),
);
}
else
{
if
(
model
.
status
==
1
)
{
return
BuiltAwaiting
(
model:
model
,);
return
BuiltAwaiting
(
model:
model
,
controller:
UserOrderController
(
0
),
);
}
else
if
(
model
.
status
==
2
)
{
return
BuiltCanceled
(
model:
model
,);
}
else
if
(
model
.
status
==
3
)
{
...
...
lib/pages/user_order_awaiting/controller.dart
浏览文件 @
206717a2
...
...
@@ -32,13 +32,12 @@ class UserOrderAwaitingController extends GetxController {
}
/// 取消订单
void
cancelPay
()
async
{
Future
<
bool
>
cancelPay
()
async
{
final
result
=
await
MineAPI
.
cancelPay
(
ordersnum:
orderNum
);
if
(
result
)
{
Get
.
find
<
UserOrderController
>().
onRefresh
();
Toast
.
show
(
'取消成功'
);
context
.
pop
(
true
);
}
return
result
;
}
...
...
@@ -100,7 +99,6 @@ class UserOrderAwaitingController extends GetxController {
// 支付宝支付
void
requestAliPay
(){
print
(
'================================================================
${payOrderModel.encryptionOrder!}
'
);
tobias
.
pay
(
payOrderModel
.
encryptionOrder
!).
then
((
payResult
){
if
(
payResult
[
'resultStatus'
]
==
'9000'
)
{
...
...
lib/pages/user_order_awaiting/view.dart
浏览文件 @
206717a2
...
...
@@ -2,7 +2,8 @@ part of user_order_awaiting;
class
UserOrderAwaitingPage
extends
StatefulWidget
{
final
String
orderNum
;
// 订单编号
const
UserOrderAwaitingPage
({
Key
?
key
,
required
this
.
orderNum
})
:
super
(
key:
key
);
const
UserOrderAwaitingPage
({
Key
?
key
,
required
this
.
orderNum
})
:
super
(
key:
key
);
@override
State
<
UserOrderAwaitingPage
>
createState
()
=>
_UserOrderAwaitingState
();
...
...
@@ -20,15 +21,22 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> {
@override
Widget
build
(
BuildContext
context
)
{
return
FutureBuilder
(
future:
myController
.
getOrderInfo
(),
return
WillPopScope
(
onWillPop:
()
async
{
context
.
pop
(
true
);
return
false
;
},
child:
FutureBuilder
(
future:
myController
.
getOrderInfo
(),
builder:
(
context
,
snapshot
)
{
if
(
snapshot
.
connectionState
==
ConnectionState
.
waiting
)
{
return
Scaffold
(
appBar:
AppBar
(
centerTitle:
true
,
title:
const
Text
(
'等待付款'
),
),);
}
else
{
),
);
}
else
{
return
WillPopScope
(
onWillPop:
()
async
{
context
.
pop
(
true
);
...
...
@@ -71,7 +79,7 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> {
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Image
.
network
(
myController
.
model
?.
bookList
?[
0
].
img
??
''
,
myController
.
model
?.
bookList
?[
0
].
img
??
''
,
fit:
BoxFit
.
cover
,
// 设置适应方式为充满
width:
72.0
.
w
,
height:
86.0
.
w
,
...
...
@@ -89,7 +97,9 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> {
CrossAxisAlignment
.
end
,
// 下面的Text靠左
children:
[
Text
(
myController
.
model
.
bookList
?[
0
].
name
??
''
,
myController
.
model
.
bookList
?[
0
].
name
??
''
,
style:
TextStyle
(
color:
Colours
.
c3
,
fontWeight:
Fonts
.
bold
,
...
...
@@ -166,7 +176,7 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> {
height:
39
.
w
,
),
GestureDetector
(
onTap:
()
{
onTap:
()
{
myController
.
payOrder
();
},
child:
Container
(
...
...
@@ -175,8 +185,8 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> {
decoration:
BoxDecoration
(
color:
AppTheme
.
primary
,
borderRadius:
BorderRadius
.
circular
(
180
.
w
),
border:
Border
.
all
(
color:
Colours
.
cC31F4C
,
width:
0.5
.
w
)),
border:
Border
.
all
(
color:
Colours
.
cC31F4C
,
width:
0.5
.
w
)),
child:
Center
(
child:
Text
(
'立即支付 ¥
${myController.model.finalTotalPrice}
'
,
...
...
@@ -200,10 +210,13 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> {
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
8.0
.
w
),
),
contentPadding:
EdgeInsets
.
zero
,
// 移除内容部分的内边距
content:
Wrap
(
children:
[
contentPadding:
EdgeInsets
.
zero
,
// 移除内容部分的内边距
content:
Wrap
(
children:
[
Container
(
margin:
EdgeInsets
.
only
(
top:
44
.
w
,
bottom:
29
.
w
),
// 调整上下间距
margin:
EdgeInsets
.
only
(
top:
44
.
w
,
bottom:
29
.
w
),
// 调整上下间距
child:
Center
(
child:
Text
(
'确定取消订单吗'
,
...
...
@@ -220,12 +233,15 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> {
width:
double
.
infinity
,
// 设置分割线的宽度
color:
Colours
.
cLine
,
// 设置分割线的颜色
),
],),
],
),
// 去除操作按钮区域的内边距
actionsPadding:
EdgeInsets
.
zero
,
actions:
<
Widget
>[
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
// 或者使用MainAxisAlignment.spaceEvenly
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
// 或者使用MainAxisAlignment.spaceEvenly
children:
[
GestureDetector
(
onTap:
()
=>
Navigator
.
of
(
context
).
pop
(),
...
...
@@ -249,10 +265,12 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> {
color:
Colours
.
cLine
,
// 设置分割线的颜色
),
GestureDetector
(
onTap:
()
{
myController
.
cancelPay
();
onTap:
()
async
{
Future
<
bool
>
result
=
myController
.
cancelPay
();
if
(
await
result
){
Navigator
.
of
(
context
).
pop
();
// Navigator.pop(context);
context
.
pop
(
true
);
}
},
child:
Container
(
width:
105
.
w
,
...
...
@@ -270,7 +288,6 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> {
),
],
),
],
);
},
...
...
@@ -290,16 +307,13 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> {
),
),
),
],
),
),
);
}
},);
},
),
);
}
}
lib/pages/user_order_coin_awaiting/controller.dart
浏览文件 @
206717a2
...
...
@@ -53,6 +53,7 @@ class UserOrderCoinAwaitingController extends GetxController {
@override
void
onClose
()
{
// controller.onRefresh();
if
(
_connectionSubscription
!=
null
)
{
_connectionSubscription
.
cancel
();
_connectionSubscription
=
null
;
...
...
@@ -94,14 +95,12 @@ class UserOrderCoinAwaitingController extends GetxController {
/// 取消订单
void
cancelPay
()
async
{
Future
<
bool
>
cancelPay
()
async
{
final
result
=
await
MineAPI
.
cancelPay
(
ordersnum:
orderNum
);
if
(
result
)
{
Get
.
find
<
UserOrderController
>().
onRefresh
();
Toast
.
show
(
'取消成功'
);
context
.
pop
(
true
);
// update();
}
return
result
;
}
/// 获取订单信息
...
...
@@ -231,7 +230,6 @@ class UserOrderCoinAwaitingController extends GetxController {
final
result
=
await
ShopAPI
.
orderStatus
(
orderNumber:
model
.
ordersnum
??
''
,
receipt:
_resultItem
!=
null
?
_resultItem
!.
transactionReceipt
.
toString
():
''
);
if
(
result
.
paySuccess
==
1
){
Toast
.
show
(
'订单支付完成'
);
Get
.
find
<
UserOrderController
>().
onRefresh
();
if
(
context
.
mounted
){
context
.
pop
(
true
);
}
...
...
lib/pages/user_order_coin_awaiting/view.dart
浏览文件 @
206717a2
...
...
@@ -23,7 +23,12 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinAwaitingPage> {
@override
Widget
build
(
BuildContext
context
)
{
return
FutureBuilder
(
return
WillPopScope
(
onWillPop:
()
async
{
context
.
pop
(
true
);
return
false
;
},
child:
FutureBuilder
(
future:
myController
.
getOrderInfo
(),
builder:
(
context
,
snapshot
)
{
if
(
snapshot
.
connectionState
==
ConnectionState
.
waiting
)
{
...
...
@@ -269,10 +274,12 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinAwaitingPage> {
color:
Colours
.
cLine
,
// 设置分割线的颜色
),
GestureDetector
(
onTap:
()
{
myController
.
cancelPay
();
onTap:
()
async
{
Future
<
bool
>
result
=
myController
.
cancelPay
();
if
(
await
result
){
Navigator
.
of
(
context
).
pop
();
context
.
pop
(
true
);
}
},
child:
Container
(
width:
105
.
w
,
...
...
@@ -315,6 +322,7 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinAwaitingPage> {
);
}
},
),
);
}
}
lib/pages/user_order_evaluate/view.dart
浏览文件 @
206717a2
...
...
@@ -96,14 +96,14 @@ class _UserOrderEvaluatePageState extends State<UserOrderEvaluatePage> with Auto
List
<
OrderEvaluate
>
orderEvaluates
,
List
<
TextEditingController
>
controllers
)
{
int
indexToUpdate
=
orderEvaluates
.
indexWhere
((
obj
)
=>
obj
.
recordId
==
bookListModel
.
recordId
);
TextEditingController
textFieldController
=
TextEditingController
();
if
(
indexToUpdate
==-
1
){
OrderEvaluate
evaluate
=
OrderEvaluate
(
recordId:
bookListModel
.
recordId
);
orderEvaluates
.
add
(
evaluate
);
controllers
.
add
(
textFieldController
);
}
else
{
textFieldController
=
controllers
[
indexToUpdate
];
}
//
TextEditingController textFieldController= TextEditingController();
//
if(indexToUpdate==-1){
//
OrderEvaluate evaluate = OrderEvaluate(recordId: bookListModel.recordId);
//
orderEvaluates.add(evaluate);
//
controllers.add(textFieldController);
//
}else{
//
textFieldController = controllers[indexToUpdate];
//
}
int
index
=
orderEvaluates
.
length
-
1
;
return
Container
(
...
...
@@ -225,7 +225,7 @@ class _UserOrderEvaluatePageState extends State<UserOrderEvaluatePage> with Auto
hintStyle:
TextStyle
(
fontSize:
14
.
w
,
height:
1.5
,
color:
Colours
.
c6
)),
maxLines:
5
,
controller:
textFieldController
,
//
controller: textFieldController,
hintText:
'请简要描述'
,
),
),
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论