Browse Source

优惠券列表更改

remove_uniapp
w-R 3 years ago
parent
commit
db6ead0247
  1. 15
      lib/view_widget/new_coupon_widget.dart

15
lib/view_widget/new_coupon_widget.dart

@ -18,6 +18,17 @@ class NewCouponWidget extends StatelessWidget {
return buildCoupon(context); return buildCoupon(context);
} }
String getCouponStoreName(){
String couponStoreName = coupon.tenantName;
if(coupon?.storeList != null && coupon.storeId != "0"){
coupon.storeList.forEach((element) {
if(element.id == coupon.storeId)
couponStoreName = element.storeName;
});
}
return couponStoreName;
}
Widget buildCoupon(BuildContext context) { Widget buildCoupon(BuildContext context) {
// if(coupon != null) { // if(coupon != null) {
// coupon.isEx = fa; // coupon.isEx = fa;
@ -92,9 +103,7 @@ class NewCouponWidget extends StatelessWidget {
width: 8.w, width: 8.w,
), ),
Expanded( Expanded(
child: Text( child: Text(getCouponStoreName(),
(coupon.storeId != "0" && coupon?.storeList != null && coupon.storeList.isNotEmpty && coupon.storeList.firstWhere((x) => x.id == coupon.storeId)!=null ?
coupon.storeList.firstWhere((x) => x.id == coupon.storeId).storeName : coupon.tenantName),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontSize: 16.sp, fontSize: 16.sp,

Loading…
Cancel
Save