|
|
@ -33,7 +33,7 @@ class WriteOffPage extends StatefulWidget { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
class _WriteOffPage extends State<WriteOffPage> { |
|
|
|
class _WriteOffPage extends State<WriteOffPage> { |
|
|
|
dynamic coupon; |
|
|
|
Coupon coupon; |
|
|
|
ApiService apiService; |
|
|
|
ApiService apiService; |
|
|
|
CouponDetail queryCoupon; |
|
|
|
CouponDetail queryCoupon; |
|
|
|
final RefreshController refreshController = RefreshController(); |
|
|
|
final RefreshController refreshController = RefreshController(); |
|
|
@ -42,10 +42,10 @@ class _WriteOffPage extends State<WriteOffPage> { |
|
|
|
void initState() { |
|
|
|
void initState() { |
|
|
|
super.initState(); |
|
|
|
super.initState(); |
|
|
|
|
|
|
|
|
|
|
|
coupon = jsonDecode(widget.arguments["coupon"]); |
|
|
|
coupon = widget.arguments["coupon"]; |
|
|
|
if (mounted) setState(() {}); |
|
|
|
if (mounted) setState(() {}); |
|
|
|
|
|
|
|
|
|
|
|
queryCouponDetail(coupon["memberCouponId"]); |
|
|
|
queryCouponDetail(coupon.memberCouponId); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
///查询核销券状态/查询优惠券详情 |
|
|
|
///查询核销券状态/查询优惠券详情 |
|
|
@ -60,15 +60,14 @@ class _WriteOffPage extends State<WriteOffPage> { |
|
|
|
} |
|
|
|
} |
|
|
|
BaseData baseData = await apiService.couponDetail(memberCouponId); |
|
|
|
BaseData baseData = await apiService.couponDetail(memberCouponId); |
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
setState(() { |
|
|
|
|
|
|
|
queryCoupon = baseData.data; |
|
|
|
queryCoupon = baseData.data; |
|
|
|
if(queryCoupon.status==2){ |
|
|
|
if(queryCoupon.status==2){ |
|
|
|
Navigator.of(context).pop(true); |
|
|
|
Navigator.of(context).pop(true); |
|
|
|
} |
|
|
|
} |
|
|
|
else Future.delayed(Duration(seconds: 1), () { |
|
|
|
// else Future.delayed(Duration(seconds: 15), () { |
|
|
|
queryCouponDetail(coupon["memberCouponId"]); |
|
|
|
// queryCouponDetail(coupon.memberCouponId); |
|
|
|
}); |
|
|
|
// }); |
|
|
|
}); |
|
|
|
// setState(() {}); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); |
|
|
|
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); |
|
|
|
} |
|
|
|
} |
|
|
@ -127,7 +126,7 @@ class _WriteOffPage extends State<WriteOffPage> { |
|
|
|
child: Column( |
|
|
|
child: Column( |
|
|
|
children: [ |
|
|
|
children: [ |
|
|
|
Text( |
|
|
|
Text( |
|
|
|
coupon != null ? coupon["couponName"] : "", |
|
|
|
coupon != null ? coupon.couponName : "", |
|
|
|
style: TextStyle( |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 16.sp, |
|
|
|
fontSize: 16.sp, |
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
fontWeight: FontWeight.bold, |
|
|
@ -137,8 +136,8 @@ class _WriteOffPage extends State<WriteOffPage> { |
|
|
|
height:11.h, |
|
|
|
height:11.h, |
|
|
|
), |
|
|
|
), |
|
|
|
Text( |
|
|
|
Text( |
|
|
|
(coupon["useStartTime"] == null || coupon["useEndTime"] == null) ? "" : S.of(context).youxiaoqi( |
|
|
|
(coupon.useStartTime == null || coupon.useEndTime == null) ? "" : S.of(context).youxiaoqi( |
|
|
|
"${coupon["useStartTime"].replaceAll("-", ".").split(" ")[0]}-${coupon["useEndTime"].replaceAll("-", ".").split(" ")[0]}"), |
|
|
|
"${coupon.useStartTime.replaceAll("-", ".").split(" ")[0]}-${coupon.useEndTime.replaceAll("-", ".").split(" ")[0]}"), |
|
|
|
style: TextStyle( |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 12.sp, |
|
|
|
fontSize: 12.sp, |
|
|
|
color: Color(0xFF353535), |
|
|
|
color: Color(0xFF353535), |
|
|
@ -203,7 +202,7 @@ class _WriteOffPage extends State<WriteOffPage> { |
|
|
|
height: 16.h, |
|
|
|
height: 16.h, |
|
|
|
), |
|
|
|
), |
|
|
|
Expanded(child: QrImage( |
|
|
|
Expanded(child: QrImage( |
|
|
|
data: "{\"type\":\"wiped\",\"memberCouponId\":\"${coupon["memberCouponId"]}\"}", |
|
|
|
data: "{\"type\":\"wiped\",\"memberCouponId\":\"${coupon.memberCouponId}\"}", |
|
|
|
version: QrVersions.auto, |
|
|
|
version: QrVersions.auto, |
|
|
|
size: 250.w, |
|
|
|
size: 250.w, |
|
|
|
gapless: true, |
|
|
|
gapless: true, |
|
|
@ -560,7 +559,7 @@ class _WriteOffPage extends State<WriteOffPage> { |
|
|
|
Container( |
|
|
|
Container( |
|
|
|
child: Html( |
|
|
|
child: Html( |
|
|
|
data: |
|
|
|
data: |
|
|
|
coupon != null ? coupon["remark"] : "", |
|
|
|
coupon != null ? coupon.remark : "", |
|
|
|
customImageRenders: { |
|
|
|
customImageRenders: { |
|
|
|
networkSourceMatcher(): networkImageRender( |
|
|
|
networkSourceMatcher(): networkImageRender( |
|
|
|
loadingWidget: () { |
|
|
|
loadingWidget: () { |
|
|
|