feast_deposit_manage_page.dart
5.11 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
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:provider/provider.dart';
import '../../../provider/feast_model.dart';
import '../../../provider/user_model.dart';
import '../../../res/colors.dart';
import '../../../route/navigator_util.dart';
import '../../../utils/screen_util.dart';
import '../../../utils/utils.dart';
import '../../../widgets/h_empty_view.dart';
import '../../../widgets/system_app_bar.dart';
/**
*
* 定金设置
*/
class FeastDepositManagePage extends StatefulWidget {
FeastDepositManagePage({Key key}) : super(key: key);
@override
_FeastDepositManagePageState createState() => _FeastDepositManagePageState();
}
class _FeastDepositManagePageState extends State<FeastDepositManagePage> {
FeastModel feastModel;
@override
void initState() {
super.initState();
Utils.changeStatusColor(color: MyColours.color_438E93);
WidgetsBinding.instance.addPostFrameCallback((_) {
_getBanquetConf();
});
}
_getBanquetConf() async {
await feastModel.getBanquetConf(context);
}
Widget feastManegeItem(String title, {GestureTapCallback onTap}) {
return InkWell(
onTap: onTap,
child: Container(
height: h(48),
margin: EdgeInsets.only(top: w(12)),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: w(0.5), color: MyColours.color_E7E7E7))),
child: Row(
children: [
Text(
title,
style: TextStyle(
fontSize: font(16), color: MyColours.color_E5000000),
),
Spacer(),
Text(
'修改/添加',
style: TextStyle(
fontSize: font(16), color: MyColours.color_66000000),
),
HEmptyView(22),
Image.asset(
"assets/arrow_right_new.png",
width: ScreenUtil().setWidth(9 * 2),
height: ScreenUtil().setWidth(16 * 2),
),
HEmptyView(48),
],
),
));
}
@override
Widget build(BuildContext context) {
feastModel = Provider.of<FeastModel>(context);
return Scaffold(
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar(
'定金设置',
needWhite: true,
bgColor: MyColours.color_438E93,
titleColor: MyColours.color_F6F6F6,
onTap: () {
Navigator.pop(context);
},
),
body: Padding(
padding: EdgeInsets.only(left: w(16)),
child: Column(
children: [
feastManegeItem('定金类型', onTap: () {
NavigatorUtil.goFeastDepositTypePage(context);
}),
Container(
height: w(48),
margin: EdgeInsets.only(top: w(12)),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: h(0.5), color: MyColours.color_E7E7E7))),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
width: w(81),
height: w(48),
alignment: Alignment.centerLeft,
child: Text(
'是否可退',
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_E5000000),
),
),
Spacer(),
InkWell(
onTap: () async {
setState(() {
feastModel.isDepositBack =
!feastModel.isDepositBack;
});
Map<String, String> pramas = {
'sid':
Provider.of<UserModel>(context, listen: false)
.user
.sellerid,
'is_deposit_back':
feastModel.isDepositBack ? '1' : '0'
};
await feastModel.setBanquetConf(context, pramas);
},
child: Container(
padding:
EdgeInsets.only(left: w(16), right: w(16)),
child: Image.asset(
Utils.getImgPath(feastModel.isDepositBack
? 'swich_on'
: 'swich_off'),
width: w(44),
))),
],
),
),
],
)));
}
}