Showing
4 changed files
with
396 additions
and
320 deletions
assets/close1.png
0 → 100644
3.06 KB
| @@ -104,233 +104,283 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | @@ -104,233 +104,283 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | ||
| 104 | Widget build(BuildContext context) { | 104 | Widget build(BuildContext context) { |
| 105 | myModel = Provider.of<MyModel>(context, listen: true); | 105 | myModel = Provider.of<MyModel>(context, listen: true); |
| 106 | return Scaffold( | 106 | return Scaffold( |
| 107 | - appBar: AppBar( | ||
| 108 | - backgroundColor: MyColours.color_199095, //把appbar的背景色改成透明 | ||
| 109 | - elevation: 0, //appbar的阴影 | ||
| 110 | - centerTitle: true, // 标题居中 | ||
| 111 | - title: Text( | ||
| 112 | - '我的', | ||
| 113 | - style: TextStyle( | ||
| 114 | - color: MyColours.color_fefefe, | ||
| 115 | - fontSize: ScreenUtil().setSp(34), | ||
| 116 | - fontWeight: FontWeight.normal, | ||
| 117 | - decoration: TextDecoration.none), | ||
| 118 | - )), | ||
| 119 | - body: Consumer<UserModel>( | ||
| 120 | - builder: (BuildContext context, UserModel model, Widget child) { | ||
| 121 | - return MediaQuery.removePadding( | ||
| 122 | - context: context, | ||
| 123 | - child: SingleChildScrollView( | ||
| 124 | - child: Column( | ||
| 125 | - children: <Widget>[ | ||
| 126 | - Stack( | ||
| 127 | - children: [ | ||
| 128 | - Container( | ||
| 129 | - width: double.infinity, | ||
| 130 | - height: ScreenUtil().setHeight(200), | ||
| 131 | - alignment: Alignment.centerLeft, | ||
| 132 | - color: MyColours.color_199095, | ||
| 133 | - ), | ||
| 134 | - Padding( | ||
| 135 | - padding: | ||
| 136 | - EdgeInsets.only(left: ScreenUtil().setWidth(40)), | ||
| 137 | - child: Column( | ||
| 138 | - crossAxisAlignment: CrossAxisAlignment.start, | ||
| 139 | - children: [ | ||
| 140 | - VEmptyView(38), | ||
| 141 | - Text( | ||
| 142 | - model.user.sellername, | ||
| 143 | - style: TextStyle( | ||
| 144 | - color: MyColours.color_ffffff, | ||
| 145 | - fontSize: ScreenUtil().setSp(36)), | ||
| 146 | - ), | ||
| 147 | - VEmptyView(38), | ||
| 148 | - Text( | ||
| 149 | - model.user.account + | ||
| 150 | - " | " + | ||
| 151 | - model.user.role_name, | ||
| 152 | - style: TextStyle( | ||
| 153 | - color: MyColours.color_ffffff, | ||
| 154 | - fontSize: ScreenUtil().setSp(30)), | ||
| 155 | - ), | ||
| 156 | - ], | ||
| 157 | - )) | ||
| 158 | - ], | ||
| 159 | - ), | ||
| 160 | - VEmptyView(40), | ||
| 161 | - MyItem( | ||
| 162 | - title: "短信管理", | ||
| 163 | - content: myModel.smsInfo.isNotEmpty | ||
| 164 | - ? '剩余${myModel.smsInfo}条' | ||
| 165 | - : '', | ||
| 166 | - callback: () { | ||
| 167 | - Utils.goMiniProgramZm(context, "setting/sms"); | ||
| 168 | - }, | ||
| 169 | - ), | ||
| 170 | - MyDivider( | ||
| 171 | - double.infinity, | ||
| 172 | - ScreenUtil().setHeight(1), | ||
| 173 | - color: MyColours.color_f3f3f3, | ||
| 174 | - ), | ||
| 175 | - MyItem( | ||
| 176 | - title: "包间类型置满管理", | ||
| 177 | - content: "", | ||
| 178 | - callback: () { | ||
| 179 | - Utils.goMiniProgramZm(context, "roomtype/roomtype"); | ||
| 180 | - }, | ||
| 181 | - ), | ||
| 182 | - MyDivider( | ||
| 183 | - double.infinity, | ||
| 184 | - ScreenUtil().setHeight(1), | ||
| 185 | - color: MyColours.color_f3f3f3, | ||
| 186 | - ), | ||
| 187 | - MyItem( | ||
| 188 | - title: "可订时段管理", | ||
| 189 | - content: "", | ||
| 190 | - callback: () { | ||
| 191 | - NavigatorUtil.goBookTimeSetPage(context); | ||
| 192 | - }, | ||
| 193 | - ), | ||
| 194 | - MyDivider( | ||
| 195 | - double.infinity, | ||
| 196 | - ScreenUtil().setHeight(1), | ||
| 197 | - color: MyColours.color_f3f3f3, | ||
| 198 | - ), | ||
| 199 | - MyItem( | ||
| 200 | - title: "接单时间管理", | ||
| 201 | - content: "", | ||
| 202 | - callback: () { | ||
| 203 | - NavigatorUtil.goReceiveOrdersTimeSetPage(context); | ||
| 204 | - }, | ||
| 205 | - ), | ||
| 206 | - MyDivider( | ||
| 207 | - double.infinity, | ||
| 208 | - ScreenUtil().setHeight(1), | ||
| 209 | - color: MyColours.color_f3f3f3, | ||
| 210 | - ), | ||
| 211 | - MyItem( | ||
| 212 | - title: "常用备注管理", | ||
| 213 | - content: "", | ||
| 214 | - callback: () { | ||
| 215 | - NavigatorUtil.goRemarkManagerPage(context); | ||
| 216 | - }, | ||
| 217 | - ), | ||
| 218 | - VEmptyView(40), | ||
| 219 | - MyItem( | ||
| 220 | - title: "联系客服", | ||
| 221 | - content: "09:00~21:00", | ||
| 222 | - callback: () { | ||
| 223 | - Utils.goPhone("400-000-9690"); | ||
| 224 | - }, | ||
| 225 | - ), | ||
| 226 | - MyDivider( | ||
| 227 | - double.infinity, | ||
| 228 | - ScreenUtil().setHeight(1), | ||
| 229 | - color: MyColours.color_f3f3f3, | ||
| 230 | - ), | ||
| 231 | - MyItem( | ||
| 232 | - title: "帮助与反馈", | ||
| 233 | - content: "", | ||
| 234 | - callback: () { | ||
| 235 | - Utils.goHelp(context); | ||
| 236 | - }, | ||
| 237 | - ), | ||
| 238 | - MyDivider(double.infinity, ScreenUtil().setHeight(1), | ||
| 239 | - color: MyColours.color_f3f3f3), | ||
| 240 | - GestureDetector( | ||
| 241 | - onTap: checkUpdate, | ||
| 242 | - child: Container( | 107 | + appBar: AppBar( |
| 108 | + backgroundColor: MyColours.color_199095, //把appbar的背景色改成透明 | ||
| 109 | + elevation: 0, //appbar的阴影 | ||
| 110 | + centerTitle: true, // 标题居中 | ||
| 111 | + title: Text( | ||
| 112 | + '我的', | ||
| 113 | + style: TextStyle( | ||
| 114 | + color: MyColours.color_fefefe, | ||
| 115 | + fontSize: ScreenUtil().setSp(34), | ||
| 116 | + fontWeight: FontWeight.normal, | ||
| 117 | + decoration: TextDecoration.none), | ||
| 118 | + )), | ||
| 119 | + body: NestedScrollView( | ||
| 120 | + // controller: _scrollViewController, | ||
| 121 | + headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) { | ||
| 122 | + return <Widget>[ | ||
| 123 | + SliverAppBar( | ||
| 124 | + pinned: false, | ||
| 125 | + floating: false, | ||
| 126 | + expandedHeight: ScreenUtil().setWidth(200), | ||
| 127 | + flexibleSpace: FlexibleSpaceBar( | ||
| 128 | + collapseMode: CollapseMode.pin, | ||
| 129 | + background: Consumer<UserModel>(builder: | ||
| 130 | + (BuildContext context, UserModel model, Widget child) { | ||
| 131 | + return Stack( | ||
| 132 | + children: [ | ||
| 133 | + Container( | ||
| 243 | width: double.infinity, | 134 | width: double.infinity, |
| 244 | - height: ScreenUtil().setHeight(122), | ||
| 245 | - color: MyColours.color_ffffff, | ||
| 246 | - padding: EdgeInsets.symmetric( | ||
| 247 | - horizontal: ScreenUtil().setWidth(40)), | ||
| 248 | - alignment: Alignment.center, | ||
| 249 | - child: Row( | ||
| 250 | - children: <Widget>[ | ||
| 251 | - Text( | ||
| 252 | - "版本更新", | ||
| 253 | - style: TextStyle( | ||
| 254 | - fontSize: ScreenUtil().setSp(30), | ||
| 255 | - color: MyColours.color_353535), | ||
| 256 | - ), | ||
| 257 | - Spacer(), | ||
| 258 | - newVersion | ||
| 259 | - ? Container( | ||
| 260 | - width: ScreenUtil().setWidth(120), | ||
| 261 | - height: ScreenUtil().setWidth(34), | ||
| 262 | - decoration: BoxDecoration( | ||
| 263 | - color: MyColours.color_E14553, | ||
| 264 | - borderRadius: BorderRadius.all( | ||
| 265 | - Radius.circular( | ||
| 266 | - ScreenUtil().setWidth(6))), | ||
| 267 | - ), | ||
| 268 | - child: Center( | ||
| 269 | - child: Text( | ||
| 270 | - "发现新版本", | ||
| 271 | - style: TextStyle( | ||
| 272 | - fontSize: ScreenUtil().setSp(24), | ||
| 273 | - color: MyColours.color_ffffff), | ||
| 274 | - ), | 135 | + height: ScreenUtil().setHeight(200), |
| 136 | + alignment: Alignment.centerLeft, | ||
| 137 | + color: MyColours.color_199095, | ||
| 138 | + ), | ||
| 139 | + Padding( | ||
| 140 | + padding: | ||
| 141 | + EdgeInsets.only(left: ScreenUtil().setWidth(40)), | ||
| 142 | + child: Column( | ||
| 143 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 144 | + children: [ | ||
| 145 | + VEmptyView(38), | ||
| 146 | + Text( | ||
| 147 | + model.user.sellername, | ||
| 148 | + style: TextStyle( | ||
| 149 | + color: MyColours.color_ffffff, | ||
| 150 | + fontSize: ScreenUtil().setSp(36)), | ||
| 151 | + ), | ||
| 152 | + VEmptyView(38), | ||
| 153 | + Text( | ||
| 154 | + model.user.account + | ||
| 155 | + " | " + | ||
| 156 | + model.user.role_name, | ||
| 157 | + style: TextStyle( | ||
| 158 | + color: MyColours.color_ffffff, | ||
| 159 | + fontSize: ScreenUtil().setSp(30)), | ||
| 160 | + ), | ||
| 161 | + ], | ||
| 162 | + )) | ||
| 163 | + ], | ||
| 164 | + ); | ||
| 165 | + }), | ||
| 166 | + ), | ||
| 167 | + ) | ||
| 168 | + ]; | ||
| 169 | + }, body: Consumer<UserModel>( | ||
| 170 | + builder: (BuildContext context, UserModel model, Widget child) { | ||
| 171 | + return MediaQuery.removePadding( | ||
| 172 | + context: context, | ||
| 173 | + child: SingleChildScrollView( | ||
| 174 | + child: Column( | ||
| 175 | + children: <Widget>[ | ||
| 176 | + // Stack( | ||
| 177 | + // children: [ | ||
| 178 | + // Container( | ||
| 179 | + // width: double.infinity, | ||
| 180 | + // height: ScreenUtil().setHeight(200), | ||
| 181 | + // alignment: Alignment.centerLeft, | ||
| 182 | + // color: MyColours.color_199095, | ||
| 183 | + // ), | ||
| 184 | + // Padding( | ||
| 185 | + // padding: | ||
| 186 | + // EdgeInsets.only(left: ScreenUtil().setWidth(40)), | ||
| 187 | + // child: Column( | ||
| 188 | + // crossAxisAlignment: CrossAxisAlignment.start, | ||
| 189 | + // children: [ | ||
| 190 | + // VEmptyView(38), | ||
| 191 | + // Text( | ||
| 192 | + // model.user.sellername, | ||
| 193 | + // style: TextStyle( | ||
| 194 | + // color: MyColours.color_ffffff, | ||
| 195 | + // fontSize: ScreenUtil().setSp(36)), | ||
| 196 | + // ), | ||
| 197 | + // VEmptyView(38), | ||
| 198 | + // Text( | ||
| 199 | + // model.user.account + | ||
| 200 | + // " | " + | ||
| 201 | + // model.user.role_name, | ||
| 202 | + // style: TextStyle( | ||
| 203 | + // color: MyColours.color_ffffff, | ||
| 204 | + // fontSize: ScreenUtil().setSp(30)), | ||
| 205 | + // ), | ||
| 206 | + // ], | ||
| 207 | + // )) | ||
| 208 | + // ], | ||
| 209 | + // ), | ||
| 210 | + VEmptyView(40), | ||
| 211 | + MyItem( | ||
| 212 | + title: "短信管理", | ||
| 213 | + content: | ||
| 214 | + myModel.smsInfo.isNotEmpty ? '剩余${myModel.smsInfo}条' : '', | ||
| 215 | + callback: () { | ||
| 216 | + Utils.goMiniProgramZm(context, "setting/sms"); | ||
| 217 | + }, | ||
| 218 | + ), | ||
| 219 | + MyDivider( | ||
| 220 | + double.infinity, | ||
| 221 | + ScreenUtil().setHeight(1), | ||
| 222 | + color: MyColours.color_f3f3f3, | ||
| 223 | + ), | ||
| 224 | + MyItem( | ||
| 225 | + title: "包间类型置满管理", | ||
| 226 | + content: "", | ||
| 227 | + callback: () { | ||
| 228 | + Utils.goMiniProgramZm(context, "roomtype/roomtype"); | ||
| 229 | + }, | ||
| 230 | + ), | ||
| 231 | + MyDivider( | ||
| 232 | + double.infinity, | ||
| 233 | + ScreenUtil().setHeight(1), | ||
| 234 | + color: MyColours.color_f3f3f3, | ||
| 235 | + ), | ||
| 236 | + MyItem( | ||
| 237 | + title: "可订时段管理", | ||
| 238 | + content: "", | ||
| 239 | + callback: () { | ||
| 240 | + NavigatorUtil.goBookTimeSetPage(context); | ||
| 241 | + }, | ||
| 242 | + ), | ||
| 243 | + MyDivider( | ||
| 244 | + double.infinity, | ||
| 245 | + ScreenUtil().setHeight(1), | ||
| 246 | + color: MyColours.color_f3f3f3, | ||
| 247 | + ), | ||
| 248 | + MyItem( | ||
| 249 | + title: "接单时间管理", | ||
| 250 | + content: "", | ||
| 251 | + callback: () { | ||
| 252 | + NavigatorUtil.goReceiveOrdersTimeSetPage(context); | ||
| 253 | + }, | ||
| 254 | + ), | ||
| 255 | + MyDivider( | ||
| 256 | + double.infinity, | ||
| 257 | + ScreenUtil().setHeight(1), | ||
| 258 | + color: MyColours.color_f3f3f3, | ||
| 259 | + ), | ||
| 260 | + MyItem( | ||
| 261 | + title: "常用备注管理", | ||
| 262 | + content: "", | ||
| 263 | + callback: () { | ||
| 264 | + NavigatorUtil.goRemarkManagerPage(context); | ||
| 265 | + }, | ||
| 266 | + ), | ||
| 267 | + VEmptyView(40), | ||
| 268 | + MyItem( | ||
| 269 | + title: "联系客服", | ||
| 270 | + content: "09:00~21:00", | ||
| 271 | + callback: () { | ||
| 272 | + Utils.goPhone("400-000-9690"); | ||
| 273 | + }, | ||
| 274 | + ), | ||
| 275 | + MyDivider( | ||
| 276 | + double.infinity, | ||
| 277 | + ScreenUtil().setHeight(1), | ||
| 278 | + color: MyColours.color_f3f3f3, | ||
| 279 | + ), | ||
| 280 | + MyItem( | ||
| 281 | + title: "帮助与反馈", | ||
| 282 | + content: "", | ||
| 283 | + callback: () { | ||
| 284 | + Utils.goHelp(context); | ||
| 285 | + }, | ||
| 286 | + ), | ||
| 287 | + MyDivider(double.infinity, ScreenUtil().setHeight(1), | ||
| 288 | + color: MyColours.color_f3f3f3), | ||
| 289 | + GestureDetector( | ||
| 290 | + onTap: checkUpdate, | ||
| 291 | + child: Container( | ||
| 292 | + width: double.infinity, | ||
| 293 | + height: ScreenUtil().setHeight(122), | ||
| 294 | + color: MyColours.color_ffffff, | ||
| 295 | + padding: EdgeInsets.symmetric( | ||
| 296 | + horizontal: ScreenUtil().setWidth(40)), | ||
| 297 | + alignment: Alignment.center, | ||
| 298 | + child: Row( | ||
| 299 | + children: <Widget>[ | ||
| 300 | + Text( | ||
| 301 | + "版本更新", | ||
| 302 | + style: TextStyle( | ||
| 303 | + fontSize: ScreenUtil().setSp(30), | ||
| 304 | + color: MyColours.color_353535), | ||
| 305 | + ), | ||
| 306 | + Spacer(), | ||
| 307 | + newVersion | ||
| 308 | + ? Container( | ||
| 309 | + width: ScreenUtil().setWidth(120), | ||
| 310 | + height: ScreenUtil().setWidth(34), | ||
| 311 | + decoration: BoxDecoration( | ||
| 312 | + color: MyColours.color_E14553, | ||
| 313 | + borderRadius: BorderRadius.all( | ||
| 314 | + Radius.circular( | ||
| 315 | + ScreenUtil().setWidth(6))), | ||
| 316 | + ), | ||
| 317 | + child: Center( | ||
| 318 | + child: Text( | ||
| 319 | + "发现新版本", | ||
| 320 | + style: TextStyle( | ||
| 321 | + fontSize: ScreenUtil().setSp(24), | ||
| 322 | + color: MyColours.color_ffffff), | ||
| 275 | ), | 323 | ), |
| 276 | - ) | ||
| 277 | - : Text( | ||
| 278 | - cur_version, | ||
| 279 | - style: TextStyle( | ||
| 280 | - fontSize: ScreenUtil().setSp(28), | ||
| 281 | - color: MyColours.color_666666), | ||
| 282 | ), | 324 | ), |
| 283 | - HEmptyView(20), | ||
| 284 | - Image.asset( | ||
| 285 | - "assets/arr_right_gray.png", | ||
| 286 | - width: ScreenUtil().setWidth(14), | ||
| 287 | - height: ScreenUtil().setWidth(22), | ||
| 288 | - ) | ||
| 289 | - ], | ||
| 290 | - ), | 325 | + ) |
| 326 | + : Text( | ||
| 327 | + cur_version, | ||
| 328 | + style: TextStyle( | ||
| 329 | + fontSize: ScreenUtil().setSp(28), | ||
| 330 | + color: MyColours.color_666666), | ||
| 331 | + ), | ||
| 332 | + HEmptyView(20), | ||
| 333 | + Image.asset( | ||
| 334 | + "assets/arr_right_gray.png", | ||
| 335 | + width: ScreenUtil().setWidth(14), | ||
| 336 | + height: ScreenUtil().setWidth(22), | ||
| 337 | + ) | ||
| 338 | + ], | ||
| 291 | ), | 339 | ), |
| 292 | ), | 340 | ), |
| 293 | - MyDivider( | ||
| 294 | - double.infinity, | ||
| 295 | - ScreenUtil().setHeight(1), | ||
| 296 | - color: MyColours.color_f3f3f3, | ||
| 297 | - ), | ||
| 298 | - VEmptyView(40), | ||
| 299 | - Consumer<UserModel>( | ||
| 300 | - builder: | ||
| 301 | - (BuildContext context, UserModel model, Widget child) { | ||
| 302 | - return GestureDetector( | ||
| 303 | - onTap: () { | ||
| 304 | - model.showLoginOutDialog(context); | ||
| 305 | - }, | ||
| 306 | - child: Container( | ||
| 307 | - height: ScreenUtil().setHeight(122), | ||
| 308 | - color: MyColours.color_ffffff, | ||
| 309 | - child: Center( | ||
| 310 | - child: Row( | ||
| 311 | - mainAxisSize: MainAxisSize.min, | ||
| 312 | - crossAxisAlignment: CrossAxisAlignment.center, | ||
| 313 | - children: <Widget>[ | ||
| 314 | - Image.asset( | ||
| 315 | - "assets/icon_exist.png", | ||
| 316 | - width: ScreenUtil().setWidth(30), | ||
| 317 | - height: ScreenUtil().setWidth(30), | ||
| 318 | - ), | ||
| 319 | - HEmptyView(18), | ||
| 320 | - Text("退出登录", | ||
| 321 | - style: TextStyle( | ||
| 322 | - color: MyColours.color_199095, | ||
| 323 | - fontSize: ScreenUtil().setSp(34), | ||
| 324 | - )) | ||
| 325 | - ], | ||
| 326 | - ), | 341 | + ), |
| 342 | + MyDivider( | ||
| 343 | + double.infinity, | ||
| 344 | + ScreenUtil().setHeight(1), | ||
| 345 | + color: MyColours.color_f3f3f3, | ||
| 346 | + ), | ||
| 347 | + VEmptyView(40), | ||
| 348 | + Consumer<UserModel>( | ||
| 349 | + builder: | ||
| 350 | + (BuildContext context, UserModel model, Widget child) { | ||
| 351 | + return GestureDetector( | ||
| 352 | + onTap: () { | ||
| 353 | + model.showLoginOutDialog(context); | ||
| 354 | + }, | ||
| 355 | + child: Container( | ||
| 356 | + height: ScreenUtil().setHeight(122), | ||
| 357 | + color: MyColours.color_ffffff, | ||
| 358 | + child: Center( | ||
| 359 | + child: Row( | ||
| 360 | + mainAxisSize: MainAxisSize.min, | ||
| 361 | + crossAxisAlignment: CrossAxisAlignment.center, | ||
| 362 | + children: <Widget>[ | ||
| 363 | + Image.asset( | ||
| 364 | + "assets/icon_exist.png", | ||
| 365 | + width: ScreenUtil().setWidth(30), | ||
| 366 | + height: ScreenUtil().setWidth(30), | ||
| 367 | + ), | ||
| 368 | + HEmptyView(18), | ||
| 369 | + Text("退出登录", | ||
| 370 | + style: TextStyle( | ||
| 371 | + color: MyColours.color_199095, | ||
| 372 | + fontSize: ScreenUtil().setSp(34), | ||
| 373 | + )) | ||
| 374 | + ], | ||
| 327 | ), | 375 | ), |
| 328 | ), | 376 | ), |
| 329 | - ); | ||
| 330 | - }, | ||
| 331 | - ) | ||
| 332 | - ], | ||
| 333 | - ))); | ||
| 334 | - })); | 377 | + ), |
| 378 | + ); | ||
| 379 | + }, | ||
| 380 | + ) | ||
| 381 | + ], | ||
| 382 | + ))); | ||
| 383 | + })), | ||
| 384 | + ); | ||
| 335 | } | 385 | } |
| 336 | } | 386 | } |
| @@ -6,6 +6,7 @@ import 'package:one_key/models/remark.dart'; | @@ -6,6 +6,7 @@ import 'package:one_key/models/remark.dart'; | ||
| 6 | import 'package:one_key/provider/remark_manager_model.dart'; | 6 | import 'package:one_key/provider/remark_manager_model.dart'; |
| 7 | import 'package:one_key/provider/user_model.dart'; | 7 | import 'package:one_key/provider/user_model.dart'; |
| 8 | import 'package:one_key/res/colors.dart'; | 8 | import 'package:one_key/res/colors.dart'; |
| 9 | +import 'package:one_key/utils/event_bus.dart'; | ||
| 9 | import 'package:one_key/utils/utils.dart'; | 10 | import 'package:one_key/utils/utils.dart'; |
| 10 | import 'package:one_key/widgets/MyDivider.dart'; | 11 | import 'package:one_key/widgets/MyDivider.dart'; |
| 11 | import 'package:one_key/widgets/h_empty_view.dart'; | 12 | import 'package:one_key/widgets/h_empty_view.dart'; |
| @@ -281,99 +282,105 @@ class RemarkManagerPageState extends State<RemarkManagerPage> { | @@ -281,99 +282,105 @@ class RemarkManagerPageState extends State<RemarkManagerPage> { | ||
| 281 | // TODO: implement build | 282 | // TODO: implement build |
| 282 | remarkManagerModel = | 283 | remarkManagerModel = |
| 283 | Provider.of<RemarkManagerModel>(context, listen: false); | 284 | Provider.of<RemarkManagerModel>(context, listen: false); |
| 284 | - return Scaffold( | ||
| 285 | - backgroundColor: MyColours.color_ffffff, | ||
| 286 | - appBar: SystemAppBar( | ||
| 287 | - '常用备注管理', | ||
| 288 | - onTap: () { | ||
| 289 | - Navigator.of(context).pop(); | ||
| 290 | - }, | ||
| 291 | - ), | ||
| 292 | - body: SafeArea( | ||
| 293 | - child: Consumer<RemarkManagerModel>( | ||
| 294 | - builder: (context, model, _) { | ||
| 295 | - if (model.pageState != PageState.Success) { | ||
| 296 | - return ExceptionPage( | ||
| 297 | - pageState: model.pageState, | ||
| 298 | - callback: () { | ||
| 299 | - _getRemarks(showPageLoading: true); | ||
| 300 | - }, | ||
| 301 | - emptyMsg: "暂时没有备注哦", | ||
| 302 | - emptyImg: "empty_search", | ||
| 303 | - showMsg: "加载中,请稍后...", | ||
| 304 | - ); | ||
| 305 | - } else { | ||
| 306 | - return Container( | ||
| 307 | - padding: EdgeInsets.symmetric( | ||
| 308 | - horizontal: ScreenUtil().setWidth(40)), | ||
| 309 | - child: Column( | ||
| 310 | - crossAxisAlignment: CrossAxisAlignment.start, | ||
| 311 | - children: [ | ||
| 312 | - VEmptyView(60), | ||
| 313 | - Row( | ||
| 314 | - crossAxisAlignment: CrossAxisAlignment.end, | 285 | + return WillPopScope( |
| 286 | + child: Scaffold( | ||
| 287 | + backgroundColor: MyColours.color_ffffff, | ||
| 288 | + appBar: SystemAppBar( | ||
| 289 | + '常用备注管理', | ||
| 290 | + onTap: () { | ||
| 291 | + EventBus().emit('changeStatusColor'); | ||
| 292 | + Navigator.of(context).pop(); | ||
| 293 | + }, | ||
| 294 | + ), | ||
| 295 | + body: SafeArea( | ||
| 296 | + child: Consumer<RemarkManagerModel>( | ||
| 297 | + builder: (context, model, _) { | ||
| 298 | + if (model.pageState != PageState.Success) { | ||
| 299 | + return ExceptionPage( | ||
| 300 | + pageState: model.pageState, | ||
| 301 | + callback: () { | ||
| 302 | + _getRemarks(showPageLoading: true); | ||
| 303 | + }, | ||
| 304 | + emptyMsg: "暂时没有备注哦", | ||
| 305 | + emptyImg: "empty_search", | ||
| 306 | + showMsg: "加载中,请稍后...", | ||
| 307 | + ); | ||
| 308 | + } else { | ||
| 309 | + return Container( | ||
| 310 | + padding: EdgeInsets.symmetric( | ||
| 311 | + horizontal: ScreenUtil().setWidth(40)), | ||
| 312 | + child: Column( | ||
| 313 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 315 | children: [ | 314 | children: [ |
| 316 | - Text( | ||
| 317 | - "我的常用备注", | ||
| 318 | - style: TextStyle( | ||
| 319 | - color: MyColours.color_353535, | ||
| 320 | - fontSize: ScreenUtil().setSp(30), | ||
| 321 | - fontWeight: FontWeight.bold), | 315 | + VEmptyView(60), |
| 316 | + Row( | ||
| 317 | + crossAxisAlignment: CrossAxisAlignment.end, | ||
| 318 | + children: [ | ||
| 319 | + Text( | ||
| 320 | + "我的常用备注", | ||
| 321 | + style: TextStyle( | ||
| 322 | + color: MyColours.color_353535, | ||
| 323 | + fontSize: ScreenUtil().setSp(30), | ||
| 324 | + fontWeight: FontWeight.bold), | ||
| 325 | + ), | ||
| 326 | + Text( | ||
| 327 | + "(最多添加10个)", | ||
| 328 | + style: TextStyle( | ||
| 329 | + color: MyColours.color_666666, | ||
| 330 | + fontSize: ScreenUtil().setSp(26)), | ||
| 331 | + ), | ||
| 332 | + ], | ||
| 322 | ), | 333 | ), |
| 323 | - Text( | ||
| 324 | - "(最多添加10个)", | ||
| 325 | - style: TextStyle( | ||
| 326 | - color: MyColours.color_666666, | ||
| 327 | - fontSize: ScreenUtil().setSp(26)), | 334 | + Padding( |
| 335 | + padding: EdgeInsets.symmetric( | ||
| 336 | + vertical: ScreenUtil().setWidth(40)), | ||
| 337 | + child: Wrap( | ||
| 338 | + spacing: ScreenUtil().setWidth(20), | ||
| 339 | + runSpacing: ScreenUtil().setWidth(20), | ||
| 340 | + children: _buildAlwayItems()), | ||
| 328 | ), | 341 | ), |
| 329 | - ], | ||
| 330 | - ), | ||
| 331 | - Padding( | ||
| 332 | - padding: EdgeInsets.symmetric( | ||
| 333 | - vertical: ScreenUtil().setWidth(40)), | ||
| 334 | - child: Wrap( | ||
| 335 | - spacing: ScreenUtil().setWidth(20), | ||
| 336 | - runSpacing: ScreenUtil().setWidth(20), | ||
| 337 | - children: _buildAlwayItems()), | ||
| 338 | - ), | ||
| 339 | - MyDivider( | ||
| 340 | - double.infinity, | ||
| 341 | - ScreenUtil().setWidth(2), | ||
| 342 | - color: MyColours.color_f3f3f3, | ||
| 343 | - ), | ||
| 344 | - VEmptyView(40), | ||
| 345 | - Row( | ||
| 346 | - crossAxisAlignment: CrossAxisAlignment.end, | ||
| 347 | - children: [ | ||
| 348 | - Text( | ||
| 349 | - "所有备注", | ||
| 350 | - style: TextStyle( | ||
| 351 | - color: MyColours.color_353535, | ||
| 352 | - fontSize: ScreenUtil().setSp(30), | ||
| 353 | - fontWeight: FontWeight.bold), | 342 | + MyDivider( |
| 343 | + double.infinity, | ||
| 344 | + ScreenUtil().setWidth(2), | ||
| 345 | + color: MyColours.color_f3f3f3, | ||
| 354 | ), | 346 | ), |
| 355 | - Text( | ||
| 356 | - "(最多添加20个)", | ||
| 357 | - style: TextStyle( | ||
| 358 | - color: MyColours.color_666666, | ||
| 359 | - fontSize: ScreenUtil().setSp(26)), | 347 | + VEmptyView(40), |
| 348 | + Row( | ||
| 349 | + crossAxisAlignment: CrossAxisAlignment.end, | ||
| 350 | + children: [ | ||
| 351 | + Text( | ||
| 352 | + "所有备注", | ||
| 353 | + style: TextStyle( | ||
| 354 | + color: MyColours.color_353535, | ||
| 355 | + fontSize: ScreenUtil().setSp(30), | ||
| 356 | + fontWeight: FontWeight.bold), | ||
| 357 | + ), | ||
| 358 | + Text( | ||
| 359 | + "(最多添加20个)", | ||
| 360 | + style: TextStyle( | ||
| 361 | + color: MyColours.color_666666, | ||
| 362 | + fontSize: ScreenUtil().setSp(26)), | ||
| 363 | + ), | ||
| 364 | + ], | ||
| 360 | ), | 365 | ), |
| 366 | + Padding( | ||
| 367 | + padding: EdgeInsets.symmetric( | ||
| 368 | + vertical: ScreenUtil().setWidth(40)), | ||
| 369 | + child: Wrap( | ||
| 370 | + spacing: ScreenUtil().setWidth(20), | ||
| 371 | + runSpacing: ScreenUtil().setWidth(20), | ||
| 372 | + children: _buildAllItems()), | ||
| 373 | + ) | ||
| 361 | ], | 374 | ], |
| 362 | ), | 375 | ), |
| 363 | - Padding( | ||
| 364 | - padding: EdgeInsets.symmetric( | ||
| 365 | - vertical: ScreenUtil().setWidth(40)), | ||
| 366 | - child: Wrap( | ||
| 367 | - spacing: ScreenUtil().setWidth(20), | ||
| 368 | - runSpacing: ScreenUtil().setWidth(20), | ||
| 369 | - children: _buildAllItems()), | ||
| 370 | - ) | ||
| 371 | - ], | ||
| 372 | - ), | ||
| 373 | - ); | ||
| 374 | - } | ||
| 375 | - }, | ||
| 376 | - ), | ||
| 377 | - )); | 376 | + ); |
| 377 | + } | ||
| 378 | + }, | ||
| 379 | + ), | ||
| 380 | + )), | ||
| 381 | + onWillPop: () async { | ||
| 382 | + EventBus().emit('changeStatusColor'); | ||
| 383 | + return true; | ||
| 384 | + }); | ||
| 378 | } | 385 | } |
| 379 | } | 386 | } |
| @@ -21,6 +21,7 @@ import 'package:table_calendar/table_calendar.dart'; | @@ -21,6 +21,7 @@ import 'package:table_calendar/table_calendar.dart'; | ||
| 21 | import 'package:one_key/models/table.dart' as t; | 21 | import 'package:one_key/models/table.dart' as t; |
| 22 | 22 | ||
| 23 | typedef CustomCallBack = void Function(Object object); | 23 | typedef CustomCallBack = void Function(Object object); |
| 24 | + | ||
| 24 | class DialogUtil { | 25 | class DialogUtil { |
| 25 | //备注弹框 | 26 | //备注弹框 |
| 26 | static showRemarkDialog( | 27 | static showRemarkDialog( |
| @@ -29,7 +30,7 @@ class DialogUtil { | @@ -29,7 +30,7 @@ class DialogUtil { | ||
| 29 | return showModalBottomSheet( | 30 | return showModalBottomSheet( |
| 30 | context: context, | 31 | context: context, |
| 31 | isScrollControlled: true, | 32 | isScrollControlled: true, |
| 32 | - isDismissible: false, | 33 | + // isDismissible: false, |
| 33 | backgroundColor: Colors.transparent, | 34 | backgroundColor: Colors.transparent, |
| 34 | builder: (context) { | 35 | builder: (context) { |
| 35 | return StatefulBuilder(builder: (context, state) { | 36 | return StatefulBuilder(builder: (context, state) { |
| @@ -45,15 +46,33 @@ class DialogUtil { | @@ -45,15 +46,33 @@ class DialogUtil { | ||
| 45 | crossAxisAlignment: CrossAxisAlignment.start, | 46 | crossAxisAlignment: CrossAxisAlignment.start, |
| 46 | children: <Widget>[ | 47 | children: <Widget>[ |
| 47 | VEmptyView(40), | 48 | VEmptyView(40), |
| 48 | - Center( | ||
| 49 | - child: Text( | ||
| 50 | - '更多标签', | ||
| 51 | - style: TextStyle( | ||
| 52 | - fontSize: ScreenUtil().setSp(32), | ||
| 53 | - color: MyColours.color_353535, | ||
| 54 | - ), | ||
| 55 | - softWrap: true, | ||
| 56 | - textAlign: TextAlign.center, | 49 | + InkWell( |
| 50 | + onTap: () { | ||
| 51 | + Navigator.pop(context); | ||
| 52 | + }, | ||
| 53 | + child: Stack( | ||
| 54 | + children: [ | ||
| 55 | + Center( | ||
| 56 | + child: Text( | ||
| 57 | + '更多标签', | ||
| 58 | + style: TextStyle( | ||
| 59 | + fontSize: ScreenUtil().setSp(32), | ||
| 60 | + color: MyColours.color_353535, | ||
| 61 | + ), | ||
| 62 | + softWrap: true, | ||
| 63 | + textAlign: TextAlign.center, | ||
| 64 | + ), | ||
| 65 | + ), | ||
| 66 | + Positioned( | ||
| 67 | + top: ScreenUtil().setWidth(10), | ||
| 68 | + right: ScreenUtil().setWidth(40), | ||
| 69 | + child: Image.asset( | ||
| 70 | + Utils.getImgPath('close1'), | ||
| 71 | + width: ScreenUtil().setWidth(28), | ||
| 72 | + height: ScreenUtil().setWidth(28), | ||
| 73 | + ), | ||
| 74 | + ) | ||
| 75 | + ], | ||
| 57 | ), | 76 | ), |
| 58 | ), | 77 | ), |
| 59 | VEmptyView(60), | 78 | VEmptyView(60), |
| @@ -95,10 +114,10 @@ class DialogUtil { | @@ -95,10 +114,10 @@ class DialogUtil { | ||
| 95 | return InkWell( | 114 | return InkWell( |
| 96 | onTap: onPress, | 115 | onTap: onPress, |
| 97 | child: Container( | 116 | child: Container( |
| 98 | - height: ScreenUtil().setHeight(50), | 117 | + height: ScreenUtil().setHeight(54), |
| 99 | padding: EdgeInsets.symmetric( | 118 | padding: EdgeInsets.symmetric( |
| 100 | horizontal: ScreenUtil().setWidth(20), | 119 | horizontal: ScreenUtil().setWidth(20), |
| 101 | - vertical: ScreenUtil().setWidth(12)), | 120 | + vertical: ScreenUtil().setWidth(10)), |
| 102 | decoration: BoxDecoration( | 121 | decoration: BoxDecoration( |
| 103 | borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10)), | 122 | borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10)), |
| 104 | color: isSelect ? MyColours.color_199095 : MyColours.color_f5f5f5, | 123 | color: isSelect ? MyColours.color_199095 : MyColours.color_f5f5f5, |
-
Please register or login to post a comment