Commit 6c2ac0c338a2cc8f77e8cad335917227c64c74e5

Authored by weixin_45529955
1 parent 14cbbf98

发放消费金输入框UI

@@ -55,7 +55,7 @@ class _GrantPageState extends State<GrantPage> { @@ -55,7 +55,7 @@ class _GrantPageState extends State<GrantPage> {
55 } 55 }
56 } 56 }
57 57
58 - _createConsumeQrcode(String amounts) async { 58 + _createConsumeQrcode(String amounts) async {
59 Map<String, String> pramas = { 59 Map<String, String> pramas = {
60 'sellerid': 60 'sellerid':
61 Provider.of<UserModel>(context, listen: false).user!.sellerid!, 61 Provider.of<UserModel>(context, listen: false).user!.sellerid!,
@@ -102,27 +102,35 @@ class _GrantPageState extends State<GrantPage> { @@ -102,27 +102,35 @@ class _GrantPageState extends State<GrantPage> {
102 onTap: () { 102 onTap: () {
103 //删除媒体 103 //删除媒体
104 104
105 - // 确认是否删除 105 + if (data.amount != null) {
  106 + // 确认是否删除
106 107
107 - //弹框确认是否删除  
108 - DialogUtil.cupertinoAlertDialog(context,  
109 - title: "",  
110 - content: "确定要将该发放金删除吗?",  
111 - rTitle: "确定", rCallback: () async {  
112 - Map<String, String?> pramas = {  
113 - 'id': data.id,  
114 - }; 108 + //弹框确认是否删除
  109 + DialogUtil.cupertinoAlertDialog(context,
  110 + title: "",
  111 + content: "确定要将该发放金删除吗?",
  112 + rTitle: "确定", rCallback: () async {
  113 + //接口删除
  114 + Map<String, String?> pramas = {
  115 + 'id': data.id,
  116 + };
115 117
116 - bool success = await financeProvider!  
117 - .delConsumeQrcode(context, pramas);  
118 - if (success) {  
119 - //删除成功,刷新页面 118 + bool success = await financeProvider!
  119 + .delConsumeQrcode(context, pramas);
  120 + if (success) {
  121 + //删除成功,刷新页面
120 122
121 - setState(() {  
122 - ladderSelectFree.removeAt(index);  
123 - });  
124 - }  
125 - }); 123 + setState(() {
  124 + ladderSelectFree.removeAt(index);
  125 + });
  126 + }
  127 + });
  128 + } else {
  129 + //本地删除数据
  130 + setState(() {
  131 + ladderSelectFree.removeAt(index);
  132 + });
  133 + }
126 }, 134 },
127 child: Padding( 135 child: Padding(
128 padding: EdgeInsets.only(top: w(8), bottom: w(8)), 136 padding: EdgeInsets.only(top: w(8), bottom: w(8)),
@@ -162,10 +170,12 @@ class _GrantPageState extends State<GrantPage> { @@ -162,10 +170,12 @@ class _GrantPageState extends State<GrantPage> {
162 style: TextStyle(color: MyColours.color_515151, fontSize: font(14)), 170 style: TextStyle(color: MyColours.color_515151, fontSize: font(14)),
163 ), 171 ),
164 HEmptyView(10), 172 HEmptyView(10),
165 - Container( 173 + Expanded(
  174 + child: Container(
166 width: w(54), 175 width: w(54),
167 height: w(26), 176 height: w(26),
168 alignment: Alignment.center, 177 alignment: Alignment.center,
  178 + // padding: EdgeInsets.symmetric(vertical: w(10)), // 增加边缘的点击区域
169 decoration: BoxDecoration( 179 decoration: BoxDecoration(
170 border: Border.all(color: MyColours.color_999999, width: w(1))), 180 border: Border.all(color: MyColours.color_999999, width: w(1))),
171 child: TextField( 181 child: TextField(
@@ -186,6 +196,7 @@ class _GrantPageState extends State<GrantPage> { @@ -186,6 +196,7 @@ class _GrantPageState extends State<GrantPage> {
186 ), 196 ),
187 focusNode: focusNodeGive, 197 focusNode: focusNodeGive,
188 decoration: InputDecoration( 198 decoration: InputDecoration(
  199 + contentPadding: EdgeInsets.zero,
189 isCollapsed: true, 200 isCollapsed: true,
190 border: OutlineInputBorder(borderSide: BorderSide.none), 201 border: OutlineInputBorder(borderSide: BorderSide.none),
191 hintText: '请输入数字', 202 hintText: '请输入数字',
@@ -205,7 +216,7 @@ class _GrantPageState extends State<GrantPage> { @@ -205,7 +216,7 @@ class _GrantPageState extends State<GrantPage> {
205 FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘 216 FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
206 }, 217 },
207 keyboardType: TextInputType.numberWithOptions()), 218 keyboardType: TextInputType.numberWithOptions()),
208 - ), 219 + )),
209 HEmptyView(10), 220 HEmptyView(10),
210 Text( 221 Text(
211 '元', 222 '元',
@@ -242,7 +242,7 @@ class FinanceProvider extends ChangeNotifier { @@ -242,7 +242,7 @@ class FinanceProvider extends ChangeNotifier {
242 context, Method.post, HttpUrl.create_consume_qrcode, 242 context, Method.post, HttpUrl.create_consume_qrcode,
243 data: params, showLoading: showLoading); 243 data: params, showLoading: showLoading);
244 if (baseResp.code == Constant.status_success) { 244 if (baseResp.code == Constant.status_success) {
245 - if (baseResp.data is String) { 245 + if (baseResp.data is List) {
246 if (needToast) { 246 if (needToast) {
247 Utils.showToast('创建成功'); 247 Utils.showToast('创建成功');
248 } 248 }