huxiaoqiang 4 vuotta sitten
vanhempi
commit
b1dc78b323

BIN
images/推广二维码.jpg


+ 1 - 0
lib/beans/store_bean_entity.dart

@@ -57,4 +57,5 @@ class StoreBeanDataData with JsonConvert<StoreBeanDataData> {
   bool ownerPayPlatformFee;
   double longitude;
   double latitude;
+  double distance;
 }

+ 29 - 10
lib/my_tools/my_tools.dart

@@ -4,6 +4,7 @@ import 'dart:io';
 
 import 'package:bbyyy/beans/address_bean_entity.dart';
 import 'package:bbyyy/beans/new_msg_bean_entity.dart';
+import 'package:bbyyy/beans/smart_order_bean_entity.dart';
 import 'package:bbyyy/my_tools/easy_loading/easy_loading.dart';
 import 'package:bbyyy/my_tools/my_cookie.dart';
 import 'package:bbyyy/my_tools/providers.dart';
@@ -19,13 +20,14 @@ import 'package:provider/provider.dart';
 import 'package:pull_to_refresh/pull_to_refresh.dart';
 import 'package:uuid/uuid.dart';
 
+import 'const.dart';
 import 'event_bus.dart';
 import 'month_day.dart';
 import 'my_colors.dart';
 
 class MyTools {
   toPage(context, page, then, {bool noBack = false}) {
-    ImageCache  imageCache = PaintingBinding.instance.imageCache;
+    ImageCache imageCache = PaintingBinding.instance.imageCache;
     imageCache.clear();
     if (noBack) {
       Navigator.pushAndRemoveUntil(
@@ -273,7 +275,7 @@ getTime(int timeIndex) {
         '${firstMonth.year}-${numberComplement('${firstMonth.month}')}-${numberComplement('${MonthDay().getDays(firstMonth)}')} 23:59:59');
   }
   //两周内
-  else if(timeIndex == 6){
+  else if (timeIndex == 6) {
     paidAt.add(
         '${dateTime.subtract(Duration(days: 14)).year}-${numberComplement('${dateTime.subtract(Duration(days: 14)).month}')}-${numberComplement('${dateTime.subtract(Duration(days: 14)).day}')} $sTime:00:00');
     paidAt.add(
@@ -310,15 +312,17 @@ getAddressByLatitudeAndLongitude(
         AddressBeanEntity().fromJson(json.decode(value.toString()));
     String city;
     String province;
-    if(addressBeanEntity.regeocode.addressComponent.province.isEmpty||addressBeanEntity.regeocode.addressComponent.province=='[]'){
+    if (addressBeanEntity.regeocode.addressComponent.province.isEmpty ||
+        addressBeanEntity.regeocode.addressComponent.province == '[]') {
       return;
-    }else{
+    } else {
       province = addressBeanEntity.regeocode.addressComponent.province;
     }
-    if( addressBeanEntity.regeocode.addressComponent.city.isEmpty||addressBeanEntity.regeocode.addressComponent.city=='[]'){
+    if (addressBeanEntity.regeocode.addressComponent.city.isEmpty ||
+        addressBeanEntity.regeocode.addressComponent.city == '[]') {
       city = province;
-    }else{
-      city  = addressBeanEntity.regeocode.addressComponent.city;
+    } else {
+      city = addressBeanEntity.regeocode.addressComponent.city;
     }
     print('city$city');
     print('province$province');
@@ -334,8 +338,23 @@ getAddressByLatitudeAndLongitude(
   });
 }
 
-double balanceDisplay(double balance){
-  int a = (balance*100).toInt();
-  double b = a/100;
+double balanceDisplay(double balance) {
+  int a = (balance * 100).toInt();
+  double b = a / 100;
   return b;
 }
+
+String orderST(SmartOrderBeanDataData data) {
+  if (data.state == orderStateUnpaid) {
+    return '未支付';
+  } else if (data.state == orderStatePaying) {
+    return '支付中';
+  } else if (data.state == orderStatePaid) {
+    if(data.buyerName.contains(data.payerName)||data.payerName.contains(data.buyerName)){
+      return '已支付';
+    }
+    else{
+      return '代支付';
+    }
+  }
+}

+ 31 - 27
lib/my_tools/my_views.dart

@@ -44,7 +44,6 @@ import 'package:path_provider/path_provider.dart';
 import 'package:provider/provider.dart';
 
 import '../beans/complain_bean_entity.dart';
-import '../paegs/ad_details_page/ad_details_page.dart';
 import '../paegs/other_people_s_turnover_page/other_people_s_turnover_page.dart';
 import 'const.dart';
 import 'dims.dart';
@@ -232,7 +231,7 @@ class MyViews {
     } else if (data is AdBeanDataData) {
       return GestureDetector(
         onTap: () {
-          MyTools().toPage(context, AdDetailsPage(data), (then) {});
+          // MyTools().toPage(context, AdDetailsPage(data), (then) {});
         },
         behavior: HitTestBehavior.translucent,
         child: Card(
@@ -339,32 +338,34 @@ class MyViews {
             margin: EdgeInsets.only(left: 10, top: 16),
             child: Row(
               children: [
-                ClipRRect(
+                Row(children: [ClipRRect(
                   child: data.type == orderTypeAnnualFee || data.sellerUid == 0
                       ? Image.asset(
-                          'images/app_logo.png',
-                          height: 25,
-                          width: 25,
-                        )
+                    'images/app_logo.png',
+                    height: 25,
+                    width: 25,
+                  )
                       : MyViews().netImg(imgURL(data.sellerPic), 25, 25),
                   borderRadius: BorderRadius.all(Radius.circular(12.5)),
                 ),
-                Container(
-                  margin: EdgeInsets.only(right: 5, left: 5),
-                  child: Text(
-                    data.type == orderTypeAnnualFee || data.sellerUid == 0
-                        ? '$appName'
-                        : '${data.sellerName}(${hideUID(data.sellerUid.toString())})',
-                    style: TextStyle(
-                      color: MyColors.c333333,
-                      fontSize: 14,
+                  Container(
+                    margin: EdgeInsets.only(right: 5, left: 5),
+                    child: Text(
+                      data.type == orderTypeAnnualFee || data.sellerUid == 0
+                          ? '$appName'
+                          : '${data.sellerName}(${hideUID(data.sellerUid.toString())})',
+                      style: TextStyle(
+                        color: MyColors.c333333,
+                        fontSize: 14,
+                      ),
+                      maxLines: 1,
+                      overflow: TextOverflow.ellipsis,
+                      softWrap: true,
                     ),
-                    maxLines: 1,
-                    overflow: TextOverflow.ellipsis,
-                    softWrap: true,
-                  ),
-                ),
-              ],
+                  ),],),
+                Text(orderST(data),style: TextStyle(   color: MyColors.c333333,
+                  fontSize: 14,),),
+              ],mainAxisAlignment: MainAxisAlignment.spaceBetween,
             ),
           ),
           Container(
@@ -2190,10 +2191,13 @@ class MyViews {
             padding: const EdgeInsets.all(10),
             child: Row(
               children: [
-                ClipRRect(
-                  child: MyViews().netImg(imgURL(data.picture), 70, 70,
-                      placeholder: 'images/svg/goodsDefImg.svg'),
-                  borderRadius: BorderRadius.circular(4),
+                Container(
+                  decoration: BoxDecoration(border: Border.all(color: MyColors.cE7E7E7,),borderRadius: BorderRadius.circular(4)),
+                  child: ClipRRect(
+                    child: MyViews().netImg(imgURL(data.picture), 70, 70,
+                        placeholder: 'images/svg/goodsDefImg.svg'),
+                    borderRadius: BorderRadius.circular(4),
+                  ),
                 ),
                 Expanded(
                   child: Container(
@@ -2270,7 +2274,7 @@ class MyViews {
     } else if (data is AdBeanDataData) {
       return GestureDetector(
         onTap: () {
-          MyTools().toPage(context, AdDetailsPage(data), (then) {});
+          // MyTools().toPage(context, AdDetailsPage(data), (then) {});
         },
         behavior: HitTestBehavior.translucent,
         child: Container(

+ 15 - 9
lib/paegs/gang_page/gang_in_page/gang_in_page.dart

@@ -408,10 +408,16 @@ class _GangInPageState extends State<GangInPage> {
                               shopInfo();
                             },
                             behavior: HitTestBehavior.translucent,
-                            child: ClipRRect(
-                              child: MyViews()
-                                  .netImg(imgURL(widget.data.shopPic), 65, 65),
-                              borderRadius: BorderRadius.circular(4),
+                            child: Container(
+                              decoration: BoxDecoration(
+                                border: Border.all(color: MyColors.cE7E7E7),
+                                borderRadius: BorderRadius.circular(4)
+                              ),
+                              child: ClipRRect(
+                                child: MyViews()
+                                    .netImg(imgURL(widget.data.shopPic), 65, 65),
+                                borderRadius: BorderRadius.circular(4),
+                              ),
                             ),
                           ),
                         ),
@@ -968,7 +974,7 @@ class _GangInPageState extends State<GangInPage> {
                   child: MyViews().getNoPayGoodsItem(orders[index], context,
                       widget.data.ownerUid, widget.data.role),
                   actionPane: SlidableDrawerActionPane(),
-                  enabled: paymentAuthority(widget.data.role),
+                  enabled: paymentAuthority(widget.data.role)&&orders[index].state!=orderStatePaying,
                   actionExtentRatio: 0.25,
                   secondaryActions: <Widget>[
                     SlideAction(
@@ -1012,7 +1018,7 @@ class _GangInPageState extends State<GangInPage> {
                       widget.data.ownerUid, widget.data.role),
                   actionPane: SlidableDrawerActionPane(),
                   enabled: orders[index].type == orderTypeOfflineTransfer &&
-                      orders[index].buyerUid == MyCookie().getUID(),
+                      orders[index].buyerUid == MyCookie().getUID()&&orders[index].state!=orderStatePaying,
                   actionExtentRatio: 0.25,
                   secondaryActions: <Widget>[
                     SlideAction(
@@ -1212,10 +1218,10 @@ class _GangInPageState extends State<GangInPage> {
   void unreceivedOrder() {
     var conditions = [];
     if (paymentAuthority(widget.data.role)) {
-      conditions.add('state == $orderStateUnpaid');
+      conditions.add('state IN [$orderStateUnpaid,$orderStatePaying]');
       conditions.add('shop_uid == ${widget.data.shopUid}');
     } else {
-      conditions.add('state == $orderStateUnpaid');
+      conditions.add('state IN [$orderStateUnpaid,$orderStatePaying]');
       conditions.add('shop_uid == ${widget.data.shopUid}');
       conditions.add('seller_uid == ${MyCookie().getUID()}');
     }
@@ -1246,7 +1252,7 @@ class _GangInPageState extends State<GangInPage> {
       conditions.add('state == $orderStatePaid');
       conditions.add('shop_uid == ${widget.data.shopUid}');
     } else {
-      conditions.add('state == $orderStateUnpaid');
+      conditions.add('state IN [$orderStateUnpaid,$orderStatePaying]');
       conditions.add('shop_uid == ${widget.data.shopUid}');
       conditions.add('buyer_uid==0');
       conditions.add('buyer_name LIKE ${MyCookie().getName()}');

+ 4 - 0
lib/paegs/gang_page/gang_in_page/gang_information_page/gang_information_page.dart

@@ -94,6 +94,10 @@ class _GangInformationPageState extends State<GangInformationPage> {
                             children: [
                               Container(
                                 margin: EdgeInsets.only(right: 9),
+                                decoration: BoxDecoration(
+                                    border: Border.all(color: MyColors.cE7E7E7),
+                                    borderRadius: BorderRadius.circular(4)
+                                ),
                                 child: ClipRRect(
                                   child: store == null
                                       ? SvgPicture.asset(

+ 6 - 1
lib/paegs/gang_page/gang_in_page/gang_information_page/member_list_page/member_order_flow.dart

@@ -318,7 +318,7 @@ class _MemberOrderFlowPageState extends State<MemberOrderFlowPage> {
   }
 
   StateSetter ss;
-  List<String> types = ['全部', '订单', '佣金', '提现'];
+  List<String> types = ['全部', '订单', '佣金', '提现','缴费'];
   int typeIndex = 0;
   // List<String> times = ['全部', '今天', '昨天', '本周', '上周', '本月'];
   List<String> times = ['今天', '昨天', '本周', '上周'];
@@ -583,6 +583,11 @@ class _MemberOrderFlowPageState extends State<MemberOrderFlowPage> {
         case 3:
           conditions.add('type IN ${[flowTypeWithdraw]}');
           break;
+        case 4:
+          conditions.add('type IN ${[
+            flowTypePlatformFee
+          ]}');
+          break;
       }
       // conditions.add("type IN ${typeIndex == 1 ? [
       //     flowTypeOrderCommodity,

+ 19 - 9
lib/paegs/gang_page/gang_in_page/shop_flow_page/shop_flow_page.dart

@@ -277,7 +277,7 @@ class _ShopFlowPageState extends State<ShopFlowPage> {
   }
 
   StateSetter ss;
-  List<String> types = ['全部', '订单', '佣金'];
+  List<String> types = ['全部', '订单', '佣金','缴费'];
   int typeIndex = 0;
 
   // List<String> times = ['全部', '今天', '昨天', '本周', '上周', '本月'];
@@ -526,14 +526,24 @@ class _ShopFlowPageState extends State<ShopFlowPage> {
       'user_uid == ${widget.data.ownerUid}'
     ];
     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 ${ [flowTypePlatformFee]}");
+          break;
+      }
     }
     if ( timeIndex != -1) {
       conditions.add("pay_time between ${getTime(timeIndex)}");

+ 4 - 0
lib/paegs/gang_page/gang_page.dart

@@ -465,6 +465,10 @@ class _GangPageState extends State<GangPage>
                             placeholder: 'images/svg/占位图.svg'),
                         borderRadius: BorderRadius.all(Radius.circular(4)),
                       ),
+                      decoration: BoxDecoration(
+                          border: Border.all(color: MyColors.cE7E7E7),
+                          borderRadius: BorderRadius.circular(4)
+                      ),
                     ),
                     Expanded(
                       child: Container(

+ 11 - 8
lib/paegs/gang_page/qr_code_for_store_payment_page/qr_code_for_store_payment_page.dart

@@ -25,9 +25,11 @@ class QRCodeForStorePaymentPage extends StatefulWidget {
 
 class _QRCodeForStorePaymentPageState extends State<QRCodeForStorePaymentPage> {
   GlobalKey rootWidgetKey = GlobalKey();
+  String qrData;
 
   @override
   Widget build(BuildContext context) {
+    qrData = 'https://bby.banghuo.net/pay.html?shop_uid=${widget.data.shopUid}';
     return Scaffold(
       body: Stack(
         children: [
@@ -93,9 +95,7 @@ class _QRCodeForStorePaymentPageState extends State<QRCodeForStorePaymentPage> {
                               borderRadius: BorderRadius.circular(9.6),
                               color: Colors.white),
                           child: QrImage(
-                            data:
-                                // 'http://www.banghuo.net/bby/pay/pay.html?shop_uid=${widget.data.shopUid}',
-                                'https://bby.banghuo.net/pay.html?shop_uid=${widget.data.shopUid}',
+                            data: qrData,
                             gapless: false,
                             version: QrVersions.auto,
                             size: 216,
@@ -145,7 +145,10 @@ class _QRCodeForStorePaymentPageState extends State<QRCodeForStorePaymentPage> {
               child: Container(
                 width: MediaQuery.of(context).size.width,
                 color: Colors.white,
-                child: Image.asset('images/收款码logo.png',height: MediaQuery.of(context).size.width / 97 * 10,),
+                child: Image.asset(
+                  'images/收款码logo.png',
+                  height: MediaQuery.of(context).size.width / 97 * 10,
+                ),
                 alignment: Alignment.center,
               ),
             ),
@@ -166,8 +169,7 @@ class _QRCodeForStorePaymentPageState extends State<QRCodeForStorePaymentPage> {
                           borderRadius: BorderRadius.circular(9.6),
                           color: Colors.white),
                       child: QrImage(
-                        data:
-                            'http://www.banghuo.net/bby/pay/pay.html?shop_uid=${widget.data.shopUid}',
+                        data: qrData,
                         gapless: false,
                         version: QrVersions.auto,
                         size: MediaQuery.of(context).size.width / 97 * 57.5,
@@ -210,11 +212,12 @@ class _QRCodeForStorePaymentPageState extends State<QRCodeForStorePaymentPage> {
           name: 'bby_${DateTime.now()}');
       // print('======================|\n$result\n|===========================');
       // print('======================|\n${json.encode(result)}\n|===========================');
-      SaveQrCodeBeanEntity entity = SaveQrCodeBeanEntity().fromJson(json.decode(json.encode(result)));
+      SaveQrCodeBeanEntity entity =
+          SaveQrCodeBeanEntity().fromJson(json.decode(json.encode(result)));
 
       // bool isSuccess = result.toString().contains('isSuccess: true');
       bool isSuccess = entity.isSuccess;
-      showToast(isSuccess ? '保存成功,请前往相册查看': '保存失败,请打开相应权限,或截图保存');
+      showToast(isSuccess ? '保存成功,请前往相册查看' : '保存失败,请打开相应权限,或截图保存');
       return pngBytes;
     } catch (e) {
       print(e);

+ 51 - 0
lib/paegs/home_page/home_page.dart

@@ -3,6 +3,7 @@ import 'dart:convert';
 import 'dart:math';
 
 import 'package:address_picker/address_picker.dart';
+import 'package:amap_flutter_base/amap_flutter_base.dart';
 import 'package:bbyyy/beans/commodity_category_bean_entity.dart';
 import 'package:bbyyy/beans/goods_bean_entity.dart';
 import 'package:bbyyy/beans/home_carousel_bean_entity.dart';
@@ -18,6 +19,7 @@ import 'package:bbyyy/my_tools/my_colors.dart';
 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/my_tools/providers.dart';
 import 'package:bbyyy/paegs/gang_page/gang_in_page/scan_page/scan_page.dart';
 import 'package:bbyyy/paegs/home_page/qr_code_payment/new_qr_code_payment_page.dart';
 import 'package:bbyyy/paegs/home_page/qr_code_payment/qr_code_payment_page.dart';
@@ -28,6 +30,7 @@ import 'package:flutter/material.dart';
 import 'package:flutter_svg/flutter_svg.dart';
 import 'package:flutter_swiper/flutter_swiper.dart';
 import 'package:get/get.dart';
+import 'package:provider/src/provider.dart';
 import 'package:pull_to_refresh/pull_to_refresh.dart';
 
 class HomePage extends StatefulWidget {
@@ -764,6 +767,54 @@ class _HomePageState extends State<HomePage>
       data.addAll(container);
     } else {
       puShop.addAll(container);
+      if(MyCookie().location!=null){
+        puShop.forEach((element) {
+          try{
+            if(element is StoreBeanDataData&&element.longitude != 0 ){
+              element.distance = balanceDisplay(AMapTools.distanceBetween(LatLng(element.latitude, element.longitude), LatLng(MyCookie().location.latitude, MyCookie().location.longitude)) / 1000);
+              print('element.distance------${element.distance}');
+            }
+          }catch(e){
+            print('element.distance------$e');
+          }
+        });
+        puShop.sort((e1,e2){
+          if(e1 is StoreBeanDataData&&e1.distance!=null&&e2 is StoreBeanDataData&&e2.distance!=null){
+            return e1.distance.compareTo(e2.distance);
+          }else if(e1 is StoreBeanDataData&&e1.distance==null&&e2 is StoreBeanDataData&&e2.distance!=null){
+           return 1;
+          }else if(e1 is StoreBeanDataData&&e1.distance!=null&&e2 is StoreBeanDataData&&e2.distance==null){
+            return -1;
+          }else{
+            return 0;
+          }
+        });
+      }else{
+        EventBus().on('getLocation', (arg) {
+          puShop.forEach((element) {
+            try{
+              if(element is StoreBeanDataData&&element.longitude != 0 ){
+                element.distance = balanceDisplay(AMapTools.distanceBetween(LatLng(element.latitude, element.longitude), LatLng(MyCookie().location.latitude, MyCookie().location.longitude)) / 1000);
+                print('element.distance------${element.distance}');
+              }
+            }catch(e){
+              print('element.distance------$e');
+            }
+          });
+          puShop.sort((e1,e2){
+            if(e1 is StoreBeanDataData&&e1.distance!=null&&e2 is StoreBeanDataData&&e2.distance!=null){
+              return e1.distance.compareTo(e2.distance);
+            }else if(e1 is StoreBeanDataData&&e1.distance==null&&e2 is StoreBeanDataData&&e2.distance!=null){
+              return 1;
+            }else if(e1 is StoreBeanDataData&&e1.distance!=null&&e2 is StoreBeanDataData&&e2.distance==null){
+              return -1;
+            }else{
+              return 0;
+            }
+          });
+        });
+
+      }
     }
     setState(() {});
     endRe(_reController);

+ 108 - 104
lib/paegs/login_page/login_page.dart

@@ -45,120 +45,124 @@ class _LoginPageState extends State<LoginPage> {
     Future.delayed(Duration.zero, () {
       MyCookie().reNum = 0;
       checkAuditStatus();
-      showDialog(
-        context: context,
-        builder: (BuildContext context) {
-          return Material(
-            color: Colors.transparent,
-            child: Center(
-              child: Container(
-                height: 220,
-                margin: EdgeInsets.symmetric(horizontal: 20),
-                decoration: BoxDecoration(
-                  color: Colors.white,
-                  borderRadius: BorderRadius.circular(15),
-                ),
-                child: Column(
-                  children: [
-                    Container(
-                      child:
-                          MyViews().myText('使用协议和隐私政策', MyColors.c333333, 18),
-                      margin: EdgeInsets.only(top: 12),
-                    ),
-                    Expanded(
-                      child: Container(
-                        margin: EdgeInsets.all(12),
-                        child: RichText(
-                          text: TextSpan(
-                              children: [
-                                TextSpan(
-                                    text: '《使用协议》',
-                                    style: TextStyle(
-                                        color: MyColors.cFF4233, fontSize: 14),
-                                    recognizer: TapGestureRecognizer()
-                                      ..onTap = () {
-                                        MyTools().toPage(
-                                            context,
-                                            PrivacyPolicyPage('使用协议'),
-                                            (then) {});
-                                      }),
-                                TextSpan(
-                                    text: '和',
-                                    style: TextStyle(
-                                        color: MyColors.c333333, fontSize: 14)),
-                                TextSpan(
-                                    text: '《隐私政策》',
-                                    style: TextStyle(
-                                        color: MyColors.cFF4233, fontSize: 14),
-                                    recognizer: TapGestureRecognizer()
-                                      ..onTap = () {
-                                        MyTools().toPage(
-                                            context,
-                                            PrivacyPolicyPage('隐私政策'),
-                                            (then) {});
-                                      }),
-                                TextSpan(
-                                    text: '了解详细信息。如你同意,请点击"同意开始接受我们的服务',
-                                    style: TextStyle(
-                                        color: MyColors.c333333, fontSize: 14)),
-                              ],
-                              text:
-                                  '请你务必审慎阅读、充分理解"使用协议“和“隐私政策"各条款,你可以在"设置"中查看、变更、删除个人信息并管理你的授权。你可阅读',
-                              style: TextStyle(
-                                  color: MyColors.c333333, fontSize: 14)),
-                        ),
+      if(MyCookie().prefs.getBool('同意协议')==null){
+        showDialog(
+          context: context,
+          builder: (BuildContext context) {
+            return Material(
+              color: Colors.transparent,
+              child: Center(
+                child: Container(
+                  height: 220,
+                  margin: EdgeInsets.symmetric(horizontal: 20),
+                  decoration: BoxDecoration(
+                    color: Colors.white,
+                    borderRadius: BorderRadius.circular(15),
+                  ),
+                  child: Column(
+                    children: [
+                      Container(
+                        child:
+                        MyViews().myText('使用协议和隐私政策', MyColors.c333333, 18),
+                        margin: EdgeInsets.only(top: 12),
                       ),
-                    ),
-                    Container(
-                      height: 0.5,
-                      color: MyColors.cBFBFBF,
-                    ),
-                    Row(
-                      children: [
-                        Expanded(
-                          child: GestureDetector(
-                            onTap: () async {
-                              await SystemChannels.platform
-                                  .invokeMethod('SystemNavigator.pop');
-                            },
-                            behavior: HitTestBehavior.translucent,
-                            child: Container(
-                              height: 50,
-                              child: Text(
-                                '暂不使用',
+                      Expanded(
+                        child: Container(
+                          margin: EdgeInsets.all(12),
+                          child: RichText(
+                            text: TextSpan(
+                                children: [
+                                  TextSpan(
+                                      text: '《使用协议》',
+                                      style: TextStyle(
+                                          color: MyColors.cFF4233, fontSize: 14),
+                                      recognizer: TapGestureRecognizer()
+                                        ..onTap = () {
+                                          MyTools().toPage(
+                                              context,
+                                              PrivacyPolicyPage('使用协议'),
+                                                  (then) {});
+                                        }),
+                                  TextSpan(
+                                      text: '和',
+                                      style: TextStyle(
+                                          color: MyColors.c333333, fontSize: 14)),
+                                  TextSpan(
+                                      text: '《隐私政策》',
+                                      style: TextStyle(
+                                          color: MyColors.cFF4233, fontSize: 14),
+                                      recognizer: TapGestureRecognizer()
+                                        ..onTap = () {
+                                          MyTools().toPage(
+                                              context,
+                                              PrivacyPolicyPage('隐私政策'),
+                                                  (then) {});
+                                        }),
+                                  TextSpan(
+                                      text: '了解详细信息。如你同意,请点击"同意开始接受我们的服务',
+                                      style: TextStyle(
+                                          color: MyColors.c333333, fontSize: 14)),
+                                ],
+                                text:
+                                '请你务必审慎阅读、充分理解"使用协议“和“隐私政策"各条款,你可以在"设置"中查看、变更、删除个人信息并管理你的授权。你可阅读',
                                 style: TextStyle(
-                                    color: MyColors.c333333, fontSize: 20),
+                                    color: MyColors.c333333, fontSize: 14)),
+                          ),
+                        ),
+                      ),
+                      Container(
+                        height: 0.5,
+                        color: MyColors.cBFBFBF,
+                      ),
+                      Row(
+                        children: [
+                          Expanded(
+                            child: GestureDetector(
+                              onTap: () async {
+                                await SystemChannels.platform
+                                    .invokeMethod('SystemNavigator.pop');
+                              },
+                              behavior: HitTestBehavior.translucent,
+                              child: Container(
+                                height: 50,
+                                child: Text(
+                                  '暂不使用',
+                                  style: TextStyle(
+                                      color: MyColors.c333333, fontSize: 20),
+                                ),
+                                alignment: Alignment.center,
                               ),
-                              alignment: Alignment.center,
                             ),
                           ),
-                        ),
-                        Expanded(
-                          child: GestureDetector(
-                            onTap: () {
-                              Navigator.pop(context);
-                            },
-                            behavior: HitTestBehavior.translucent,
-                            child: Container(
-                              height: 50,
-                              child: Text(
-                                '同意',
-                                style: TextStyle(
-                                    color: MyColors.cFF4233, fontSize: 20),
+                          Expanded(
+                            child: GestureDetector(
+                              onTap: () {
+                                Navigator.pop(context);
+                                MyCookie().prefs.setBool('同意协议', true);
+                              },
+                              behavior: HitTestBehavior.translucent,
+                              child: Container(
+                                height: 50,
+                                child: Text(
+                                  '同意',
+                                  style: TextStyle(
+                                      color: MyColors.cFF4233, fontSize: 20),
+                                ),
+                                alignment: Alignment.center,
                               ),
-                              alignment: Alignment.center,
                             ),
                           ),
-                        ),
-                      ],
-                    )
-                  ],
+                        ],
+                      )
+                    ],
+                  ),
                 ),
               ),
-            ),
-          );
-        },
-      );
+            );
+          },
+        );
+      }
+
     });
   }
 

+ 4 - 4
lib/paegs/mine_page/mine_page.dart

@@ -366,10 +366,10 @@ class _MinePageState extends State<MinePage> {
                       queryPersonalInformation();
                     });
                   }),
-                  if (!MyCookie().underReview)
-                    functionItem('images/svg/广告.svg', '广告', () {
-                      MyTools().toPage(context, AdvertisingPage(), (then) {});
-                    }),
+                  // if (!MyCookie().underReview)
+                  //   functionItem('images/svg/广告.svg', '广告', () {
+                  //     MyTools().toPage(context, AdvertisingPage(), (then) {});
+                  //   }),
                   functionItem('images/svg/处罚.svg', '投诉', () {
                     MyTools().toPage(context, PunishPage(), (then) {
                       queryPersonalInformation();

+ 3 - 2
lib/paegs/mine_page/order_page/order_page.dart

@@ -352,9 +352,10 @@ class _OrderPageState extends State<OrderPage> {
       if (!hasError) {
         MyShopBeanEntity entity =
             MyShopBeanEntity().fromJson(json.decode(response.data.toString()));
-        myShopUIDs.clear();
         entity.data.data.forEach((element) {
-          myShopUIDs.add(element.shopUid);
+          if(!myShopUIDs.contains(element.shopUid)){
+            myShopUIDs.add(element.shopUid);
+          }
         });
         if(myShopUIDs.length==0){
           endRe(controller);

+ 9 - 6
lib/paegs/mine_page/promotion_download_page/promotion_download_page.dart

@@ -1,5 +1,3 @@
-import 'dart:ui';
-
 import 'package:bbyyy/my_tools/my_views.dart';
 import 'package:flutter/material.dart';
 
@@ -14,10 +12,15 @@ class _PromotionDownloadPageState extends State<PromotionDownloadPage> {
   @override
   Widget build(BuildContext context) {
     return Scaffold(
-      body: Column(children: [
-        MyViews().myAppBar('推广下载', context, []),
-        Container(child: Image.asset('images/推广二维码.png'),margin: EdgeInsets.symmetric(horizontal: 30,vertical: 30),)
-      ],),
+      body: Column(
+        children: [
+          MyViews().myAppBar('推广下载', context, []),
+          Container(
+            child: Image.asset('images/推广二维码.jpg'),
+            margin: EdgeInsets.symmetric(horizontal: 30, vertical: 30),
+          )
+        ],
+      ),
     );
   }
 }

+ 19 - 9
lib/paegs/mine_page/referrer_page/referrer_flow_page.dart

@@ -175,7 +175,7 @@ class _ReferrerFlowPageState extends State<ReferrerFlowPage> {
   }
 
   StateSetter ss;
-  List<String> types = ['全部', '订单', '佣金'];
+  List<String> types = ['全部', '订单', '佣金','缴费'];
   int typeIndex = 0;
   // List<String> times = ['全部', '今天', '昨天', '本周', '上周', '本月'];
   List<String> times = ['今天', '昨天', '本周', '上周'];
@@ -426,14 +426,24 @@ class _ReferrerFlowPageState extends State<ReferrerFlowPage> {
       // "paid_amount ${sTab == 0 ? '>' : '<'} 0"
     ];
     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 ${ [flowTypePlatformFee]}");
+          break;
+      }
     }
     if (timeIndex != -1) {
       conditions.add("pay_time between ${getTime(timeIndex)}");

+ 39 - 4
lib/paegs/mine_page/set_page/change_password_page.dart

@@ -8,6 +8,7 @@ import 'package:bbyyy/my_tools/my_tools.dart';
 import 'package:bbyyy/my_tools/my_views.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/services.dart';
+import 'package:flutter_svg/svg.dart';
 
 class ChangePasswordPage extends StatefulWidget {
   @override
@@ -17,6 +18,8 @@ class ChangePasswordPage extends StatefulWidget {
 class _ChangePasswordPageState extends State<ChangePasswordPage> {
   TextEditingController oldPW = TextEditingController();
   TextEditingController newPW = TextEditingController();
+  bool seeOldPW = true;
+  bool seeNewPW = true;
 
   @override
   Widget build(BuildContext context) {
@@ -65,9 +68,25 @@ class _ChangePasswordPageState extends State<ChangePasswordPage> {
                                       height: 1.3,
                                       letterSpacing: 0.2),
                                   keyboardType: TextInputType.visiblePassword,
-                                  obscureText: true,
+                                  obscureText: seeOldPW,
                                   onChanged: (t) {},
-                                ))
+                                )),
+                                GestureDetector(
+                                  onTap: () {
+                                    setState(() {
+                                      seeOldPW = !seeOldPW;
+                                    });
+                                  },
+                                  behavior: HitTestBehavior.translucent,
+                                  child: Container(
+                                    height: 35,
+                                    width: 35,
+                                    padding: EdgeInsets.all(6.5),
+                                    child: SvgPicture.asset(seeOldPW
+                                        ? 'images/svg/不显示.svg'
+                                        : 'images/svg/显示.svg',color: MyColors.c333333,),
+                                  ),
+                                ),
                               ],
                             ),
                             padding:
@@ -106,9 +125,25 @@ class _ChangePasswordPageState extends State<ChangePasswordPage> {
                                       height: 1.3,
                                       letterSpacing: 0.2),
                                   keyboardType: TextInputType.visiblePassword,
-                                  obscureText: true,
+                                  obscureText: seeNewPW,
                                   onChanged: (t) {},
-                                ))
+                                )),
+                                GestureDetector(
+                                  onTap: () {
+                                    setState(() {
+                                      seeNewPW = !seeNewPW;
+                                    });
+                                  },
+                                  behavior: HitTestBehavior.translucent,
+                                  child: Container(
+                                    height: 35,
+                                    width: 35,
+                                    padding: EdgeInsets.all(6.5),
+                                    child: SvgPicture.asset(seeNewPW
+                                        ? 'images/svg/不显示.svg'
+                                        : 'images/svg/显示.svg',color: MyColors.c333333,),
+                                  ),
+                                ),
                               ],
                             ),
                             padding:

+ 6 - 1
lib/paegs/mine_page/wallet_page/wallet_page.dart

@@ -303,7 +303,7 @@ class _WalletPageState extends State<WalletPage> {
   }
 
   StateSetter ss;
-  List<String> types = ['全部', '订单', '佣金','提现'];
+  List<String> types = ['全部', '订单', '佣金','提现','缴费'];
   int typeIndex = 0;
   // List<String> times = ['全部', '今天', '昨天', '本周', '上周', '本月'];
   List<String> times = ['今天', '昨天', '本周', '上周'];
@@ -580,6 +580,11 @@ class _WalletPageState extends State<WalletPage> {
             flowTypeWithdraw
           ]}');
           break;
+        case 4:
+          conditions.add('type IN ${[
+            flowTypePlatformFee
+          ]}');
+          break;
       }
       // conditions.add("type IN ${typeIndex == 1 ? [
       //     flowTypeOrderCommodity,

+ 30 - 2
lib/paegs/pay_page/pay_page.dart

@@ -37,7 +37,7 @@ class PayPage extends StatefulWidget {
   double discountAmount;
 
   PayPage(this.orderUID, this.cancelOrder, this.amount, this.payWay,
-      this.couponData,this.discountAmount);
+      this.couponData, this.discountAmount);
 
   @override
   _PayPageState createState() => _PayPageState();
@@ -49,6 +49,7 @@ class _PayPageState extends State<PayPage> with WidgetsBindingObserver {
   var content = ['正在支付,请稍后…', '支付成功,即将自动跳转…', '支付失败'];
   int status = 0;
   SmartOrderBeanDataData order;
+  bool showCancel = false;
 
   @override
   void initState() {
@@ -57,6 +58,11 @@ class _PayPageState extends State<PayPage> with WidgetsBindingObserver {
     Future.delayed(Duration(seconds: 1), () {
       pay();
     });
+    Future.delayed(Duration(seconds: 3), () {
+      showCancel = true;
+      setState(() {
+      });
+    });
   }
 
   @override
@@ -70,6 +76,9 @@ class _PayPageState extends State<PayPage> with WidgetsBindingObserver {
   Widget build(BuildContext context) {
     return WillPopScope(
       onWillPop: () {
+        if(status!=1){
+          resetOrder(widget.orderUID);
+        }
         Navigator.pop(context, status);
         return Future.value(false);
       },
@@ -95,6 +104,9 @@ class _PayPageState extends State<PayPage> with WidgetsBindingObserver {
                         left: 0,
                         child: GestureDetector(
                           onTap: () {
+                            if(status!=1){
+                              resetOrder(widget.orderUID);
+                            }
                             Navigator.pop(context, status);
                           },
                           behavior: HitTestBehavior.translucent,
@@ -366,6 +378,23 @@ class _PayPageState extends State<PayPage> with WidgetsBindingObserver {
                       ),
                     ),
             ),
+            if (showCancel && status != 1)
+              GestureDetector(
+                onTap: (){
+                  resetOrder(widget.orderUID);
+                  Navigator.pop(context,2);
+                },
+                child: Container(
+                  margin: EdgeInsets.symmetric(horizontal: 50,vertical: 50),
+                  decoration: BoxDecoration(
+                    color: MyColors.cFF4233,
+                    borderRadius: BorderRadius.circular(20),
+                  ),
+                  height: 40,
+                    child: Text('取消支付',style: TextStyle(color: Colors.white,fontSize: 16),),
+                  alignment: Alignment.center,
+                ),
+              )
           ],
         ),
       ),
@@ -541,7 +570,6 @@ class _PayPageState extends State<PayPage> with WidgetsBindingObserver {
             if (widget.cancelOrder) {
               revokePayOrder(widget.orderUID);
             } else {
-
               resetOrder(widget.orderUID);
             }
             status = 2;

+ 63 - 39
lib/paegs/registered_page/registered_page.dart

@@ -148,7 +148,28 @@ class _RegisteredPageState extends State<RegisteredPage> {
                               )
                             ],
                           ),
-                        )
+                        ),
+                        Positioned(
+                          child: GestureDetector(
+                            onTap: (){
+                              MyTools().toPage(context, LoginPage(), (then) {},
+                                  noBack: true);
+                            },
+                            behavior: HitTestBehavior.translucent,
+                            child: Container(
+                              height: 30,
+                              width: 60,
+                              decoration: BoxDecoration(
+                                color: Colors.white,
+                                borderRadius: BorderRadius.circular(15),
+                              ),
+                              child: Text('去登录',style: TextStyle(color: MyColors.cFF4233,fontSize: 12),),
+                              alignment: Alignment.center,
+                            ),
+                          ),
+                          top: 67,
+                          right: 10,
+                        ),
                       ],
                       alignment: Alignment.topCenter,
                     ),
@@ -270,7 +291,7 @@ class _RegisteredPageState extends State<RegisteredPage> {
                         Container(
                           height: 1,
                           color:
-                          focus == 2 ? MyColors.cFF4233 : MyColors.cD7D7D7,
+                              focus == 2 ? MyColors.cFF4233 : MyColors.cD7D7D7,
                           margin: EdgeInsets.only(top: 8, bottom: 39),
                         ),
                         Row(
@@ -307,8 +328,8 @@ class _RegisteredPageState extends State<RegisteredPage> {
                                     hintStyle: TextStyle(
                                         color: MyColors.c999999, fontSize: 16),
                                     isDense: true,
-                                    contentPadding:
-                                    const EdgeInsets.fromLTRB(14, 4.5, 8, 4.5)),
+                                    contentPadding: const EdgeInsets.fromLTRB(
+                                        14, 4.5, 8, 4.5)),
                                 maxLines: 1,
                                 style: TextStyle(
                                     color: MyColors.c333333,
@@ -320,8 +341,8 @@ class _RegisteredPageState extends State<RegisteredPage> {
                               ),
                             ),
                             GestureDetector(
-                              onTap: (){
-                                if(verificationCodeText!='发送验证码'){
+                              onTap: () {
+                                if (verificationCodeText != '发送验证码') {
                                   showToast('验证码发送中');
                                   return;
                                 }
@@ -332,8 +353,12 @@ class _RegisteredPageState extends State<RegisteredPage> {
                                 decoration: BoxDecoration(
                                     color: MyColors.c19FF4233,
                                     borderRadius:
-                                    BorderRadius.all(Radius.circular(4))),
-                                child: Text(verificationCodeText,style: TextStyle(color: MyColors.cFF4233,fontSize: 14),),
+                                        BorderRadius.all(Radius.circular(4))),
+                                child: Text(
+                                  verificationCodeText,
+                                  style: TextStyle(
+                                      color: MyColors.cFF4233, fontSize: 14),
+                                ),
                                 alignment: Alignment.center,
                                 height: 34,
                                 width: 90,
@@ -402,7 +427,8 @@ class _RegisteredPageState extends State<RegisteredPage> {
                                 },
                                 behavior: HitTestBehavior.translucent,
                                 child: Container(
-                                  height: 30,width: 30,
+                                    height: 30,
+                                    width: 30,
                                     padding: EdgeInsets.all(4),
                                     child: SvgPicture.asset(showPW
                                         ? 'images/svg/不显示.svg'
@@ -517,25 +543,25 @@ class _RegisteredPageState extends State<RegisteredPage> {
                             padding: EdgeInsets.only(bottom: 2),
                           ),
                         ),
-                        Container(
-                          margin: EdgeInsets.only(top: 20),
-                          alignment: Alignment.centerRight,
-                          child: GestureDetector(
-                            onTap: () {
-                              MyTools().toPage(context, LoginPage(), (then) {},
-                                  noBack: true);
-                            },
-                            behavior: HitTestBehavior.translucent,
-                            child: Container(
-                              child: Text(
-                                '已有账号,去登录',
-                                style: TextStyle(
-                                    color: MyColors.cFF4233, fontSize: 13),
-                              ),
-                              padding: EdgeInsets.all(8),
-                            ),
-                          ),
-                        ),
+                        // Container(
+                        //   margin: EdgeInsets.only(top: 20),
+                        //   alignment: Alignment.centerRight,
+                        //   child: GestureDetector(
+                        //     onTap: () {
+                        //       MyTools().toPage(context, LoginPage(), (then) {},
+                        //           noBack: true);
+                        //     },
+                        //     behavior: HitTestBehavior.translucent,
+                        //     child: Container(
+                        //       child: Text(
+                        //         '已有账号,去登录',
+                        //         style: TextStyle(
+                        //             color: MyColors.cFF4233, fontSize: 13),
+                        //       ),
+                        //       padding: EdgeInsets.all(8),
+                        //     ),
+                        //   ),
+                        // ),
                       ],
                       crossAxisAlignment: CrossAxisAlignment.start,
                     ),
@@ -591,17 +617,15 @@ class _RegisteredPageState extends State<RegisteredPage> {
   }
 
   int countdown = 60;
+
   void sendTheVerificationCode() {
-    if(_phoneNum.text.isEmpty||_phoneNum.text.length!=11){
+    if (_phoneNum.text.isEmpty || _phoneNum.text.length != 11) {
       showToast('请输入正确的手机号');
       return;
     }
-    MyDio().post(MyApis.getApi('sendCode'), {
-      'mobile':_phoneNum.text
-    }, (response, hasError) {
-      if(!hasError){
-
-      }
+    MyDio().post(MyApis.getApi('sendCode'), {'mobile': _phoneNum.text},
+        (response, hasError) {
+      if (!hasError) {}
     }, (error) {
       showToast('发送失败');
       countdown = 2;
@@ -614,7 +638,7 @@ class _RegisteredPageState extends State<RegisteredPage> {
       });
     });
     _timer = Timer.periodic(Duration(seconds: 1), (timer) {
-      if(countdown==0){
+      if (countdown == 0) {
         timer.cancel();
         setState(() {
           countdown = 60;
@@ -631,10 +655,10 @@ class _RegisteredPageState extends State<RegisteredPage> {
 
   void verificationCode() {
     MyDio().post(MyApis.getApi('verifyCode'), {
-      'mobile':_phoneNum.text,
-      'code':int.parse(_verificationCode.text),
+      'mobile': _phoneNum.text,
+      'code': int.parse(_verificationCode.text),
     }, (response, hasError) {
-      if(!hasError){
+      if (!hasError) {
         uploadAvatar();
       }
     }, (error) {

+ 1 - 1
pubspec.yaml

@@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
 # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
 # Read more about iOS versioning at
 # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
-version: 1.1.20+1
+version: 1.1.21+1
 
 environment:
   sdk: ">=2.7.0 <3.0.0"