huxiaoqiang vor 4 Jahren
Ursprung
Commit
2770c8d708

+ 1 - 1
lib/https/url.dart

@@ -6,7 +6,7 @@ class MyUrl {
   static String checkLogin = '/aa/checkLogin';
   static String login = '/aa/login';
   static String registered = '/reg/user';
-  static String filePath = 'http://${MyCookie().server}:3001' + '${MyApis.getApi('download')}?path=';
+  static String filePath = 'https://${MyCookie().server}:4001' + '${MyApis.getApi('download')}?path=';
 }
 
 String imgURL(String path) {

+ 4 - 5
lib/my_tools/my_apis.dart

@@ -1,4 +1,3 @@
-import 'package:bbyyy/my_tools/my_cookie.dart';
 
 class MyApis {
   static getApi(String api) {
@@ -208,11 +207,11 @@ class MyApis {
         }
         break;
       case 'download':
-        // if (un) {
+        if (un) {
           return '/file/download';
-        // } else {
-        //   return '/v1/downloadFile';
-        // }
+        } else {
+          return '/v1/downloadFile';
+        }
         break;
       case 'withdraw':
         if (un) {

+ 277 - 28
lib/paegs/gang_page/gang_page.dart

@@ -1,11 +1,12 @@
 import 'dart:convert';
 
-import 'package:azlistview/azlistview.dart';
 import 'package:bbyyy/beans/my_shop_bean_entity.dart';
+import 'package:bbyyy/beans/store_bean_entity.dart';
 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/event_bus.dart';
 import 'package:bbyyy/my_tools/my_colors.dart';
 import 'package:bbyyy/my_tools/my_cookie.dart';
@@ -323,32 +324,130 @@ class _GangPageState extends State<GangPage>
             });
           } else {
             String s = '';
-            if(data.shopState==shopStateArrearage){
+            if (data.shopState == shopStateArrearage) {
               s = '欠费';
-            }
-            else if(data.shopState==shopStateBanned){
+            } else if (data.shopState == shopStateBanned) {
               s = '被禁';
-            }
-            else if(data.shopState==shopStateClosed){
+            } else if (data.shopState == shopStateClosed) {
               s = '关闭';
             }
-            showSimpleDialog('该店铺已$s,请尽快处理', context, (){
-              if(data.shopState==shopStateArrearage){
-                MyTools().toPage(
-                    context,
-                    OrderPage(
-                      index: 2,
-                    ), (then) {
-                  onRefresh();
-                });
-              }
-              else if(data.shopState==shopStateBanned){
-                Navigator.pop(context);
-              }
-              else if(data.shopState==shopStateClosed){
-                Navigator.pop(context);
-              }
-            });
+
+            showDialog(
+              context: context,
+              builder: (BuildContext context) {
+                return Material(
+                  color: Colors.black12,
+                  child: Center(
+                    child: Container(
+                      decoration: BoxDecoration(
+                        borderRadius: BorderRadius.circular(16),
+                        color: Colors.white,
+                      ),
+                      height: 180,
+                      margin: EdgeInsets.symmetric(horizontal: 18),
+                      padding:
+                          EdgeInsets.symmetric(horizontal: 12, vertical: 12),
+                      child: Column(
+                        children: [
+                          Row(
+                            children: [
+                              GestureDetector(
+                                child: Icon(Icons.clear),
+                                onTap: () {
+                                  Navigator.pop(context);
+                                },
+                              ),
+                            ],
+                            mainAxisAlignment: MainAxisAlignment.end,
+                          ),
+                          Expanded(
+                            child: Center(
+                              child: Container(
+                                child: MyViews().myText(
+                                    '该店铺已$s,请尽快处理', MyColors.c333333, 14),
+                                margin: EdgeInsets.symmetric(horizontal: 20),
+                              ),
+                            ),
+                          ),
+                          Container(
+                            height: 0.5,
+                            color: MyColors.cE7E7E7,
+                            margin: EdgeInsets.only(bottom: 12),
+                          ),
+                          Container(
+                            margin: EdgeInsets.symmetric(horizontal: 10),
+                            child: Row(
+                              children: [
+                                Expanded(
+                                  child: GestureDetector(
+                                    onTap: () {
+                                      Navigator.pop(context);
+                                      dismissTheBulletFrame(data);
+                                    },
+                                    behavior: HitTestBehavior.translucent,
+                                    child: Container(
+                                      decoration: BoxDecoration(
+                                          borderRadius: BorderRadius.only(
+                                            topLeft: Radius.circular(20),
+                                            bottomLeft: Radius.circular(20),
+                                          ),
+                                          border: Border.all(
+                                              color: MyColors.cFF4233,
+                                              width: 1.1),
+                                          color: Colors.white),
+                                      child: MyViews()
+                                          .myText('解散货帮', MyColors.cFF4233, 14),
+                                      height: 40,
+                                      alignment: Alignment.center,
+                                    ),
+                                  ),
+                                ),
+                                Expanded(
+                                  child: GestureDetector(
+                                    behavior: HitTestBehavior.translucent,
+                                    onTap: () {
+                                      if (data.shopState ==
+                                          shopStateArrearage) {
+                                        MyTools().toPage(
+                                            context,
+                                            OrderPage(
+                                              index: 2,
+                                            ), (then) {
+                                          onRefresh();
+                                        });
+                                      } else if (data.shopState ==
+                                          shopStateBanned) {
+                                        Navigator.pop(context);
+                                      } else if (data.shopState ==
+                                          shopStateClosed) {
+                                        Navigator.pop(context);
+                                      }
+                                    },
+                                    child: Container(
+                                      decoration: BoxDecoration(
+                                          borderRadius: BorderRadius.only(
+                                            topRight: Radius.circular(20),
+                                            bottomRight: Radius.circular(20),
+                                          ),
+                                          color: MyColors.cFF4233),
+                                      height: 40,
+                                      child: MyViews()
+                                          .myText('去缴费', Colors.white, 14),
+                                      alignment: Alignment.center,
+                                    ),
+                                  ),
+                                )
+                              ],
+                            ),
+                          )
+                        ],
+                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                      ),
+                    ),
+                  ),
+                );
+              },
+            );
           }
         },
         behavior: HitTestBehavior.translucent,
@@ -472,6 +571,130 @@ class _GangPageState extends State<GangPage>
     }
   }
 
+  dismissTheBulletFrame(MyShopBeanDataData data) {
+    TextEditingController controller = TextEditingController();
+    showDialog(
+      context: context,
+      builder: (BuildContext context) {
+        return Material(
+          color: Colors.black12,
+          child: Center(
+            child: Container(
+              decoration: BoxDecoration(
+                borderRadius: BorderRadius.circular(16),
+                color: Colors.white,
+              ),
+              height: 180,
+              margin: EdgeInsets.symmetric(horizontal: 18),
+              padding: EdgeInsets.symmetric(horizontal: 8, vertical: 12),
+              child: Column(
+                children: [
+                  Expanded(
+                    child: Center(
+                      child: Column(
+                        children: [
+                          Container(
+                            child: MyViews().myText(
+                                '确认解散${data.shopName}(${data.shopUid})?',
+                                MyColors.c333333,
+                                14),
+                            margin: EdgeInsets.symmetric(horizontal: 20),
+                          ),
+                          TextField(
+                            controller: controller,
+                            decoration: InputDecoration(
+                                border: InputBorder.none,
+                                disabledBorder: InputBorder.none,
+                                enabledBorder: InputBorder.none,
+                                focusedBorder: InputBorder.none,
+                                hintText: '输入“解散货帮”确认解散',
+                                hintStyle: TextStyle(
+                                    color: MyColors.c999999, fontSize: 16),
+                                isDense: true,
+                                contentPadding:
+                                    const EdgeInsets.fromLTRB(14, 4.5, 8, 4.5)),
+                            textAlign: TextAlign.center,
+                          )
+                        ],
+                        mainAxisAlignment: MainAxisAlignment.spaceAround,
+                      ),
+                    ),
+                  ),
+                  Container(
+                    height: 0.5,
+                    color: MyColors.cE7E7E7,
+                    margin: EdgeInsets.only(bottom: 12),
+                  ),
+                  Container(
+                    margin: EdgeInsets.symmetric(horizontal: 10),
+                    child: Row(
+                      children: [
+                        Expanded(
+                          child: GestureDetector(
+                            onTap: () {
+                              Navigator.pop(context);
+                            },
+                            behavior: HitTestBehavior.translucent,
+                            child: Container(
+                              decoration: BoxDecoration(
+                                  borderRadius: BorderRadius.only(
+                                    topLeft: Radius.circular(20),
+                                    bottomLeft: Radius.circular(20),
+                                  ),
+                                  border: Border.all(
+                                      color: MyColors.cFF4233, width: 1.1),
+                                  color: Colors.white),
+                              child:
+                                  MyViews().myText('取消', MyColors.cFF4233, 14),
+                              height: 40,
+                              alignment: Alignment.center,
+                            ),
+                          ),
+                        ),
+                        Expanded(
+                          child: GestureDetector(
+                            behavior: HitTestBehavior.translucent,
+                            onTap: () {
+                              if (controller.text.toString() == '解散货帮') {
+                                Navigator.pop(context);
+                                EasyLoading.instance
+                                  ..contentPadding = EdgeInsets.symmetric(
+                                      horizontal: 20, vertical: 12)
+                                  ..alignment = Alignment.center
+                                  ..loadingStyle = EasyLoadingStyle.light
+                                  ..contentMargin = EdgeInsets.all(20);
+                                EasyLoading.show();
+                                delShop(data);
+                              } else {
+                                showToast('请输入“解散货帮”');
+                              }
+                            },
+                            child: Container(
+                              decoration: BoxDecoration(
+                                  borderRadius: BorderRadius.only(
+                                    topRight: Radius.circular(20),
+                                    bottomRight: Radius.circular(20),
+                                  ),
+                                  color: MyColors.cFF4233),
+                              height: 40,
+                              child: MyViews().myText('确认', Colors.white, 14),
+                              alignment: Alignment.center,
+                            ),
+                          ),
+                        )
+                      ],
+                    ),
+                  )
+                ],
+                mainAxisAlignment: MainAxisAlignment.spaceBetween,
+              ),
+            ),
+          ),
+        );
+      },
+    );
+  }
+
   @override
   // TODO: implement wantKeepAlive
   bool get wantKeepAlive => true;
@@ -532,10 +755,11 @@ class _GangPageState extends State<GangPage>
         //   return aT.compareTo(bT);
         // });
         data.forEach((element) {
-          element.tagIndex = PinyinHelper.getPinyinE(element.shopName).toLowerCase();
+          element.tagIndex =
+              PinyinHelper.getPinyinE(element.shopName).toLowerCase();
         });
-        data.sort((left,right)=>left.tagIndex.compareTo(right.tagIndex));
-        if (applications.isNotEmpty&&page==1&&sIndex == 0) {
+        data.sort((left, right) => left.tagIndex.compareTo(right.tagIndex));
+        if (applications.isNotEmpty && page == 1 && sIndex == 0) {
           MyShopBeanDataData shopB = MyShopBeanDataData();
           shopB.shopName = '0';
           // add hotCityList.
@@ -550,7 +774,7 @@ class _GangPageState extends State<GangPage>
     }, (error) {});
   }
 
-  void _handleList(List<MyShopBeanDataData> list) {
+  /*void _handleList(List<MyShopBeanDataData> list) {
     List<MyShopBeanDataData> selfBuilt = [];
     list.forEach((element) {
       if (element.ownerUid == MyCookie().getUID()) {
@@ -585,7 +809,7 @@ class _GangPageState extends State<GangPage>
     SuspensionUtil.setShowSuspensionStatus(data);
 
     setState(() {});
-  }
+  }*/
 
   enquiryApplication() {
     MyDio().query({
@@ -619,4 +843,29 @@ class _GangPageState extends State<GangPage>
     queryGang();
     enquiryApplication();
   }
+
+  void delShop(MyShopBeanDataData data) {
+    MyDio().query({
+      "key": "shop",
+      "filters": {
+        "conditions": ["uid == ${data.shopUid}"]
+      },
+      "dims": shopDims,
+      "paging": [1, 5]
+    }, (response, hasError) {
+      if (!hasError) {
+        StoreBeanEntity entity =
+            StoreBeanEntity().fromJson(json.decode(response.data.toString()));
+        MyDio().del({
+          'key': 'shop',
+          'ids': [entity.data.data[0].id]
+        }, (response, hasError) {
+          if (!hasError) {
+            showToast('删除成功');
+            onRefresh();
+          }
+        }, (error) {});
+      }
+    }, (error) {});
+  }
 }

+ 3 - 3
lib/paegs/mine_page/wallet_page/withdraw_page/withdraw_page.dart

@@ -318,7 +318,7 @@ class _WithdrawPageState extends State<WithdrawPage> {
                                           _controller.text = MyCookie()
                                               .userBean
                                               .balance
-                                              .toString();
+                                              .toStringAsFixed(2);
                                           showH();
                                           setState(() {
                                             withdrawalStatus = 0;
@@ -334,7 +334,7 @@ class _WithdrawPageState extends State<WithdrawPage> {
                                       color: MyColors.c999999, fontSize: 15),
                                   children: [
                                     TextSpan(
-                                      text: '$handlingFee',
+                                      text: '${handlingFee.toStringAsFixed(2)}',
                                       style: TextStyle(
                                           color: MyColors.cFF4233,
                                           fontSize: 15),
@@ -350,7 +350,7 @@ class _WithdrawPageState extends State<WithdrawPage> {
                                   children: [
                                     TextSpan(
                                       text:
-                                          '${double.parse(_controller.text.toString()) - handlingFee}',
+                                          '${(double.parse(_controller.text.toString()) - handlingFee).toStringAsFixed(2)}',
                                       style: TextStyle(
                                           color: MyColors.cFF4233,
                                           fontSize: 15),