my_integral_page.dart
7.42 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/models/integral_model.dart';
import 'package:one_key/provider/my_model.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/utils/event_bus.dart';
import 'package:one_key/utils/utils.dart';
import 'package:one_key/widgets/MyDivider.dart';
import 'package:one_key/widgets/h_empty_view.dart';
import 'package:one_key/widgets/my_item.dart';
import 'package:one_key/widgets/round_button.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import 'package:provider/provider.dart';
class MyIntegralPage extends StatefulWidget {
final IntegralSunModel sunModel;
MyIntegralPage({Key key, this.sunModel}) : super(key: key);
@override
_MyIntegralPageState createState() => _MyIntegralPageState();
}
class _MyIntegralPageState extends State<MyIntegralPage> {
// MyModel myModel;
@override
void initState() {
super.initState();
Utils.changeStatusColor(color: MyColours.color_199095);
}
@override
Widget build(BuildContext context) {
// myModel = Provider.of<MyModel>(context, listen: true);
return Scaffold(
backgroundColor: MyColours.color_f5f5f5,
appBar: SystemAppBar(
'我的积分',
bgColor: MyColours.color_199095,
needWhite: true,
onTap: () {
EventBus().emit('changeStatusColor');
Navigator.of(context).pop();
},
),
body: Container(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Stack(
clipBehavior: Clip.none,
children: [
Container(
height: ScreenUtil().setWidth(145 * 2),
color: MyColours.color_199095,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
VEmptyView(40),
Container(
alignment: Alignment.center,
width: double.infinity,
height: ScreenUtil().setWidth(56 * 2),
child: Text(
widget.sunModel?.myIntegral != null
? widget.sunModel.myIntegral
: '0',
style: TextStyle(
fontSize: ScreenUtil().setSp(80),
color: MyColours.color_fefefe,
fontWeight: FontWeight.bold),
)),
Container(
alignment: Alignment.center,
width: double.infinity,
height: ScreenUtil().setWidth(20 * 2),
child: Text(
'当前积分',
style: TextStyle(
fontSize: ScreenUtil().setSp(28),
color: Color.fromRGBO(255, 255, 255, 0.6),
),
),
)
],
),
),
Positioned(
top: ScreenUtil().setWidth(145 * 2 - 18 * 2),
left: ScreenUtil().setWidth(20),
right: ScreenUtil().setWidth(20),
child: Column(children: [
Container(
padding: EdgeInsets.symmetric(
vertical: ScreenUtil().setWidth(20)),
// height: ScreenUtil().setWidth(205 * 2),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(40)),
color: Colors.white),
child: Column(
children: [
MyItem(
title: '已兑换积分',
content: widget.sunModel?.converted != null
? widget.sunModel.converted
: '0',
needRadius: true,
),
Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40)),
child: MyDivider(
double.infinity,
ScreenUtil().setWidth(2),
color: MyColours.color_f3f3f3,
)),
MyItem(
title: '累计积分',
content: widget.sunModel?.cumulative != null
? widget.sunModel.cumulative
: '0',
needRadius: true,
),
Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40)),
child: MyDivider(
double.infinity,
ScreenUtil().setWidth(2),
color: MyColours.color_f3f3f3,
)),
MyItem(
title: '待审核积分',
content: widget.sunModel?.reviewed != null
? widget.sunModel.reviewed
: '0',
needRadius: true,
)
],
),
),
VEmptyView(60),
RoundButton(
onPressed: () async {},
text: '兑换',
fontSize: 34,
isBold: false,
height: ScreenUtil().setWidth(84),
width: ScreenUtil().setWidth(155 * 2),
radius: ScreenUtil().setWidth(10),
),
VEmptyView(100),
Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40)),
child: Text(
'积分规则:\n1.每成功创建一个内部预订的预订安排微信发送给客户并且客户打开后,获得10积分;\n2.每个餐厅每天每个时段预订安排发送总量不能超过现有桌位数;\n3.同一顾客同一时段的订单,积分只给最早创建内部预订的经理;\n4.订单创建人转发的预订安排,才可获得积分,转发他人创建的订单无效。',
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_999999,
height: 1.3)))
])),
],
),
],
))));
}
}