account_page.dart
3.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
import 'package:one_poem/res/gaps.dart';
import 'package:one_poem/res/resources.dart';
import 'package:one_poem/routers/fluro_navigator.dart';
import 'package:one_poem/util/image_utils.dart';
import 'package:one_poem/widgets/click_item.dart';
import 'package:one_poem/widgets/my_app_bar.dart';
import 'package:one_poem/widgets/rise_number_text.dart';
import '../account_router.dart';
/// design/6店铺-账户/index.html#artboard2
class AccountPage extends StatefulWidget {
const AccountPage({Key? key}) : super(key: key);
@override
_AccountPageState createState() => _AccountPageState();
}
class _AccountPageState extends State<AccountPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: const MyAppBar(
centerTitle: '资金管理',
),
body: SingleChildScrollView(
child: Column(
children: <Widget>[
Gaps.vGap5,
_buildCard(),
Gaps.vGap5,
ClickItem(
title: '提现',
onTap: () => NavigatorUtils.push(context, AccountRouter.accountPage),//TODO
),
ClickItem(
title: '提现记录',
onTap: () => NavigatorUtils.push(context, AccountRouter.accountPage),//TODO
),
ClickItem(
title: '提现密码',
onTap: () => NavigatorUtils.push(context, AccountRouter.accountPage),//TODO
),
],
),
)
);
}
Widget _buildCard() {
return AspectRatio(
aspectRatio: 1.85,
child: Container(
margin: const EdgeInsets.symmetric(horizontal: 6.0),
padding: const EdgeInsets.all(6.0),
decoration: BoxDecoration(
image: DecorationImage(
image: ImageUtils.getAssetImage('account/bg'),
fit: BoxFit.fill,
),
),
child: Column(
children: <Widget>[
const _AccountMoney(
title: '当前余额(元)',
money: '30.12',
alignment: MainAxisAlignment.end,
moneyTextStyle: TextStyle(color: Colors.white, fontSize: 32.0, fontWeight: FontWeight.bold, fontFamily: 'RobotoThin'),
),
Expanded(
child: Row(
children: const <Widget>[
_AccountMoney(title: '累计结算金额', money: '20000'),
_AccountMoney(title: '累计发放佣金', money: '0.02'),
],
),
),
],
),
),
);
}
}
class _AccountMoney extends StatelessWidget {
const _AccountMoney({
Key? key,
required this.title,
required this.money,
this.alignment,
this.moneyTextStyle
}): super(key: key);
final String title;
final String money;
final MainAxisAlignment? alignment;
final TextStyle? moneyTextStyle;
@override
Widget build(BuildContext context) {
return Expanded(
child: MergeSemantics(
child: Column(
mainAxisAlignment: alignment ?? MainAxisAlignment.center,
children: <Widget>[
/// 横向撑开Column,扩大语义区域
const SizedBox(width: double.infinity),
Text(title, style: const TextStyle(color: Colours.text_disabled, fontSize: Dimens.font_sp12)),
Gaps.vGap8,
RiseNumberText(
NumUtil.getDoubleByValueStr(money) ?? 0,
style: moneyTextStyle ?? const TextStyle(
color: Colours.text_disabled,
fontSize: Dimens.font_sp14,
fontWeight: FontWeight.bold,
fontFamily: 'RobotoThin'
)
),
],
),
),
);
}
}