huxiaoqiang 4 år sedan
förälder
incheckning
fb07920df3

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 13 - 0
images/svg/logo.svg


+ 58 - 20
lib/https/my_request.dart

@@ -3,6 +3,7 @@ import 'dart:io';
 
 import 'package:bbyyy/beans/android_app_version_bean_entity.dart';
 import 'package:bbyyy/beans/home_carousel_bean_entity.dart';
+import 'package:bbyyy/beans/my_shop_bean_entity.dart';
 import 'package:bbyyy/beans/smart_order_bean_entity.dart';
 import 'package:bbyyy/beans/store_bean_entity.dart';
 import 'package:bbyyy/my_tools/const.dart';
@@ -187,33 +188,70 @@ grabACoupon(int id) {
 
 //查询第三方未付订单
 void checkUnpaidThirdPartyOrders() {
-  MyDio().query({
-    "key": "order",
+  var dJson;
+  var conditions1 = [
+    "role!=$shopUserOwner",
+    "user_uid==${MyCookie().getUID()}",
+    "review_state==1"
+  ];
+  var conditions2 = [
+    "role==$shopUserOwner",
+    "user_uid==${MyCookie().getUID()}"
+  ];
+  conditions1.add('private_shop==true');
+  dJson = {
+    "key": "shop_user",
     "filters": {
       "or": true,
-      "conditions": [
-        "state == $orderStateUnpaid",
-        'buyer_uid==0',
-        'buyer_name LIKE ${MyCookie().getName()}'
-      ],
+      "conditions": conditions1,
       "filters": [
-        {
+        {"conditions": conditions2}
+      ]
+    },
+    "dims": shopUserDims,
+    "paging": [1, 1000],
+    "order_by": ["shop_name,DESC"]
+  };
+
+  MyDio().query(dJson, (response, hasError) {
+    if (!hasError) {
+      MyShopBeanEntity entity =
+      MyShopBeanEntity().fromJson(json.decode(response.data.toString()));
+      List<int> myShopUIDs  = [];
+      entity.data.data.forEach((element) {
+        myShopUIDs.add(element.shopUid);
+      });
+      MyDio().query({
+        "key": "order",
+        "filters": {
+          "or": true,
           "conditions": [
             "state == $orderStateUnpaid",
-            'buyer_uid==${MyCookie().getUID()}'
+            'buyer_uid==0',
+            'buyer_name LIKE ${MyCookie().getName()}',
+            'shop_uid IN $myShopUIDs'
+          ],
+          "filters": [
+            {
+              "conditions": [
+                "state == $orderStateUnpaid",
+                'buyer_uid==${MyCookie().getUID()}'
+              ]
+            }
           ]
+        },
+        "dims": orderDims,
+        "paging": [1, 20],
+        "order_by": ["create_time,DESC"]
+      }, (response, hasError) {
+        if (!hasError) {
+          SmartOrderBeanEntity entity = SmartOrderBeanEntity()
+              .fromJson(json.decode(response.data.toString()));
+          MyCookie().haveNoPay = entity.data.data.isNotEmpty;
+          EventBus().emit('hasNoPay');
         }
-      ]
-    },
-    "dims": orderDims,
-    "paging": [1, 20],
-    "order_by": ["create_time,DESC"]
-  }, (response, hasError) {
-    if (!hasError) {
-      SmartOrderBeanEntity entity = SmartOrderBeanEntity()
-          .fromJson(json.decode(response.data.toString()));
-      MyCookie().haveNoPay = entity.data.data.isNotEmpty;
-      EventBus().emit('hasNoPay');
+      }, (error) {});
     }
   }, (error) {});
+
 }

+ 5 - 0
lib/my_tools/my_colors.dart

@@ -22,7 +22,9 @@ import 'dart:ui';
   100%=00(全透明)*/
 class MyColors{
   static Color cFF4233 = Color(0xffFF4233);
+  static Color cF25D4B = Color(0xffF25D4B);
   static Color cff3646 = Color(0xffff3646);
+  static Color cF55544 = Color(0xffF55544);
   static Color cFFECEB = Color(0xffFFECEB);
   static Color cFF7F86 = Color(0xffFF7F86);
   static Color cF7E4E3 = Color(0xffF7E4E3);
@@ -36,6 +38,7 @@ class MyColors{
   static Color cC9C9C9 = Color(0xffC9C9C9);
   static Color cC2C2C2 = Color(0xffC2C2C2);
   static Color cE7E7E7 = Color(0xffE7E7E7);
+  static Color c25E7E7E7 = Color(0x3FE7E7E7);
   static Color cf3f3f3 = Color(0xfff3f3f3);
   static Color cF5F5F5 = Color(0xffF5F5F5);
   static Color cf8f8f8 = Color(0xfff8f8f8);
@@ -48,6 +51,7 @@ class MyColors{
   static Color c979797 = Color(0xff979797);
   static Color cf2f2f2 = Color(0xfff2f2f2);
   static Color c333333 = Color(0xff333333);
+  static Color cF1D19B = Color(0xffF1D19B);
   static Color c21333333 = Color(0x21333333);
   static Color c7FE1E1E1 = Color(0x7FE1E1E1);
   static Color cE1E1E1 = Color(0xffE1E1E1);
@@ -58,6 +62,7 @@ class MyColors{
   static Color c666666 = Color(0xff666666);
   static Color cBFBFBF = Color(0xffBFBFBF);
   static Color cADD358 = Color(0xffADD358);
+  static Color c44D7B6 = Color(0xff44D7B6);
   static Color cFFCD00 = Color(0xffFFCD00);
   static Color cFFCD74 = Color(0xffFFCD74);
   static Color cFFB455 = Color(0xffFFB455);

+ 269 - 117
lib/my_tools/order_processing/order_processing.dart

@@ -42,6 +42,7 @@ class OrderProcessing {
   int amountCompleted = 0;
   bool saving = false;
   Map idTemplate = Map();
+  bool showOrderDetail = false;
 
   //初始化变量
   void initialization() {
@@ -53,6 +54,7 @@ class OrderProcessing {
     template = null;
     commissionPayerNum = -1;
     orderHash = '';
+    showOrderDetail = false;
     order.clear();
     EasyLoading.dismiss();
     showToast('发送成功');
@@ -266,133 +268,275 @@ class OrderProcessing {
         child: StatefulBuilder(
           builder: (c, s) {
             ss = s;
-            return Column(
-              children: [
-                Container(
-                  child: Stack(
-                    children: [
-                      Container(
-                        child: MyViews().myText('智能订单', MyColors.c333333, 14),
-                        alignment: Alignment.center,
-                        height: 22,
-                      ),
-                      Positioned(
-                        right: 0,
-                        child: GestureDetector(
-                          onTap: () {
-                            initialization();
-                            PopUpQueue().onShow = false;
-                            PopUpQueue().showNext();
-                          },
-                          behavior: HitTestBehavior.translucent,
-                          child: Container(
-                            child: Icon(
-                              Icons.close,
-                              size: 20,
-                              color: Colors.white,
+            if (showOrderDetail) {
+              return Column(
+                children: [
+                  Container(
+                    child: Stack(
+                      children: [
+                        Container(
+                          child: MyViews().myText('订单详情', MyColors.c333333, 14),
+                          alignment: Alignment.center,
+                          height: 22,
+                        ),
+                        Positioned(
+                          right: 0,
+                          child: GestureDetector(
+                            onTap: () {
+                              initialization();
+                              PopUpQueue().onShow = false;
+                              PopUpQueue().showNext();
+                            },
+                            behavior: HitTestBehavior.translucent,
+                            child: Container(
+                              child: Icon(
+                                Icons.close,
+                                size: 20,
+                                color: Colors.white,
+                              ),
+                              decoration: BoxDecoration(
+                                  color: MyColors.cB6B6B6,
+                                  borderRadius: BorderRadius.circular(11)),
+                              height: 22,
+                              width: 22,
                             ),
-                            decoration: BoxDecoration(
-                                color: MyColors.cB6B6B6,
-                                borderRadius: BorderRadius.circular(11)),
-                            height: 22,
-                            width: 22,
                           ),
+                        )
+                      ],
+                      alignment: Alignment.center,
+                    ),
+                    height: 30,
+                    padding: EdgeInsets.symmetric(horizontal: 12),
+                  ),
+                  Container(
+                    child: Text(
+                      '¥${amount()}',
+                      style: TextStyle(color: MyColors.cFF4233, fontSize: 25),
+                    ),
+                    margin: EdgeInsets.only(top: 15,bottom: 10),
+                  ),
+                  Padding(
+                    padding: EdgeInsets.symmetric(horizontal: 16, vertical: 5),
+                    child: Row(
+                      children: [
+                        Text('所属店铺:'),
+                        Row(
+                          children: [
+                            ClipRRect(
+                              child: MyViews()
+                                  .netImg(imgURL(shop.shopPic), 30, 30),
+                              borderRadius: BorderRadius.circular(15),
+                            ),
+                            Container(
+                              child: Text('${shop.shopName}(${shop.shopUid})'),
+                              margin: EdgeInsets.only(left: 10),
+                            )
+                          ],
+                        )
+                      ],
+                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                    ),
+                  ),
+                  Padding(
+                    padding: EdgeInsets.symmetric(horizontal: 16, vertical: 5),
+                    child: Row(
+                      children: [
+                        Text('收款人:'),
+                        Row(
+                          children: [
+                            ClipRRect(
+                              child: MyViews()
+                                  .netImg(imgURL(MyCookie().getPic()), 30, 30),
+                              borderRadius: BorderRadius.circular(15),
+                            ),
+                            Container(
+                              child: Text(
+                                  '${MyCookie().getName()}(${MyCookie().getUID().toString().replaceRange(0, 4, '****')})'),
+                              margin: EdgeInsets.only(left: 10),
+                            )
+                          ],
+                        )
+                      ],
+                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                    ),
+                  ),
+                  Container(
+                    child: GestureDetector(
+                      onTap: () {
+                        if (saving) {
+                          return;
+                        } else {
+                          ss((){
+                            saving = true;
+                          });
+                          EventBus().on('saveOrder', (arg) {
+                            amountCompleted++;
+                            if (amountCompleted == order.length) {
+                              initialization();
+                            }
+                          });
+                          order.forEach((element) {
+                            sendOrder(element);
+                          });
+                        }
+                      },
+                      behavior: HitTestBehavior.translucent,
+                      child: Container(
+                        decoration: BoxDecoration(
+                          color: MyColors.cFF4233,
+                          borderRadius: BorderRadius.circular(20),
                         ),
-                      )
-                    ],
+                        height: 40,
+                        width: 150,
+                        child: saving?Container(
+                          height: 30,width: 30,
+                          padding: const EdgeInsets.all(2.0),
+                          child: CircularProgressIndicator(
+                            backgroundColor: Colors.transparent,
+                            valueColor: AlwaysStoppedAnimation(Colors.white),
+                            strokeWidth: 2,
+                          ),
+                        ):MyViews().myText('发送订单', Colors.white, 14),
+                        alignment: Alignment.center,
+                      ),
+                    ),
                     alignment: Alignment.center,
+                    margin: EdgeInsets.only(top: 15),
+                  )
+                ],
+              );
+            } else {
+              return Column(
+                children: [
+                  Container(
+                    child: Stack(
+                      children: [
+                        Container(
+                          child: MyViews().myText('智能订单', MyColors.c333333, 14),
+                          alignment: Alignment.center,
+                          height: 22,
+                        ),
+                        Positioned(
+                          right: 0,
+                          child: GestureDetector(
+                            onTap: () {
+                              initialization();
+                              PopUpQueue().onShow = false;
+                              PopUpQueue().showNext();
+                            },
+                            behavior: HitTestBehavior.translucent,
+                            child: Container(
+                              child: Icon(
+                                Icons.close,
+                                size: 20,
+                                color: Colors.white,
+                              ),
+                              decoration: BoxDecoration(
+                                  color: MyColors.cB6B6B6,
+                                  borderRadius: BorderRadius.circular(11)),
+                              height: 22,
+                              width: 22,
+                            ),
+                          ),
+                        )
+                      ],
+                      alignment: Alignment.center,
+                    ),
+                    height: 30,
+                    padding: EdgeInsets.symmetric(horizontal: 12),
                   ),
-                  height: 30,
-                  padding: EdgeInsets.symmetric(horizontal: 12),
-                ),
-                Container(
-                  height: 5,
-                  color: MyColors.cF7F7F7,
-                  margin: EdgeInsets.only(top: 10),
-                ),
-                Column(
-                  children: items(order),
-                ),
-                Container(
-                  height: 5,
-                  color: MyColors.cF7F7F7,
-                  margin: EdgeInsets.only(top: 10),
-                ),
-                Visibility(
-                  child: Column(
-                    children: [
-                      Container(
-                        child: MyViews().myText('货帮选择', MyColors.c333333, 13),
-                        margin: EdgeInsets.only(left: 7, top: 11),
-                      ),
-                      Container(
-                        margin:
-                            EdgeInsets.symmetric(horizontal: 7, vertical: 10),
-                        height: (showShops.length * 1.0 / 2).ceil() *
-                                (double.parse(
-                                            '${MediaQuery.of(buildContext).size.width - 74}') /
-                                        2 /
-                                        3.8 +
-                                    10) -
-                            10,
-                        child: GridView(
-                          gridDelegate:
-                              SliverGridDelegateWithFixedCrossAxisCount(
-                                  crossAxisCount: 2, //横轴三个子widget
-                                  childAspectRatio: 3.8,
-                                  crossAxisSpacing: 10,
-                                  mainAxisSpacing: 8 //宽高比为1时,子widget
-                                  ),
-                          children: shopItem(showShops),
-                          padding: EdgeInsets.all(0),
+                  Container(
+                    height: 5,
+                    color: MyColors.cF7F7F7,
+                    margin: EdgeInsets.only(top: 10),
+                  ),
+                  Column(
+                    children: items(order),
+                  ),
+                  Container(
+                    height: 5,
+                    color: MyColors.cF7F7F7,
+                    margin: EdgeInsets.only(top: 10),
+                  ),
+                  Visibility(
+                    child: Column(
+                      children: [
+                        Container(
+                          child: MyViews().myText('货帮选择', MyColors.c333333, 13),
+                          margin: EdgeInsets.only(left: 7, top: 11),
                         ),
-                      ),
-                    ],
-                    crossAxisAlignment: CrossAxisAlignment.start,
+                        Container(
+                          margin:
+                              EdgeInsets.symmetric(horizontal: 7, vertical: 10),
+                          height: (showShops.length * 1.0 / 2).ceil() *
+                                  (double.parse(
+                                              '${MediaQuery.of(buildContext).size.width - 74}') /
+                                          2 /
+                                          3.8 +
+                                      10) -
+                              10,
+                          child: GridView(
+                            gridDelegate:
+                                SliverGridDelegateWithFixedCrossAxisCount(
+                                    crossAxisCount: 2, //横轴三个子widget
+                                    childAspectRatio: 3.8,
+                                    crossAxisSpacing: 10,
+                                    mainAxisSpacing: 8 //宽高比为1时,子widget
+                                    ),
+                            children: shopItem(showShops),
+                            padding: EdgeInsets.all(0),
+                          ),
+                        ),
+                      ],
+                      crossAxisAlignment: CrossAxisAlignment.start,
+                    ),
+                    visible: showShops.length != 1,
                   ),
-                  visible: showShops.length != 1,
-                ),
-                Container(
-                  height: 0.5,
-                  color: MyColors.cF7F7F7,
-                  margin: EdgeInsets.only(bottom: 10),
-                ),
-                Container(
-                  child: GestureDetector(
-                    onTap: () {
-                      if (saving) {
-                        return;
-                      } else {
-                        saving = true;
-                        EventBus().on('saveOrder', (arg) {
-                          amountCompleted++;
-                          if (amountCompleted == order.length) {
-                            initialization();
-                          }
-                        });
-                        order.forEach((element) {
-                          sendOrder(element);
+                  Container(
+                    height: 0.5,
+                    color: MyColors.cF7F7F7,
+                    margin: EdgeInsets.only(bottom: 10),
+                  ),
+                  Container(
+                    child: GestureDetector(
+                      onTap: () {
+                        // if (saving) {
+                        //   return;
+                        // } else {
+                        //   saving = true;
+                        //   EventBus().on('saveOrder', (arg) {
+                        //     amountCompleted++;
+                        //     if (amountCompleted == order.length) {
+                        //       initialization();
+                        //     }
+                        //   });
+                        //   order.forEach((element) {
+                        //     sendOrder(element);
+                        //   });
+                        // }
+                        ss(() {
+                          showOrderDetail = true;
                         });
-                      }
-                    },
-                    behavior: HitTestBehavior.translucent,
-                    child: Container(
-                      decoration: BoxDecoration(
-                        color: MyColors.cFF4233,
-                        borderRadius: BorderRadius.circular(20),
+                      },
+                      behavior: HitTestBehavior.translucent,
+                      child: Container(
+                        decoration: BoxDecoration(
+                          color: MyColors.cFF4233,
+                          borderRadius: BorderRadius.circular(20),
+                        ),
+                        height: 40,
+                        width: 150,
+                        child: MyViews().myText('确认', Colors.white, 14),
+                        alignment: Alignment.center,
                       ),
-                      height: 40,
-                      width: 150,
-                      child: MyViews().myText('发送订单', Colors.white, 14),
-                      alignment: Alignment.center,
                     ),
-                  ),
-                  alignment: Alignment.center,
-                )
-              ],
-              mainAxisAlignment: MainAxisAlignment.start,
-              crossAxisAlignment: CrossAxisAlignment.start,
-            );
+                    alignment: Alignment.center,
+                  )
+                ],
+                mainAxisAlignment: MainAxisAlignment.start,
+                crossAxisAlignment: CrossAxisAlignment.start,
+              );
+            }
           },
         ),
       ),
@@ -729,4 +873,12 @@ class OrderProcessing {
       return false;
     }
   }
+
+  String amount() {
+    double amount = 0.0;
+    order.forEach((element) {
+      amount += element.payer.amount * element.factor;
+    });
+    return amount.toStringAsFixed(2);
+  }
 }

+ 48 - 44
lib/paegs/chat_page/chat_page.dart

@@ -40,6 +40,7 @@ class _ChatPageState extends State<ChatPage> {
       RefreshController(initialRefresh: true);
   int page = 1;
   List<MessageBeanContent> msges = [];
+  StateSetter ss;
 
   @override
   void initState() {
@@ -70,51 +71,54 @@ class _ChatPageState extends State<ChatPage> {
                 context, []),
             // ChatPageView().goodsInfo(widget.goods),
             Expanded(
-              child: Container(
-                color: MyColors.cf2f2f2,
-                child: SmartRefresher(
-                  enablePullDown: true,
-                  onLoading: onLoading,
-                  onRefresh: onRefresh,
-                  footer: CustomFooter(
-                    loadStyle: LoadStyle.ShowWhenLoading,
-                    builder: (context, mode) {
-                      if (mode == LoadStatus.loading) {
-                        return Container(
-                          height: 60.0,
-                          child: Container(
-                            height: 20.0,
-                            width: 20.0,
-                            child: CupertinoActivityIndicator(),
-                          ),
+              child: StatefulBuilder(builder: (BuildContext context, void Function(void Function()) setState) {
+                ss = setState;
+                return Container(
+                  color: MyColors.cf2f2f2,
+                  child: SmartRefresher(
+                    enablePullDown: true,
+                    onLoading: onLoading,
+                    onRefresh: onRefresh,
+                    footer: CustomFooter(
+                      loadStyle: LoadStyle.ShowWhenLoading,
+                      builder: (context, mode) {
+                        if (mode == LoadStatus.loading) {
+                          return Container(
+                            height: 60.0,
+                            child: Container(
+                              height: 20.0,
+                              width: 20.0,
+                              child: CupertinoActivityIndicator(),
+                            ),
+                          );
+                        } else
+                          return Container();
+                      },
+                    ),
+                    enablePullUp: true,
+                    controller: _refreshController,
+                    child: Scrollable(
+                      controller: _scrollController,
+                      axisDirection: AxisDirection.up,
+                      viewportBuilder: (context, offset) {
+                        return ExpandedViewport(
+                          offset: offset,
+                          axisDirection: AxisDirection.up,
+                          slivers: <Widget>[
+                            SliverExpanded(),
+                            SliverList(
+                              delegate: SliverChildBuilderDelegate(
+                                      (c, i) =>
+                                      ChatPageView().chatItems(msges[i], context),
+                                  childCount: msges.length),
+                            )
+                          ],
                         );
-                      } else
-                        return Container();
-                    },
+                      },
+                    ),
                   ),
-                  enablePullUp: true,
-                  controller: _refreshController,
-                  child: Scrollable(
-                    controller: _scrollController,
-                    axisDirection: AxisDirection.up,
-                    viewportBuilder: (context, offset) {
-                      return ExpandedViewport(
-                        offset: offset,
-                        axisDirection: AxisDirection.up,
-                        slivers: <Widget>[
-                          SliverExpanded(),
-                          SliverList(
-                            delegate: SliverChildBuilderDelegate(
-                                (c, i) =>
-                                    ChatPageView().chatItems(msges[i], context),
-                                childCount: msges.length),
-                          )
-                        ],
-                      );
-                    },
-                  ),
-                ),
-              ),
+                );
+              },),
             ),
             ChatPageView().inputBox(context, _focusNode)
           ],
@@ -150,7 +154,7 @@ class _ChatPageState extends State<ChatPage> {
       ChatData().msges = msges;
     });
     endRe(_refreshController);
-    setState(() {});
+    ss(() {});
   }
 
   @override

+ 30 - 15
lib/paegs/chat_page/chat_page_view.dart

@@ -20,6 +20,7 @@ import 'package:bbyyy/paegs/chat_page/chat_data.dart';
 import 'package:bbyyy/paegs/picture_display_page/picture_display_page.dart';
 import 'package:bbyyy/paegs/red_packet_page/red_packet_page.dart';
 import 'package:flutter/material.dart';
+import 'package:flutter/services.dart';
 import 'package:flutter_svg/svg.dart';
 
 class ChatPageView {
@@ -231,19 +232,19 @@ class ChatPageView {
         }
       },
     ));
-    if(!MyCookie().underReview)
-    items.add(GestureDetector(
-      child: Container(
-        child: SvgPicture.asset(
-          'images/svg/发红包.svg',
+    if (!MyCookie().underReview)
+      items.add(GestureDetector(
+        child: Container(
+          child: SvgPicture.asset(
+            'images/svg/发红包.svg',
+          ),
         ),
-      ),
-      behavior: HitTestBehavior.translucent,
-      onTap: () async {
-        MyTools()
-            .toPage(context, RedPacketPage(ChatData().chatWith), (then) {});
-      },
-    ));
+        behavior: HitTestBehavior.translucent,
+        onTap: () async {
+          MyTools()
+              .toPage(context, RedPacketPage(ChatData().chatWith), (then) {});
+        },
+      ));
     return items;
   }
 
@@ -345,7 +346,10 @@ class ChatPageView {
             mainAxisAlignment: MainAxisAlignment.start,
           ),
           Visibility(
-            child: Container(child: MyViews().myText('红包已自动存入', MyColors.c999999, 10),margin: EdgeInsets.only(top: 10),),
+            child: Container(
+              child: MyViews().myText('红包已自动存入', MyColors.c999999, 10),
+              margin: EdgeInsets.only(top: 10),
+            ),
             visible: msg.type == chatMsgTypeRedPackage,
           )
         ],
@@ -355,7 +359,13 @@ class ChatPageView {
 
   headWidget(MessageBeanContent msg) {
     return ClipRRect(
-      child: msg.senderUid==0?Image.asset('images/app_logo.png',width: 40,height: 40,):MyViews().netImg(imgURL(msg.senderPic), 40, 40),
+      child: msg.senderUid == 0
+          ? Image.asset(
+              'images/app_logo.png',
+              width: 40,
+              height: 40,
+            )
+          : MyViews().netImg(imgURL(msg.senderPic), 40, 40),
       borderRadius: BorderRadius.circular(20),
     );
   }
@@ -480,7 +490,12 @@ class ChatPageView {
 
   bubbleItem(MessageBeanContent msg, BuildContext context) {
     if (msg.type == chatMsgTypeText) {
-      return MyViews().myText(msg.content, MyColors.c333333, 15);
+      return GestureDetector(
+        onLongPress: (){
+          showToast('已复制到剪切板');
+          Clipboard.setData(ClipboardData(text: '${msg.content}'));
+        },
+          child: MyViews().myText(msg.content, MyColors.c333333, 15));
     } else if (msg.type == chatMsgTypePic) {
       return GestureDetector(
         child: AsperctRaioImage.network(imgURL(msg.content),

+ 3 - 0
lib/paegs/gang_page/gang_in_page/shop_flow_page/shop_flow_page.dart

@@ -499,6 +499,9 @@ class _ShopFlowPageState extends State<ShopFlowPage> {
     if (timeIndex != 0 && timeIndex != -1) {
       conditions.add("pay_time between ${getTime(timeIndex - 1)}");
     }
+    if(typeIndex==2){
+      conditions.add('paid_amount>0');
+    }
     MyDio().query({
       "key": "flow",
       "filters": {"conditions": conditions},

+ 20 - 13
lib/paegs/home_page/home_page.dart

@@ -20,7 +20,6 @@ import 'package:bbyyy/my_tools/my_cookie.dart';
 import 'package:bbyyy/my_tools/my_tools.dart';
 import 'package:bbyyy/my_tools/my_views.dart';
 import 'package:bbyyy/paegs/home_page/recommended_today_page.dart';
-import 'package:bbyyy/paegs/map_demo/map_demo_page.dart';
 import 'package:bbyyy/paegs/root_page/root_page_view.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:flutter/material.dart';
@@ -87,7 +86,8 @@ class _HomePageState extends State<HomePage>
       _reController.requestRefresh();
     });
     EventBus().on('getLocation', (arg) {
-      if(MyCookie().location.province=='四川省'&&MyCookie().location.city=='成都市'){
+      if (MyCookie().location.province == '四川省' &&
+          MyCookie().location.city == '成都市') {
         return;
       }
       _reController.requestRefresh();
@@ -261,10 +261,11 @@ class _HomePageState extends State<HomePage>
                   style: TextStyle(color: MyColors.c333333, fontSize: 14),
                 ),
                 GestureDetector(
-                  onTap: (){
-                    MyTools().toPage(context, RecommendedTodayPage(), (then){});
+                  onTap: () {
+                    MyTools()
+                        .toPage(context, RecommendedTodayPage(), (then) {});
                   },
-                  behavior:HitTestBehavior.translucent,
+                  behavior: HitTestBehavior.translucent,
                   child: Row(
                     children: [
                       Text(
@@ -337,12 +338,18 @@ class _HomePageState extends State<HomePage>
                             ),
                             height: 14,
                             width: 30,
-                            child: Text('详情',style: TextStyle(color: MyColors.cFF4233,fontSize: 9),),
+                            child: Text(
+                              '详情',
+                              style: TextStyle(
+                                  color: MyColors.cFF4233, fontSize: 9),
+                            ),
                             alignment: Alignment.center,
                           )
-                        ],mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                        ],
+                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                       )
-                    ],mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                    ],
+                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                     crossAxisAlignment: CrossAxisAlignment.start,
                   ),
                 );
@@ -369,14 +376,14 @@ class _HomePageState extends State<HomePage>
                 itemBuilder: (BuildContext context, int index) {
                   return netImgs.length == 0
                       ? GestureDetector(
-                    onTap: (){
-                      // MyTools().toPage(context, MapDemoPage(), (then){});
-                    },
-                        child: Image.asset(
+                          onTap: () {
+                            // EventBus().emit('showRP');
+                          },
+                          child: Image.asset(
                             "${imgs[index]}",
                             fit: BoxFit.cover,
                           ),
-                      )
+                        )
                       : MyViews().netImg(
                           imgURL(netImgs[index]), H, double.infinity,
                           placeholder: 'images/svg/goodsDefImg.svg');

+ 80 - 24
lib/paegs/mine_page/order_page/order_page.dart

@@ -1,5 +1,6 @@
 import 'dart:convert';
 
+import 'package:bbyyy/beans/my_shop_bean_entity.dart';
 import 'package:bbyyy/beans/smart_order_bean_entity.dart';
 import 'package:bbyyy/https/MyDio.dart';
 import 'package:bbyyy/https/my_request.dart';
@@ -29,12 +30,15 @@ class _OrderPageState extends State<OrderPage> {
   List<SmartOrderBeanDataData> orders = [];
   RefreshController controller = RefreshController(initialRefresh: true);
   int page = 1;
+  List<int> myShopUIDs  = [];
 
   @override
   void initState() {
     // TODO: implement initState
     super.initState();
-    EventBus().on('刷新未付订单', (arg) { controller.requestRefresh();});
+    EventBus().on('刷新未付订单', (arg) {
+      controller.requestRefresh();
+    });
     selectedIndex = widget.index;
   }
 
@@ -173,10 +177,14 @@ class _OrderPageState extends State<OrderPage> {
                   : ListView.builder(
                       itemBuilder: (c, index) {
                         return Slidable(
-                          child: MyViews()
-                              .getNoPayGoodsItem(orders[index], context, -1,-1),
+                          child: MyViews().getNoPayGoodsItem(
+                              orders[index], context, -1, -1),
                           actionPane: SlidableDrawerActionPane(),
-                          enabled: selectedIndex == 0 || (orders[index].type == orderTypeOfflineTransfer && orders[index].buyerUid == MyCookie().getUID())||orders[index].buyerUid==MyCookie().getUID(),
+                          enabled: selectedIndex == 0 ||
+                              (orders[index].type == orderTypeOfflineTransfer &&
+                                  orders[index].buyerUid ==
+                                      MyCookie().getUID()) ||
+                              orders[index].buyerUid == MyCookie().getUID(),
                           actionExtentRatio: 0.25,
                           secondaryActions: <Widget>[
                             SlideAction(
@@ -186,18 +194,22 @@ class _OrderPageState extends State<OrderPage> {
                                     borderRadius: BorderRadius.circular(30),
                                     color: MyColors.cFF4233,
                                   ),
-                                  height: 60,width: 60,
-                                  child: SvgPicture.asset('images/svg/del.svg',height: 40,width: 40,),
+                                  height: 60,
+                                  width: 60,
+                                  child: SvgPicture.asset(
+                                    'images/svg/del.svg',
+                                    height: 40,
+                                    width: 40,
+                                  ),
                                   alignment: Alignment.center,
                                 ),
                               ),
-                              onTap: (){
+                              onTap: () {
                                 showSimpleDialog(
-                                    '将删除订单(${orders[index].uid})', context,
-                                        () {
-                                      Navigator.pop(context);
-                                      deleteOrder(orders[index]);
-                                    });
+                                    '将删除订单(${orders[index].uid})', context, () {
+                                  Navigator.pop(context);
+                                  deleteOrder(orders[index]);
+                                });
                               },
                             )
                           ],
@@ -215,12 +227,12 @@ class _OrderPageState extends State<OrderPage> {
 
   void onLoading() {
     page++;
-    checkingOrder();
+    checkMyStore();
   }
 
   void onRefresh() {
     page = 1;
-    checkingOrder();
+    checkMyStore();
   }
 
   checkingOrder() {
@@ -235,18 +247,23 @@ class _OrderPageState extends State<OrderPage> {
       conditions.add("state == $orderStateUnpaid");
       conditions.add('buyer_uid==0');
       conditions.add('buyer_name LIKE ${MyCookie().getName()}');
+      conditions.add('shop_uid IN $myShopUIDs');
     }
     var filters;
-    if(selectedIndex==2){
-      filters = {"conditions": conditions,"or":true,"filters": [
-        {
-          "conditions": [
-            "state == $orderStateUnpaid",
-            'buyer_uid==${MyCookie().getUID()}'
-          ]
-        }
-      ]};
-    }else{
+    if (selectedIndex == 2) {
+      filters = {
+        "conditions": conditions,
+        "or": true,
+        "filters": [
+          {
+            "conditions": [
+              "state == $orderStateUnpaid",
+              'buyer_uid==${MyCookie().getUID()}'
+            ]
+          }
+        ]
+      };
+    } else {
       filters = {"conditions": conditions};
     }
     MyDio().query({
@@ -269,6 +286,45 @@ class _OrderPageState extends State<OrderPage> {
     }, (error) {});
   }
 
+  checkMyStore() {
+    var dJson;
+    var conditions1 = [
+      "role!=$shopUserOwner",
+      "user_uid==${MyCookie().getUID()}",
+      "review_state==1"
+    ];
+    var conditions2 = [
+      "role==$shopUserOwner",
+      "user_uid==${MyCookie().getUID()}"
+    ];
+    conditions1.add('private_shop==true');
+    dJson = {
+      "key": "shop_user",
+      "filters": {
+        "or": true,
+        "conditions": conditions1,
+        "filters": [
+          {"conditions": conditions2}
+        ]
+      },
+      "dims": shopUserDims,
+      "paging": [page, 1000],
+      "order_by": ["shop_name,DESC"]
+    };
+
+    MyDio().query(dJson, (response, hasError) {
+      if (!hasError) {
+        MyShopBeanEntity entity =
+            MyShopBeanEntity().fromJson(json.decode(response.data.toString()));
+        myShopUIDs.clear();
+        entity.data.data.forEach((element) {
+          myShopUIDs.add(element.shopUid);
+        });
+        checkingOrder();
+      }
+    }, (error) {});
+  }
+
   void deleteOrder(SmartOrderBeanDataData order) {
     MyDio().del({
       'key': 'order',

+ 88 - 2
lib/paegs/mine_page/wallet_page/withdraw_page/withdraw_page.dart

@@ -26,7 +26,7 @@ class WithdrawPage extends StatefulWidget {
 
 class _WithdrawPageState extends State<WithdrawPage> {
   TextEditingController _controller = TextEditingController();
-  int withdrawalStatus = 0; //0--未提现  1--提现中 2--提现完成
+  int withdrawalStatus = 1; //0--未提现  1--提现中 2--提现完成
   double percentFee = 0.0;
   double extraFee = 0.0;
   double threshold = 0.0;
@@ -36,6 +36,8 @@ class _WithdrawPageState extends State<WithdrawPage> {
   List<PayWayBeanData> payWays;
   bool showAlipay = false;
   bool showWeChat = false;
+  bool showHandlingFee = false;
+  double handlingFee = 0.0;
 
   @override
   void initState() {
@@ -228,6 +230,7 @@ class _WithdrawPageState extends State<WithdrawPage> {
                                     inputFormatters: [
                                       FilteringTextInputFormatter.allow(
                                           RegExp("[0-9.]")),
+                                      MoneyTextInputFormatter()
                                     ],
                                     controller: _controller,
                                     cursorColor: MyColors.cFF4233,
@@ -255,6 +258,7 @@ class _WithdrawPageState extends State<WithdrawPage> {
                                     keyboardType: TextInputType.number,
                                     onChanged: (t) {
                                       try {
+                                        showH();
                                         double amount = double.parse(t);
                                         if (amount > 0) {
                                           withdrawalStatus = 0;
@@ -302,10 +306,41 @@ class _WithdrawPageState extends State<WithdrawPage> {
                                               .userBean
                                               .balance
                                               .toString();
-                                          setState(() {});
+                                          showH();
+                                          setState(() {
+                                            withdrawalStatus = 0;
+                                          });
                                         }),
                                 ]),
                           ),
+                          if(showHandlingFee)
+                          RichText(
+                            text: TextSpan(
+                                text: '手续费',
+                                style: TextStyle(
+                                    color: MyColors.c999999, fontSize: 15),
+                                children: [
+                                  TextSpan(
+                                    text: '$handlingFee',
+                                    style: TextStyle(
+                                        color: MyColors.cFF4233, fontSize: 15),
+                                  ),
+                                ]),
+                          ),
+                          if(showHandlingFee)
+                          RichText(
+                            text: TextSpan(
+                                text: '实际到账',
+                                style: TextStyle(
+                                    color: MyColors.c999999, fontSize: 15),
+                                children: [
+                                  TextSpan(
+                                    text: '${double.parse(_controller.text.toString())-handlingFee}',
+                                    style: TextStyle(
+                                        color: MyColors.cFF4233, fontSize: 15),
+                                  ),
+                                ]),
+                          ),
                           GestureDetector(
                             onTap: () {
                               if(withdrawalPath==-1){
@@ -540,4 +575,55 @@ class _WithdrawPageState extends State<WithdrawPage> {
       setState(() {});
     }, (error) {});
   }
+
+  showH(){
+    try{
+      double amount = double.parse(_controller.text.toString());
+      if(amount>=minPerHand){
+        handlingFee = double.parse((double.parse(_controller.text.toString())*percentFee*100).toStringAsFixed(0))/100+extraFee;
+        setState(() {
+          showHandlingFee = true;
+        });
+      }else{
+        setState(() {
+          showHandlingFee = false;
+        });
+      }
+    }catch(e){
+      setState(() {
+        showHandlingFee = false;
+      });
+    }
+  }
 }
+
+
+class MoneyTextInputFormatter extends TextInputFormatter{
+
+  @override
+  TextEditingValue formatEditUpdate(TextEditingValue oldValue, TextEditingValue newValue) {
+    // TODO: implement formatEditUpdate
+
+    String newvalueText=newValue.text;
+
+    if(newvalueText=="."){
+      //第一个数为.
+      newvalueText="0.";
+
+    } else if(newvalueText.contains(".")){
+      if(newvalueText.lastIndexOf(".")!=newvalueText.indexOf(".")){
+        //输入了2个小数点
+        newvalueText=  newvalueText.substring(0,newvalueText.lastIndexOf('.'));
+      }else if(newvalueText.length-1-newvalueText.indexOf(".")>2){
+        //输入了1个小数点 小数点后两位
+        newvalueText=newvalueText.substring(0,newvalueText.indexOf(".")+3);
+      }
+    }
+
+    return TextEditingValue(
+      text: newvalueText,
+      selection: new TextSelection.collapsed(offset: newvalueText.length),
+    );
+  }
+
+}

+ 334 - 5
lib/paegs/root_page/root_page.dart

@@ -1,9 +1,6 @@
 import 'dart:async';
 import 'dart:convert';
-import 'dart:io';
 
-import 'package:amap_flutter_location/amap_flutter_location.dart';
-import 'package:amap_flutter_location/amap_location_option.dart';
 import 'package:bbyyy/beans/coupon_bean_entity.dart';
 import 'package:bbyyy/beans/user_bean_entity.dart';
 import 'package:bbyyy/https/MyDio.dart';
@@ -12,6 +9,7 @@ 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/loacion_util.dart';
+import 'package:bbyyy/my_tools/my_colors.dart';
 import 'package:bbyyy/my_tools/my_cookie.dart';
 import 'package:bbyyy/my_tools/my_datas.dart';
 import 'package:bbyyy/my_tools/my_tools.dart';
@@ -24,10 +22,10 @@ import 'package:bbyyy/paegs/mine_page/order_page/order_page.dart';
 import 'package:bbyyy/paegs/msg_page/msg_page.dart';
 import 'package:bbyyy/paegs/root_page/root_page_view.dart';
 import 'package:flutter/cupertino.dart';
+import 'package:flutter/gestures.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/services.dart';
 import 'package:flutter_svg/flutter_svg.dart';
-import 'package:permission_handler/permission_handler.dart';
 
 class RootPage extends StatefulWidget {
   @override
@@ -37,7 +35,7 @@ class RootPage extends StatefulWidget {
 class _RootPageState extends State<RootPage> {
   PageController pageController = PageController(initialPage: 0);
   DateTime lastPopTime;
-
+  double ppx;
 
   @override
   void initState() {
@@ -71,6 +69,9 @@ class _RootPageState extends State<RootPage> {
     EventBus().on('hasNoPay', (arg) {
       setState(() {});
     });
+    EventBus().on('showRP', (arg) {
+      signInRedEnvelope();
+    });
     MyData().init(context);
     queryPersonalInformation();
     checkForUpdates(context);
@@ -84,12 +85,14 @@ class _RootPageState extends State<RootPage> {
     // TODO: implement dispose
     EventBus().off('ChangePage');
     EventBus().off('hasNoPay');
+    EventBus().off('showRP');
     LocationUtil().stopLocation();
     super.dispose();
   }
 
   @override
   Widget build(BuildContext context) {
+    ppx = MediaQuery.of(context).size.width / 375;
     return WillPopScope(
       onWillPop: () async {
         if (lastPopTime == null ||
@@ -208,7 +211,333 @@ class _RootPageState extends State<RootPage> {
     }, (error) {});
   }
 
+  int showWitch = 0;
 
+  //登录红包
+  signInRedEnvelope() {
+    showDialog<void>(
+      context: context,
+      barrierDismissible: false,
+      // false = user must tap button, true = tap outside dialog
+      builder: (BuildContext dialogContext) {
+        return StatefulBuilder(builder: (BuildContext context, void Function(void Function()) setState) {
+          return Container(
+            child: Column(
+              children: [
+                showRedEnvelope(setState),
+                GestureDetector(
+                  onTap: () {
+                    showWitch = 0;
+                    Navigator.pop(context);
+                  },
+                  child: Container(
+                    margin: EdgeInsets.only(top: 24 * ppx),
+                    child: Icon(
+                      Icons.clear,
+                      color: Colors.white,
+                    ),
+                    height: 28 * ppx,
+                    width: 28 * ppx,
+                    alignment: Alignment.center,
+                    decoration: BoxDecoration(
+                        color: MyColors.c25E7E7E7,
+                        borderRadius: BorderRadius.circular(14 * ppx)),
+                  ),
+                )
+              ],
+              mainAxisAlignment: MainAxisAlignment.center,
+            ),
+            alignment: Alignment.center,
+          );
+        },);
+      },
+    );
+  }
 
+  Stack showRedEnvelope(void Function(void Function() p1) setState) {
+    switch (showWitch) {
+      case 0:
+        return redEnvelopeP1(setState);
+      case 1:
+        return redEnvelopeP2(setState);
+      case 2:
+        return redEnvelopeP3(setState);
+      default:
+        return redEnvelopeP1(setState);
+    }
+  }
 
+  Stack redEnvelopeP1(void Function(void Function() p1) setState) {
+    return Stack(
+      children: [
+        Positioned(
+          child: Container(
+            height: 396 * ppx,
+            width: double.infinity,
+            decoration: BoxDecoration(
+                borderRadius: BorderRadius.circular(16),
+                color: MyColors.cF25D4B),
+            margin: EdgeInsets.symmetric(horizontal: 45 * ppx),
+            alignment: Alignment.bottomCenter,
+            child: CustomPaint(
+                painter: RedEnvelopePath(),
+                size: Size(double.infinity - (90 * ppx), 120 * ppx)),
+          ),
+        ),
+        Positioned(
+          bottom: 40 * ppx,
+          left: ((375 / 2 - 45) * ppx),
+          child: GestureDetector(
+            onTap: () {
+              setState((){
+                showWitch = 1;
+              });
+            },
+            behavior: HitTestBehavior.translucent,
+            child: Container(
+              decoration: BoxDecoration(
+                  color: MyColors.cF1D19B,
+                  borderRadius: BorderRadius.circular(45 * ppx)),
+              height: 90 * ppx,
+              width: 90 * ppx,
+              child: Text(
+                '抢',
+                style: TextStyle(
+                    color: MyColors.c333333,
+                    fontSize: 40 * ppx,
+                    decoration: TextDecoration.none,
+                    fontWeight: FontWeight.normal),
+              ),
+              alignment: Alignment.center,
+            ),
+          ),
+        ),
+        Positioned(
+          child: Column(
+            children: [
+              SvgPicture.asset('images/svg/logo.svg'),
+              Container(
+                margin: EdgeInsets.only(top: 28 * ppx),
+                child: Text(
+                  '登陆红包',
+                  style: TextStyle(
+                      color: Colors.white,
+                      fontSize: 32 * ppx,
+                      fontWeight: FontWeight.normal,
+                      decoration: TextDecoration.none),
+                ),
+              ),
+              Container(
+                margin: EdgeInsets.only(top: 4 * ppx),
+                child: Text(
+                  '每人仅限1份',
+                  style: TextStyle(
+                      color: MyColors.cF1D19B,
+                      fontSize: 14 * ppx,
+                      fontWeight: FontWeight.normal,
+                      decoration: TextDecoration.none),
+                ),
+              )
+            ],
+          ),
+          top: 37 * ppx,
+        )
+      ],
+      alignment: Alignment.topCenter,
+    );
+  }
+
+  Stack redEnvelopeP2(void Function(void Function() p1) setState) {
+    return Stack(
+      children: [
+        Positioned(
+          child: Container(
+            height: 396 * ppx,
+            width: double.infinity,
+            decoration: BoxDecoration(
+                borderRadius: BorderRadius.circular(16),
+                color: MyColors.cF55544),
+            margin: EdgeInsets.symmetric(horizontal: 45 * ppx),
+            alignment: Alignment.bottomCenter,
+          ),
+        ),
+        Positioned(
+          child: Column(
+            children: [
+              SvgPicture.asset('images/svg/logo.svg'),
+              Container(
+                margin: EdgeInsets.only(top: 48 * ppx),
+                child: Text(
+                  '0.30元',
+                  style: TextStyle(
+                      color: MyColors.cF1D19B,
+                      fontSize: 30 * ppx,
+                      fontWeight: FontWeight.normal,
+                      decoration: TextDecoration.none),
+                ),
+              ),
+              Container(
+                margin: EdgeInsets.only(top: 10 * ppx),
+                child: RichText(
+                  text: TextSpan(
+                      text: '自动划入钱包,去',
+                      style: TextStyle(
+                          color: MyColors.c333333,
+                          decoration: TextDecoration.none,
+                          fontSize: 13 * ppx),
+                      children: [
+                        TextSpan(
+                            text: '提现',
+                            style: TextStyle(
+                                color: MyColors.c44D7B6,
+                                decoration: TextDecoration.underline,
+                                fontSize: 13 * ppx),
+                            recognizer: TapGestureRecognizer()
+                              ..onTap = () {
+                                setState((){
+                                  showWitch = 2;
+                                });
+                              }),
+                      ]),
+                ),
+              )
+            ],
+          ),
+          top: 37 * ppx,
+        ),
+        Positioned(
+          child: Column(
+            children: [
+              Text(
+                '详细规则',
+                style: TextStyle(
+                    color: Colors.white,
+                    fontSize: 12 * ppx,
+                    fontWeight: FontWeight.normal,
+                    decoration: TextDecoration.none),
+              ),
+              Container(
+                margin: EdgeInsets.only(top: 4 * ppx),
+                child: Text(
+                  '每人每天限领一份,每天八点官方准时派发登陆活动,',
+                  style: TextStyle(
+                      color: Colors.white,
+                      fontSize: 9 * ppx,
+                      fontWeight: FontWeight.normal,
+                      decoration: TextDecoration.none),
+                ),
+              ),
+              Text(
+                '每天10000元,最高可直接领取100元!!!',
+                style: TextStyle(
+                    color: Colors.white,
+                    fontSize: 9 * ppx,
+                    fontWeight: FontWeight.normal,
+                    decoration: TextDecoration.none),
+              ),
+            ],
+          ),
+          bottom: 20 * ppx,
+        )
+      ],
+      alignment: Alignment.topCenter,
+    );
+  }
+
+  Stack redEnvelopeP3(void Function(void Function() p1) setState) {
+    return Stack(
+      children: [
+        Positioned(
+          child: Container(
+            height: 396 * ppx,
+            width: double.infinity,
+            decoration: BoxDecoration(
+                borderRadius: BorderRadius.circular(16),
+                color: MyColors.cF55544),
+            margin: EdgeInsets.symmetric(horizontal: 45 * ppx),
+          ),
+        ),
+        Positioned(
+          child: Column(
+            children: [
+              SvgPicture.asset('images/svg/logo.svg'),
+              Container(
+                margin: EdgeInsets.only(top: 64 * ppx),
+                child: Text(
+                  '呀!来晚了,明天我一定准时!',
+                  style: TextStyle(
+                      color: MyColors.cF1D19B,
+                      fontSize: 15 * ppx,
+                      fontWeight: FontWeight.normal,
+                      decoration: TextDecoration.none),
+                ),
+              )
+            ],
+          ),
+          top: 37 * ppx,
+        ),
+        Positioned(
+          child: Column(
+            children: [
+              Text(
+                '详细规则',
+                style: TextStyle(
+                    color: Colors.white,
+                    fontSize: 12 * ppx,
+                    fontWeight: FontWeight.normal,
+                    decoration: TextDecoration.none),
+              ),
+              Container(
+                margin: EdgeInsets.only(top: 4 * ppx),
+                child: Text(
+                  '每人每天限领一份,每天八点官方准时派发登陆活动,',
+                  style: TextStyle(
+                      color: Colors.white,
+                      fontSize: 9 * ppx,
+                      fontWeight: FontWeight.normal,
+                      decoration: TextDecoration.none),
+                ),
+              ),
+              Text(
+                '每天10000元,最高可直接领取100元!!!',
+                style: TextStyle(
+                    color: Colors.white,
+                    fontSize: 9 * ppx,
+                    fontWeight: FontWeight.normal,
+                    decoration: TextDecoration.none),
+              ),
+            ],
+          ),
+          bottom: 20 * ppx,
+        )
+      ],
+      alignment: Alignment.topCenter,
+    );
+  }
+}
+
+class RedEnvelopePath extends CustomPainter {
+  Paint _paint = Paint()
+    ..color = MyColors.cF55544 //画笔颜色
+    ..strokeCap = StrokeCap.round //画笔笔触类型
+    ..isAntiAlias = true //是否启动抗锯齿
+    ..strokeWidth = 15.0; //画笔的宽度
+  @override
+  void paint(Canvas canvas, Size size) {
+    print(size);
+    var path = Path()
+      ..moveTo(0, 0)
+      ..quadraticBezierTo(size.width / 2, 80, size.width, 0)
+      ..lineTo(size.width, size.height - 16)
+      ..quadraticBezierTo(size.width, size.height, size.width - 16, size.height)
+      ..lineTo(16, size.height)
+      ..quadraticBezierTo(0, size.height, 0, size.height - 16)
+      ..close();
+    canvas.drawPath(path, _paint);
+  }
+
+  @override
+  bool shouldRepaint(covariant CustomPainter oldDelegate) {
+    return null;
+  }
 }

Vissa filer visades inte eftersom för många filer har ändrats