|
|
|
import 'package:common_utils/common_utils.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/services.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
import 'package:one_key/models/coupon_model.dart';
|
|
|
|
import 'package:one_key/provider/coupon_provider.dart';
|
|
...
|
...
|
@@ -19,16 +20,17 @@ class CouponItemF extends StatefulWidget { |
|
|
|
final bool showBtn;
|
|
|
|
final bool showCheck;
|
|
|
|
final bool radio;
|
|
|
|
CouponItemF(
|
|
|
|
{Key key,
|
|
|
|
this.from,
|
|
|
|
this.onPressed,
|
|
|
|
this.onPressedSwich,
|
|
|
|
this.couponSonModel,
|
|
|
|
this.showBtn = false,
|
|
|
|
this.showCheck = false,
|
|
|
|
this.radio = false})
|
|
|
|
: super(key: key);
|
|
|
|
|
|
|
|
CouponItemF({
|
|
|
|
Key key,
|
|
|
|
this.from,
|
|
|
|
this.onPressed,
|
|
|
|
this.onPressedSwich,
|
|
|
|
this.couponSonModel,
|
|
|
|
this.showBtn = false,
|
|
|
|
this.showCheck = false,
|
|
|
|
this.radio = false,
|
|
|
|
}) : super(key: key);
|
|
|
|
|
|
|
|
@override
|
|
|
|
_CouponItemFState createState() => _CouponItemFState();
|
|
...
|
...
|
@@ -68,138 +70,141 @@ class _CouponItemFState extends State<CouponItemF> { |
|
|
|
children: [
|
|
|
|
HEmptyView(20),
|
|
|
|
widget.from == 'select'
|
|
|
|
? Image.asset(
|
|
|
|
Utils.getImgPath(sunModel.isCheck
|
|
|
|
? widget.radio
|
|
|
|
? 'select_f'
|
|
|
|
: 'c_mul_select'
|
|
|
|
: widget.radio
|
|
|
|
? 'show_select_f'
|
|
|
|
: 'c_not_edit'),
|
|
|
|
width: w(20),
|
|
|
|
)
|
|
|
|
? InkWell(
|
|
|
|
onTap: widget.onPressed,
|
|
|
|
child: Image.asset(
|
|
|
|
Utils.getImgPath(sunModel.isCheck
|
|
|
|
? widget.radio
|
|
|
|
? 'c_mul_select'
|
|
|
|
: 'select_f'
|
|
|
|
: widget.radio
|
|
|
|
? 'c_not_edit'
|
|
|
|
: 'show_select_f'),
|
|
|
|
width: w(20),
|
|
|
|
))
|
|
|
|
: Container(),
|
|
|
|
Expanded(
|
|
|
|
child: InkWell(
|
|
|
|
onTap: widget.onPressed,
|
|
|
|
child: Container(
|
|
|
|
// width: ScreenUtil().setWidth(610),
|
|
|
|
margin: EdgeInsets.fromLTRB(
|
|
|
|
ScreenUtil().setWidth(20),
|
|
|
|
ScreenUtil().setWidth(0),
|
|
|
|
ScreenUtil().setWidth(40),
|
|
|
|
ScreenUtil().setWidth(0)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
boxShadow: [
|
|
|
|
BoxShadow(
|
|
|
|
spreadRadius: ScreenUtil().setWidth(2),
|
|
|
|
color: Color.fromRGBO(0, 0, 0, 0.25),
|
|
|
|
offset: Offset(0, ScreenUtil().setWidth(8)),
|
|
|
|
blurRadius: ScreenUtil().setWidth(8))
|
|
|
|
],
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
Radius.circular(ScreenUtil().setWidth(16)),
|
|
|
|
child: Container(
|
|
|
|
// width: ScreenUtil().setWidth(610),
|
|
|
|
margin: EdgeInsets.fromLTRB(
|
|
|
|
ScreenUtil().setWidth(20),
|
|
|
|
ScreenUtil().setWidth(0),
|
|
|
|
ScreenUtil().setWidth(40),
|
|
|
|
ScreenUtil().setWidth(0)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
boxShadow: [
|
|
|
|
BoxShadow(
|
|
|
|
spreadRadius: ScreenUtil().setWidth(2),
|
|
|
|
color: Color.fromRGBO(0, 0, 0, 0.25),
|
|
|
|
offset: Offset(0, ScreenUtil().setWidth(8)),
|
|
|
|
blurRadius: ScreenUtil().setWidth(8))
|
|
|
|
],
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
Radius.circular(ScreenUtil().setWidth(16)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Column(
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(40),
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(24)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: widget.from == 'history'
|
|
|
|
? MyColours.color_BFC4D4
|
|
|
|
: widget.from == 'setting'
|
|
|
|
? MyColours.color_00A870
|
|
|
|
: notSelect
|
|
|
|
? sunModel.isType == '1' ||
|
|
|
|
sunModel.isType == '3' ||
|
|
|
|
sunModel.isType == '4'
|
|
|
|
? sunModel.isMarking
|
|
|
|
? MyColours.color_00A870
|
|
|
|
: MyColours.color_438E93
|
|
|
|
: MyColours.color_ED7B2F
|
|
|
|
: MyColours.color_999999,
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
topLeft:
|
|
|
|
Radius.circular(ScreenUtil().setWidth(16)),
|
|
|
|
topRight: Radius.circular(
|
|
|
|
ScreenUtil().setWidth(16)))),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
sunModel.isType == '1'
|
|
|
|
? sunModel.isExamine == '1'
|
|
|
|
? '店铺优惠券(核销)'
|
|
|
|
: '店铺优惠券'
|
|
|
|
: sunModel.isType == '2'
|
|
|
|
? '我的优惠券'
|
|
|
|
: sunModel.isType == '3'
|
|
|
|
? '免费代金券'
|
|
|
|
: '付费优惠券',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
fontSize: ScreenUtil().setSp(24)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Column(
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(40),
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(24)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: widget.from == 'history'
|
|
|
|
? MyColours.color_BFC4D4
|
|
|
|
: widget.from == 'setting'
|
|
|
|
? MyColours.color_00A870
|
|
|
|
: notSelect
|
|
|
|
? sunModel.isType == '1' ||
|
|
|
|
sunModel.isType ==
|
|
|
|
'3' ||
|
|
|
|
sunModel.isType == '4'
|
|
|
|
? sunModel.isMarking
|
|
|
|
? MyColours.color_00A870
|
|
|
|
: MyColours.color_438E93
|
|
|
|
: MyColours.color_ED7B2F
|
|
|
|
: MyColours.color_999999,
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
topLeft: Radius.circular(
|
|
|
|
ScreenUtil().setWidth(16)),
|
|
|
|
topRight: Radius.circular(
|
|
|
|
ScreenUtil().setWidth(16)))),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment:
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
sunModel.isType == '1'
|
|
|
|
? sunModel.isExamine == '1'
|
|
|
|
? '店铺优惠券(核销)'
|
|
|
|
: '店铺优惠券'
|
|
|
|
: sunModel.isType == '2'
|
|
|
|
? '我的优惠券'
|
|
|
|
: sunModel.isType == '3'
|
|
|
|
? '免费代金券'
|
|
|
|
: '付费优惠券',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
fontSize: ScreenUtil().setSp(24)),
|
|
|
|
),
|
|
|
|
InkWell(
|
|
|
|
onTap: widget.onPressedSwich,
|
|
|
|
child: Text(
|
|
|
|
sunModel.isType == '1'
|
|
|
|
? sunModel.isExamine == '1'
|
|
|
|
? '被领取:${sunModel.receiveNum}张 已核销:${sunModel.useNum}张'
|
|
|
|
: '创建人:${sunModel.nickname ?? sunModel.uid} 被领取:${sunModel.receiveNum}张'
|
|
|
|
: sunModel.isType == '2'
|
|
|
|
? '被领取:${sunModel.receiveNum}张'
|
|
|
|
: '被领取:${sunModel.receiveNum}张 已核销:${sunModel.useNum}张',
|
|
|
|
maxLines: 1,
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil().setSp(20))),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
padding: EdgeInsets.fromLTRB(
|
|
|
|
ScreenUtil().setWidth(24 * 2),
|
|
|
|
ScreenUtil().setWidth(9 * 2),
|
|
|
|
ScreenUtil().setWidth(10),
|
|
|
|
ScreenUtil().setWidth(20)),
|
|
|
|
child: Column(
|
|
|
|
InkWell(
|
|
|
|
onTap: widget.onPressedSwich,
|
|
|
|
child: Text(
|
|
|
|
sunModel.isType == '1'
|
|
|
|
? sunModel.isExamine == '1'
|
|
|
|
? '被领取:${sunModel.receiveNum}张 已核销:${sunModel.useNum}张'
|
|
|
|
: '创建人:${sunModel.nickname ?? sunModel.uid} 被领取:${sunModel.receiveNum}张'
|
|
|
|
: sunModel.isType == '2'
|
|
|
|
? '被领取:${sunModel.receiveNum}张'
|
|
|
|
: sunModel.receiveNum == null
|
|
|
|
? ''
|
|
|
|
: '被领取:${sunModel.receiveNum}张 已核销:${sunModel.useNum}张',
|
|
|
|
maxLines: 1,
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
fontSize: ScreenUtil().setSp(20))),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
padding: EdgeInsets.fromLTRB(
|
|
|
|
ScreenUtil().setWidth(24 * 2),
|
|
|
|
ScreenUtil().setWidth(9 * 2),
|
|
|
|
ScreenUtil().setWidth(10),
|
|
|
|
ScreenUtil().setWidth(20)),
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
width: ScreenUtil().setWidth(232 * 2),
|
|
|
|
// width: ScreenUtil()
|
|
|
|
// .setWidth(232 * 2),
|
|
|
|
child: Container(
|
|
|
|
height: ScreenUtil().setWidth(25 * 2),
|
|
|
|
constraints: BoxConstraints(
|
|
|
|
maxWidth:
|
|
|
|
ScreenUtil().setWidth(190)),
|
|
|
|
child: Text(
|
|
|
|
sunModel.aname,
|
|
|
|
maxLines: 2,
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
style: TextStyle(
|
|
|
|
color: widget.from == 'history'
|
|
|
|
? MyColours.color_BFC4D4
|
|
|
|
: notSelect
|
|
|
|
? MyColours.color_515151
|
|
|
|
: MyColours
|
|
|
|
.color_999999,
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil().setSp(36),
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
height: ScreenUtil().setWidth(25 * 2),
|
|
|
|
constraints: BoxConstraints(
|
|
|
|
maxWidth: ScreenUtil().setWidth(190)),
|
|
|
|
child: Text(
|
|
|
|
sunModel.aname,
|
|
|
|
maxLines: 2,
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
style: TextStyle(
|
|
|
|
color: widget.from == 'history'
|
|
|
|
? MyColours.color_BFC4D4
|
|
|
|
: notSelect
|
|
|
|
? MyColours.color_515151
|
|
|
|
: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(36),
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(14 * 2),
|
|
|
|
width: ScreenUtil().setWidth(232 * 2),
|
|
...
|
...
|
@@ -221,177 +226,298 @@ class _CouponItemFState extends State<CouponItemF> { |
|
|
|
fontSize: ScreenUtil().setSp(20),
|
|
|
|
)),
|
|
|
|
),
|
|
|
|
VEmptyView(16),
|
|
|
|
(ObjectUtil.isNotEmpty(sunModel.stime) &&
|
|
|
|
sunModel.stime != '0') ||
|
|
|
|
(ObjectUtil.isNotEmpty(
|
|
|
|
sunModel.etime) &&
|
|
|
|
sunModel.etime != '0')
|
|
|
|
? Container(
|
|
|
|
child: Text(
|
|
|
|
'使用时间:${ObjectUtil.isNotEmpty(sunModel.stime) ? Utils.getDateStrFromJiekou(sunModel.stime) : '--'} 至 ${ObjectUtil.isNotEmpty(sunModel.etime) ? Utils.getDateStrFromJiekou(sunModel.etime) : '--'}',
|
|
|
|
style: TextStyle(
|
|
|
|
color: widget.from ==
|
|
|
|
'history'
|
|
|
|
? MyColours.color_BFC4D4
|
|
|
|
: MyColours
|
|
|
|
.color_999999,
|
|
|
|
fontSize: ScreenUtil()
|
|
|
|
.setSp(20))),
|
|
|
|
)
|
|
|
|
: Container(),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
// widget.from == 'select'
|
|
|
|
// ? widget.showCheck
|
|
|
|
// ? Positioned(
|
|
|
|
// right: 0,
|
|
|
|
// top: ScreenUtil().setWidth(20),
|
|
|
|
// child: Image.asset(
|
|
|
|
// Utils.getImgPath(widget.couponSonModel.isCheck
|
|
|
|
// ? 'check_r'
|
|
|
|
// : 'check_un'),
|
|
|
|
// width: ScreenUtil().setWidth(40),
|
|
|
|
// height: ScreenUtil().setWidth(40),
|
|
|
|
// ))
|
|
|
|
// : Container()
|
|
|
|
// :
|
|
|
|
),
|
|
|
|
ObjectUtil.isNotEmpty(sunModel.explain)
|
|
|
|
? const MySeparator(
|
|
|
|
width: 3, color: MyColours.color_f3f3f3)
|
|
|
|
: SizedBox(),
|
|
|
|
ObjectUtil.isNotEmpty(sunModel.explain)
|
|
|
|
? InkWell(
|
|
|
|
onTap: () {
|
|
|
|
if (explainH > 19) {
|
|
|
|
setState(() {
|
|
|
|
widget.couponSonModel.showText =
|
|
|
|
!widget.couponSonModel.showText;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
width: double.infinity,
|
|
|
|
)),
|
|
|
|
if (widget.from == 'select' &&
|
|
|
|
sunModel.isType == '3' &&
|
|
|
|
widget.radio)
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
if (sunModel.number == 0) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
sunModel.number--;
|
|
|
|
sunModel.numberC.text =
|
|
|
|
'${sunModel.number}';
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
height: w(40),
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: w(10)),
|
|
|
|
child: Image.asset(
|
|
|
|
Utils.getImgPath('plan_dish_minus'),
|
|
|
|
width: w(8),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
// constraints: BoxConstraints(
|
|
|
|
// minWidth: w(34),
|
|
|
|
// ),
|
|
|
|
width: w(30),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: widget.from == 'history'
|
|
|
|
? MyColours.color_ffffff
|
|
|
|
: notSelect
|
|
|
|
? MyColours.color_ffffff
|
|
|
|
: MyColours.color_FAFAFA,
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
bottomLeft: Radius.circular(
|
|
|
|
ScreenUtil()
|
|
|
|
.setWidth(20)),
|
|
|
|
bottomRight: Radius.circular(
|
|
|
|
ScreenUtil()
|
|
|
|
.setWidth(20)))),
|
|
|
|
child: Row(
|
|
|
|
crossAxisAlignment:
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
widget.couponSonModel.showText
|
|
|
|
? Container(
|
|
|
|
padding:
|
|
|
|
EdgeInsets.fromLTRB(
|
|
|
|
ScreenUtil()
|
|
|
|
.setWidth(
|
|
|
|
24 * 2),
|
|
|
|
ScreenUtil()
|
|
|
|
.setWidth(14),
|
|
|
|
ScreenUtil()
|
|
|
|
.setWidth(0),
|
|
|
|
ScreenUtil()
|
|
|
|
.setWidth(
|
|
|
|
14)),
|
|
|
|
width: ScreenUtil()
|
|
|
|
.screenWidth -
|
|
|
|
ScreenUtil()
|
|
|
|
.setWidth(92 * 2),
|
|
|
|
child: Text(
|
|
|
|
'说明:${sunModel.explain}',
|
|
|
|
maxLines: 5,
|
|
|
|
style: TextStyle(
|
|
|
|
color: widget
|
|
|
|
.from ==
|
|
|
|
'history'
|
|
|
|
? MyColours
|
|
|
|
.color_BFC4D4
|
|
|
|
: MyColours
|
|
|
|
.color_999999,
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil()
|
|
|
|
.setSp(
|
|
|
|
20))),
|
|
|
|
)
|
|
|
|
: Container(
|
|
|
|
padding:
|
|
|
|
EdgeInsets.fromLTRB(
|
|
|
|
ScreenUtil()
|
|
|
|
.setWidth(
|
|
|
|
24 * 2),
|
|
|
|
ScreenUtil()
|
|
|
|
.setWidth(14),
|
|
|
|
ScreenUtil()
|
|
|
|
.setWidth(0),
|
|
|
|
ScreenUtil()
|
|
|
|
.setWidth(
|
|
|
|
14)),
|
|
|
|
width: ScreenUtil()
|
|
|
|
.screenWidth -
|
|
|
|
ScreenUtil().setWidth(
|
|
|
|
92 * 2) +
|
|
|
|
ScreenUtil()
|
|
|
|
.setWidth(20),
|
|
|
|
child: Text(
|
|
|
|
'说明:${sunModel.explain}',
|
|
|
|
maxLines: 1,
|
|
|
|
overflow:
|
|
|
|
TextOverflow.fade,
|
|
|
|
softWrap: false,
|
|
|
|
style: TextStyle(
|
|
|
|
color: widget
|
|
|
|
.from ==
|
|
|
|
'history'
|
|
|
|
? MyColours
|
|
|
|
.color_BFC4D4
|
|
|
|
: MyColours
|
|
|
|
.color_999999,
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil()
|
|
|
|
.setSp(
|
|
|
|
20))),
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
explainH > 19
|
|
|
|
? Container(
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
top: ScreenUtil()
|
|
|
|
.setWidth(10),
|
|
|
|
right: ScreenUtil()
|
|
|
|
.setWidth(16)),
|
|
|
|
child: Image.asset(
|
|
|
|
!widget.couponSonModel
|
|
|
|
.showText
|
|
|
|
? Utils.getImgPath(
|
|
|
|
'quan_down_f')
|
|
|
|
: Utils.getImgPath(
|
|
|
|
'quan_up_f'),
|
|
|
|
width: ScreenUtil()
|
|
|
|
.setWidth(28),
|
|
|
|
height: ScreenUtil()
|
|
|
|
.setWidth(28)),
|
|
|
|
)
|
|
|
|
: Container(),
|
|
|
|
HEmptyView(14)
|
|
|
|
borderRadius:
|
|
|
|
BorderRadius.circular(r(5)),
|
|
|
|
border: Border.all(
|
|
|
|
width: w(1),
|
|
|
|
color:
|
|
|
|
MyColours.color_438E93)),
|
|
|
|
// constraints: BoxConstraints(minWidth: w(20)),
|
|
|
|
child: TextField(
|
|
|
|
maxLines: 1,
|
|
|
|
controller: sunModel.numberC,
|
|
|
|
// focusNode: _focusNode,
|
|
|
|
// autofocus: true,
|
|
|
|
|
|
|
|
inputFormatters: [
|
|
|
|
FilteringTextInputFormatter.allow(
|
|
|
|
RegExp(r'[0-9]')),
|
|
|
|
],
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_438E93,
|
|
|
|
fontSize: font(11)),
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
// textAlignVertical: TextAlignVertical.center,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
hintText: "数量",
|
|
|
|
isCollapsed: true,
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: font(11),
|
|
|
|
),
|
|
|
|
// isCollapsed:
|
|
|
|
// true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度
|
|
|
|
border: OutlineInputBorder(
|
|
|
|
borderSide: BorderSide.none),
|
|
|
|
contentPadding: EdgeInsets.only(
|
|
|
|
top: w(2), bottom: w(2)),
|
|
|
|
),
|
|
|
|
keyboardType:
|
|
|
|
TextInputType.numberWithOptions(
|
|
|
|
decimal: true),
|
|
|
|
textInputAction:
|
|
|
|
TextInputAction.done,
|
|
|
|
|
|
|
|
onChanged: (value) {
|
|
|
|
// bool isNumber = Utils.isNumeric(
|
|
|
|
// value); //判断输入的内容是否是数字
|
|
|
|
// if (!isNumber) {
|
|
|
|
// Utils.showToast('请输入数字');
|
|
|
|
// pNumC.text = '';
|
|
|
|
// return;
|
|
|
|
// } else {
|
|
|
|
if (value != null &&
|
|
|
|
value != '') {
|
|
|
|
if (int.parse(value) >
|
|
|
|
int.parse(
|
|
|
|
sunModel.grantNum)) {
|
|
|
|
Utils.showToast(
|
|
|
|
'最大数量限制为${sunModel.grantNum}');
|
|
|
|
sunModel.numberC.text =
|
|
|
|
sunModel.grantNum;
|
|
|
|
sunModel.number = int.parse(
|
|
|
|
sunModel.grantNum);
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
sunModel.number =
|
|
|
|
int.parse(value);
|
|
|
|
}
|
|
|
|
|
|
|
|
// }
|
|
|
|
// setState(() {});
|
|
|
|
// _searchSellerLocation();
|
|
|
|
// customerProvider.searchData(value);
|
|
|
|
},
|
|
|
|
onEditingComplete: () {
|
|
|
|
FocusScope.of(context)
|
|
|
|
.requestFocus(
|
|
|
|
FocusNode()); //点击空白处隐藏键盘
|
|
|
|
// contantShowModel.searchData(
|
|
|
|
// contantShowModel.controller.text);
|
|
|
|
// _searchSellerLocation();
|
|
|
|
// _focusNode.unfocus();
|
|
|
|
},
|
|
|
|
)),
|
|
|
|
)
|
|
|
|
: Container(),
|
|
|
|
VEmptyView(32),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
))),
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
if (sunModel.number ==
|
|
|
|
int.parse(sunModel.grantNum)) {
|
|
|
|
Utils.showToast('已达到最大数量限制');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
sunModel.number++;
|
|
|
|
sunModel.numberC.text =
|
|
|
|
'${sunModel.number}';
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
height: w(40),
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
left: w(10), right: w(10)),
|
|
|
|
child: Image.asset(
|
|
|
|
Utils.getImgPath('plan_dish_add'),
|
|
|
|
width: w(8),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
if (widget.from == 'setting' &&
|
|
|
|
sunModel.isType == '3')
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.only(right: w(20)),
|
|
|
|
child: Text(
|
|
|
|
'${sunModel.number}张',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: font(12),
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
color: MyColours.color_438E93),
|
|
|
|
))
|
|
|
|
],
|
|
|
|
),
|
|
|
|
VEmptyView(16),
|
|
|
|
(ObjectUtil.isNotEmpty(sunModel.stime) &&
|
|
|
|
sunModel.stime != '0') ||
|
|
|
|
(ObjectUtil.isNotEmpty(sunModel.etime) &&
|
|
|
|
sunModel.etime != '0')
|
|
|
|
? Container(
|
|
|
|
child: Text(
|
|
|
|
'使用时间:${ObjectUtil.isNotEmpty(sunModel.stime) ? Utils.getDateStrFromJiekou(sunModel.stime) : '--'} 至 ${ObjectUtil.isNotEmpty(sunModel.etime) ? Utils.getDateStrFromJiekou(sunModel.etime) : '--'}',
|
|
|
|
style: TextStyle(
|
|
|
|
color: widget.from == 'history'
|
|
|
|
? MyColours.color_BFC4D4
|
|
|
|
: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(20))),
|
|
|
|
)
|
|
|
|
: Container(),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
// widget.from == 'select'
|
|
|
|
// ? widget.showCheck
|
|
|
|
// ? Positioned(
|
|
|
|
// right: 0,
|
|
|
|
// top: ScreenUtil().setWidth(20),
|
|
|
|
// child: Image.asset(
|
|
|
|
// Utils.getImgPath(widget.couponSonModel.isCheck
|
|
|
|
// ? 'check_r'
|
|
|
|
// : 'check_un'),
|
|
|
|
// width: ScreenUtil().setWidth(40),
|
|
|
|
// height: ScreenUtil().setWidth(40),
|
|
|
|
// ))
|
|
|
|
// : Container()
|
|
|
|
// :
|
|
|
|
),
|
|
|
|
ObjectUtil.isNotEmpty(sunModel.explain)
|
|
|
|
? const MySeparator(
|
|
|
|
width: 3, color: MyColours.color_f3f3f3)
|
|
|
|
: SizedBox(),
|
|
|
|
ObjectUtil.isNotEmpty(sunModel.explain)
|
|
|
|
? InkWell(
|
|
|
|
onTap: () {
|
|
|
|
if (explainH > 19) {
|
|
|
|
setState(() {
|
|
|
|
widget.couponSonModel.showText =
|
|
|
|
!widget.couponSonModel.showText;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
width: double.infinity,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: widget.from == 'history'
|
|
|
|
? MyColours.color_ffffff
|
|
|
|
: notSelect
|
|
|
|
? MyColours.color_ffffff
|
|
|
|
: MyColours.color_FAFAFA,
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
bottomLeft: Radius.circular(
|
|
|
|
ScreenUtil().setWidth(20)),
|
|
|
|
bottomRight: Radius.circular(
|
|
|
|
ScreenUtil().setWidth(20)))),
|
|
|
|
child: Row(
|
|
|
|
crossAxisAlignment:
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
widget.couponSonModel.showText
|
|
|
|
? Container(
|
|
|
|
padding: EdgeInsets.fromLTRB(
|
|
|
|
ScreenUtil().setWidth(24 * 2),
|
|
|
|
ScreenUtil().setWidth(14),
|
|
|
|
ScreenUtil().setWidth(0),
|
|
|
|
ScreenUtil().setWidth(14)),
|
|
|
|
width: ScreenUtil().screenWidth -
|
|
|
|
ScreenUtil().setWidth(92 * 2),
|
|
|
|
child: Text(
|
|
|
|
'说明:${sunModel.explain}',
|
|
|
|
maxLines: 5,
|
|
|
|
style: TextStyle(
|
|
|
|
color: widget.from ==
|
|
|
|
'history'
|
|
|
|
? MyColours
|
|
|
|
.color_BFC4D4
|
|
|
|
: MyColours
|
|
|
|
.color_999999,
|
|
|
|
fontSize: ScreenUtil()
|
|
|
|
.setSp(20))),
|
|
|
|
)
|
|
|
|
: Container(
|
|
|
|
padding: EdgeInsets.fromLTRB(
|
|
|
|
ScreenUtil().setWidth(24 * 2),
|
|
|
|
ScreenUtil().setWidth(14),
|
|
|
|
ScreenUtil().setWidth(0),
|
|
|
|
ScreenUtil().setWidth(14)),
|
|
|
|
width: ScreenUtil().screenWidth -
|
|
|
|
ScreenUtil()
|
|
|
|
.setWidth(92 * 2) +
|
|
|
|
ScreenUtil().setWidth(20),
|
|
|
|
child: Text(
|
|
|
|
'说明:${sunModel.explain}',
|
|
|
|
maxLines: 1,
|
|
|
|
overflow: TextOverflow.fade,
|
|
|
|
softWrap: false,
|
|
|
|
style: TextStyle(
|
|
|
|
color: widget.from ==
|
|
|
|
'history'
|
|
|
|
? MyColours
|
|
|
|
.color_BFC4D4
|
|
|
|
: MyColours
|
|
|
|
.color_999999,
|
|
|
|
fontSize: ScreenUtil()
|
|
|
|
.setSp(20))),
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
explainH > 19
|
|
|
|
? Container(
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
top:
|
|
|
|
ScreenUtil().setWidth(10),
|
|
|
|
right: ScreenUtil()
|
|
|
|
.setWidth(16)),
|
|
|
|
child: Image.asset(
|
|
|
|
!widget.couponSonModel
|
|
|
|
.showText
|
|
|
|
? Utils.getImgPath(
|
|
|
|
'quan_down_f')
|
|
|
|
: Utils.getImgPath(
|
|
|
|
'quan_up_f'),
|
|
|
|
width:
|
|
|
|
ScreenUtil().setWidth(28),
|
|
|
|
height: ScreenUtil()
|
|
|
|
.setWidth(28)),
|
|
|
|
)
|
|
|
|
: Container(),
|
|
|
|
HEmptyView(14)
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
)
|
|
|
|
: Container(),
|
|
|
|
VEmptyView(32),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
Positioned(
|
...
|
...
|
|