李志伟 3 anni fa
parent
commit
ebd14b003f

BIN
images/main/walletBgi.png Vedi File


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

@@ -11,7 +11,8 @@ export 'machineryMap/index.dart';
11 11
 export 'bankList/index.dart';
12 12
 export 'addBankCard/index.dart';
13 13
 export 'userInfo/index.dart';
14
+export 'wallet/index.dart';
15
+export 'withdrawal/index.dart';
14 16
 export 'aboutUs/index.dart';
15 17
 export 'agreement/index.dart';
16 18
 export 'feedback/index.dart';
17
-

+ 28
- 20
lib/pages/main/index.dart Vedi 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
   void goAboutUs(){
@@ -191,21 +193,26 @@ class Main extends BasicPage {
191 193
                             ],
192 194
                           ),
193 195
                         ),
194
-                        Column(
195
-                          mainAxisAlignment: MainAxisAlignment.center,
196
-                          children: [
197
-                            Image.asset(
198
-                              'images/main/wallet.png',
199
-                              width: 30.w,
200
-                            ),
201
-                            Text(
202
-                              '我的钱包',
203
-                              style: TextStyle(
204
-                                  fontSize: 17.sp,
205
-                                  fontWeight: FontWeight.bold,
206
-                                  color: Color(0xFF333333)),
207
-                            )
208
-                          ],
196
+                        GestureDetector(
197
+                          onTap: () {
198
+                            goWallet();
199
+                          },
200
+                          child: Column(
201
+                            mainAxisAlignment: MainAxisAlignment.center,
202
+                            children: [
203
+                              Image.asset(
204
+                                'images/main/wallet.png',
205
+                                width: 30.w,
206
+                              ),
207
+                              Text(
208
+                                '我的钱包',
209
+                                style: TextStyle(
210
+                                    fontSize: 17.sp,
211
+                                    fontWeight: FontWeight.bold,
212
+                                    color: Color(0xFF333333)),
213
+                              )
214
+                            ],
215
+                          ),
209 216
                         ),
210 217
                         GestureDetector(
211 218
                           onTap: () {
@@ -237,7 +244,6 @@ class Main extends BasicPage {
237 244
                         EdgeInsets.symmetric(horizontal: 15.w, vertical: 0),
238 245
                     child: Column(
239 246
                       children: [
240
-
241 247
                         MyCell(
242 248
                           head: Image.asset(
243 249
                             'images/main/account.png',
@@ -255,7 +261,9 @@ class Main extends BasicPage {
255 261
                             'images/main/goto.png',
256 262
                             width: 10.w,
257 263
                           ),
258
-                          onClick: () {goUserInfo();},
264
+                          onClick: () {
265
+                            goUserInfo();
266
+                          },
259 267
                         ),
260 268
                         MyCell(
261 269
                           head: Image.asset(

+ 76
- 0
lib/pages/wallet/index.dart Vedi 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
+}

+ 132
- 0
lib/pages/wallet/widget/money.dart Vedi File

@@ -0,0 +1,132 @@
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
+
65
+
66
+                    begin: Alignment.topCenter,
67
+                    end: Alignment.bottomCenter,
68
+                    colors: [
69
+                      Color(0xff37BC6A),
70
+                      Color(0xff127B39),
71
+                    ],
72
+                  ),
73
+                ),
74
+                child: Text(
75
+                  '提现',
76
+                  style: TextStyle(
77
+                    fontSize: 24.sp,
78
+                    color: Colors.white,
79
+                    fontWeight: FontWeight.bold,
80
+                  ),
81
+                ),
82
+              ),
83
+            )
84
+          ],
85
+        ),
86
+      );
87
+    } else {
88
+      return _initWidget();
89
+    }
90
+  }
91
+}
92
+
93
+class _initWidget extends StatelessWidget {
94
+  const _initWidget({Key? key}) : super(key: key);
95
+
96
+  @override
97
+  Widget build(BuildContext context) {
98
+    return Container(
99
+      width: 345.w,
100
+      height: 173.w,
101
+      padding: EdgeInsets.fromLTRB(40, 33, 0, 0),
102
+      alignment: Alignment.centerLeft,
103
+      decoration: BoxDecoration(
104
+        borderRadius: new BorderRadius.all(new Radius.circular(20.0)),
105
+        image: const DecorationImage(
106
+          image: AssetImage(
107
+            'images/main/walletBgi.png',
108
+          ),
109
+        ),
110
+      ),
111
+      child: Column(
112
+        children: [
113
+          Text(
114
+            '钱包余额(元)',
115
+            style: TextStyle(fontSize: 20.sp, color: Colors.white),
116
+          ),
117
+          Container(
118
+            margin: EdgeInsets.fromLTRB(0, 20, 0, 10),
119
+            child: Text(
120
+              (5 / 100).toString(),
121
+              style: TextStyle(
122
+                fontSize: 35.sp,
123
+                color: Colors.white,
124
+                fontWeight: FontWeight.bold,
125
+              ),
126
+            ),
127
+          ),
128
+        ],
129
+      ),
130
+    );
131
+  }
132
+}

+ 79
- 0
lib/pages/wallet/widget/moneyInfo.dart Vedi 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 Vedi 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 Vedi File

@@ -22,6 +22,8 @@ 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
   GetPage(name: '/aboutUs', page: () => AboutUs()),
26 28
   GetPage(name: '/agreement', page: () => Agreement()),
27 29
   GetPage(name: '/feedback', page: () => Feedback()),