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

+ 2 - 1
lib/beans/fixed_price_bean_entity.dart

@@ -7,8 +7,9 @@ class FixedPriceBeanEntity with JsonConvert<FixedPriceBeanEntity> {
 }
 
 class FixedPriceBeanData with JsonConvert<FixedPriceBeanData> {
-	String pricing;
+	double pricing;
 	int id;
 	int type;
 	String title;
+	bool percent;
 }

+ 7 - 1
lib/generated/json/fixed_price_bean_entity_helper.dart

@@ -19,7 +19,9 @@ Map<String, dynamic> fixedPriceBeanEntityToJson(FixedPriceBeanEntity entity) {
 
 fixedPriceBeanDataFromJson(FixedPriceBeanData data, Map<String, dynamic> json) {
 	if (json['pricing'] != null) {
-		data.pricing = json['pricing'].toString();
+		data.pricing = json['pricing'] is String
+				? double.tryParse(json['pricing'])
+				: json['pricing'].toDouble();
 	}
 	if (json['id'] != null) {
 		data.id = json['id'] is String
@@ -34,6 +36,9 @@ fixedPriceBeanDataFromJson(FixedPriceBeanData data, Map<String, dynamic> json) {
 	if (json['title'] != null) {
 		data.title = json['title'].toString();
 	}
+	if (json['percent'] != null) {
+		data.percent = json['percent'];
+	}
 	return data;
 }
 
@@ -43,5 +48,6 @@ Map<String, dynamic> fixedPriceBeanDataToJson(FixedPriceBeanData entity) {
 	data['id'] = entity.id;
 	data['type'] = entity.type;
 	data['title'] = entity.title;
+	data['percent'] = entity.percent;
 	return data;
 }

+ 2 - 2
lib/https/MyDio.dart

@@ -43,8 +43,8 @@ class MyDio {
     // 或者通过传递一个 `options`来创建dio实例
     options = BaseOptions(
       baseUrl: MyCookie().getServer(),
-      connectTimeout: 15000,
-      receiveTimeout: 5000,
+      connectTimeout: 20000,
+      receiveTimeout: 20000,
     );
     if (MyCookie().loginInformation != null) {
       options.headers = {

+ 1 - 1
lib/my_tools/my_cookie.dart

@@ -40,7 +40,7 @@ class MyCookie {
   }
 
   getServer() {
-    return 'http://$server:4001';
+    return 'https://$server:4001';
   }
 
   initP() async {

+ 159 - 122
lib/paegs/gang_page/create_a_gang_page/create_a_gang_page.dart

@@ -61,18 +61,18 @@ class _CreateAGangPageState extends State<CreateAGangPage> {
   @override
   void initState() {
     super.initState();
-    types.forEach((element) {
-      sortItems.add(DropdownMenuItem(
-        child: Container(
-          child: Text(
-            element,
-            style: TextStyle(color: MyColors.c666666, fontSize: 15),
-          ),
-          alignment: Alignment.center,
-        ),
-        value: element,
-      ));
-    });
+    // types.forEach((element) {
+    //   sortItems.add(DropdownMenuItem(
+    //     child: Container(
+    //       child: Text(
+    //         element,
+    //         style: TextStyle(color: MyColors.c666666, fontSize: 15),
+    //       ),
+    //       alignment: Alignment.center,
+    //     ),
+    //     value: element,
+    //   ));
+    // });
     // _startingPoint.text = '20';
     // _amountCharged.text = '1';
     Future.delayed(Duration.zero, () {
@@ -85,33 +85,45 @@ class _CreateAGangPageState extends State<CreateAGangPage> {
   Widget build(BuildContext context) {
     if (fixedPrices.length > 0) {
       sortItems.clear();
-      if (private) {
-        types3.forEach((element) {
-          sortItems.add(DropdownMenuItem(
-            child: Container(
-              child: Text(
-                element,
-                style: TextStyle(color: MyColors.c666666, fontSize: 15),
-              ),
-              alignment: Alignment.center,
+      // if (private) {
+      //   types3.forEach((element) {
+      //     sortItems.add(DropdownMenuItem(
+      //       child: Container(
+      //         child: Text(
+      //           element,
+      //           style: TextStyle(color: MyColors.c666666, fontSize: 15),
+      //         ),
+      //         alignment: Alignment.center,
+      //       ),
+      //       value: element,
+      //     ));
+      //   });
+      // } else {
+      //   types2.forEach((element) {
+      //     sortItems.add(DropdownMenuItem(
+      //       child: Container(
+      //         child: Text(
+      //           element,
+      //           style: TextStyle(color: MyColors.c666666, fontSize: 15),
+      //         ),
+      //         alignment: Alignment.center,
+      //       ),
+      //       value: element,
+      //     ));
+      //   });
+      // }
+      fixedPrices.forEach((element) {
+        sortItems.add(DropdownMenuItem(
+          child: Container(
+            child: Text(
+              element.title,
+              style: TextStyle(color: MyColors.c666666, fontSize: 15),
             ),
-            value: element,
-          ));
-        });
-      } else {
-        types2.forEach((element) {
-          sortItems.add(DropdownMenuItem(
-            child: Container(
-              child: Text(
-                element,
-                style: TextStyle(color: MyColors.c666666, fontSize: 15),
-              ),
-              alignment: Alignment.center,
-            ),
-            value: element,
-          ));
-        });
-      }
+            alignment: Alignment.center,
+          ),
+          value: '${element.title}',
+        ));
+      });
     }
     return GestureDetector(
       onTap: () {
@@ -451,73 +463,43 @@ class _CreateAGangPageState extends State<CreateAGangPage> {
                             onChanged: (t) {},
                           ),
                         ),
-                        //是否私有店铺
-                        Container(
-                          height: 0.5,
-                          color: MyColors.cF7F7F7,
-                          margin: EdgeInsets.symmetric(horizontal: 15),
-                        ),
-                        Container(
-                          child: Container(
-                            child: Row(
-                              children: [
-                                MyViews()
-                                    .myText('是否私有货帮', MyColors.c333333, 15),
-                                CupertinoSwitch(
-                                  value: private,
-                                  onChanged: (v) {
-                                    setState(() {
-                                      MyTools().hideKeyboard(context);
-                                      private = v;
-                                      shopCommissionType = v ? 1 : 0;
-                                      typeIndex = v ? 2 : 0;
-                                      print(
-                                          '--------------\nprivate-----$private\nshopCommissionType-----$shopCommissionType\ntypeIndex-----$typeIndex\nprivate-----$private\n--------------');
-                                      setFee();
-                                    });
-                                  },
-                                  activeColor: MyColors.cFF4233,
-                                )
-                              ],
-                              mainAxisAlignment: MainAxisAlignment.spaceBetween,
-                            ),
-                          ),
-                          padding: EdgeInsets.fromLTRB(16, 0, 15, 0),
-                          height: 50,
-                        ),
+
                         //店铺收费
                         //付费方式
-                        Container(
-                          height: 10,
-                          color: MyColors.cF7F7F7,
-                        ),
-                        Container(
-                          child: Container(
-                            child: Row(
-                              children: [
-                                MyViews()
-                                    .myText('货帮入驻付费方式', MyColors.c333333, 15),
-                                DropdownButtonHideUnderline(
-                                  child: DropdownButton(
-                                    isDense: true,
-                                    items: sortItems,
-                                    onChanged: (v) {
-                                      MyTools().hideKeyboard(context);
-                                      setState(() {
-                                        typeIndex = types.indexOf(v);
-                                        setFee();
-                                      });
-                                    },
-                                    value: types[typeIndex],
+                        if(fixedPrices.isNotEmpty)
+                        Column(children: [
+                          Container(
+                            height: 10,
+                            color: MyColors.cF7F7F7,
+                          ),
+                          Container(
+                            child: Container(
+                              child: Row(
+                                children: [
+                                  MyViews()
+                                      .myText('货帮入驻付费方式', MyColors.c333333, 15),
+                                  DropdownButtonHideUnderline(
+                                    child: DropdownButton(
+                                      isDense: true,
+                                      items: sortItems,
+                                      onChanged: (v) {
+                                        MyTools().hideKeyboard(context);
+                                        setState(() {
+                                          typeIndex = fixedPrices.indexWhere((element) => element.title==v);
+                                          setFee();
+                                        });
+                                      },
+                                      value: fixedPrices[typeIndex].title,
+                                    ),
                                   ),
-                                ),
-                              ],
-                              mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                                ],
+                                mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                              ),
                             ),
+                            padding: EdgeInsets.fromLTRB(16, 0, 15, 0),
+                            height: 50,
                           ),
-                          padding: EdgeInsets.fromLTRB(16, 0, 15, 0),
-                          height: 50,
-                        ),
+                        ],),
                         //店铺佣金类型
                         Visibility(
                           child: Column(
@@ -560,14 +542,14 @@ class _CreateAGangPageState extends State<CreateAGangPage> {
                                                 Checkbox(
                                                   activeColor: MyColors.cFF4233,
                                                   checkColor: Colors.white,
-                                                  value:
-                                                      shopCommissionType == 1,
+                                                  value:fixedPrices.isEmpty?false:
+                                                      fixedPrices[typeIndex].percent,
                                                   onChanged: (v) {
-                                                    MyTools()
-                                                        .hideKeyboard(context);
-                                                    shopCommissionType = 1;
-                                                    setFee();
-                                                    setState(() {});
+                                                    // MyTools()
+                                                    //     .hideKeyboard(context);
+                                                    // shopCommissionType = 1;
+                                                    // setFee();
+                                                    // setState(() {});
                                                   },
                                                 ),
                                                 MyViews().myText('按照比例',
@@ -589,25 +571,62 @@ class _CreateAGangPageState extends State<CreateAGangPage> {
                               ),
                             ],
                           ),
-                          visible: typeIndex != 0,
+                          visible: fixedPrices.isNotEmpty,
                         ),
                         //支付价格
+                        if(fixedPrices.isNotEmpty)
+                          Column(children: [
+                            Container(
+                              height: 0.5,
+                              color: MyColors.cF7F7F7,
+                              margin: EdgeInsets.symmetric(horizontal: 15),
+                            ),
+                            Container(
+                              child: Container(
+                                child: Row(
+                                  children: [
+                                    MyViews().myText('支付价格', MyColors.c333333, 15),
+                                    MyViews().myText(
+                                        fixedPrices.isEmpty?'0元':fixedPrices[typeIndex].percent
+                                            ? '${NumUtil.multiply(fixedPrices[typeIndex].pricing, 100)}%'
+                                            :'${fixedPrices[typeIndex].pricing}元',
+                                        MyColors.c333333,
+                                        15),
+                                  ],
+                                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                                ),
+                              ),
+                              padding: EdgeInsets.fromLTRB(16, 0, 15, 0),
+                              height: 50,
+                            ),
+                          ],),
+
+                        //是否私有店铺
                         Container(
-                          height: 0.5,
+                          height: 10,
                           color: MyColors.cF7F7F7,
-                          margin: EdgeInsets.symmetric(horizontal: 15),
                         ),
                         Container(
                           child: Container(
                             child: Row(
                               children: [
-                                MyViews().myText('支付价格', MyColors.c333333, 15),
-                                MyViews().myText(
-                                    shopCommissionType == 0
-                                        ? '$feePricing元'
-                                        : '${NumUtil.multiply(double.parse(feePricing), 100)}%',
-                                    MyColors.c333333,
-                                    15),
+                                MyViews()
+                                    .myText('是否私有货帮', MyColors.c333333, 15),
+                                CupertinoSwitch(
+                                  value: private,
+                                  onChanged: (v) {
+                                    setState(() {
+                                      MyTools().hideKeyboard(context);
+                                      private = v;
+                                      // shopCommissionType = v ? 1 : 0;
+                                      // typeIndex = v ? 2 : 0;
+                                      // print(
+                                      //     '--------------\nprivate-----$private\nshopCommissionType-----$shopCommissionType\ntypeIndex-----$typeIndex\nprivate-----$private\n--------------');
+                                      setFee();
+                                    });
+                                  },
+                                  activeColor: MyColors.cFF4233,
+                                )
                               ],
                               mainAxisAlignment: MainAxisAlignment.spaceBetween,
                             ),
@@ -615,6 +634,7 @@ class _CreateAGangPageState extends State<CreateAGangPage> {
                           padding: EdgeInsets.fromLTRB(16, 0, 15, 0),
                           height: 50,
                         ),
+
                         //店铺佣金
 
                         Visibility(
@@ -1061,9 +1081,9 @@ class _CreateAGangPageState extends State<CreateAGangPage> {
       'picture': data.data[0].path,
       'private': private,
       'owner_uid': MyCookie().getUID(),
-      'fee_type': feeType,
-      'fee_percent': shopCommissionType == 1,
-      'fee_pricing': feePricing,
+      'fee_type': fixedPrices[typeIndex].type,
+      'fee_percent': fixedPrices[typeIndex].percent,
+      'fee_pricing': fixedPrices[typeIndex].pricing,
       'inner_trade': innerTrade,
       'category': shopTypeV,
       'owner_pay_platform_fee': ownerPayPlatformCommission,
@@ -1104,10 +1124,26 @@ class _CreateAGangPageState extends State<CreateAGangPage> {
     }, (error) {});
   }
 
+  // getFixedPrice() {
+  //   MyDio().query({
+  //     "key": "shop_pricing",
+  //     "dims": ["id", "type", "pricing", "title"],
+  //     "filters": {}
+  //   }, (response, hasError) {
+  //     if (!hasError) {
+  //       FixedPriceBeanEntity fixedPrice = FixedPriceBeanEntity()
+  //           .fromJson(json.decode(response.data.toString()));
+  //       fixedPrices = fixedPrice.data;
+  //       setFee();
+  //       setState(() {});
+  //     }
+  //   }, (error) {});
+  // }
   getFixedPrice() {
     MyDio().query({
-      "key": "shop_pricing",
-      "dims": ["id", "type", "pricing", "title"],
+      "key": "platform_pricing",
+      "dims": ["id", "type", "pricing", "title",
+      "percent"],
       "filters": {}
     }, (response, hasError) {
       if (!hasError) {
@@ -1120,6 +1156,7 @@ class _CreateAGangPageState extends State<CreateAGangPage> {
     }, (error) {});
   }
 
+
   void setFee() {
     print('==================================');
     print(types[typeIndex]);

+ 2 - 1
lib/paegs/gang_page/qr_code_for_store_payment_page/qr_code_for_store_payment_page.dart

@@ -94,7 +94,8 @@ class _QRCodeForStorePaymentPageState extends State<QRCodeForStorePaymentPage> {
                               color: Colors.white),
                           child: QrImage(
                             data:
-                                'http://www.banghuo.net/bby/pay/pay.html?shop_uid=${widget.data.shopUid}',
+                                // 'http://www.banghuo.net/bby/pay/pay.html?shop_uid=${widget.data.shopUid}',
+                                'https://bby.banghuo.net/pay.html?shop_uid=${widget.data.shopUid}',
                             gapless: false,
                             version: QrVersions.auto,
                             size: 216,

+ 1 - 1
lib/paegs/home_page/home_page.dart

@@ -559,7 +559,7 @@ class _HomePageState extends State<HomePage>
                               if (then.isNotEmpty && then != null) {
                                 Timer(Duration(milliseconds: 200), () {
                                   if (then.contains(
-                                      'http://www.banghuo.net/bby/pay/pay.html?shop_uid=')) {
+                                      'https://bby.banghuo.net/pay.html?shop_uid=')) {
                                   } else {
                                     showToast('暂不支持该二维码');
                                     return;