[baozhangchao] 3 years ago
parent
commit
c5408fb225

BIN
images/main/walletBgi.png View File


+ 2
- 1
lib/pages/index.dart View File

@@ -11,4 +11,5 @@ export 'machineryMap/index.dart';
11 11
 export 'bankList/index.dart';
12 12
 export 'addBankCard/index.dart';
13 13
 export 'userInfo/index.dart';
14
-
14
+export 'wallet/index.dart';
15
+export 'withdrawal/index.dart';

+ 28
- 20
lib/pages/main/index.dart View File

@@ -34,14 +34,16 @@ class Main extends BasicPage {
34 34
 
35 35
   void goWallet() {
36 36
     //钱包页面
37
-    // Get.toNamed('/bankList');
37
+    Get.toNamed('/wallet');
38 38
   }
39
+
39 40
   void goBankPage() {
40 41
     // if (store.user().isOrgManager==true) {
41
-      Get.toNamed('/bankList');
42
+    Get.toNamed('/bankList');
42 43
     // }
43 44
   }
44
-  void goUserInfo(){
45
+
46
+  void goUserInfo() {
45 47
     Get.toNamed('/userInfo');
46 48
   }
47 49
 
@@ -182,21 +184,26 @@ class Main extends BasicPage {
182 184
                             ],
183 185
                           ),
184 186
                         ),
185
-                        Column(
186
-                          mainAxisAlignment: MainAxisAlignment.center,
187
-                          children: [
188
-                            Image.asset(
189
-                              'images/main/wallet.png',
190
-                              width: 30.w,
191
-                            ),
192
-                            Text(
193
-                              '我的钱包',
194
-                              style: TextStyle(
195
-                                  fontSize: 17.sp,
196
-                                  fontWeight: FontWeight.bold,
197
-                                  color: Color(0xFF333333)),
198
-                            )
199
-                          ],
187
+                        GestureDetector(
188
+                          onTap: () {
189
+                            goWallet();
190
+                          },
191
+                          child: Column(
192
+                            mainAxisAlignment: MainAxisAlignment.center,
193
+                            children: [
194
+                              Image.asset(
195
+                                'images/main/wallet.png',
196
+                                width: 30.w,
197
+                              ),
198
+                              Text(
199
+                                '我的钱包',
200
+                                style: TextStyle(
201
+                                    fontSize: 17.sp,
202
+                                    fontWeight: FontWeight.bold,
203
+                                    color: Color(0xFF333333)),
204
+                              )
205
+                            ],
206
+                          ),
200 207
                         ),
201 208
                         GestureDetector(
202 209
                           onTap: () {
@@ -228,7 +235,6 @@ class Main extends BasicPage {
228 235
                         EdgeInsets.symmetric(horizontal: 15.w, vertical: 0),
229 236
                     child: Column(
230 237
                       children: [
231
-
232 238
                         MyCell(
233 239
                           head: Image.asset(
234 240
                             'images/main/account.png',
@@ -246,7 +252,9 @@ class Main extends BasicPage {
246 252
                             'images/main/goto.png',
247 253
                             width: 10.w,
248 254
                           ),
249
-                          onClick: () {goUserInfo();},
255
+                          onClick: () {
256
+                            goUserInfo();
257
+                          },
250 258
                         ),
251 259
                         MyCell(
252 260
                           head: Image.asset(

+ 76
- 0
lib/pages/wallet/index.dart View File

@@ -0,0 +1,76 @@
1
+import 'package:flutter/material.dart';
2
+import 'package:flutter_screenutil/flutter_screenutil.dart';
3
+import 'package:get/get.dart';
4
+import 'package:worker_client/pages/wallet/widget/money.dart';
5
+import 'package:worker_client/pages/wallet/widget/moneyInfo.dart';
6
+
7
+import '../../widgets/layout/BasicPage.dart';
8
+
9
+class MyWallet extends BasicPage {
10
+  MyWallet({Key? key}) : super(key: key) {
11
+    naviTitle = '我的钱包';
12
+  }
13
+
14
+  @override
15
+  Widget builder(BuildContext context) {
16
+    return ListView(
17
+      children: [
18
+        Container(
19
+          alignment: Alignment.center,
20
+          child: Column(
21
+            children: [
22
+              MoneyCard(),
23
+              Container(
24
+                  alignment: Alignment.center,
25
+                  width: 345.w,
26
+                  margin: EdgeInsets.fromLTRB(0, 15.w, 0, 15.w),
27
+                  decoration: BoxDecoration(
28
+                    borderRadius: BorderRadius.circular(10),
29
+                    color: Colors.white,
30
+                  ),
31
+                  child: Column(
32
+                    children: [
33
+                      Container(
34
+                          margin: EdgeInsets.fromLTRB(0, 30.w, 0, 20.w),
35
+                          alignment: Alignment.topLeft,
36
+                          decoration: const BoxDecoration(
37
+                              border: Border(
38
+                                  left: BorderSide(
39
+                                      width: 5, color: Color(0xff000000)
40
+                                      // 0x17000000
41
+                                      ))),
42
+                          child: Padding(
43
+                            padding: EdgeInsets.fromLTRB(13.w, 0, 0, 0),
44
+                            child: Text(
45
+                              '零钱明细',
46
+                              style: TextStyle(
47
+                                color: Color(0xff333333),
48
+                                fontWeight: FontWeight.bold,
49
+                                fontSize: 17,
50
+                              ),
51
+                            ),
52
+                          )),
53
+                      MoneyInfoCard(),
54
+                      MoneyInfoCard(),
55
+                      MoneyInfoCard(),
56
+                      MoneyInfoCard(),
57
+                      MoneyInfoCard(),
58
+                      MoneyInfoCard(),
59
+                      MoneyInfoCard(),
60
+                      MoneyInfoCard(),
61
+                      MoneyInfoCard(),
62
+                      MoneyInfoCard(),
63
+                      MoneyInfoCard(),
64
+                      MoneyInfoCard(),
65
+                      MoneyInfoCard(),
66
+                      MoneyInfoCard(),
67
+                      MoneyInfoCard(),
68
+                    ],
69
+                  )),
70
+            ],
71
+          ),
72
+        ),
73
+      ],
74
+    );
75
+  }
76
+}

+ 130
- 0
lib/pages/wallet/widget/money.dart View File

@@ -0,0 +1,130 @@
1
+import 'package:flutter/material.dart';
2
+import 'package:flutter_screenutil/flutter_screenutil.dart';
3
+import 'package:get/get.dart';
4
+import 'package:get/get_core/src/get_main.dart';
5
+
6
+class MoneyCard extends StatefulWidget {
7
+  final bool type;
8
+  const MoneyCard({Key? key, this.type = false}) : super(key: key);
9
+
10
+  @override
11
+  State<MoneyCard> createState() => _MoneyCardState();
12
+}
13
+
14
+class _MoneyCardState extends State<MoneyCard> {
15
+  void _goWithdrawPage() {
16
+    print('asdasdsad');
17
+    Get.toNamed('/withdrawal');
18
+  }
19
+
20
+  @override
21
+  Widget build(BuildContext context) {
22
+    if (!widget.type) {
23
+      return Container(
24
+        width: 345.w,
25
+        height: 173.w,
26
+        padding: EdgeInsets.fromLTRB(40, 33, 0, 0),
27
+        alignment: Alignment.centerLeft,
28
+        decoration: BoxDecoration(
29
+          borderRadius: new BorderRadius.all(new Radius.circular(20.0)),
30
+          image: const DecorationImage(
31
+            image: AssetImage(
32
+              'images/main/walletBgi.png',
33
+            ),
34
+          ),
35
+        ),
36
+        child: Column(
37
+          children: [
38
+            Text(
39
+              '钱包余额(元)',
40
+              style: TextStyle(fontSize: 20.sp, color: Colors.white),
41
+            ),
42
+            Container(
43
+              margin: EdgeInsets.fromLTRB(0, 20, 0, 10),
44
+              child: Text(
45
+                (5 / 100).toString(),
46
+                style: TextStyle(
47
+                  fontSize: 35.sp,
48
+                  color: Colors.white,
49
+                  fontWeight: FontWeight.bold,
50
+                ),
51
+              ),
52
+            ),
53
+            GestureDetector(
54
+              onTap: () {
55
+                _goWithdrawPage();
56
+              },
57
+              child: Container(
58
+                alignment: Alignment.center,
59
+                width: 70.w,
60
+                height: 34.w,
61
+                decoration: BoxDecoration(
62
+                  borderRadius: BorderRadius.circular(20),
63
+                  gradient: LinearGradient(
64
+                    begin: Alignment.topCenter,
65
+                    end: Alignment.bottomCenter,
66
+                    colors: [
67
+                      Color(0xff37BC6A),
68
+                      Color(0xff127B39),
69
+                    ],
70
+                  ),
71
+                ),
72
+                child: Text(
73
+                  '提现',
74
+                  style: TextStyle(
75
+                    fontSize: 24.sp,
76
+                    color: Colors.white,
77
+                    fontWeight: FontWeight.bold,
78
+                  ),
79
+                ),
80
+              ),
81
+            )
82
+          ],
83
+        ),
84
+      );
85
+    } else {
86
+      return _initWidget();
87
+    }
88
+  }
89
+}
90
+
91
+class _initWidget extends StatelessWidget {
92
+  const _initWidget({Key? key}) : super(key: key);
93
+
94
+  @override
95
+  Widget build(BuildContext context) {
96
+    return Container(
97
+      width: 345.w,
98
+      height: 173.w,
99
+      padding: EdgeInsets.fromLTRB(40, 33, 0, 0),
100
+      alignment: Alignment.centerLeft,
101
+      decoration: BoxDecoration(
102
+        borderRadius: new BorderRadius.all(new Radius.circular(20.0)),
103
+        image: const DecorationImage(
104
+          image: AssetImage(
105
+            'images/main/walletBgi.png',
106
+          ),
107
+        ),
108
+      ),
109
+      child: Column(
110
+        children: [
111
+          Text(
112
+            '钱包余额(元)',
113
+            style: TextStyle(fontSize: 20.sp, color: Colors.white),
114
+          ),
115
+          Container(
116
+            margin: EdgeInsets.fromLTRB(0, 20, 0, 10),
117
+            child: Text(
118
+              (5 / 100).toString(),
119
+              style: TextStyle(
120
+                fontSize: 35.sp,
121
+                color: Colors.white,
122
+                fontWeight: FontWeight.bold,
123
+              ),
124
+            ),
125
+          ),
126
+        ],
127
+      ),
128
+    );
129
+  }
130
+}

+ 79
- 0
lib/pages/wallet/widget/moneyInfo.dart View File

@@ -0,0 +1,79 @@
1
+import 'package:flutter/cupertino.dart';
2
+import 'package:flutter/material.dart';
3
+import 'package:flutter_screenutil/flutter_screenutil.dart';
4
+
5
+class MoneyInfoCard extends StatelessWidget {
6
+  const MoneyInfoCard({Key? key}) : super(key: key);
7
+
8
+  @override
9
+  Widget build(BuildContext context) {
10
+    return Container(
11
+      alignment: Alignment.topLeft,
12
+      padding: EdgeInsets.fromLTRB(15, 10, 15, 10),
13
+      decoration: const BoxDecoration(
14
+          border: Border(
15
+              bottom: BorderSide(width: 1, color: Color(0x20000000)
16
+                  // 0x17000000
17
+                  ))),
18
+      child: Row(
19
+        mainAxisAlignment: MainAxisAlignment.spaceBetween,
20
+        children: [
21
+          Column(
22
+            mainAxisAlignment: MainAxisAlignment.center,
23
+            //交叉轴方向从起点开始,默认为center
24
+            crossAxisAlignment: CrossAxisAlignment.start,
25
+            children: [
26
+              Container(
27
+                alignment: Alignment.topLeft,
28
+                child: Text(
29
+                  '订单收入',
30
+                  textAlign: TextAlign.left,
31
+                  style: TextStyle(
32
+                    fontWeight: FontWeight.w500,
33
+                    fontSize: 17,
34
+                  ),
35
+                ),
36
+              ),
37
+              Padding(
38
+                padding: EdgeInsets.fromLTRB(0, 8, 0, 5),
39
+                child: Text('2022-05-01 16:66',
40
+                    style: TextStyle(fontSize: 15, color: Color(0xff666666))),
41
+              ),
42
+            ],
43
+          ),
44
+          RichText(
45
+            text: TextSpan(children: <InlineSpan>[
46
+              const TextSpan(
47
+                  text: '+',
48
+                  style: TextStyle(
49
+                      color: Color(
50
+                        0xffFF3F3F,
51
+                      ),
52
+                      fontSize: 22,
53
+                      fontWeight: FontWeight.bold)),
54
+              TextSpan(
55
+                  text: (2559 / 100).toString(),
56
+                  style: TextStyle(
57
+                      color: Color(
58
+                        0xffFF3F3F,
59
+                      ),
60
+                      fontSize: 22,
61
+                      fontWeight: FontWeight.bold)),
62
+            ]),
63
+          ),
64
+
65
+          // RichText(
66
+          //   text: TextSpan(children: <InlineSpan>[
67
+          //     const TextSpan(
68
+          //         text: '-',
69
+          //         style: TextStyle(color: Color(0xff00AE3A,),fontSize: 15,fontWeight: FontWeight.bold)),
70
+          //     TextSpan(
71
+          //         text: (5500/100).toString(),
72
+          //         style: TextStyle(color: Color(0xff00AE3A,),fontSize: 15,fontWeight: FontWeight.bold)),
73
+          //   ]),
74
+          // ),
75
+        ],
76
+      ),
77
+    );
78
+  }
79
+}

+ 30
- 0
lib/pages/withdrawal/index.dart View File

@@ -0,0 +1,30 @@
1
+
2
+import 'package:flutter/material.dart';
3
+import 'package:flutter_screenutil/flutter_screenutil.dart';
4
+import 'package:get/get.dart';
5
+import 'package:worker_client/pages/wallet/widget/money.dart';
6
+import 'package:worker_client/pages/wallet/widget/moneyInfo.dart';
7
+
8
+import '../../widgets/layout/BasicPage.dart';
9
+
10
+
11
+class MyWithdrawal extends BasicPage {
12
+  MyWithdrawal({Key? key}) : super(key: key) {
13
+    naviTitle = '我的钱包';
14
+  }
15
+
16
+
17
+  @override
18
+  Widget builder(BuildContext context) {
19
+    return
20
+        Container(
21
+          alignment: Alignment.center,
22
+          child: Column(
23
+            children: [
24
+              Text('sdsd'),
25
+
26
+            ],
27
+          ),
28
+    );
29
+  }
30
+}

+ 2
- 0
lib/routes/pages.dart View File

@@ -22,4 +22,6 @@ List<GetPage> pages=[
22 22
   GetPage(name: '/bankList', page: () => BankListPages()),
23 23
   GetPage(name: '/addBankCard', page: () => AddBankPage()),
24 24
   GetPage(name: '/userInfo', page: () => UserInfo()),
25
+  GetPage(name: '/wallet', page: () => MyWallet()),
26
+  GetPage(name: '/withdrawal', page: () => MyWithdrawal()),
25 27
 ];