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)
.pushNamed('/router/write_off_page', arguments: {
"couponId": cop.id,
"coupon": jsonEncode(cop.toJson()),
"coupon": cop,
});
} else {
showStoreSelector(cop.storeList);

2
lib/mine/coupon_page.dart

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

2
lib/mine/coupons_page.dart

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

2
lib/mine/roll_center_page.dart

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

25
lib/order/write_off_page.dart

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

Loading…
Cancel
Save