huxiaoqiang %!s(int64=4) %!d(string=hai) anos
pai
achega
afd5a6feb3

+ 201 - 58
lib/paegs/gang_page/gang_in_page/gang_information_page/member_list_page/member_order_flow.dart

@@ -29,11 +29,17 @@ class MemberOrderFlowPage extends StatefulWidget {
 }
 
 class _MemberOrderFlowPageState extends State<MemberOrderFlowPage> {
+  int sTab = 0;
+  List<FlowBeanDataDataRecords> flow = [];
   int page = 1;
+  RefreshController controller = RefreshController(initialRefresh: true);
   int total = 0;
   double totalAmount = 0.0;
-  RefreshController controller = RefreshController(initialRefresh: true);
-  List<FlowBeanDataDataRecords> flow = [];
+
+  @override
+  void initState() {
+    super.initState();
+  }
 
   @override
   Widget build(BuildContext context) {
@@ -46,7 +52,7 @@ class _MemberOrderFlowPageState extends State<MemberOrderFlowPage> {
                 decoration: BoxDecoration(
                   gradient: LinearGradient(colors: MyColors.lg),
                 ),
-                height: 220,
+                height: 250,
               ),
               Column(
                 children: [
@@ -83,31 +89,103 @@ class _MemberOrderFlowPageState extends State<MemberOrderFlowPage> {
                               ),
                             ),
                           ),
-                          // Row(
-                          //   children: [
-                          //     GestureDetector(
-                          //       onTap: () {
-                          //         showSelect();
-                          //       },
-                          //       behavior: HitTestBehavior.translucent,
-                          //       child: Container(
-                          //         padding: EdgeInsets.symmetric(
-                          //             vertical: 8, horizontal: 16),
-                          //         child: Text(
-                          //           '筛选',
-                          //           style: TextStyle(
-                          //               color: Colors.white, fontSize: 16),
-                          //         ),
-                          //       ),
-                          //     ),
-                          //   ],
-                          //   mainAxisAlignment: MainAxisAlignment.end,
-                          // )
+                          Row(
+                            children: [
+                              GestureDetector(
+                                onTap: () {
+                                  showSelect();
+                                },
+                                behavior: HitTestBehavior.translucent,
+                                child: Container(
+                                  padding: EdgeInsets.symmetric(
+                                      vertical: 8, horizontal: 16),
+                                  child: Text(
+                                    '筛选',
+                                    style: TextStyle(
+                                        color: Colors.white, fontSize: 16),
+                                  ),
+                                ),
+                              ),
+                            ],
+                            mainAxisAlignment: MainAxisAlignment.end,
+                          )
                         ],
                         alignment: Alignment.center,
                       ),
                     ),
                   ),
+                  // Container(
+                  //   decoration: BoxDecoration(
+                  //       border: Border.all(color: Colors.white, width: 1),
+                  //       borderRadius: BorderRadius.all(Radius.circular(20))),
+                  //   height: 40,
+                  //   width: double.infinity,
+                  //   margin: EdgeInsets.symmetric(horizontal: 33, vertical: 7),
+                  //   child: Row(
+                  //     children: [
+                  //       Expanded(
+                  //         child: GestureDetector(
+                  //           onTap: () {
+                  //             setState(() {
+                  //               sTab = 0;
+                  //               controller.requestRefresh();
+                  //             });
+                  //           },
+                  //           behavior: HitTestBehavior.translucent,
+                  //           child: Container(
+                  //             height: 40,
+                  //             decoration: BoxDecoration(
+                  //                 borderRadius: BorderRadius.only(
+                  //                   topLeft: Radius.circular(20),
+                  //                   bottomLeft: Radius.circular(20),
+                  //                 ),
+                  //                 color: sTab == 0
+                  //                     ? Colors.white
+                  //                     : Colors.transparent),
+                  //             child: Text(
+                  //               '我的收入',
+                  //               style: TextStyle(
+                  //                   color: sTab == 0
+                  //                       ? MyColors.cFF4233
+                  //                       : Colors.white),
+                  //             ),
+                  //             alignment: Alignment.center,
+                  //           ),
+                  //         ),
+                  //       ),
+                  //       Expanded(
+                  //         child: GestureDetector(
+                  //           onTap: () {
+                  //             setState(() {
+                  //               sTab = 1;
+                  //               controller.requestRefresh();
+                  //             });
+                  //           },
+                  //           behavior: HitTestBehavior.translucent,
+                  //           child: Container(
+                  //             height: 40,
+                  //             decoration: BoxDecoration(
+                  //                 borderRadius: BorderRadius.only(
+                  //                   topRight: Radius.circular(20),
+                  //                   bottomRight: Radius.circular(20),
+                  //                 ),
+                  //                 color: sTab == 1
+                  //                     ? Colors.white
+                  //                     : Colors.transparent),
+                  //             child: Text(
+                  //               '我的支出',
+                  //               style: TextStyle(
+                  //                   color: sTab == 1
+                  //                       ? MyColors.cFF4233
+                  //                       : Colors.white),
+                  //             ),
+                  //             alignment: Alignment.center,
+                  //           ),
+                  //         ),
+                  //       )
+                  //     ],
+                  //   ),
+                  // ),
                   Container(
                     margin: EdgeInsets.only(top: 10),
                     child: Row(
@@ -133,8 +211,8 @@ class _MemberOrderFlowPageState extends State<MemberOrderFlowPage> {
                     margin: EdgeInsets.only(top: 10),
                     child: Center(
                       child: Text(
-                        '总额:$totalAmount',
-                        style: TextStyle(color: Colors.white, fontSize: 20),
+                        '$totalAmount',
+                        style: TextStyle(color: Colors.white, fontSize: 25),
                       ),
                     ),
                   ),
@@ -147,6 +225,72 @@ class _MemberOrderFlowPageState extends State<MemberOrderFlowPage> {
                       ),
                     ),
                   ),
+
+                  // Container(
+                  //   height: 22,
+                  //   child: Row(
+                  //     children: [
+                  //       Text(
+                  //         '$total笔数',
+                  //         style: TextStyle(color: Colors.white, fontSize: 14),
+                  //       ),
+                  //       // Visibility(
+                  //       //   visible: sTab == 0,
+                  //       //   child: GestureDetector(
+                  //       //     onTap: () {
+                  //       //       if (MyCookie().userBean.aliPayAccount.isEmpty) {
+                  //       //         MyTools().toPage(context, SetAlipayPage(),
+                  //       //             (then) {
+                  //       //           if (MyCookie()
+                  //       //               .userBean
+                  //       //               .aliPayAccount
+                  //       //               .isNotEmpty) {
+                  //       //             MyTools().toPage(context, WithdrawPage(),
+                  //       //                 (then) {
+                  //       //               controller.requestRefresh();
+                  //       //             });
+                  //       //           }
+                  //       //         });
+                  //       //       } else {
+                  //       //         MyTools().toPage(context, WithdrawPage(),
+                  //       //             (then) {
+                  //       //           controller.requestRefresh();
+                  //       //         });
+                  //       //       }
+                  //       //     },
+                  //       //     behavior: HitTestBehavior.translucent,
+                  //       //     child: Container(
+                  //       //       decoration: BoxDecoration(
+                  //       //         color: MyColors.cFFCD00,
+                  //       //         borderRadius:
+                  //       //             BorderRadius.all(Radius.circular(15)),
+                  //       //       ),
+                  //       //       height: 30,
+                  //       //       width: 70,
+                  //       //       child: Text(
+                  //       //         '申请提现',
+                  //       //         style: TextStyle(
+                  //       //             color: Colors.white, fontSize: 13),
+                  //       //       ),
+                  //       //       alignment: Alignment.center,
+                  //       //       padding: EdgeInsets.only(bottom: 1),
+                  //       //     ),
+                  //       //   ),
+                  //       // )
+                  //     ],
+                  //     mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                  //   ),
+                  //   alignment: Alignment.centerLeft,
+                  //   margin: EdgeInsets.only(top: 25, left: 15, right: 17),
+                  // ),
+                  // Container(
+                  //   child: Text(
+                  //     '¥${NumUtil.multiply(totalAmount, 1)}',
+                  //     style: TextStyle(color: Colors.white, fontSize: 24),
+                  //   ),
+                  //   alignment: Alignment.center,
+                  //   margin: EdgeInsets.only(top: 2),
+                  // ),
                 ],
               )
             ],
@@ -175,7 +319,7 @@ class _MemberOrderFlowPageState extends State<MemberOrderFlowPage> {
   }
 
   StateSetter ss;
-  List<String> types = ['全部', '订单', '佣金'];
+  List<String> types = ['全部', '订单', '佣金','提现'];
   int typeIndex = 0;
   List<String> times = ['全部', '今天', '昨天', '本周', '上周', '本月'];
   int timeIndex = 0;
@@ -420,19 +564,39 @@ class _MemberOrderFlowPageState extends State<MemberOrderFlowPage> {
 
     var conditions = [
       "user_uid==${widget.data.userUid}",
-      'paid_amount > 0 '
+      // "paid_amount ${sTab == 0 ? '>' : '<'} 0"
     ];
-    conditions.add('type IN [$flowTypeOrderThirdPlatform]');
-    conditions.add('shop_uid == ${widget.data.shopUid}');
     if (typeIndex != 0 && typeIndex != -1) {
-      conditions.add("type IN ${typeIndex == 1 ? [
-      flowTypeOrderCommodity,
-          flowTypeOrderAnnualFee,
-          flowTypeOrderVirtualProduct,
-          flowTypeOrderThirdPlatform,
-          flowTypeOrderOfflineTransfer,
-          flowTypeScancodeAilyPay
-          ] : [flowTypeShopCommission]}");
+      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;
+      }
+      // conditions.add("type IN ${typeIndex == 1 ? [
+      //     flowTypeOrderCommodity,
+      //     flowTypeOrderAnnualFee,
+      //     flowTypeOrderVirtualProduct,
+      //     flowTypeOrderThirdPlatform,
+      //     flowTypeOrderOfflineTransfer,
+      //     flowTypeScancodeAilyPay
+      //   ] : [flowTypeShopCommission]}");
     }
     if (timeIndex != 0 && timeIndex != -1) {
       conditions.add("pay_time between ${getTime(timeIndex - 1)}");
@@ -463,7 +627,6 @@ class _MemberOrderFlowPageState extends State<MemberOrderFlowPage> {
 
   void onRefresh() {
     page = 1;
-    checkIfYouAreTheOwner();
     myFlow();
   }
 
@@ -472,24 +635,4 @@ class _MemberOrderFlowPageState extends State<MemberOrderFlowPage> {
     myFlow();
   }
 
-  void checkIfYouAreTheOwner() {
-    MyDio().query({
-      "key": "shop",
-      "filters": {
-        "conditions": ["owner_uid == ${MyCookie().getUID()}"]
-      },
-      "dims": shopDims,
-      "paging": [1, 5000]
-    }, (response, hasError) {
-      if (!hasError) {
-        StoreBeanEntity entity =
-        StoreBeanEntity().fromJson(json.decode(response.data.toString()));
-        if (entity.data.data.length == 0) {
-          types.remove('佣金');
-        }
-        setState(() {});
-      }
-      endRe(controller);
-    }, (error) {});
-  }
 }