|
...
|
...
|
@@ -58,8 +58,8 @@ class _CouponDetailPageState extends State<CouponDetailPage> { |
|
|
|
|
|
|
|
_getActivityById() async {
|
|
|
|
pageState = PageState.Loading;
|
|
|
|
bool success =
|
|
|
|
await couponProvider.getActivityById(context, {'id': widget.idstr});
|
|
|
|
bool success = await couponProvider
|
|
|
|
.getActivityById(context, {'id': widget.idstr}, isShowLoading: false);
|
|
|
|
if (success) {
|
|
|
|
pageState = PageState.Success;
|
|
|
|
} else {
|
|
...
|
...
|
@@ -84,8 +84,7 @@ class _CouponDetailPageState extends State<CouponDetailPage> { |
|
|
|
child: Text(
|
|
|
|
title,
|
|
|
|
style: TextStyle(
|
|
|
|
color: Color.fromRGBO(0, 0, 0, 0.9),
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(32)),
|
|
|
|
),
|
|
|
|
),
|
|
...
|
...
|
@@ -122,8 +121,7 @@ class _CouponDetailPageState extends State<CouponDetailPage> { |
|
|
|
child: Text(
|
|
|
|
title,
|
|
|
|
style: TextStyle(
|
|
|
|
color: Color.fromRGBO(0, 0, 0, 0.9),
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(32)),
|
|
|
|
),
|
|
|
|
),
|
|
...
|
...
|
@@ -176,6 +174,36 @@ class _CouponDetailPageState extends State<CouponDetailPage> { |
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
///是否立即启用
|
|
|
|
Widget _canUse(String title, bool swich) {
|
|
|
|
return Container(
|
|
|
|
padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(24)),
|
|
|
|
child: Row(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
// height: ScreenUtil().setWidth(40),
|
|
|
|
// color: Colors.red,
|
|
|
|
child: Text(
|
|
|
|
title,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(32)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
Image.asset(
|
|
|
|
swich
|
|
|
|
? Utils.getImgPath('swich_on')
|
|
|
|
: Utils.getImgPath('swich_off'),
|
|
|
|
width: ScreenUtil().setWidth(44 * 2),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
couponProvider = Provider.of<CouponProvider>(context, listen: true);
|
|
...
|
...
|
@@ -186,6 +214,19 @@ class _CouponDetailPageState extends State<CouponDetailPage> { |
|
|
|
onTap: () {
|
|
|
|
Navigator.pop(context);
|
|
|
|
},
|
|
|
|
rightImgName: couponProvider.couponSunModel.isType == '1' &&
|
|
|
|
couponProvider.couponSunModel.isExamine == '1' &&
|
|
|
|
couponProvider.couponSunModel.status == '1'
|
|
|
|
? 'share.png'
|
|
|
|
: null,
|
|
|
|
onTapRight: () {
|
|
|
|
if (couponProvider.couponSunModel.isType == '1' &&
|
|
|
|
couponProvider.couponSunModel.isExamine == '1' &&
|
|
|
|
couponProvider.couponSunModel.status == '1') {
|
|
|
|
//店铺可核销券
|
|
|
|
Utils.goShareBuyCouponToWeChat(context, widget.idstr);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
),
|
|
|
|
body: Consumer<CouponProvider>(builder: (context, model, _) {
|
|
|
|
if (pageState != PageState.Success) {
|
|
...
|
...
|
@@ -213,16 +254,29 @@ class _CouponDetailPageState extends State<CouponDetailPage> { |
|
|
|
_item(
|
|
|
|
'券类型',
|
|
|
|
couponProvider.couponSunModel.isType == '1'
|
|
|
|
? couponProvider.couponSunModel.isExamine ==
|
|
|
|
'1'
|
|
|
|
? '店铺优惠券(核销券)'
|
|
|
|
: '店铺优惠券'
|
|
|
|
? '店铺优惠券'
|
|
|
|
: '我的优惠券'),
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
),
|
|
|
|
VEmptyView(24),
|
|
|
|
if (couponProvider.couponSunModel.isType == '1')
|
|
|
|
Column(
|
|
|
|
children: [
|
|
|
|
_canUse(
|
|
|
|
'是否核销',
|
|
|
|
couponProvider.couponSunModel.isExamine ==
|
|
|
|
'1'
|
|
|
|
? true
|
|
|
|
: false),
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
),
|
|
|
|
VEmptyView(24),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
_item('券名称', couponProvider.couponSunModel.aname),
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(2),
|
|
...
|
...
|
@@ -232,17 +286,9 @@ class _CouponDetailPageState extends State<CouponDetailPage> { |
|
|
|
if (couponProvider.couponSunModel.isType == '1' &&
|
|
|
|
couponProvider.couponSunModel.use != null)
|
|
|
|
Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
_item(
|
|
|
|
'销售价',
|
|
|
|
couponProvider.couponSunModel.price ??
|
|
|
|
''),
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
),
|
|
|
|
VEmptyView(24),
|
|
|
|
_item(
|
|
|
|
'券用途',
|
|
|
|
couponProvider.couponSunModel.use.isCash
|
|
|
|
? '代金券'
|
|
...
|
...
|
@@ -253,16 +299,20 @@ class _CouponDetailPageState extends State<CouponDetailPage> { |
|
|
|
.couponSunModel.use.isDish
|
|
|
|
? '菜品券'
|
|
|
|
: ''),
|
|
|
|
VEmptyView(10),
|
|
|
|
_textShow(
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
),
|
|
|
|
VEmptyView(24),
|
|
|
|
_item(
|
|
|
|
couponProvider.couponSunModel.use.isCash
|
|
|
|
? '金额:'
|
|
|
|
? '金额'
|
|
|
|
: couponProvider
|
|
|
|
.couponSunModel.use.isDiscount
|
|
|
|
? '折扣率:'
|
|
|
|
? '折扣率'
|
|
|
|
: couponProvider
|
|
|
|
.couponSunModel.use.isDish
|
|
|
|
? '菜品:'
|
|
|
|
? '菜品'
|
|
|
|
: '',
|
|
|
|
couponProvider.couponSunModel.use.isCash
|
|
|
|
? '${couponProvider.couponSunModel.use.cash}元'
|
|
...
|
...
|
@@ -274,7 +324,15 @@ class _CouponDetailPageState extends State<CouponDetailPage> { |
|
|
|
? couponProvider
|
|
|
|
.couponSunModel.use.dish
|
|
|
|
: ''),
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
),
|
|
|
|
VEmptyView(24),
|
|
|
|
_item(
|
|
|
|
'销售价',
|
|
|
|
'${couponProvider.couponSunModel.price}元' ??
|
|
|
|
''),
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
...
|
...
|
@@ -318,25 +376,44 @@ class _CouponDetailPageState extends State<CouponDetailPage> { |
|
|
|
? '会员生日当天'
|
|
|
|
: couponProvider.couponSunModel
|
|
|
|
.expDate.isWeek
|
|
|
|
? couponProvider.couponSunModel
|
|
|
|
.expDate.weekShow
|
|
|
|
? '每周指定日期餐段可用'
|
|
|
|
: ''),
|
|
|
|
if (couponProvider
|
|
|
|
.couponSunModel.expDate.isWeek)
|
|
|
|
Align(
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.only(left: w(16)),
|
|
|
|
child: Text(
|
|
|
|
couponProvider
|
|
|
|
.couponSunModel.expDate.weekShow,
|
|
|
|
textAlign: TextAlign.left,
|
|
|
|
style: TextStyle(
|
|
|
|
height: 1.5,
|
|
|
|
fontSize: font(16),
|
|
|
|
color: MyColours.color_999999),
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
if (couponProvider
|
|
|
|
.couponSunModel.expDate.isWeek)
|
|
|
|
VEmptyView(24),
|
|
|
|
]),
|
|
|
|
couponProvider.couponSunModel.isType == '1'
|
|
|
|
? Column(
|
|
|
|
crossAxisAlignment:
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
),
|
|
|
|
VEmptyView(24),
|
|
|
|
_item('创建人',
|
|
|
|
couponProvider.couponSunModel.uid),
|
|
|
|
],
|
|
|
|
)
|
|
|
|
: SizedBox(),
|
|
|
|
|
|
|
|
// couponProvider.couponSunModel.isType == '1'
|
|
|
|
// ? Column(
|
|
|
|
// crossAxisAlignment:
|
|
|
|
// CrossAxisAlignment.start,
|
|
|
|
// children: [
|
|
|
|
// Container(
|
|
|
|
// height: ScreenUtil().setWidth(2),
|
|
|
|
// color: MyColours.color_E7E7E7,
|
|
|
|
// ),
|
|
|
|
// VEmptyView(24),
|
|
|
|
// _item('创建人',
|
|
|
|
// couponProvider.couponSunModel.uid),
|
|
|
|
// ],
|
|
|
|
// )
|
|
|
|
// : SizedBox(),
|
|
|
|
couponProvider.couponSunModel.isType == '1'
|
|
|
|
? Column(
|
|
|
|
crossAxisAlignment:
|
|
...
|
...
|
@@ -375,19 +452,39 @@ class _CouponDetailPageState extends State<CouponDetailPage> { |
|
|
|
: SizedBox(),
|
|
|
|
couponProvider.couponSunModel.explain != null &&
|
|
|
|
couponProvider.couponSunModel.explain != ''
|
|
|
|
? _item('券说明',
|
|
|
|
couponProvider.couponSunModel.explain)
|
|
|
|
? _item('券说明', '')
|
|
|
|
: SizedBox(),
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_E7E7E7,
|
|
|
|
),
|
|
|
|
VEmptyView(24),
|
|
|
|
_item(
|
|
|
|
'券状态',
|
|
|
|
if (couponProvider.couponSunModel.explain != null &&
|
|
|
|
couponProvider.couponSunModel.explain != '')
|
|
|
|
Align(
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
child: Text(
|
|
|
|
couponProvider.couponSunModel.explain,
|
|
|
|
textAlign: TextAlign.left,
|
|
|
|
style: TextStyle(
|
|
|
|
// height: 1.5,
|
|
|
|
fontSize: font(16),
|
|
|
|
color: MyColours.color_999999),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
if (couponProvider.couponSunModel.explain != null &&
|
|
|
|
couponProvider.couponSunModel.explain != '')
|
|
|
|
VEmptyView(24),
|
|
|
|
// Container(
|
|
|
|
// height: ScreenUtil().setWidth(2),
|
|
|
|
// color: MyColours.color_E7E7E7,
|
|
|
|
// ),
|
|
|
|
VEmptyView(24),
|
|
|
|
_canUse(
|
|
|
|
'立即启用',
|
|
|
|
couponProvider.couponSunModel.status == '1'
|
|
|
|
? '发放中'
|
|
|
|
: '停用')
|
|
|
|
? true
|
|
|
|
: false)
|
|
|
|
],
|
|
|
|
))),
|
|
|
|
)
|
...
|
...
|
|