Browse Source

兑换列表,福利兑换优化更改;

dev
wurong 1 year ago
parent
commit
10de196448
  1. 2
      lib/home/welfare_exchange.dart
  2. 83
      lib/order/exchange_history_page.dart

2
lib/home/welfare_exchange.dart

@ -72,7 +72,7 @@ class _WelfareExchange extends State<WelfareExchange>
}
}
creditGoods({isLoading = true}) async {
creditGoods({bool isLoading = true}) async {
try{
if(isLoading)
EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);

83
lib/order/exchange_history_page.dart

@ -124,9 +124,10 @@ class ExchangeHistoryList extends StatefulWidget {
}
class _ExchangeHistoryList extends State<ExchangeHistoryList>
with AutomaticKeepAliveClientMixin{
with AutomaticKeepAliveClientMixin {
ApiService apiService;
RefreshController _refreshController = RefreshController(initialRefresh: false);
RefreshController _refreshController =
RefreshController(initialRefresh: false);
int pageNum = 1;
List<ExchangeOrder> orders = [];
@ -136,15 +137,18 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList>
SharedPreferences.getInstance().then((value) => {
apiService = ApiService(Dio(),
showLoading: false,
context: context, token: value.getString('token')),
context: context,
token: value.getString('token')),
queryHistory(),
});
}
queryHistory({isLoading = true}) async {
try{
if(isLoading)
EasyLoading.show(status: S.current.zhengzaijiazai,maskType: EasyLoadingMaskType.black);
queryHistory({bool isLoading = true}) async {
try {
if (isLoading)
EasyLoading.show(
status: S.current.zhengzaijiazai,
maskType: EasyLoadingMaskType.black);
var map = {
"pageNum": pageNum,
"pageSize": 10,
@ -173,7 +177,8 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList>
} else {
_refreshController.refreshFailed();
_refreshController.loadFailed();
}}finally{
}
} finally {
EasyLoading.dismiss();
setState(() {});
}
@ -197,14 +202,16 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList>
),
controller: _refreshController,
onRefresh: _refresh,
onLoading: queryHistory,
onLoading: () {
queryHistory(isLoading: false);
},
child: orders == null || orders.length == 0
? NoDataView(
src: "assets/image/ding_dan.webp",
isShowBtn: false,
text: "目前暂无记录,手上那么多积分要赶紧用掉哦~",
fontSize: 16.sp,
margin: EdgeInsets.only(top: 120.h,left: 72,right: 72),
margin: EdgeInsets.only(top: 120.h, left: 72, right: 72),
)
: ListView.builder(
itemCount: orders == null ? 0 : orders.length,
@ -261,11 +268,16 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList>
),
),
Text(
exchangeOrder.payStatus != 1 ? "未支付":
((exchangeOrder.useTyped ==1)?((exchangeOrder.sendStatus==3 || exchangeOrder.sendStatus == 9)?"已自提":"待提货")
:(exchangeOrder.useTyped == 2 ?((exchangeOrder.sendStatus==1)?"待发货"
:"已发货")
:orderStatus(exchangeOrder.state))),
exchangeOrder.payStatus != 1
? "未支付"
: ((exchangeOrder.useTyped == 1)
? ((exchangeOrder.sendStatus == 3 ||
exchangeOrder.sendStatus == 9)
? "已自提"
: "待提货")
: (exchangeOrder.useTyped == 2
? ((exchangeOrder.sendStatus == 1) ? "待发货" : "已发货")
: orderStatus(exchangeOrder.state))),
style: TextStyle(
color: Color(0xFFFE951E),
fontWeight: MyFontWeight.semi_bold,
@ -277,8 +289,8 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList>
SizedBox(
height: 16.h,
),
exchangeOrder.useTyped == 1 ?
Container(
exchangeOrder.useTyped == 1
? Container(
child: Column(
children: [
Row(
@ -368,12 +380,12 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList>
),
],
),
):
Row(
)
: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if(exchangeOrder.useTyped != 3)
if (exchangeOrder.useTyped != 3)
Text(
S.of(context).shouhuodi + " :",
style: TextStyle(
@ -480,9 +492,13 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList>
Text(
exchangeOrder?.amount == null || exchangeOrder.amount == "0"
? ""
: exchangeOrder.payType == 2 ? "实付印章 ${exchangeOrder.amount}印章":(S.of(context).shifujifen(exchangeOrder.amount) +
( exchangeOrder?.creditOrderDetailList[0]?.money == null ||
exchangeOrder?.creditOrderDetailList[0]?.money ==
: exchangeOrder.payType == 2
? "实付印章 ${exchangeOrder.amount}印章"
: (S.of(context).shifujifen(exchangeOrder.amount) +
(exchangeOrder?.creditOrderDetailList[0]?.money ==
null ||
exchangeOrder
?.creditOrderDetailList[0]?.money ==
"0.00"
? ""
: " + ${double.parse(exchangeOrder?.creditOrderDetailList[0]?.money.toString()) * exchangeOrder?.creditOrderDetailList[0].goodsNumber}")),
@ -511,9 +527,9 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList>
color: Color(0xFF353535),
),
),
if(exchangeOrder.useTyped != 3)
(exchangeOrder.useTyped == 1 ?
GestureDetector(
if (exchangeOrder.useTyped != 3)
(exchangeOrder.useTyped == 1
? GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
// if (exchangeOrder.state == 1) {
@ -529,18 +545,21 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList>
});
},
child: buildBtnStatus(exchangeOrder.state),
):
GestureDetector(
)
: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
Navigator.of(context).pushNamed(
'/router/logistics_information_page',
arguments: {
"orderId": exchangeOrder.creditOrderDetailList[0].orderId,
"orderId": exchangeOrder
.creditOrderDetailList[0].orderId,
"logisticsNum": "",
"logisticsName": "",
"productNum": exchangeOrder.creditOrderDetailList[0].goodsNumber,
"skuImg":exchangeOrder.creditOrderDetailList[0].goodsMainImg
"productNum": exchangeOrder
.creditOrderDetailList[0].goodsNumber,
"skuImg": exchangeOrder
.creditOrderDetailList[0].goodsMainImg
});
},
child: buildBtnStatusTow(exchangeOrder.sendStatus),
@ -560,7 +579,7 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList>
}
Widget buildBtnStatus(state) {
if (state ==1) {
if (state == 1) {
return RoundButton(
padding: EdgeInsets.fromLTRB(8, 4, 8, 4),
text: S.of(context).chakanhexiaoma,

Loading…
Cancel
Save