|
|
@@ -8,6 +8,7 @@ import 'package:bbyyy/https/MyDio.dart';
|
|
|
import 'package:bbyyy/https/url.dart';
|
|
|
import 'package:bbyyy/my_tools/const.dart';
|
|
|
import 'package:bbyyy/my_tools/dims.dart';
|
|
|
+import 'package:bbyyy/my_tools/easy_loading/easy_loading.dart';
|
|
|
import 'package:bbyyy/my_tools/my_colors.dart';
|
|
|
import 'package:bbyyy/my_tools/my_cookie.dart';
|
|
|
import 'package:bbyyy/my_tools/my_tools.dart';
|
|
|
@@ -33,6 +34,24 @@ class _WalletPageState extends State<WalletPage> {
|
|
|
@override
|
|
|
void initState() {
|
|
|
super.initState();
|
|
|
+ for(int i =0;i<types.length;i++){
|
|
|
+ tId[types[i]] = typesID[i];
|
|
|
+ }
|
|
|
+ Future.delayed(Duration.zero,(){
|
|
|
+ EasyLoading.show();
|
|
|
+ getUserWalletBalance((re, hE) {
|
|
|
+ if (!hE) {
|
|
|
+ UserBalanceEntity balance =
|
|
|
+ UserBalanceEntity().fromJson(json.decode(re.data.toString()));
|
|
|
+ MyCookie().balance = balance.data;
|
|
|
+ setState(() {
|
|
|
+ EasyLoading.dismiss();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }, (e) {
|
|
|
+ EasyLoading.dismiss();
|
|
|
+ }, context);
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
@override
|
|
|
@@ -303,8 +322,24 @@ class _WalletPageState extends State<WalletPage> {
|
|
|
}
|
|
|
|
|
|
StateSetter ss;
|
|
|
- List<String> types = ['全部', '订单', '佣金','提现','缴费'];
|
|
|
+ List<String> types = ['全部', '订单', '佣金', '提现', '缴费'];
|
|
|
+ var typesID = [
|
|
|
+ [],
|
|
|
+ [
|
|
|
+ flowTypeOrderCommodity,
|
|
|
+ flowTypeOrderAnnualFee,
|
|
|
+ flowTypeOrderVirtualProduct,
|
|
|
+ flowTypeOrderThirdPlatform,
|
|
|
+ flowTypeOrderOfflineTransfer,
|
|
|
+ flowTypeScancodeAilyPay
|
|
|
+ ],
|
|
|
+ [flowTypeShopCommission],
|
|
|
+ [flowTypeWithdraw],
|
|
|
+ [flowTypePlatformFee]
|
|
|
+ ];
|
|
|
int typeIndex = 0;
|
|
|
+ Map tId = Map();
|
|
|
+
|
|
|
// List<String> times = ['全部', '今天', '昨天', '本周', '上周', '本月'];
|
|
|
List<String> times = ['今天', '昨天', '本周', '上周'];
|
|
|
int timeIndex = -1;
|
|
|
@@ -550,7 +585,7 @@ class _WalletPageState extends State<WalletPage> {
|
|
|
if (!hE) {
|
|
|
UserBalanceEntity balance =
|
|
|
UserBalanceEntity().fromJson(json.decode(re.data.toString()));
|
|
|
- MyCookie().userBean.balance = balance.data;
|
|
|
+ MyCookie().balance = balance.data;
|
|
|
setState(() {});
|
|
|
}
|
|
|
}, (e) {}, context);
|
|
|
@@ -559,33 +594,28 @@ class _WalletPageState extends State<WalletPage> {
|
|
|
// "paid_amount ${sTab == 0 ? '>' : '<'} 0"
|
|
|
];
|
|
|
if (typeIndex != 0 && typeIndex != -1) {
|
|
|
- switch(typeIndex){
|
|
|
- case 1:
|
|
|
- conditions.add('type IN ${[
|
|
|
- flowTypeOrderCommodity,
|
|
|
- flowTypeOrderAnnualFee,
|
|
|
- flowTypeOrderVirtualProduct,
|
|
|
- flowTypeOrderThirdPlatform,
|
|
|
- flowTypeOrderOfflineTransfer,
|
|
|
- flowTypeScancodeAilyPay
|
|
|
- ]}');
|
|
|
- break;
|
|
|
- case 2:
|
|
|
- conditions.add('type IN ${[
|
|
|
- flowTypeShopCommission
|
|
|
- ]}');
|
|
|
- break;
|
|
|
- case 3:
|
|
|
- conditions.add('type IN ${[
|
|
|
- flowTypeWithdraw
|
|
|
- ]}');
|
|
|
- break;
|
|
|
- case 4:
|
|
|
- conditions.add('type IN ${[
|
|
|
- flowTypePlatformFee
|
|
|
- ]}');
|
|
|
- break;
|
|
|
- }
|
|
|
+ conditions.add('type IN ${tId[types[typeIndex]]}');
|
|
|
+ // switch (typeIndex) {
|
|
|
+ // case 1:
|
|
|
+ // conditions.add('type IN ${[
|
|
|
+ // flowTypeOrderCommodity,
|
|
|
+ // flowTypeOrderAnnualFee,
|
|
|
+ // flowTypeOrderVirtualProduct,
|
|
|
+ // flowTypeOrderThirdPlatform,
|
|
|
+ // flowTypeOrderOfflineTransfer,
|
|
|
+ // flowTypeScancodeAilyPay
|
|
|
+ // ]}');
|
|
|
+ // break;
|
|
|
+ // case 2:
|
|
|
+ // conditions.add('type IN ${[flowTypeShopCommission]}');
|
|
|
+ // break;
|
|
|
+ // case 3:
|
|
|
+ // conditions.add('type IN ${[flowTypeWithdraw]}');
|
|
|
+ // break;
|
|
|
+ // case 4:
|
|
|
+ // conditions.add('type IN ${[flowTypePlatformFee]}');
|
|
|
+ // break;
|
|
|
+ // }
|
|
|
// conditions.add("type IN ${typeIndex == 1 ? [
|
|
|
// flowTypeOrderCommodity,
|
|
|
// flowTypeOrderAnnualFee,
|
|
|
@@ -597,7 +627,7 @@ class _WalletPageState extends State<WalletPage> {
|
|
|
}
|
|
|
if (timeIndex != -1) {
|
|
|
conditions.add("pay_time between ${getTime(timeIndex)}");
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
conditions.add("pay_time between ${getTime(6)}");
|
|
|
}
|
|
|
MyDio().query({
|
|
|
@@ -649,6 +679,7 @@ class _WalletPageState extends State<WalletPage> {
|
|
|
StoreBeanEntity().fromJson(json.decode(response.data.toString()));
|
|
|
if (entity.data.data.length == 0) {
|
|
|
types.remove('佣金');
|
|
|
+ types.remove('缴费');
|
|
|
}
|
|
|
setState(() {});
|
|
|
}
|