Showing
20 changed files
with
588 additions
and
275 deletions
assets/check_g.png
0 → 100644
2.06 KB
assets/check_r.png
0 → 100644
2.05 KB
assets/check_un.png
0 → 100644
1.74 KB
assets/jian.png
0 → 100644
459 Bytes
assets/quan_down.png
0 → 100644
3.06 KB
assets/quan_un_wan.png
0 → 100644
3.22 KB
assets/quan_un_zhi.png
0 → 100644
3 KB
assets/quan_up.png
0 → 100644
2.91 KB
assets/quan_wan.png
0 → 100644
3.27 KB
assets/quan_zhi.png
0 → 100644
3.03 KB
| @@ -67,6 +67,7 @@ class CouponSunModel extends Object { | @@ -67,6 +67,7 @@ class CouponSunModel extends Object { | ||
| 67 | bool isOpenBool = false; | 67 | bool isOpenBool = false; |
| 68 | 68 | ||
| 69 | bool isCheck = false; | 69 | bool isCheck = false; |
| 70 | + bool showText = false; | ||
| 70 | 71 | ||
| 71 | CouponSunModel( | 72 | CouponSunModel( |
| 72 | this.id, | 73 | this.id, |
| @@ -10,6 +10,7 @@ import 'package:one_key/utils/dialog_util.dart'; | @@ -10,6 +10,7 @@ import 'package:one_key/utils/dialog_util.dart'; | ||
| 10 | import 'package:one_key/utils/event_bus.dart'; | 10 | import 'package:one_key/utils/event_bus.dart'; |
| 11 | import 'package:one_key/utils/navigator_util.dart'; | 11 | import 'package:one_key/utils/navigator_util.dart'; |
| 12 | import 'package:one_key/utils/utils.dart'; | 12 | import 'package:one_key/utils/utils.dart'; |
| 13 | +import 'package:one_key/widgets/MyDivider.dart'; | ||
| 13 | import 'package:one_key/widgets/h_empty_view.dart'; | 14 | import 'package:one_key/widgets/h_empty_view.dart'; |
| 14 | import 'package:one_key/widgets/round_button.dart'; | 15 | import 'package:one_key/widgets/round_button.dart'; |
| 15 | import 'package:one_key/widgets/system_app_bar.dart'; | 16 | import 'package:one_key/widgets/system_app_bar.dart'; |
| @@ -32,7 +33,7 @@ class _CouponEidtPageState extends State<CouponEidtPage> { | @@ -32,7 +33,7 @@ class _CouponEidtPageState extends State<CouponEidtPage> { | ||
| 32 | TextEditingController _couponNameEditControl = TextEditingController(); | 33 | TextEditingController _couponNameEditControl = TextEditingController(); |
| 33 | TextEditingController _couponRequireEditControl = TextEditingController(); | 34 | TextEditingController _couponRequireEditControl = TextEditingController(); |
| 34 | TextEditingController _couponExplainEditControl = TextEditingController(); | 35 | TextEditingController _couponExplainEditControl = TextEditingController(); |
| 35 | - final heightCell = ScreenUtil().setWidth(80); | 36 | + final heightCell = ScreenUtil().setWidth(48); |
| 36 | bool swichState = true; //默认启用 开关状态 | 37 | bool swichState = true; //默认启用 开关状态 |
| 37 | final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); | 38 | final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); |
| 38 | String fromDate = '点击选择'; //有效期开始时间 | 39 | String fromDate = '点击选择'; //有效期开始时间 |
| @@ -100,14 +101,10 @@ class _CouponEidtPageState extends State<CouponEidtPage> { | @@ -100,14 +101,10 @@ class _CouponEidtPageState extends State<CouponEidtPage> { | ||
| 100 | ///输入框 | 101 | ///输入框 |
| 101 | Widget _textfield(String title, String hintText) { | 102 | Widget _textfield(String title, String hintText) { |
| 102 | return Container( | 103 | return Container( |
| 103 | - height: heightCell, | ||
| 104 | child: Row( | 104 | child: Row( |
| 105 | - crossAxisAlignment: CrossAxisAlignment.center, | ||
| 106 | - mainAxisAlignment: MainAxisAlignment.center, | 105 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, |
| 107 | children: [ | 106 | children: [ |
| 108 | Container( | 107 | Container( |
| 109 | - // height: ScreenUtil().setWidth(40), | ||
| 110 | - // color: Colors.red, | ||
| 111 | child: Text( | 108 | child: Text( |
| 112 | title, | 109 | title, |
| 113 | style: TextStyle( | 110 | style: TextStyle( |
| @@ -116,13 +113,15 @@ class _CouponEidtPageState extends State<CouponEidtPage> { | @@ -116,13 +113,15 @@ class _CouponEidtPageState extends State<CouponEidtPage> { | ||
| 116 | fontSize: ScreenUtil().setSp(34)), | 113 | fontSize: ScreenUtil().setSp(34)), |
| 117 | ), | 114 | ), |
| 118 | ), | 115 | ), |
| 119 | - HEmptyView(20), | ||
| 120 | - Expanded( | 116 | + HEmptyView(80), |
| 117 | + Container( | ||
| 118 | + width: ScreenUtil().setWidth(231 * 2), | ||
| 121 | child: TextField( | 119 | child: TextField( |
| 122 | controller: title == '券名称' | 120 | controller: title == '券名称' |
| 123 | ? _couponNameEditControl | 121 | ? _couponNameEditControl |
| 124 | : _couponRequireEditControl, | 122 | : _couponRequireEditControl, |
| 125 | textAlign: TextAlign.right, | 123 | textAlign: TextAlign.right, |
| 124 | + textAlignVertical: TextAlignVertical.bottom, | ||
| 126 | maxLines: 1, | 125 | maxLines: 1, |
| 127 | // //光标颜色 | 126 | // //光标颜色 |
| 128 | // cursorColor: | 127 | // cursorColor: |
| @@ -132,19 +131,19 @@ class _CouponEidtPageState extends State<CouponEidtPage> { | @@ -132,19 +131,19 @@ class _CouponEidtPageState extends State<CouponEidtPage> { | ||
| 132 | fontSize: ScreenUtil().setSp(32), | 131 | fontSize: ScreenUtil().setSp(32), |
| 133 | ), | 132 | ), |
| 134 | focusNode: title == '券名称' ? _nameFocusNode : _requireFocusNode, | 133 | focusNode: title == '券名称' ? _nameFocusNode : _requireFocusNode, |
| 135 | - // textAlignVertical: TextAlignVertical.bottom, | ||
| 136 | decoration: InputDecoration( | 134 | decoration: InputDecoration( |
| 137 | - // fillColor: Colors.lightGreenAccent, | ||
| 138 | - // filled: true, | ||
| 139 | border: OutlineInputBorder(borderSide: BorderSide.none), | 135 | border: OutlineInputBorder(borderSide: BorderSide.none), |
| 140 | hintText: hintText, | 136 | hintText: hintText, |
| 141 | hintStyle: TextStyle( | 137 | hintStyle: TextStyle( |
| 142 | color: MyColours.color_999999, | 138 | color: MyColours.color_999999, |
| 143 | fontSize: ScreenUtil().setSp(32), | 139 | fontSize: ScreenUtil().setSp(32), |
| 144 | ), | 140 | ), |
| 145 | - // contentPadding: EdgeInsets.only( | ||
| 146 | - // bottom: ScreenUtil().setWidth(30)), //ios 17 | ||
| 147 | - // border: InputBorder.none, | 141 | + enabledBorder: new UnderlineInputBorder( |
| 142 | + borderSide: BorderSide.none, | ||
| 143 | + ), | ||
| 144 | + focusedBorder: new UnderlineInputBorder( | ||
| 145 | + borderSide: BorderSide.none, | ||
| 146 | + ), | ||
| 148 | ), | 147 | ), |
| 149 | onChanged: (value) {}, | 148 | onChanged: (value) {}, |
| 150 | onEditingComplete: () { | 149 | onEditingComplete: () { |
| @@ -218,7 +217,7 @@ class _CouponEidtPageState extends State<CouponEidtPage> { | @@ -218,7 +217,7 @@ class _CouponEidtPageState extends State<CouponEidtPage> { | ||
| 218 | color: hintText == '点击选择' | 217 | color: hintText == '点击选择' |
| 219 | ? MyColours.color_999999 | 218 | ? MyColours.color_999999 |
| 220 | : MyColours.color_333333, | 219 | : MyColours.color_333333, |
| 221 | - fontSize: ScreenUtil().setSp(26), | 220 | + fontSize: ScreenUtil().setSp(32), |
| 222 | )), | 221 | )), |
| 223 | HEmptyView(20), | 222 | HEmptyView(20), |
| 224 | Image.asset( | 223 | Image.asset( |
| @@ -239,39 +238,56 @@ class _CouponEidtPageState extends State<CouponEidtPage> { | @@ -239,39 +238,56 @@ class _CouponEidtPageState extends State<CouponEidtPage> { | ||
| 239 | child: Column( | 238 | child: Column( |
| 240 | crossAxisAlignment: CrossAxisAlignment.start, | 239 | crossAxisAlignment: CrossAxisAlignment.start, |
| 241 | children: [ | 240 | children: [ |
| 242 | - Container( | ||
| 243 | - height: heightCell, | ||
| 244 | - child: Align( | ||
| 245 | - alignment: Alignment.centerLeft, | ||
| 246 | - child: Text( | ||
| 247 | - title, | ||
| 248 | - textAlign: TextAlign.left, | ||
| 249 | - style: TextStyle( | ||
| 250 | - color: MyColours.color_333333, | ||
| 251 | - fontWeight: FontWeight.bold, | ||
| 252 | - fontSize: ScreenUtil().setSp(34)), | ||
| 253 | - )), | ||
| 254 | - ), | ||
| 255 | - VEmptyView(10), | 241 | + Align( |
| 242 | + alignment: Alignment.centerLeft, | ||
| 243 | + child: Text( | ||
| 244 | + title, | ||
| 245 | + textAlign: TextAlign.left, | ||
| 246 | + style: TextStyle( | ||
| 247 | + color: MyColours.color_333333, | ||
| 248 | + fontWeight: FontWeight.bold, | ||
| 249 | + fontSize: ScreenUtil().setSp(34)), | ||
| 250 | + )), | ||
| 251 | + VEmptyView(30), | ||
| 256 | TextField( | 252 | TextField( |
| 257 | controller: _couponExplainEditControl, | 253 | controller: _couponExplainEditControl, |
| 258 | // keyboardType: TextInputType.number, //键盘类型,数字键盘 | 254 | // keyboardType: TextInputType.number, //键盘类型,数字键盘 |
| 259 | - maxLines: 7, | ||
| 260 | - // maxLength: 200, | ||
| 261 | - // maxLengthEnforced: true, | 255 | + maxLines: 6, |
| 256 | + maxLength: 50, | ||
| 262 | 257 | ||
| 258 | + // maxLengthEnforced: true, | ||
| 259 | + style: TextStyle( | ||
| 260 | + fontSize: ScreenUtil().setSp(32), | ||
| 261 | + color: MyColours.color_333333), //输入文本的样式 | ||
| 263 | decoration: InputDecoration( | 262 | decoration: InputDecoration( |
| 264 | - contentPadding: EdgeInsets.all(ScreenUtil().setWidth(20)), | 263 | + contentPadding: EdgeInsets.all(ScreenUtil().setWidth(30)), |
| 265 | hintText: hintText, | 264 | hintText: hintText, |
| 266 | hintStyle: TextStyle( | 265 | hintStyle: TextStyle( |
| 267 | color: MyColours.color_999999, | 266 | color: MyColours.color_999999, |
| 268 | fontSize: ScreenUtil().setSp(32), | 267 | fontSize: ScreenUtil().setSp(32), |
| 269 | ), | 268 | ), |
| 270 | - fillColor: MyColours.color_EEEEEE, | 269 | + fillColor: MyColours.color_F9F9F9, |
| 270 | + // fillColor: Colors.red, | ||
| 271 | filled: true, | 271 | filled: true, |
| 272 | - border: OutlineInputBorder( | ||
| 273 | - borderRadius: BorderRadius.circular(15), | ||
| 274 | - borderSide: BorderSide.none), | 272 | + enabledBorder: OutlineInputBorder( |
| 273 | + //未选中时候的颜色 | ||
| 274 | + borderRadius: BorderRadius.circular(ScreenUtil().setWidth(20)), | ||
| 275 | + borderSide: BorderSide( | ||
| 276 | + color: MyColours.color_cccccc, | ||
| 277 | + width: ScreenUtil().setWidth(2)), | ||
| 278 | + ), | ||
| 279 | + focusedBorder: OutlineInputBorder( | ||
| 280 | + //选中时外边框颜色 | ||
| 281 | + borderRadius: BorderRadius.circular(ScreenUtil().setWidth(20)), | ||
| 282 | + borderSide: BorderSide( | ||
| 283 | + color: MyColours.app_main, | ||
| 284 | + ), | ||
| 285 | + ), | ||
| 286 | + // border: OutlineInputBorder( | ||
| 287 | + // borderRadius: | ||
| 288 | + // BorderRadius.circular(ScreenUtil().setWidth(20)), | ||
| 289 | + // borderSide: BorderSide( | ||
| 290 | + // color: Colors.red, width: ScreenUtil().setWidth(2))), | ||
| 275 | ), | 291 | ), |
| 276 | onChanged: (value) {}, | 292 | onChanged: (value) {}, |
| 277 | ), | 293 | ), |
| @@ -324,6 +340,7 @@ class _CouponEidtPageState extends State<CouponEidtPage> { | @@ -324,6 +340,7 @@ class _CouponEidtPageState extends State<CouponEidtPage> { | ||
| 324 | Widget build(BuildContext context) { | 340 | Widget build(BuildContext context) { |
| 325 | couponProvider = Provider.of<CouponProvider>(context, listen: true); | 341 | couponProvider = Provider.of<CouponProvider>(context, listen: true); |
| 326 | return Scaffold( | 342 | return Scaffold( |
| 343 | + backgroundColor: MyColours.color_ffffff, | ||
| 327 | key: scaffoldKey, | 344 | key: scaffoldKey, |
| 328 | appBar: SystemAppBar( | 345 | appBar: SystemAppBar( |
| 329 | '创建新券', | 346 | '创建新券', |
| @@ -345,18 +362,47 @@ class _CouponEidtPageState extends State<CouponEidtPage> { | @@ -345,18 +362,47 @@ class _CouponEidtPageState extends State<CouponEidtPage> { | ||
| 345 | horizontal: ScreenUtil().setWidth(40)), | 362 | horizontal: ScreenUtil().setWidth(40)), |
| 346 | child: Column( | 363 | child: Column( |
| 347 | children: [ | 364 | children: [ |
| 348 | - VEmptyView(20), | 365 | + VEmptyView(40), |
| 349 | _textfield('券名称', '例:9折券/200元代金券/菜品券'), | 366 | _textfield('券名称', '例:9折券/200元代金券/菜品券'), |
| 350 | - VEmptyView(20), | 367 | + VEmptyView(22), |
| 368 | + Container( | ||
| 369 | + height: ScreenUtil().setWidth(2), | ||
| 370 | + color: MyColours.color_efefef, | ||
| 371 | + margin: EdgeInsets.only( | ||
| 372 | + left: ScreenUtil().setWidth(108 * 2)), | ||
| 373 | + ), | ||
| 374 | + VEmptyView(30), | ||
| 351 | _textfield('券要求', '例:无门槛/满2000元'), | 375 | _textfield('券要求', '例:无门槛/满2000元'), |
| 352 | - VEmptyView(20), | 376 | + VEmptyView(22), |
| 377 | + Container( | ||
| 378 | + height: ScreenUtil().setWidth(2), | ||
| 379 | + color: MyColours.color_efefef, | ||
| 380 | + margin: EdgeInsets.only( | ||
| 381 | + left: ScreenUtil().setWidth(108 * 2)), | ||
| 382 | + ), | ||
| 383 | + VEmptyView(30), | ||
| 353 | _select('有效期从', fromDate), | 384 | _select('有效期从', fromDate), |
| 354 | - VEmptyView(20), | 385 | + VEmptyView(30), |
| 386 | + Container( | ||
| 387 | + height: ScreenUtil().setWidth(2), | ||
| 388 | + color: MyColours.color_efefef, | ||
| 389 | + margin: EdgeInsets.only( | ||
| 390 | + left: ScreenUtil().setWidth(108 * 2)), | ||
| 391 | + ), | ||
| 392 | + VEmptyView(30), | ||
| 355 | _select('有效期至', endDate), | 393 | _select('有效期至', endDate), |
| 356 | - VEmptyView(20), | 394 | + VEmptyView(30), |
| 395 | + Container( | ||
| 396 | + height: ScreenUtil().setWidth(2), | ||
| 397 | + color: MyColours.color_efefef, | ||
| 398 | + margin: EdgeInsets.only( | ||
| 399 | + left: ScreenUtil().setWidth(108 * 2)), | ||
| 400 | + ), | ||
| 401 | + VEmptyView(30), | ||
| 357 | _explain('券说明', '例:可用包间,停车免费,不与店内其他活动共享等'), | 402 | _explain('券说明', '例:可用包间,停车免费,不与店内其他活动共享等'), |
| 358 | - VEmptyView(20), | 403 | + // VEmptyView(20), |
| 359 | _canUse('是否立即启用'), | 404 | _canUse('是否立即启用'), |
| 405 | + VEmptyView(30), | ||
| 360 | ], | 406 | ], |
| 361 | ))), | 407 | ))), |
| 362 | ), | 408 | ), |
| @@ -4,8 +4,10 @@ import 'package:one_key/constant/state.dart'; | @@ -4,8 +4,10 @@ import 'package:one_key/constant/state.dart'; | ||
| 4 | import 'package:one_key/pages/coupon/coupon_item.dart'; | 4 | import 'package:one_key/pages/coupon/coupon_item.dart'; |
| 5 | import 'package:one_key/provider/coupon_provider.dart'; | 5 | import 'package:one_key/provider/coupon_provider.dart'; |
| 6 | import 'package:one_key/provider/user_model.dart'; | 6 | import 'package:one_key/provider/user_model.dart'; |
| 7 | +import 'package:one_key/res/colors.dart'; | ||
| 7 | import 'package:one_key/widgets/page_exception.dart'; | 8 | import 'package:one_key/widgets/page_exception.dart'; |
| 8 | import 'package:one_key/widgets/system_app_bar.dart'; | 9 | import 'package:one_key/widgets/system_app_bar.dart'; |
| 10 | +import 'package:one_key/widgets/v_empty_view.dart'; | ||
| 9 | import 'package:provider/provider.dart'; | 11 | import 'package:provider/provider.dart'; |
| 10 | 12 | ||
| 11 | /** | 13 | /** |
| @@ -45,6 +47,7 @@ class _CouponHistoryPageState extends State<CouponHistoryPage> { | @@ -45,6 +47,7 @@ class _CouponHistoryPageState extends State<CouponHistoryPage> { | ||
| 45 | Widget build(BuildContext context) { | 47 | Widget build(BuildContext context) { |
| 46 | couponProvider = Provider.of<CouponProvider>(context, listen: true); | 48 | couponProvider = Provider.of<CouponProvider>(context, listen: true); |
| 47 | return Scaffold( | 49 | return Scaffold( |
| 50 | + backgroundColor: MyColours.color_fefefe, | ||
| 48 | appBar: SystemAppBar( | 51 | appBar: SystemAppBar( |
| 49 | ' 历史券', | 52 | ' 历史券', |
| 50 | onTap: () { | 53 | onTap: () { |
| @@ -71,6 +74,12 @@ class _CouponHistoryPageState extends State<CouponHistoryPage> { | @@ -71,6 +74,12 @@ class _CouponHistoryPageState extends State<CouponHistoryPage> { | ||
| 71 | SliverList( | 74 | SliverList( |
| 72 | delegate: SliverChildBuilderDelegate( | 75 | delegate: SliverChildBuilderDelegate( |
| 73 | (BuildContext context, int index) { | 76 | (BuildContext context, int index) { |
| 77 | + return VEmptyView(40); | ||
| 78 | + }, childCount: 1), | ||
| 79 | + ), | ||
| 80 | + SliverList( | ||
| 81 | + delegate: SliverChildBuilderDelegate( | ||
| 82 | + (BuildContext context, int index) { | ||
| 74 | return CouponItem( | 83 | return CouponItem( |
| 75 | from: 'history', | 84 | from: 'history', |
| 76 | couponSonModel: couponProvider.couponListHistory[index], | 85 | couponSonModel: couponProvider.couponListHistory[index], |
| @@ -15,13 +15,15 @@ class CouponItem extends StatefulWidget { | @@ -15,13 +15,15 @@ class CouponItem extends StatefulWidget { | ||
| 15 | final VoidCallback onPressedSwich; | 15 | final VoidCallback onPressedSwich; |
| 16 | final CouponSunModel couponSonModel; | 16 | final CouponSunModel couponSonModel; |
| 17 | final bool showBtn; | 17 | final bool showBtn; |
| 18 | + final bool showCheck; | ||
| 18 | CouponItem( | 19 | CouponItem( |
| 19 | {Key key, | 20 | {Key key, |
| 20 | this.from, | 21 | this.from, |
| 21 | this.onPressed, | 22 | this.onPressed, |
| 22 | this.onPressedSwich, | 23 | this.onPressedSwich, |
| 23 | this.couponSonModel, | 24 | this.couponSonModel, |
| 24 | - this.showBtn = false}) | 25 | + this.showBtn = false, |
| 26 | + this.showCheck = false}) | ||
| 25 | : super(key: key); | 27 | : super(key: key); |
| 26 | 28 | ||
| 27 | @override | 29 | @override |
| @@ -29,6 +31,7 @@ class CouponItem extends StatefulWidget { | @@ -29,6 +31,7 @@ class CouponItem extends StatefulWidget { | ||
| 29 | } | 31 | } |
| 30 | 32 | ||
| 31 | class _CouponItemState extends State<CouponItem> { | 33 | class _CouponItemState extends State<CouponItem> { |
| 34 | + // bool showText = false; | ||
| 32 | @override | 35 | @override |
| 33 | Widget build(BuildContext context) { | 36 | Widget build(BuildContext context) { |
| 34 | CouponSunModel sunModel = widget.couponSonModel; | 37 | CouponSunModel sunModel = widget.couponSonModel; |
| @@ -38,6 +41,17 @@ class _CouponItemState extends State<CouponItem> { | @@ -38,6 +41,17 @@ class _CouponItemState extends State<CouponItem> { | ||
| 38 | } else { | 41 | } else { |
| 39 | notSelect = sunModel.isOpenBool; | 42 | notSelect = sunModel.isOpenBool; |
| 40 | } | 43 | } |
| 44 | + double explainH = 0.0; | ||
| 45 | + | ||
| 46 | + if (ObjectUtil.isNotEmpty(sunModel.explain)) { | ||
| 47 | + explainH = Utils.calculateTextHeight( | ||
| 48 | + '说明:${sunModel.explain}', | ||
| 49 | + ScreenUtil().setSp(24), | ||
| 50 | + FontWeight.normal, | ||
| 51 | + ScreenUtil.screenWidthDp - ScreenUtil().setWidth(92 * 2), | ||
| 52 | + 5, | ||
| 53 | + context); | ||
| 54 | + } | ||
| 41 | return InkWell( | 55 | return InkWell( |
| 42 | onTap: widget.onPressed, | 56 | onTap: widget.onPressed, |
| 43 | child: Stack( | 57 | child: Stack( |
| @@ -49,137 +63,260 @@ class _CouponItemState extends State<CouponItem> { | @@ -49,137 +63,260 @@ class _CouponItemState extends State<CouponItem> { | ||
| 49 | ScreenUtil().setWidth(0), | 63 | ScreenUtil().setWidth(0), |
| 50 | ScreenUtil().setWidth(40), | 64 | ScreenUtil().setWidth(40), |
| 51 | ScreenUtil().setWidth(30)), | 65 | ScreenUtil().setWidth(30)), |
| 52 | - padding: EdgeInsets.all(ScreenUtil().setWidth(30)), | ||
| 53 | decoration: BoxDecoration( | 66 | decoration: BoxDecoration( |
| 54 | - color: | ||
| 55 | - notSelect ? MyColours.color_FFF0E5 : MyColours.color_EEF0F2, | ||
| 56 | - borderRadius: BorderRadius.circular(ScreenUtil().setWidth(20))), | 67 | + boxShadow: [ |
| 68 | + BoxShadow( | ||
| 69 | + color: MyColours.color_EEF0F2, | ||
| 70 | + blurRadius: ScreenUtil().setWidth(20)) | ||
| 71 | + ], | ||
| 72 | + borderRadius: BorderRadius.only( | ||
| 73 | + bottomLeft: Radius.circular(ScreenUtil().setWidth(20)), | ||
| 74 | + topLeft: Radius.circular(ScreenUtil().setWidth(20)), | ||
| 75 | + topRight: Radius.circular(ScreenUtil().setWidth(20)), | ||
| 76 | + ), | ||
| 77 | + ), | ||
| 57 | child: Column( | 78 | child: Column( |
| 58 | mainAxisSize: MainAxisSize.min, | 79 | mainAxisSize: MainAxisSize.min, |
| 59 | crossAxisAlignment: CrossAxisAlignment.start, | 80 | crossAxisAlignment: CrossAxisAlignment.start, |
| 60 | children: [ | 81 | children: [ |
| 61 | Container( | 82 | Container( |
| 62 | - width: ScreenUtil().setWidth(360), | ||
| 63 | - child: Row( | ||
| 64 | - crossAxisAlignment: CrossAxisAlignment.end, | ||
| 65 | - children: [ | ||
| 66 | - Container( | ||
| 67 | - constraints: BoxConstraints( | ||
| 68 | - maxWidth: ScreenUtil().setWidth(190)), | ||
| 69 | - child: Text( | ||
| 70 | - sunModel.aname, | ||
| 71 | - maxLines: 2, | ||
| 72 | - overflow: TextOverflow.ellipsis, | ||
| 73 | - style: TextStyle( | ||
| 74 | - color: notSelect | ||
| 75 | - ? MyColours.color_F05522 | ||
| 76 | - : MyColours.color_999999, | ||
| 77 | - fontSize: ScreenUtil().setSp(44), | ||
| 78 | - fontWeight: FontWeight.bold), | ||
| 79 | - ), | 83 | + width: ScreenUtil().setWidth(335 * 2 - 20), |
| 84 | + padding: EdgeInsets.fromLTRB( | ||
| 85 | + ScreenUtil().setWidth(30), | ||
| 86 | + ScreenUtil().setWidth(26 * 2), | ||
| 87 | + ScreenUtil().setWidth(10), | ||
| 88 | + ScreenUtil().setWidth(20)), | ||
| 89 | + decoration: BoxDecoration( | ||
| 90 | + color: notSelect | ||
| 91 | + ? MyColours.color_FFF0E5 | ||
| 92 | + : MyColours.color_f5f5f5, | ||
| 93 | + borderRadius: BorderRadius.only( | ||
| 94 | + topLeft: Radius.circular(ScreenUtil().setWidth(20)), | ||
| 95 | + topRight: Radius.circular(0), | ||
| 96 | + bottomLeft: ObjectUtil.isNotEmpty(sunModel.explain) | ||
| 97 | + ? Radius.circular(0) | ||
| 98 | + : Radius.circular(ScreenUtil().setWidth(20)), | ||
| 80 | ), | 99 | ), |
| 81 | - Expanded( | ||
| 82 | - flex: 1, | ||
| 83 | - child: Container( | ||
| 84 | - padding: EdgeInsets.only( | ||
| 85 | - bottom: ScreenUtil().setWidth(6)), | ||
| 86 | - child: Text('( ${sunModel.desc} )', | ||
| 87 | - maxLines: 1, | ||
| 88 | - overflow: TextOverflow.ellipsis, | ||
| 89 | - style: TextStyle( | ||
| 90 | - color: notSelect | ||
| 91 | - ? MyColours.color_F05522 | ||
| 92 | - : MyColours.color_999999, | ||
| 93 | - fontSize: ScreenUtil().setSp(30), | ||
| 94 | - fontWeight: FontWeight.normal)), | ||
| 95 | - )) | ||
| 96 | - ], | ||
| 97 | - ), | ||
| 98 | - ), | ||
| 99 | - (ObjectUtil.isNotEmpty(sunModel.stime) && | ||
| 100 | - sunModel.stime != '0') || | ||
| 101 | - (ObjectUtil.isNotEmpty(sunModel.etime) && | ||
| 102 | - sunModel.etime != '0') | ||
| 103 | - ? Container( | ||
| 104 | - padding: | ||
| 105 | - EdgeInsets.only(top: ScreenUtil().setWidth(20)), | ||
| 106 | - child: Text( | ||
| 107 | - '有效期:${ObjectUtil.isNotEmpty(sunModel.stime) ? Utils.getDateStrFromJiekou(sunModel.stime) : '--'} 至 ${ObjectUtil.isNotEmpty(sunModel.etime) ? Utils.getDateStrFromJiekou(sunModel.etime) : '--'}', | ||
| 108 | - style: TextStyle( | ||
| 109 | - color: notSelect | ||
| 110 | - ? MyColours.color_EF7249 | ||
| 111 | - : MyColours.color_B7B7B7, | ||
| 112 | - fontSize: ScreenUtil().setSp(22))), | ||
| 113 | - ) | ||
| 114 | - : Container(), | 100 | + ), |
| 101 | + child: Stack( | ||
| 102 | + children: [ | ||
| 103 | + Column( | ||
| 104 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 105 | + children: [ | ||
| 106 | + Container( | ||
| 107 | + width: ScreenUtil().setWidth(232 * 2), | ||
| 108 | + child: Container( | ||
| 109 | + height: ScreenUtil().setWidth(28 * 2), | ||
| 110 | + constraints: BoxConstraints( | ||
| 111 | + maxWidth: ScreenUtil().setWidth(190)), | ||
| 112 | + child: Text( | ||
| 113 | + sunModel.aname, | ||
| 114 | + maxLines: 2, | ||
| 115 | + overflow: TextOverflow.ellipsis, | ||
| 116 | + style: TextStyle( | ||
| 117 | + color: notSelect | ||
| 118 | + ? MyColours.color_F05522 | ||
| 119 | + : MyColours.color_B0B0B0, | ||
| 120 | + fontSize: ScreenUtil().setSp(40), | ||
| 121 | + fontWeight: FontWeight.bold), | ||
| 122 | + ), | ||
| 123 | + )), | ||
| 124 | + Container( | ||
| 125 | + height: ScreenUtil().setWidth(20 * 2), | ||
| 126 | + width: ScreenUtil().setWidth(232 * 2), | ||
| 127 | + child: Text('${sunModel.desc}', | ||
| 128 | + maxLines: 1, | ||
| 129 | + overflow: TextOverflow.ellipsis, | ||
| 130 | + style: TextStyle( | ||
| 131 | + color: notSelect | ||
| 132 | + ? MyColours.color_F05522 | ||
| 133 | + : MyColours.color_B0B0B0, | ||
| 134 | + fontSize: ScreenUtil().setSp(28), | ||
| 135 | + fontWeight: FontWeight.normal)), | ||
| 136 | + ), | ||
| 137 | + VEmptyView(20), | ||
| 138 | + (ObjectUtil.isNotEmpty(sunModel.stime) && | ||
| 139 | + sunModel.stime != '0') || | ||
| 140 | + (ObjectUtil.isNotEmpty(sunModel.etime) && | ||
| 141 | + sunModel.etime != '0') | ||
| 142 | + ? Container( | ||
| 143 | + child: Text( | ||
| 144 | + '有效期:${ObjectUtil.isNotEmpty(sunModel.stime) ? Utils.getDateStrFromJiekou(sunModel.stime) : '--'} 至 ${ObjectUtil.isNotEmpty(sunModel.etime) ? Utils.getDateStrFromJiekou(sunModel.etime) : '--'}', | ||
| 145 | + style: TextStyle( | ||
| 146 | + color: notSelect | ||
| 147 | + ? MyColours.color_EF7249 | ||
| 148 | + : MyColours.color_B8B8B8, | ||
| 149 | + fontSize: ScreenUtil().setSp(22))), | ||
| 150 | + ) | ||
| 151 | + : Container(), | ||
| 152 | + ], | ||
| 153 | + ), | ||
| 154 | + widget.from == 'select' | ||
| 155 | + ? widget.showCheck | ||
| 156 | + ? Positioned( | ||
| 157 | + right: 0, | ||
| 158 | + top: ScreenUtil().setWidth(20), | ||
| 159 | + child: Image.asset( | ||
| 160 | + Utils.getImgPath( | ||
| 161 | + widget.couponSonModel.isCheck | ||
| 162 | + ? 'check_r' | ||
| 163 | + : 'check_un'), | ||
| 164 | + width: ScreenUtil().setWidth(40), | ||
| 165 | + height: ScreenUtil().setWidth(40), | ||
| 166 | + )) | ||
| 167 | + : Container() | ||
| 168 | + : Positioned( | ||
| 169 | + right: 0, | ||
| 170 | + top: ScreenUtil().setWidth(20), | ||
| 171 | + child: widget.showBtn | ||
| 172 | + ? RoundButton( | ||
| 173 | + width: ScreenUtil().setWidth(58 * 2), | ||
| 174 | + height: ScreenUtil().setWidth(26 * 2), | ||
| 175 | + radius: ScreenUtil().setWidth(40), | ||
| 176 | + text: notSelect ? '停用' : '启用', | ||
| 177 | + fontSize: 28, | ||
| 178 | + textColor: notSelect | ||
| 179 | + ? MyColours.color_F05522 | ||
| 180 | + : MyColours.color_999999, | ||
| 181 | + gradientStart: notSelect | ||
| 182 | + ? MyColours.color_FFE2D3 | ||
| 183 | + : MyColours.color_E9E9E9, | ||
| 184 | + gradientEnd: notSelect | ||
| 185 | + ? MyColours.color_FFE2D3 | ||
| 186 | + : MyColours.color_E9E9E9, | ||
| 187 | + onPressed: widget.onPressedSwich, | ||
| 188 | + ) | ||
| 189 | + : Container()) | ||
| 190 | + ], | ||
| 191 | + )), | ||
| 115 | ObjectUtil.isNotEmpty(sunModel.explain) | 192 | ObjectUtil.isNotEmpty(sunModel.explain) |
| 116 | - ? Container( | ||
| 117 | - margin: EdgeInsets.only(top: ScreenUtil().setWidth(30)), | ||
| 118 | - padding: EdgeInsets.all(ScreenUtil().setWidth(20)), | ||
| 119 | - width: double.infinity, | ||
| 120 | - child: Text('说明:${sunModel.explain}', | ||
| 121 | - maxLines: 30, | ||
| 122 | - overflow: TextOverflow.ellipsis, | ||
| 123 | - softWrap: false, | ||
| 124 | - style: TextStyle( | 193 | + ? InkWell( |
| 194 | + onTap: () { | ||
| 195 | + if (explainH > 19) { | ||
| 196 | + setState(() { | ||
| 197 | + widget.couponSonModel.showText = | ||
| 198 | + !widget.couponSonModel.showText; | ||
| 199 | + }); | ||
| 200 | + } | ||
| 201 | + }, | ||
| 202 | + child: Container( | ||
| 203 | + width: double.infinity, | ||
| 204 | + decoration: BoxDecoration( | ||
| 125 | color: notSelect | 205 | color: notSelect |
| 126 | - ? MyColours.color_EF7249 | ||
| 127 | - : MyColours.color_999999, | ||
| 128 | - fontSize: ScreenUtil().setSp(24))), | ||
| 129 | - decoration: BoxDecoration( | ||
| 130 | - color: MyColours.color_ffffff, | ||
| 131 | - borderRadius: BorderRadius.circular( | ||
| 132 | - ScreenUtil().setWidth(30))), | 206 | + ? MyColours.color_ffffff |
| 207 | + : MyColours.color_FAFAFA, | ||
| 208 | + borderRadius: BorderRadius.only( | ||
| 209 | + bottomLeft: Radius.circular( | ||
| 210 | + ScreenUtil().setWidth(20)), | ||
| 211 | + bottomRight: Radius.circular( | ||
| 212 | + ScreenUtil().setWidth(20)))), | ||
| 213 | + child: Row( | ||
| 214 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 215 | + children: [ | ||
| 216 | + widget.couponSonModel.showText | ||
| 217 | + ? Container( | ||
| 218 | + padding: EdgeInsets.fromLTRB( | ||
| 219 | + ScreenUtil().setWidth(30), | ||
| 220 | + ScreenUtil().setWidth(14), | ||
| 221 | + ScreenUtil().setWidth(0), | ||
| 222 | + ScreenUtil().setWidth(14)), | ||
| 223 | + width: ScreenUtil.screenWidthDp - | ||
| 224 | + ScreenUtil().setWidth(92 * 2), | ||
| 225 | + child: Text('说明:${sunModel.explain}', | ||
| 226 | + maxLines: 5, | ||
| 227 | + style: TextStyle( | ||
| 228 | + color: notSelect | ||
| 229 | + ? MyColours.color_999999 | ||
| 230 | + : MyColours.color_cccccc, | ||
| 231 | + fontSize: | ||
| 232 | + ScreenUtil().setSp(24))), | ||
| 233 | + ) | ||
| 234 | + : Container( | ||
| 235 | + padding: EdgeInsets.fromLTRB( | ||
| 236 | + ScreenUtil().setWidth(30), | ||
| 237 | + ScreenUtil().setWidth(14), | ||
| 238 | + ScreenUtil().setWidth(0), | ||
| 239 | + ScreenUtil().setWidth(14)), | ||
| 240 | + width: ScreenUtil.screenWidthDp - | ||
| 241 | + ScreenUtil().setWidth(92 * 2) + | ||
| 242 | + ScreenUtil().setWidth(20), | ||
| 243 | + child: Text('说明:${sunModel.explain}', | ||
| 244 | + maxLines: 1, | ||
| 245 | + overflow: TextOverflow.fade, | ||
| 246 | + softWrap: false, | ||
| 247 | + style: TextStyle( | ||
| 248 | + color: notSelect | ||
| 249 | + ? MyColours.color_999999 | ||
| 250 | + : MyColours.color_cccccc, | ||
| 251 | + fontSize: | ||
| 252 | + ScreenUtil().setSp(24))), | ||
| 253 | + ), | ||
| 254 | + Spacer(), | ||
| 255 | + explainH > 19 | ||
| 256 | + ? Container( | ||
| 257 | + margin: EdgeInsets.only( | ||
| 258 | + top: ScreenUtil().setWidth(12)), | ||
| 259 | + child: Image.asset( | ||
| 260 | + !widget.couponSonModel.showText | ||
| 261 | + ? Utils.getImgPath('quan_down') | ||
| 262 | + : Utils.getImgPath('quan_up'), | ||
| 263 | + width: ScreenUtil().setWidth(68), | ||
| 264 | + height: ScreenUtil().setWidth(44)), | ||
| 265 | + ) | ||
| 266 | + : Container(), | ||
| 267 | + HEmptyView(14) | ||
| 268 | + ], | ||
| 269 | + )), | ||
| 133 | ) | 270 | ) |
| 134 | : Container(), | 271 | : Container(), |
| 135 | ], | 272 | ], |
| 136 | ), | 273 | ), |
| 137 | ), | 274 | ), |
| 138 | Positioned( | 275 | Positioned( |
| 139 | - top: ScreenUtil().setWidth(30), | ||
| 140 | - right: ScreenUtil().setWidth(60), | 276 | + top: 0, |
| 277 | + right: ScreenUtil().setWidth(40), | ||
| 278 | + child: Container( | ||
| 279 | + child: ObjectUtil.isNotEmpty(sunModel.explain) | ||
| 280 | + ? Image.asset( | ||
| 281 | + Utils.getImgPath( | ||
| 282 | + notSelect ? 'quan_zhi' : 'quan_un_zhi'), | ||
| 283 | + width: ScreenUtil().setWidth(20), | ||
| 284 | + height: ScreenUtil().setWidth(109 * 2)) | ||
| 285 | + : Image.asset( | ||
| 286 | + Utils.getImgPath( | ||
| 287 | + notSelect ? 'quan_wan' : 'quan_un_wan'), | ||
| 288 | + width: ScreenUtil().setWidth(20), | ||
| 289 | + height: ScreenUtil().setWidth(109 * 2)), | ||
| 290 | + )), | ||
| 291 | + Positioned( | ||
| 292 | + top: 0, | ||
| 293 | + right: ScreenUtil().setWidth(40), | ||
| 141 | child: InkWell( | 294 | child: InkWell( |
| 142 | onTap: widget.onPressedSwich, | 295 | onTap: widget.onPressedSwich, |
| 143 | - child: Row( | ||
| 144 | - children: [ | ||
| 145 | - Column( | ||
| 146 | - crossAxisAlignment: CrossAxisAlignment.start, | ||
| 147 | - children: [ | ||
| 148 | - Text('被领取:${sunModel.receiveNum}张', | ||
| 149 | - style: TextStyle( | ||
| 150 | - color: notSelect | ||
| 151 | - ? MyColours.color_EF7249 | ||
| 152 | - : MyColours.color_B7B7B7, | ||
| 153 | - fontSize: ScreenUtil().setSp(22))), | ||
| 154 | - VEmptyView(5), | ||
| 155 | - Text('已使用:${sunModel.useNum}张', | ||
| 156 | - style: TextStyle( | ||
| 157 | - color: notSelect | ||
| 158 | - ? MyColours.color_EF7249 | ||
| 159 | - : MyColours.color_B7B7B7, | ||
| 160 | - fontSize: ScreenUtil().setSp(22))), | ||
| 161 | - ], | ||
| 162 | - ), | ||
| 163 | - HEmptyView(20), | ||
| 164 | - widget.showBtn | ||
| 165 | - ? RoundButton( | ||
| 166 | - width: ScreenUtil().setWidth(100), | ||
| 167 | - height: ScreenUtil().setWidth(50), | ||
| 168 | - radius: ScreenUtil().setWidth(40), | ||
| 169 | - text: notSelect ? '停用' : '启用', | ||
| 170 | - textColor: notSelect | ||
| 171 | - ? MyColours.color_F05522 | ||
| 172 | - : MyColours.color_999999, | ||
| 173 | - gradientStart: notSelect | ||
| 174 | - ? MyColours.color_FFE2D3 | ||
| 175 | - : MyColours.color_E9E9E9, | ||
| 176 | - gradientEnd: notSelect | ||
| 177 | - ? MyColours.color_FFE2D3 | ||
| 178 | - : MyColours.color_E9E9E9, | ||
| 179 | - onPressed: widget.onPressedSwich, | ||
| 180 | - ) | ||
| 181 | - : Container() | ||
| 182 | - ], | 296 | + child: Container( |
| 297 | + constraints: | ||
| 298 | + BoxConstraints(maxWidth: ScreenUtil().setWidth(335 * 2)), | ||
| 299 | + decoration: BoxDecoration( | ||
| 300 | + color: notSelect | ||
| 301 | + ? MyColours.color_FFE1CB | ||
| 302 | + : MyColours.color_EEF0F2, | ||
| 303 | + borderRadius: BorderRadius.only( | ||
| 304 | + bottomLeft: Radius.circular(ScreenUtil().setWidth(20)), | ||
| 305 | + topRight: Radius.circular(ScreenUtil().setWidth(20)), | ||
| 306 | + bottomRight: | ||
| 307 | + Radius.circular(ScreenUtil().setWidth(20)))), | ||
| 308 | + padding: EdgeInsets.symmetric( | ||
| 309 | + horizontal: ScreenUtil().setWidth(20), | ||
| 310 | + vertical: ScreenUtil().setWidth(2)), | ||
| 311 | + child: Text( | ||
| 312 | + '被领取:${sunModel.receiveNum}张 已使用:${sunModel.useNum}张', | ||
| 313 | + maxLines: 1, | ||
| 314 | + overflow: TextOverflow.ellipsis, | ||
| 315 | + style: TextStyle( | ||
| 316 | + color: notSelect | ||
| 317 | + ? MyColours.color_EF7249 | ||
| 318 | + : MyColours.color_B7B7B7, | ||
| 319 | + fontSize: ScreenUtil().setSp(20))), | ||
| 183 | ), | 320 | ), |
| 184 | ), | 321 | ), |
| 185 | ) | 322 | ) |
| @@ -81,6 +81,7 @@ class _CouponPageState extends State<CouponPage> { | @@ -81,6 +81,7 @@ class _CouponPageState extends State<CouponPage> { | ||
| 81 | Widget build(BuildContext context) { | 81 | Widget build(BuildContext context) { |
| 82 | couponProvider = Provider.of<CouponProvider>(context, listen: true); | 82 | couponProvider = Provider.of<CouponProvider>(context, listen: true); |
| 83 | return Scaffold( | 83 | return Scaffold( |
| 84 | + backgroundColor: MyColours.color_fefefe, | ||
| 84 | appBar: SystemAppBar('线上券', rightImgName: '历史券', onTap: () { | 85 | appBar: SystemAppBar('线上券', rightImgName: '历史券', onTap: () { |
| 85 | EventBus().emit('changeStatusColor'); | 86 | EventBus().emit('changeStatusColor'); |
| 86 | Navigator.of(context).pop(); | 87 | Navigator.of(context).pop(); |
| @@ -65,25 +65,68 @@ class _CouponSelectPageState extends State<CouponSelectPage> { | @@ -65,25 +65,68 @@ class _CouponSelectPageState extends State<CouponSelectPage> { | ||
| 65 | Widget build(BuildContext context) { | 65 | Widget build(BuildContext context) { |
| 66 | couponProvider = Provider.of<CouponProvider>(context, listen: true); | 66 | couponProvider = Provider.of<CouponProvider>(context, listen: true); |
| 67 | return Scaffold( | 67 | return Scaffold( |
| 68 | - appBar: SystemAppBar( | ||
| 69 | - '优惠券', | ||
| 70 | - onTap: () { | ||
| 71 | - Navigator.pop(context); | ||
| 72 | - Utils.changeStatusColor(color: Colors.transparent); | ||
| 73 | - }, | ||
| 74 | - rightImgName: !widget.hasModify && | ||
| 75 | - couponProvider.pageStateSelect == PageState.Success | ||
| 76 | - ? couponProvider.checkValue | ||
| 77 | - ? '取消全选' | ||
| 78 | - : '全选' | ||
| 79 | - : '', | ||
| 80 | - onTapRight: () { | ||
| 81 | - if (couponProvider.checkValue) { | ||
| 82 | - couponProvider.cancelAll(); | ||
| 83 | - } else { | ||
| 84 | - couponProvider.addAll(); | ||
| 85 | - } | ||
| 86 | - }, | 68 | + appBar: AppBar( |
| 69 | + elevation: 0, | ||
| 70 | + leading: InkWell( | ||
| 71 | + onTap: () { | ||
| 72 | + Navigator.pop(context); | ||
| 73 | + Utils.changeStatusColor(color: Colors.transparent); | ||
| 74 | + }, | ||
| 75 | + child: Padding( | ||
| 76 | + padding: EdgeInsets.symmetric( | ||
| 77 | + horizontal: ScreenUtil().setWidth(40), | ||
| 78 | + vertical: ScreenUtil().setWidth(15)), | ||
| 79 | + child: Row( | ||
| 80 | + children: <Widget>[ | ||
| 81 | + Image.asset( | ||
| 82 | + "assets/icon_back.png", | ||
| 83 | + width: ScreenUtil().setWidth(20), | ||
| 84 | + height: ScreenUtil().setWidth(31), | ||
| 85 | + ) | ||
| 86 | + ], | ||
| 87 | + )), | ||
| 88 | + ), | ||
| 89 | + title: Text( | ||
| 90 | + '优惠券', | ||
| 91 | + style: TextStyle( | ||
| 92 | + color: MyColours.color_353535, | ||
| 93 | + fontSize: ScreenUtil().setSp(34), | ||
| 94 | + decoration: TextDecoration.none), | ||
| 95 | + ), | ||
| 96 | + actions: <Widget>[ | ||
| 97 | + !widget.hasModify && | ||
| 98 | + couponProvider.pageStateSelect == PageState.Success | ||
| 99 | + ? InkWell( | ||
| 100 | + onTap: () { | ||
| 101 | + if (couponProvider.checkValue) { | ||
| 102 | + couponProvider.cancelAll(); | ||
| 103 | + } else { | ||
| 104 | + couponProvider.addAll(); | ||
| 105 | + } | ||
| 106 | + }, | ||
| 107 | + child: Padding( | ||
| 108 | + padding: | ||
| 109 | + EdgeInsets.only(right: ScreenUtil().setWidth(40)), | ||
| 110 | + child: Row(children: [ | ||
| 111 | + Container( | ||
| 112 | + // color: Colors.red, | ||
| 113 | + alignment: Alignment.center, | ||
| 114 | + child: Text( | ||
| 115 | + '全选', | ||
| 116 | + style: TextStyle( | ||
| 117 | + color: MyColours.color_199095, | ||
| 118 | + fontSize: ScreenUtil().setSp(34)), | ||
| 119 | + )), | ||
| 120 | + HEmptyView(20), | ||
| 121 | + Image.asset( | ||
| 122 | + Utils.getImgPath(couponProvider.checkValue | ||
| 123 | + ? 'check_g' | ||
| 124 | + : 'check_un'), | ||
| 125 | + width: ScreenUtil().setWidth(40)) | ||
| 126 | + ]))) | ||
| 127 | + : Container() | ||
| 128 | + ], | ||
| 129 | + centerTitle: true, // 标题居中 | ||
| 87 | ), | 130 | ), |
| 88 | body: WillPopScope( | 131 | body: WillPopScope( |
| 89 | child: Column( | 132 | child: Column( |
| @@ -109,61 +152,63 @@ class _CouponSelectPageState extends State<CouponSelectPage> { | @@ -109,61 +152,63 @@ class _CouponSelectPageState extends State<CouponSelectPage> { | ||
| 109 | SliverList( | 152 | SliverList( |
| 110 | delegate: SliverChildBuilderDelegate( | 153 | delegate: SliverChildBuilderDelegate( |
| 111 | (BuildContext context, int index) { | 154 | (BuildContext context, int index) { |
| 155 | + return VEmptyView(40); | ||
| 156 | + }, childCount: 1), | ||
| 157 | + ), | ||
| 158 | + SliverList( | ||
| 159 | + delegate: SliverChildBuilderDelegate( | ||
| 160 | + (BuildContext context, int index) { | ||
| 112 | return InkWell( | 161 | return InkWell( |
| 113 | - onTap: () { | ||
| 114 | - couponProvider.couponListSelect[index].isCheck = | ||
| 115 | - !couponProvider | ||
| 116 | - .couponListSelect[index].isCheck; | ||
| 117 | - if (couponProvider | ||
| 118 | - .couponListSelect[index].isCheck) { | ||
| 119 | - couponProvider.addData(index); | ||
| 120 | - } else { | ||
| 121 | - couponProvider.cancelData(index); | ||
| 122 | - } | ||
| 123 | - couponProvider.getCheckValue(); | ||
| 124 | - }, | ||
| 125 | - child: Row( | ||
| 126 | - children: [ | ||
| 127 | - HEmptyView(30), | ||
| 128 | - !widget.hasModify | ||
| 129 | - ? Checkbox( | ||
| 130 | - value: couponProvider | ||
| 131 | - .couponListSelect[index].isCheck, | ||
| 132 | - checkColor: MyColours.color_ffffff, | ||
| 133 | - activeColor: MyColours.app_main, | ||
| 134 | - onChanged: (bool value) { | ||
| 135 | - //改这里 ******8 | ||
| 136 | - couponProvider.couponListSelect[index] | ||
| 137 | - .isCheck = | ||
| 138 | - !couponProvider | ||
| 139 | - .couponListSelect[index] | ||
| 140 | - .isCheck; | ||
| 141 | - if (couponProvider | ||
| 142 | - .couponListSelect[index] | ||
| 143 | - .isCheck) { | ||
| 144 | - couponProvider.addData(index); | ||
| 145 | - } else { | ||
| 146 | - couponProvider.cancelData(index); | ||
| 147 | - } | ||
| 148 | - couponProvider.getCheckValue(); | ||
| 149 | - }, | ||
| 150 | - ) | ||
| 151 | - : Container(), | ||
| 152 | - // Image.asset( | ||
| 153 | - // couponProvider.listData[index]['checked'] | ||
| 154 | - // ? 'assets/select.png' | ||
| 155 | - // : 'assets/unselect.png', | ||
| 156 | - // width: ScreenUtil().setWidth(44)), | ||
| 157 | - Expanded( | ||
| 158 | - child: CouponItem( | 162 | + onTap: () { |
| 163 | + couponProvider.couponListSelect[index].isCheck = | ||
| 164 | + !couponProvider | ||
| 165 | + .couponListSelect[index].isCheck; | ||
| 166 | + if (couponProvider | ||
| 167 | + .couponListSelect[index].isCheck) { | ||
| 168 | + couponProvider.addData(index); | ||
| 169 | + } else { | ||
| 170 | + couponProvider.cancelData(index); | ||
| 171 | + } | ||
| 172 | + couponProvider.getCheckValue(); | ||
| 173 | + }, | ||
| 174 | + // child: Row( | ||
| 175 | + // children: [ | ||
| 176 | + // HEmptyView(30), | ||
| 177 | + // !widget.hasModify | ||
| 178 | + // ? Checkbox( | ||
| 179 | + // value: couponProvider | ||
| 180 | + // .couponListSelect[index].isCheck, | ||
| 181 | + // checkColor: MyColours.color_ffffff, | ||
| 182 | + // activeColor: MyColours.app_main, | ||
| 183 | + // onChanged: (bool value) {}, | ||
| 184 | + // ) | ||
| 185 | + // : Container(), | ||
| 186 | + // Image.asset( | ||
| 187 | + // couponProvider.listData[index]['checked'] | ||
| 188 | + // ? 'assets/select.png' | ||
| 189 | + // : 'assets/unselect.png', | ||
| 190 | + // width: ScreenUtil().setWidth(44)), | ||
| 191 | + child: CouponItem( | ||
| 159 | from: 'select', | 192 | from: 'select', |
| 193 | + showCheck: !widget.hasModify, | ||
| 160 | couponSonModel: | 194 | couponSonModel: |
| 161 | couponProvider.couponListSelect[index], | 195 | couponProvider.couponListSelect[index], |
| 162 | - onPressed: () {}, | ||
| 163 | - )) | ||
| 164 | - ], | ||
| 165 | - ), | ||
| 166 | - ); | 196 | + onPressed: () { |
| 197 | + //改这里 ******8 | ||
| 198 | + if (!widget.hasModify) { | ||
| 199 | + couponProvider | ||
| 200 | + .couponListSelect[index].isCheck = | ||
| 201 | + !couponProvider | ||
| 202 | + .couponListSelect[index].isCheck; | ||
| 203 | + if (couponProvider | ||
| 204 | + .couponListSelect[index].isCheck) { | ||
| 205 | + couponProvider.addData(index); | ||
| 206 | + } else { | ||
| 207 | + couponProvider.cancelData(index); | ||
| 208 | + } | ||
| 209 | + couponProvider.getCheckValue(); | ||
| 210 | + } | ||
| 211 | + })); | ||
| 167 | }, childCount: couponProvider.couponListSelect.length), | 212 | }, childCount: couponProvider.couponListSelect.length), |
| 168 | ) | 213 | ) |
| 169 | ], | 214 | ], |
| @@ -6,6 +6,8 @@ import 'package:one_key/provider/user_model.dart'; | @@ -6,6 +6,8 @@ import 'package:one_key/provider/user_model.dart'; | ||
| 6 | import 'package:one_key/res/colors.dart'; | 6 | import 'package:one_key/res/colors.dart'; |
| 7 | import 'package:one_key/utils/navigator_util.dart'; | 7 | import 'package:one_key/utils/navigator_util.dart'; |
| 8 | import 'package:one_key/utils/utils.dart'; | 8 | import 'package:one_key/utils/utils.dart'; |
| 9 | +import 'package:one_key/widgets/h_empty_view.dart'; | ||
| 10 | +import 'package:one_key/widgets/round_button.dart'; | ||
| 9 | import 'package:one_key/widgets/v_empty_view.dart'; | 11 | import 'package:one_key/widgets/v_empty_view.dart'; |
| 10 | import 'package:provider/provider.dart'; | 12 | import 'package:provider/provider.dart'; |
| 11 | 13 | ||
| @@ -101,7 +103,7 @@ class InvicationPageState extends State<InvicationPage> { | @@ -101,7 +103,7 @@ class InvicationPageState extends State<InvicationPage> { | ||
| 101 | Widget _middleWidget(String title, String content) { | 103 | Widget _middleWidget(String title, String content) { |
| 102 | return Column( | 104 | return Column( |
| 103 | children: <Widget>[ | 105 | children: <Widget>[ |
| 104 | - VEmptyView(38), | 106 | + VEmptyView(80), |
| 105 | Row( | 107 | Row( |
| 106 | mainAxisSize: MainAxisSize.min, | 108 | mainAxisSize: MainAxisSize.min, |
| 107 | children: <Widget>[ | 109 | children: <Widget>[ |
| @@ -115,8 +117,8 @@ class InvicationPageState extends State<InvicationPage> { | @@ -115,8 +117,8 @@ class InvicationPageState extends State<InvicationPage> { | ||
| 115 | EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(13)), | 117 | EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(13)), |
| 116 | child: Text(title, | 118 | child: Text(title, |
| 117 | style: TextStyle( | 119 | style: TextStyle( |
| 118 | - color: MyColours.color_eadab9, | ||
| 119 | - fontSize: ScreenUtil().setSp(32))), | 120 | + color: MyColours.color_CEB689, |
| 121 | + fontSize: ScreenUtil().setSp(28))), | ||
| 120 | ), | 122 | ), |
| 121 | Image.asset( | 123 | Image.asset( |
| 122 | "assets/invication_line_right.png", | 124 | "assets/invication_line_right.png", |
| @@ -130,8 +132,8 @@ class InvicationPageState extends State<InvicationPage> { | @@ -130,8 +132,8 @@ class InvicationPageState extends State<InvicationPage> { | ||
| 130 | child: Text( | 132 | child: Text( |
| 131 | content, | 133 | content, |
| 132 | style: TextStyle( | 134 | style: TextStyle( |
| 133 | - color: MyColours.color_ffffff, | ||
| 134 | - fontSize: ScreenUtil().setSp(34)), | 135 | + color: MyColours.color_F2F2F2, |
| 136 | + fontSize: ScreenUtil().setSp(36)), | ||
| 135 | ), | 137 | ), |
| 136 | ) | 138 | ) |
| 137 | ], | 139 | ], |
| @@ -169,8 +171,8 @@ class InvicationPageState extends State<InvicationPage> { | @@ -169,8 +171,8 @@ class InvicationPageState extends State<InvicationPage> { | ||
| 169 | children: <Widget>[ | 171 | children: <Widget>[ |
| 170 | Image.asset( | 172 | Image.asset( |
| 171 | "assets/img_ydap.png", | 173 | "assets/img_ydap.png", |
| 172 | - width: ScreenUtil().setWidth(500), | ||
| 173 | - height: ScreenUtil().setHeight(300), | 174 | + width: ScreenUtil().setWidth(190 * 2), |
| 175 | + height: ScreenUtil().setHeight(200), | ||
| 174 | ), | 176 | ), |
| 175 | VEmptyView(69), | 177 | VEmptyView(69), |
| 176 | Row( | 178 | Row( |
| @@ -179,7 +181,7 @@ class InvicationPageState extends State<InvicationPage> { | @@ -179,7 +181,7 @@ class InvicationPageState extends State<InvicationPage> { | ||
| 179 | Container( | 181 | Container( |
| 180 | width: ScreenUtil().setWidth(108), | 182 | width: ScreenUtil().setWidth(108), |
| 181 | height: ScreenUtil().setHeight(2), | 183 | height: ScreenUtil().setHeight(2), |
| 182 | - color: MyColours.color_ffffff, | 184 | + color: MyColours.color_979797, |
| 183 | ), | 185 | ), |
| 184 | Container( | 186 | Container( |
| 185 | width: ScreenUtil().setWidth(442), | 187 | width: ScreenUtil().setWidth(442), |
| @@ -187,7 +189,7 @@ class InvicationPageState extends State<InvicationPage> { | @@ -187,7 +189,7 @@ class InvicationPageState extends State<InvicationPage> { | ||
| 187 | alignment: Alignment.center, | 189 | alignment: Alignment.center, |
| 188 | decoration: BoxDecoration( | 190 | decoration: BoxDecoration( |
| 189 | border: Border.all( | 191 | border: Border.all( |
| 190 | - color: MyColours.color_ffffff, | 192 | + color: MyColours.color_979797, |
| 191 | width: | 193 | width: |
| 192 | ScreenUtil().setWidth(2)), | 194 | ScreenUtil().setWidth(2)), |
| 193 | borderRadius: BorderRadius.all( | 195 | borderRadius: BorderRadius.all( |
| @@ -196,14 +198,14 @@ class InvicationPageState extends State<InvicationPage> { | @@ -196,14 +198,14 @@ class InvicationPageState extends State<InvicationPage> { | ||
| 196 | child: Text( | 198 | child: Text( |
| 197 | "订包间,用周到安排", | 199 | "订包间,用周到安排", |
| 198 | style: TextStyle( | 200 | style: TextStyle( |
| 199 | - color: MyColours.color_ffffff, | 201 | + color: MyColours.color_999999, |
| 200 | fontSize: ScreenUtil().setSp(28)), | 202 | fontSize: ScreenUtil().setSp(28)), |
| 201 | ), | 203 | ), |
| 202 | ), | 204 | ), |
| 203 | Container( | 205 | Container( |
| 204 | width: ScreenUtil().setWidth(108), | 206 | width: ScreenUtil().setWidth(108), |
| 205 | height: ScreenUtil().setHeight(2), | 207 | height: ScreenUtil().setHeight(2), |
| 206 | - color: MyColours.color_ffffff, | 208 | + color: MyColours.color_979797, |
| 207 | ), | 209 | ), |
| 208 | ], | 210 | ], |
| 209 | ), | 211 | ), |
| @@ -211,7 +213,7 @@ class InvicationPageState extends State<InvicationPage> { | @@ -211,7 +213,7 @@ class InvicationPageState extends State<InvicationPage> { | ||
| 211 | _middleWidget("包间", | 213 | _middleWidget("包间", |
| 212 | widget.tableInfo.replaceAll("\n", "")), | 214 | widget.tableInfo.replaceAll("\n", "")), |
| 213 | _middleWidget("时间", dateTimeStr), | 215 | _middleWidget("时间", dateTimeStr), |
| 214 | - VEmptyView(38), | 216 | + VEmptyView(80), |
| 215 | Column( | 217 | Column( |
| 216 | children: <Widget>[ | 218 | children: <Widget>[ |
| 217 | Row( | 219 | Row( |
| @@ -229,9 +231,9 @@ class InvicationPageState extends State<InvicationPage> { | @@ -229,9 +231,9 @@ class InvicationPageState extends State<InvicationPage> { | ||
| 229 | child: Text("地址导航", | 231 | child: Text("地址导航", |
| 230 | style: TextStyle( | 232 | style: TextStyle( |
| 231 | color: | 233 | color: |
| 232 | - MyColours.color_eadab9, | 234 | + MyColours.color_CEB689, |
| 233 | fontSize: ScreenUtil() | 235 | fontSize: ScreenUtil() |
| 234 | - .setSp(32))), | 236 | + .setSp(28))), |
| 235 | ), | 237 | ), |
| 236 | Image.asset( | 238 | Image.asset( |
| 237 | "assets/invication_arrow_right.png", | 239 | "assets/invication_arrow_right.png", |
| @@ -246,8 +248,8 @@ class InvicationPageState extends State<InvicationPage> { | @@ -246,8 +248,8 @@ class InvicationPageState extends State<InvicationPage> { | ||
| 246 | child: Text( | 248 | child: Text( |
| 247 | user.sellerAddr, | 249 | user.sellerAddr, |
| 248 | style: TextStyle( | 250 | style: TextStyle( |
| 249 | - color: MyColours.color_ffffff, | ||
| 250 | - fontSize: ScreenUtil().setSp(34)), | 251 | + color: MyColours.color_F2F2F2, |
| 252 | + fontSize: ScreenUtil().setSp(36)), | ||
| 251 | ), | 253 | ), |
| 252 | ) | 254 | ) |
| 253 | ], | 255 | ], |
| @@ -271,15 +273,20 @@ class InvicationPageState extends State<InvicationPage> { | @@ -271,15 +273,20 @@ class InvicationPageState extends State<InvicationPage> { | ||
| 271 | NavigatorUtil.goSmsPage(context, widget.rid); | 273 | NavigatorUtil.goSmsPage(context, widget.rid); |
| 272 | }, | 274 | }, |
| 273 | child: Container( | 275 | child: Container( |
| 274 | - width: ScreenUtil().setWidth(232), | 276 | + width: ScreenUtil().setWidth(135 * 2), |
| 275 | height: double.infinity, | 277 | height: double.infinity, |
| 276 | - color: MyColours.color_000000, | ||
| 277 | alignment: Alignment.center, | 278 | alignment: Alignment.center, |
| 279 | + decoration: BoxDecoration( | ||
| 280 | + color: MyColours.color_262628, | ||
| 281 | + border: Border( | ||
| 282 | + top: BorderSide( | ||
| 283 | + width: ScreenUtil().setWidth(1), | ||
| 284 | + color: MyColours.color_ECD9B7))), | ||
| 278 | child: Text( | 285 | child: Text( |
| 279 | "发短信", | 286 | "发短信", |
| 280 | style: TextStyle( | 287 | style: TextStyle( |
| 281 | - color: MyColours.color_eadab9, | ||
| 282 | - fontSize: ScreenUtil().setSp(34)), | 288 | + color: MyColours.color_ECD9B7, |
| 289 | + fontSize: ScreenUtil().setSp(28)), | ||
| 283 | ), | 290 | ), |
| 284 | ), | 291 | ), |
| 285 | ), | 292 | ), |
| @@ -317,13 +324,13 @@ class InvicationPageState extends State<InvicationPage> { | @@ -317,13 +324,13 @@ class InvicationPageState extends State<InvicationPage> { | ||
| 317 | child: Container( | 324 | child: Container( |
| 318 | width: double.infinity, | 325 | width: double.infinity, |
| 319 | height: double.infinity, | 326 | height: double.infinity, |
| 320 | - color: MyColours.color_e3d2ac, | 327 | + color: MyColours.color_ECD9B7, |
| 321 | alignment: Alignment.center, | 328 | alignment: Alignment.center, |
| 322 | child: Text( | 329 | child: Text( |
| 323 | "通知客户", | 330 | "通知客户", |
| 324 | style: TextStyle( | 331 | style: TextStyle( |
| 325 | - color: MyColours.color_83734d, | ||
| 326 | - fontSize: ScreenUtil().setSp(34)), | 332 | + color: MyColours.color_7B512A, |
| 333 | + fontSize: ScreenUtil().setSp(30)), | ||
| 327 | ), | 334 | ), |
| 328 | ), | 335 | ), |
| 329 | ), | 336 | ), |
| @@ -357,9 +364,9 @@ class InvicationPageState extends State<InvicationPage> { | @@ -357,9 +364,9 @@ class InvicationPageState extends State<InvicationPage> { | ||
| 357 | ), | 364 | ), |
| 358 | ), | 365 | ), |
| 359 | Positioned( | 366 | Positioned( |
| 360 | - left: ScreenUtil().setWidth(180), | ||
| 361 | - bottom: ScreenUtil().setWidth(130), | ||
| 362 | - right: ScreenUtil().setWidth(180), | 367 | + // left: ScreenUtil().setWidth(180), |
| 368 | + bottom: ScreenUtil().setWidth(110), | ||
| 369 | + right: ScreenUtil().setWidth(40), | ||
| 363 | child: couponProvider.hasModify || | 370 | child: couponProvider.hasModify || |
| 364 | couponProvider.coupons.length > 0 || | 371 | couponProvider.coupons.length > 0 || |
| 365 | couponProvider.couponListSelect.length > 0 | 372 | couponProvider.couponListSelect.length > 0 |
| @@ -370,27 +377,55 @@ class InvicationPageState extends State<InvicationPage> { | @@ -370,27 +377,55 @@ class InvicationPageState extends State<InvicationPage> { | ||
| 370 | hasModify: couponProvider.hasModify); | 377 | hasModify: couponProvider.hasModify); |
| 371 | }, | 378 | }, |
| 372 | behavior: HitTestBehavior.opaque, | 379 | behavior: HitTestBehavior.opaque, |
| 373 | - child: Center( | ||
| 374 | - child: Container( | ||
| 375 | - // width: ScreenUtil().setWidth(400), | ||
| 376 | - padding: EdgeInsets.symmetric( | ||
| 377 | - horizontal: ScreenUtil().setWidth(40), | ||
| 378 | - vertical: ScreenUtil().setWidth(20)), | ||
| 379 | - // height: ScreenUtil().setWidth(100), | ||
| 380 | - decoration: BoxDecoration( | ||
| 381 | - color: MyColours.color_ffffff, | ||
| 382 | - borderRadius: BorderRadius.circular( | ||
| 383 | - ScreenUtil().setWidth(20))), | ||
| 384 | - child: Text( | ||
| 385 | - '共赠送${couponProvider.coupons.length}张优惠券\n点击查看', | ||
| 386 | - textAlign: TextAlign.center, | ||
| 387 | - style: TextStyle( | ||
| 388 | - fontSize: ScreenUtil().setSp(28), | ||
| 389 | - ), | ||
| 390 | - ), | ||
| 391 | - ), | ||
| 392 | - ), | ||
| 393 | - ) | 380 | + child: Column( |
| 381 | + crossAxisAlignment: CrossAxisAlignment.center, | ||
| 382 | + children: [ | ||
| 383 | + Container( | ||
| 384 | + padding: EdgeInsets.symmetric( | ||
| 385 | + horizontal: ScreenUtil().setWidth(40), | ||
| 386 | + vertical: ScreenUtil().setWidth(16)), | ||
| 387 | + height: ScreenUtil().setWidth(35 * 2), | ||
| 388 | + decoration: BoxDecoration( | ||
| 389 | + color: MyColours.color_000000, | ||
| 390 | + borderRadius: BorderRadius.circular( | ||
| 391 | + ScreenUtil().setWidth(20))), | ||
| 392 | + child: Row( | ||
| 393 | + children: [ | ||
| 394 | + Text( | ||
| 395 | + '并赠送给顾客${couponProvider.coupons.length}张优惠券', | ||
| 396 | + textAlign: TextAlign.center, | ||
| 397 | + style: TextStyle( | ||
| 398 | + color: MyColours.color_f5f5f5, | ||
| 399 | + fontWeight: FontWeight.bold, | ||
| 400 | + fontSize: ScreenUtil().setSp(28), | ||
| 401 | + ), | ||
| 402 | + ), | ||
| 403 | + HEmptyView(40), | ||
| 404 | + RoundButton( | ||
| 405 | + width: ScreenUtil().setWidth(124), | ||
| 406 | + height: ScreenUtil().setWidth(46), | ||
| 407 | + text: '点击查看', | ||
| 408 | + textColor: MyColours.color_FDA31D, | ||
| 409 | + fontSize: 24, | ||
| 410 | + isBold: true, | ||
| 411 | + radius: ScreenUtil().setWidth(10), | ||
| 412 | + gradientStart: MyColours.color_f5f5f5, | ||
| 413 | + gradientEnd: MyColours.color_f5f5f5, | ||
| 414 | + onPressed: () async { | ||
| 415 | + NavigatorUtil.goCouponSelectPage( | ||
| 416 | + context, | ||
| 417 | + rid: widget.rid, | ||
| 418 | + hasModify: | ||
| 419 | + couponProvider.hasModify); | ||
| 420 | + }, | ||
| 421 | + ) | ||
| 422 | + ], | ||
| 423 | + )), | ||
| 424 | + Image.asset(Utils.getImgPath('jian'), | ||
| 425 | + width: ScreenUtil().setWidth(28), | ||
| 426 | + height: ScreenUtil().setWidth(20)) | ||
| 427 | + ], | ||
| 428 | + )) | ||
| 394 | : Container(), | 429 | : Container(), |
| 395 | ) | 430 | ) |
| 396 | ], | 431 | ], |
| @@ -67,4 +67,15 @@ class MyColours { | @@ -67,4 +67,15 @@ class MyColours { | ||
| 67 | static const Color color_EEF0F2 = Color(0xffEEF0F2); | 67 | static const Color color_EEF0F2 = Color(0xffEEF0F2); |
| 68 | static const Color color_B7B7B7 = Color(0xffB7B7B7); | 68 | static const Color color_B7B7B7 = Color(0xffB7B7B7); |
| 69 | static const Color color_E9E9E9 = Color(0xffE9E9E9); | 69 | static const Color color_E9E9E9 = Color(0xffE9E9E9); |
| 70 | + static const Color color_B0B0B0 = Color(0xffB0B0B0); | ||
| 71 | + static const Color color_B8B8B8 = Color(0xffB8B8B8); | ||
| 72 | + static const Color color_FFE1CB = Color(0xffFFE1CB); | ||
| 73 | + static const Color color_F9F9F9 = Color(0xffF9F9F9); | ||
| 74 | + static const Color color_979797 = Color(0xff979797); | ||
| 75 | + static const Color color_CEB689 = Color(0xffCEB689); | ||
| 76 | + static const Color color_F2F2F2 = Color(0xffF2F2F2); | ||
| 77 | + static const Color color_ECD9B7 = Color(0xffECD9B7); | ||
| 78 | + static const Color color_7B512A = Color(0xff7B512A); | ||
| 79 | + static const Color color_262628 = Color(0xff262628); | ||
| 80 | + static const Color color_FDA31D = Color(0xffFDA31D); | ||
| 70 | } | 81 | } |
| @@ -22,6 +22,33 @@ import '../app.dart'; | @@ -22,6 +22,33 @@ import '../app.dart'; | ||
| 22 | typedef BookTimeSetCallback = void Function(bool needChange); | 22 | typedef BookTimeSetCallback = void Function(bool needChange); |
| 23 | 23 | ||
| 24 | class Utils { | 24 | class Utils { |
| 25 | + ///value: 文本内容;fontSize : 文字的大小;fontWeight:文字权重;maxWidth:文本框的最大宽度;maxLines:文本支持最大多少行 | ||
| 26 | + static double calculateTextHeight( | ||
| 27 | + String value, | ||
| 28 | + fontSize, | ||
| 29 | + FontWeight fontWeight, | ||
| 30 | + double maxWidth, | ||
| 31 | + int maxLines, | ||
| 32 | + BuildContext context) { | ||
| 33 | + // value = filterText(value); | ||
| 34 | + TextPainter painter = TextPainter( | ||
| 35 | + | ||
| 36 | + ///AUTO:华为手机如果不指定locale的时候,该方法算出来的文字高度是比系统计算偏小的。 | ||
| 37 | + locale: Localizations.localeOf(context, nullOk: true), | ||
| 38 | + maxLines: maxLines, | ||
| 39 | + textDirection: TextDirection.ltr, | ||
| 40 | + text: TextSpan( | ||
| 41 | + text: value, | ||
| 42 | + style: TextStyle( | ||
| 43 | + fontWeight: fontWeight, | ||
| 44 | + fontSize: fontSize, | ||
| 45 | + ))); | ||
| 46 | + painter.layout(maxWidth: maxWidth); | ||
| 47 | + | ||
| 48 | + ///文字的宽度:painter.width | ||
| 49 | + return painter.height; | ||
| 50 | + } | ||
| 51 | + | ||
| 25 | static getDateStrFromJiekou(String ms) { | 52 | static getDateStrFromJiekou(String ms) { |
| 26 | return DateUtil.formatDate( | 53 | return DateUtil.formatDate( |
| 27 | DateTime.fromMillisecondsSinceEpoch(int.parse(ms) * 1000), | 54 | DateTime.fromMillisecondsSinceEpoch(int.parse(ms) * 1000), |
| @@ -206,6 +206,7 @@ flutter: | @@ -206,6 +206,7 @@ flutter: | ||
| 206 | - assets/bg_error.png | 206 | - assets/bg_error.png |
| 207 | - assets/mine_radio_nor.png | 207 | - assets/mine_radio_nor.png |
| 208 | - assets/mine_radio_sel.png | 208 | - assets/mine_radio_sel.png |
| 209 | + | ||
| 209 | 210 | ||
| 210 | # assets: | 211 | # assets: |
| 211 | # - images/a_dot_burr.jpeg | 212 | # - images/a_dot_burr.jpeg |
-
Please register or login to post a comment