Kaynağa Gözat

add WithDrawal

[baozhangchao] 3 yıl önce
ebeveyn
işleme
617f6ae460

BIN
images/bank/addBank.png Dosyayı Görüntüle


BIN
images/bank/walletBgi.png Dosyayı Görüntüle


+ 32
- 0
lib/models/entities/Bank.dart Dosyayı Görüntüle

@@ -0,0 +1,32 @@
1
+class Bank {
2
+  String? bankId;
3
+  String? bankCode;
4
+  String? name;
5
+  String? logo;
6
+  String? color1;
7
+  String? color2;
8
+  int? status;
9
+  int? sortNo;
10
+
11
+  Bank();
12
+
13
+  Bank.fromJson(Map<String, dynamic> json)
14
+      : bankId = json['bankId'],
15
+        bankCode = json['bankCode'],
16
+        name = json['name'],
17
+        logo = json['logo'],
18
+        color1 = json['color1'],
19
+        color2 = json['color2'],
20
+        status = json['status'],
21
+        sortNo = json['sortNo'];
22
+  Map<String, dynamic> toJson() => {
23
+        'bankId': bankId,
24
+        'bankCode': bankCode,
25
+        'name': name,
26
+        'logo': logo,
27
+        'color1': color1,
28
+        'color2': color2,
29
+        'status': status,
30
+        'sortNo': sortNo,
31
+      };
32
+}

+ 41
- 0
lib/models/entities/BankCard.dart Dosyayı Görüntüle

@@ -0,0 +1,41 @@
1
+class BankCardModel {
2
+  String? cardId;
3
+  String cardNo='';
4
+  String? createDate;
5
+  String? owerName;
6
+  String? ownerBank;
7
+  String? personId;
8
+  String? phone;
9
+  int? status;
10
+  String? color1;
11
+  String? color2;
12
+  String? bankCode;
13
+
14
+  BankCardModel();
15
+
16
+  BankCardModel.fromJson(Map<String, dynamic> json)
17
+      : cardId = json["cardId"],
18
+        cardNo = json["cardNo"],
19
+        personId = json["personId"],
20
+        owerName = json["owerName"],
21
+        phone = json["phone"],
22
+        ownerBank = json["ownerBank"],
23
+        status = json["status"],
24
+        color1 = json["color1"],
25
+        color2 = json["color2"],
26
+        bankCode = json["bankCode"],
27
+        createDate = json["createDate"];
28
+  Map<String, dynamic> toJson() => {
29
+        'cardId': cardId,
30
+        'cardNo': cardNo,
31
+        'personId': personId,
32
+        'owerName': owerName,
33
+        'color1': color1,
34
+        'color2': color2,
35
+        'bankCode': bankCode,
36
+        'phone': phone,
37
+        'ownerBank': ownerBank,
38
+        'status': status,
39
+        'createDate': createDate,
40
+      };
41
+}

+ 92
- 0
lib/pages/agreement/index.dart Dosyayı Görüntüle

@@ -0,0 +1,92 @@
1
+import 'package:flutter/cupertino.dart';
2
+import 'package:flutter/material.dart';
3
+import 'package:flutter/src/widgets/framework.dart';
4
+import 'package:flutter_screenutil/flutter_screenutil.dart';
5
+import 'package:worker_client/widgets/layout/BasicPage.dart';
6
+
7
+class Agreement extends BasicPage {
8
+  @override
9
+  Widget builder(BuildContext context) {
10
+    naviTitle = '用户协议';
11
+    return ListView(
12
+      children: [
13
+        Container(
14
+          margin: EdgeInsets.symmetric(vertical: 25.h, horizontal: 15.w),
15
+          child: Column(
16
+            children: [
17
+              Container(
18
+                margin: EdgeInsets.only(bottom: 30.h),
19
+                child: Row(
20
+                  mainAxisAlignment: MainAxisAlignment.center,
21
+                  children: [
22
+                    Image.asset(
23
+                      'images/machinery/mIcon.png',
24
+                      width: 16.5.w,
25
+                    ),
26
+                    Container(
27
+                      margin: EdgeInsets.symmetric(horizontal: 15.5.w),
28
+                      child: Text(
29
+                        '智慧农机的介绍',
30
+                        style: TextStyle(
31
+                            fontSize: 22.sp,
32
+                            fontWeight: FontWeight.bold,
33
+                            color: const Color(0xFF222222),
34
+                            height: 1.1),
35
+                      ),
36
+                    ),
37
+                    Image.asset(
38
+                      'images/machinery/mIcon.png',
39
+                      width: 16.5.w,
40
+                    ),
41
+                  ],
42
+                ),
43
+              ),
44
+              Container(
45
+                margin: EdgeInsets.only(top: 40.h),
46
+                child: Column(
47
+                  children: [
48
+                    Text(
49
+                      '本次更新:',
50
+                      style: TextStyle(
51
+                          fontSize: 16.sp,
52
+                          fontWeight: FontWeight.bold,
53
+                          color: const Color(0xff101010)),
54
+                    ),
55
+                    Text(
56
+                      '--解决了一些已知问题--',
57
+                      style: TextStyle(
58
+                          fontSize: 16.sp,
59
+                          fontWeight: FontWeight.bold,
60
+                          color: const Color(0xff101010)),
61
+                    ),
62
+                  ],
63
+                ),
64
+              ),
65
+              Container(
66
+                margin: EdgeInsets.only(top: 40.h),
67
+                child: Column(
68
+                  children: [
69
+                    Text(
70
+                      '最近更新:',
71
+                      style: TextStyle(
72
+                          fontSize: 16.sp,
73
+                          fontWeight: FontWeight.bold,
74
+                          color: const Color(0xff101010)),
75
+                    ),
76
+                    Text(
77
+                      '--这个页面回头加一个外链进来--',
78
+                      style: TextStyle(
79
+                          fontSize: 16.sp,
80
+                          fontWeight: FontWeight.bold,
81
+                          color: const Color(0xff101010)),
82
+                    ),
83
+                  ],
84
+                ),
85
+              ),
86
+            ],
87
+          ),
88
+        ),
89
+      ],
90
+    );
91
+  }
92
+}

+ 104
- 45
lib/pages/bankList/index.dart Dosyayı Görüntüle

@@ -1,72 +1,131 @@
1 1
 import 'package:dotted_border/dotted_border.dart';
2 2
 import 'package:flutter/material.dart';
3 3
 import 'package:flutter_screenutil/flutter_screenutil.dart';
4
+import 'package:fluttertoast/fluttertoast.dart';
4 5
 import 'package:get/get.dart';
6
+import 'package:worker_client/models/entities/Bank.dart';
7
+import 'package:worker_client/models/entities/BankCard.dart';
5 8
 import 'package:worker_client/pages/bankList/widget/BankCard.dart';
6
-import '../../widgets/layout/BasicPage.dart';
7
-
9
+import 'package:worker_client/services/bank.dart';
10
+import 'package:worker_client/widgets/NullCard.dart';
11
+import 'package:worker_client/widgets/layout/BasicPage.dart';
8 12
 
9 13
 class BankListPages extends BasicPage {
10 14
   BankListPages({Key? key}) : super(key: key) {
11 15
     naviTitle = '我的银行卡';
12 16
   }
17
+  final bankCardList = Rx<List<BankCardModel>>([]);
13 18
 
14
-void goAddBank(){
19
+  @override
20
+  void beforeShow() {
21
+    // TODO: implement beforeShow
22
+    super.beforeShow();
23
+    getList();
24
+  }
25
+
26
+  void goAddBank() {
15 27
     Get.toNamed('/addBankCard');
16
-}
28
+  }
29
+
30
+  void getList() {
31
+    getBankCardList({'pageSize': 500}).then((res) {
32
+      getBankList({'pageSize': 500}).then((res2) {
33
+        var list1 = <BankCardModel>[];
34
+        var bankcardlist = <BankCardModel>[];
35
+        var banklist = <Bank>[];
36
+        var current;
37
+        res['records'].forEach((item) {
38
+          bankcardlist.add(BankCardModel.fromJson(item));
39
+        });
40
+        res2['records'].forEach((item) {
41
+          banklist.add(Bank.fromJson(item));
42
+        });
43
+        for (var item in bankcardlist) {
44
+          for (var v in banklist) {
45
+            if (item.ownerBank == v.name) {
46
+              current = v;
47
+            }
48
+          }
49
+          item.color1 = current.color1;
50
+          item.color2 = current.color2;
51
+          item.bankCode = current.bankCode;
52
+          list1.add(item);
53
+        }
54
+        bankCardList(list1);
55
+      });
56
+    });
57
+  }
58
+
59
+  void unBind(id) {
60
+    // 弹窗
61
+    unbindBankCard(id).then((value) {
62
+      Fluttertoast.showToast(msg: '解绑成功');
63
+      getList();
64
+    });
65
+  }
17 66
 
18 67
   @override
19 68
   Widget builder(BuildContext context) {
20 69
     return Container(
21
-      alignment: Alignment.center,
22
-
70
+      padding: EdgeInsets.all(15.w),
23 71
       child: Column(
24 72
         children: [
25
-          BankCard(),
26
-          BankCard(),
27
-          BankCard(),
28
-      Container(
29
-        height: 120.w,
30
-        alignment: Alignment.bottomCenter,
31
-        child:       GestureDetector(
32
-          onTap: () {
33
-            goAddBank();
34
-          },
35
-          child:DottedBorder(
36
-            borderType: BorderType.RRect,
37
-            color: Color(0xffBFBFBF),
38
-            radius: Radius.circular(20),
39
-            dashPattern: [3, 3 ,3, 3],
40
-            child: ClipRRect(
41
-              child: Container(
42
-                alignment: Alignment.center,
43
-                width: 345.w,
44
-                height: 45.w,
45
-                // color: Colors.amber,
46
-                child: Row(
47
-                  mainAxisAlignment: MainAxisAlignment.center,
48
-
49
-                  children: [
50
-                    Padding(padding: EdgeInsets.fromLTRB(0, 0, 10, 0),
51
-
52
-                      child: Icon(Icons.add_circle_outline),
73
+          Expanded(
74
+            child: Obx(
75
+              () => bankCardList.value.isNotEmpty
76
+                  ? ListView(
77
+                      children: bankCardList.value.map((item) {
78
+                      return BankCard(
79
+                        item: item,
80
+                        unBind: () {
81
+                          unBind(item.cardId);
82
+                        },
83
+                      );
84
+                    }).toList())
85
+                  : const NullCard(text: '暂未绑定银行卡'),
86
+            ),
87
+          ),
88
+          Container(
89
+            margin: EdgeInsets.only(bottom: 25.h),
90
+            child: GestureDetector(
91
+              onTap: () {
92
+                goAddBank();
93
+              },
94
+              child: DottedBorder(
95
+                borderType: BorderType.RRect,
96
+                color: const Color(0xffBFBFBF),
97
+                radius: Radius.circular(20.w),
98
+                dashPattern: const [3, 3, 3, 3],
99
+                child: ClipRRect(
100
+                  child: SizedBox(
101
+                    height: 45.w,
102
+                    child: Row(
103
+                      mainAxisAlignment: MainAxisAlignment.center,
104
+                      children: [
105
+                        Padding(
106
+                          padding: EdgeInsets.fromLTRB(0, 0, 10.w, 0),
107
+                          child: Image.asset(
108
+                            'images/bank/addBank.png',
109
+                            width: 18.w,
110
+                            fit: BoxFit.cover,
111
+                          ),
112
+                        ),
113
+                        Text(
114
+                          '添加银行卡',
115
+                          style: TextStyle(
116
+                              fontWeight: FontWeight.bold,
117
+                              fontSize: 16.sp,
118
+                              color: const Color(0xff323232)),
119
+                        ),
120
+                      ],
53 121
                     ),
54
-                    Text('添加银行卡',style: TextStyle(
55
-                      fontWeight: FontWeight.bold,
56
-                      fontSize: 19.sp,
57
-
58
-                    ),)
59
-                  ],
122
+                  ),
60 123
                 ),
61 124
               ),
62 125
             ),
63
-          ),
64
-        ),
65
-      )
66
-
126
+          )
67 127
         ],
68 128
       ),
69
-
70 129
     );
71 130
   }
72 131
 }

+ 50
- 67
lib/pages/bankList/widget/BankCard.dart Dosyayı Görüntüle

@@ -1,96 +1,79 @@
1 1
 import 'package:flutter/material.dart';
2 2
 import 'package:flutter_screenutil/flutter_screenutil.dart';
3
+import 'package:worker_client/models/entities/BankCard.dart';
3 4
 
4 5
 class BankCard extends StatelessWidget {
5
-  const BankCard({Key? key}) : super(key: key);
6
+  const BankCard({Key? key, required this.item, required this.unBind})
7
+      : super(key: key);
8
+  final BankCardModel item;
9
+  final GestureTapCallback unBind;
6 10
 
7 11
   @override
8 12
   Widget build(BuildContext context) {
9 13
     return Container(
10
-      alignment: Alignment.center,
11
-      padding: EdgeInsets.fromLTRB(20.w, 20.w, 20.w, 20.w),
12
-      margin: EdgeInsets.fromLTRB(0, 7, 0, 7),
13
-      width: 345.w,
14
-      height: 120.w,
14
+      padding: EdgeInsets.all(15.w),
15
+      margin: EdgeInsets.only(bottom: 15.h),
16
+      height: 112.5.w,
15 17
       decoration: BoxDecoration(
16
-        borderRadius: BorderRadius.circular(20),
18
+        borderRadius: BorderRadius.circular(10.w),
17 19
         gradient: LinearGradient(
18 20
           begin: Alignment.topLeft,
19 21
           end: Alignment.bottomRight,
20 22
           colors: [
21
-            Color(0xffE7B820),
22
-            Color(0xff0069B7),
23
+            Color(int.parse('0xff' + item.color2.toString())),
24
+            Color(int.parse('0xff' + item.color1.toString()))
23 25
           ],
24 26
         ),
25
-
26
-        // border: Border.all(
27
-        //   color: Colors.blue,
28
-        //   width: 2,
29
-        // ),
30 27
       ),
31
-      child: Column(
28
+      child: Stack(
32 29
         children: [
33 30
           Row(
34
-            mainAxisAlignment: MainAxisAlignment.spaceBetween,
35
-
31
+            crossAxisAlignment: CrossAxisAlignment.start,
36 32
             children: [
37
-              Row(
38
-                children: [
39
-                  Container(
40
-                    width: 32.w,
41
-                    height: 32.w,
42
-                    alignment: Alignment.center,
43
-                    // margin: EdgeInsets.fromLTRB(20.w, 20.w, 0, 0),
44
-                    padding: EdgeInsets.fromLTRB(5, 5, 5, 5),
45
-                    decoration: BoxDecoration(
46
-                        borderRadius: BorderRadius.circular(100),
47
-                        color: Colors.white),
48
-                    child: Image(
49
-                      image: NetworkImage(
50
-                          'https://yz-offical.oss-accelerate.aliyuncs.com/bank-logo/3.png'),
51
-                      width: 20.w,
52
-                      height: 20.w,
53
-                    ),
33
+              Container(
34
+                  width: 30.w,
35
+                  height: 30.w,
36
+                  alignment: Alignment.center,
37
+                  margin: EdgeInsets.only(right: 15.w),
38
+                  decoration: BoxDecoration(
39
+                      borderRadius: BorderRadius.circular(15.w),
40
+                      color: Colors.white),
41
+                  child: Image.network(
42
+                    item.bankCode.toString(),
43
+                    width: 20.w,
44
+                    fit: BoxFit.cover,
45
+                  )),
46
+              Expanded(
47
+                flex: 1,
48
+                child: Text(
49
+                  item.ownerBank.toString(),
50
+                  style: const TextStyle(
51
+                    color: Colors.white,
54 52
                   ),
55
-                  Container(
56
-                    margin: EdgeInsets.fromLTRB(15.w,0, 0, 0),
57
-                    padding: EdgeInsets.fromLTRB(0, 0, 0, 15),
58
-                    child: Text('中国瑞士军刀银行', style: TextStyle(
59
-                      color: Colors.white,
60
-                    ),),
61
-                  )
62
-                ],
53
+                ),
63 54
               ),
64
-              Container(
65
-                padding: EdgeInsets.fromLTRB(0, 0, 0, 15),
66
-                child: Text('**** 8888', style: TextStyle(
67
-                  fontSize: 18.sp,
55
+              Text(
56
+                '**** ' +
57
+                    item.cardNo
58
+                        .substring(item.cardNo.length - 4, item.cardNo.length),
59
+                style: const TextStyle(
68 60
                   color: Colors.white,
69
-                ),),
70
-              )
71
-
61
+                ),
62
+              ),
72 63
             ],
73 64
           ),
74
-          Row(
75
-            mainAxisAlignment: MainAxisAlignment.end,
76
-            children: [
77
-              Container(
78
-                height: 45.w,
79
-                alignment: Alignment.bottomRight,
80
-                child:  GestureDetector(
81
-                  onTap: () {
82
-                    print('点我接触绑定');
83
-                  },
84
-                  child: Text(
85
-                    '解除绑定',
86
-                    style: TextStyle(
87
-                      color: Colors.white,
88
-                    ),
89
-                  ),
65
+          Positioned(
66
+            bottom: 0,
67
+            right: 0,
68
+            child: GestureDetector(
69
+              onTap: unBind,
70
+              child: const Text(
71
+                '解除绑定',
72
+                style: TextStyle(
73
+                  color: Colors.white,
90 74
                 ),
91 75
               ),
92
-
93
-            ],
76
+            ),
94 77
           ),
95 78
         ],
96 79
       ),

+ 101
- 0
lib/pages/feedback/index.dart Dosyayı Görüntüle

@@ -0,0 +1,101 @@
1
+import 'package:flutter/material.dart';
2
+import 'package:flutter_screenutil/flutter_screenutil.dart';
3
+import 'package:fluttertoast/fluttertoast.dart';
4
+import 'package:get/get.dart';
5
+import 'package:worker_client/widgets/layout/BasicPage.dart';
6
+import 'package:worker_client/widgets/MyButton/index.dart';
7
+import 'package:worker_client/services/feedback.dart';
8
+
9
+class Feedback extends BasicPage {
10
+  final text = Rx<String>('');
11
+  final isEdit = Rx<bool>(false);
12
+
13
+  void submit() {
14
+    if (text() == '') {
15
+      Fluttertoast.showToast(msg: '请输入内容哦');
16
+    } else {
17
+      feedback(text()).then((value) {
18
+        Fluttertoast.showToast(msg: '提交成功!');
19
+        Get.back();
20
+      });
21
+    }
22
+  }
23
+
24
+  @override
25
+  Widget builder(BuildContext context) {
26
+    naviTitle = '意见反馈';
27
+    return Container(
28
+      height: 700.h,
29
+      padding: EdgeInsets.all(15.w),
30
+      child: Stack(
31
+        children: [
32
+          Container(
33
+            margin: EdgeInsets.fromLTRB(0, 0, 0, 50.h),
34
+            padding: EdgeInsets.symmetric(vertical: 5.w, horizontal: 18.5.w),
35
+            decoration: BoxDecoration(
36
+                color: const Color(0xFFfefefe),
37
+                borderRadius: BorderRadius.all(Radius.circular(10.w)),
38
+                border: Border.all(
39
+                    color: const Color(0xcc000000),
40
+                    width: 1.h,
41
+                    style: BorderStyle.solid)),
42
+            child: TextFormField(
43
+              minLines: 6,
44
+              maxLines: 6,
45
+              style: TextStyle(fontSize: 17.sp, height: 1.5),
46
+              decoration: const InputDecoration(
47
+                isCollapsed: true,
48
+                border: InputBorder.none,
49
+                counterText: '', //去掉计数
50
+                floatingLabelBehavior: FloatingLabelBehavior.never,
51
+              ),
52
+              onTap: () {
53
+                isEdit.value = true;
54
+              },
55
+              onChanged: (e) {
56
+                text.value = e;
57
+              },
58
+            ),
59
+          ),
60
+          Obx(
61
+            () => Visibility(
62
+              visible: !isEdit(),
63
+              child: Positioned(
64
+                left: 20.w,
65
+                top: 5.w,
66
+                child: Row(
67
+                  children: [
68
+                    Container(
69
+                      margin: EdgeInsets.only(right: 8.w),
70
+                      child: Image.asset(
71
+                        'images/main/edit.png',
72
+                        width: 15.w,
73
+                      ),
74
+                    ),
75
+                    Text(
76
+                      '请留下您宝贵的意见和建议!',
77
+                      style: TextStyle(
78
+                          fontSize: 17.sp,
79
+                          letterSpacing: 2,
80
+                          color: const Color(0xFFBEBDBD)),
81
+                    ),
82
+                  ],
83
+                ),
84
+              ),
85
+            ),
86
+          ),
87
+          Positioned(
88
+              bottom: 25.h,
89
+              child: MyButton(
90
+                  pwith: 30.w,
91
+                  text: '提交',
92
+                  type: 0,
93
+                  disable: false,
94
+                  onClick: () {
95
+                    submit();
96
+                  })),
97
+        ],
98
+      ),
99
+    );
100
+  }
101
+}

+ 8
- 0
lib/pages/index.dart Dosyayı Görüntüle

@@ -11,8 +11,16 @@ export 'machineryMap/index.dart';
11 11
 export 'bankList/index.dart';
12 12
 export 'addBankCard/index.dart';
13 13
 export 'userInfo/index.dart';
14
+<<<<<<< HEAD
14 15
 
15 16
 export 'wallet/index.dart';
16 17
 export 'withdrawal/index.dart';
17 18
 
18 19
 export 'aboutUs/index.dart';
20
+=======
21
+export 'wallet/index.dart';
22
+export 'withdrawal/index.dart';
23
+export 'aboutUs/index.dart';
24
+export 'agreement/index.dart';
25
+export 'feedback/index.dart';
26
+>>>>>>> 16c3f328b59414e6748e76464e2e3847d796bdd8

+ 10
- 2
lib/pages/main/index.dart Dosyayı Görüntüle

@@ -49,6 +49,12 @@ class Main extends BasicPage {
49 49
   void goAboutUs(){
50 50
     Get.toNamed('/aboutUs');
51 51
   }
52
+  void goAgreement(){
53
+    Get.toNamed('/agreement');
54
+  }
55
+  void goFeedback(){
56
+    Get.toNamed('/feedback');
57
+  }
52 58
 
53 59
   @override
54 60
   Widget builder(BuildContext context) {
@@ -293,7 +299,7 @@ class Main extends BasicPage {
293 299
                             'images/main/goto.png',
294 300
                             width: 10.w,
295 301
                           ),
296
-                          onClick: () {},
302
+                          onClick: () {goAgreement();},
297 303
                         ),
298 304
                         MyCell(
299 305
                           head: Image.asset(
@@ -311,7 +317,9 @@ class Main extends BasicPage {
311 317
                             'images/main/goto.png',
312 318
                             width: 10.w,
313 319
                           ),
314
-                          onClick: () {},
320
+                          onClick: () {
321
+                            goFeedback();
322
+                          },
315 323
                         ),
316 324
                         Container(
317 325
                             height: 45.5.h,

+ 5
- 0
lib/routes/pages.dart Dosyayı Görüntüle

@@ -25,4 +25,9 @@ List<GetPage> pages=[
25 25
   GetPage(name: '/wallet', page: () => MyWallet()),
26 26
   GetPage(name: '/withdrawal', page: () => MyWithdrawal()),
27 27
   GetPage(name: '/aboutUs', page: () => AboutUs()),
28
+<<<<<<< HEAD
29
+=======
30
+  GetPage(name: '/agreement', page: () => Agreement()),
31
+  GetPage(name: '/feedback', page: () => Feedback()),
32
+>>>>>>> 16c3f328b59414e6748e76464e2e3847d796bdd8
28 33
 ];

+ 55
- 0
lib/services/bank.dart Dosyayı Görüntüle

@@ -0,0 +1,55 @@
1
+import 'package:dio/dio.dart';
2
+import '../utils/Request.dart';
3
+import 'package:fluttertoast/fluttertoast.dart';
4
+
5
+/// 银行列表
6
+/// @param {*} data
7
+/// @returns
8
+Future getBankList(params) async {
9
+  return request('/bank',
10
+      options: Options(method: 'GET'), queryParameters: params)
11
+      .catchError((error) =>
12
+  {Fluttertoast.showToast(msg: error.error.toString()), print(error)});
13
+}
14
+/// 银行卡列表
15
+/// @param {*} data
16
+/// @returns
17
+Future getBankCardList(params) async {
18
+  return request('/bankcard',
19
+      options: Options(method: 'GET'), queryParameters: params)
20
+      .catchError((error) =>
21
+  {Fluttertoast.showToast(msg: error.error.toString()), print(error)});
22
+}
23
+/// 银行卡详情
24
+/// @param {*} data
25
+/// @returns
26
+Future getBankCardDetail(String id) async {
27
+  return request('/bankcard/$id', options: Options(method: 'GET'))
28
+      .catchError((error) => {
29
+    Fluttertoast.showToast(msg: error.error['message']),
30
+  });
31
+}
32
+
33
+/// 添加银行卡
34
+/// @param {*} data
35
+/// @returns
36
+Future addBankCard(data) async {
37
+  return request(
38
+    '/bankcard',
39
+    options: Options(method: 'POST'),
40
+    data: data,
41
+  ).catchError((error) => {
42
+    Fluttertoast.showToast(msg: error.error['message']),
43
+  });
44
+}
45
+
46
+/// 解绑银行卡
47
+/// @param {*}
48
+/// @returns
49
+Future unbindBankCard(String id) async {
50
+  return request('/bankcard/$id/pause',
51
+      options: Options(method: 'DELETE'))
52
+      .catchError((error) => {
53
+    Fluttertoast.showToast(msg: error.error['message']),
54
+  });
55
+}

+ 17
- 0
lib/services/feedback.dart Dosyayı Görüntüle

@@ -0,0 +1,17 @@
1
+import 'package:dio/dio.dart';
2
+import '../utils/Request.dart';
3
+import 'package:fluttertoast/fluttertoast.dart';
4
+
5
+/**
6
+ * 意见反馈
7
+ * @param {*} data
8
+ * @returns
9
+ */
10
+
11
+Future feedback(String content) async {
12
+  return request('/feedback',
13
+      options: Options(method: 'POST'), data: {'content': content})
14
+      .catchError((error) => {
15
+    Fluttertoast.showToast(msg: error.error['message']),
16
+  });
17
+}

+ 1
- 0
pubspec.yaml Dosyayı Görüntüle

@@ -77,6 +77,7 @@ flutter:
77 77
     - images/index/
78 78
     - images/main/
79 79
     - images/machinery/
80
+    - images/bank/
80 81
   # To add assets to your application, add an assets section, like this:
81 82
   # assets:
82 83
   #   - images/a_dot_burr.jpeg