Browse Source

兑换券跳转类型更改;

dev
wurong 1 year ago
parent
commit
61e7dca70b
  1. 2
      lib/home/welfare_page.dart
  2. 2
      lib/mine/coupon_page.dart
  3. 2
      lib/mine/coupons_page.dart
  4. 2
      lib/mine/roll_center_page.dart
  5. 25
      lib/order/write_off_page.dart

2
lib/home/welfare_page.dart

@ -652,7 +652,7 @@ class _WelfarePage extends State<WelfarePage> {
Navigator.of(context) Navigator.of(context)
.pushNamed('/router/write_off_page', arguments: { .pushNamed('/router/write_off_page', arguments: {
"couponId": cop.id, "couponId": cop.id,
"coupon": jsonEncode(cop.toJson()), "coupon": cop,
}); });
} else { } else {
showStoreSelector(cop.storeList); showStoreSelector(cop.storeList);

2
lib/mine/coupon_page.dart

@ -245,7 +245,7 @@ class _CouponPage extends State<CouponPage> {
'/router/write_off_page', '/router/write_off_page',
arguments: { arguments: {
"couponId": coupons[position].id, "couponId": coupons[position].id,
"coupon": jsonEncode(coupons[position]), "coupon": coupons[position],
}).then((value) { }).then((value) {
_onRefresh(); _onRefresh();
}); });

2
lib/mine/coupons_page.dart

@ -180,7 +180,7 @@ class _CouponsPage extends State<CouponsPage> {
'/router/write_off_page', '/router/write_off_page',
arguments: { arguments: {
"couponId": coupons[position].id, "couponId": coupons[position].id,
"coupon": jsonEncode(coupons[position]), "coupon": coupons[position],
}).then((value) { }).then((value) {
_onRefresh(); _onRefresh();
}); });

2
lib/mine/roll_center_page.dart

@ -134,7 +134,7 @@ class _RollCenterPage extends State<RollCenterPage> {
'/router/write_off_page', '/router/write_off_page',
arguments: { arguments: {
"couponId": coupons[position].id, "couponId": coupons[position].id,
"coupon": coupons[position].toJson() "coupon": coupons[position]
}); });
} else { } else {
showStoreSelector(coupons[position].storeList); showStoreSelector(coupons[position].storeList);

25
lib/order/write_off_page.dart

@ -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: () {

Loading…
Cancel
Save