Browse Source

safety

master
fmk 3 years ago
parent
commit
59625c5c2e
  1. 9
      lib/order/exchange_history_page.dart
  2. 8
      lib/order/exchange_order_page.dart
  3. 10
      lib/order/logistics_information_page.dart
  4. 6
      lib/view_widget/custom_image.dart

9
lib/order/exchange_history_page.dart

@ -7,6 +7,7 @@ import 'package:huixiang/retrofit/data/exchange_order.dart';
import 'package:huixiang/retrofit/data/page.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/icon_text.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/my_footer.dart';
@ -323,15 +324,13 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> {
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.network(
MImage(
(exchangeOrder != null &&
exchangeOrder.creditOrderDetailList != null)
? exchangeOrder.creditOrderDetailList[0].goodsMainImg
: "",
errorBuilder: (context, error, stackTrace) {
return Image.asset("assets/image/default_1.png",
fit: BoxFit.cover);
},
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
width: 66,
height: 66,
fit: BoxFit.cover,

8
lib/order/exchange_order_page.dart

@ -262,11 +262,19 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: [
if (widget.arguments["image"] != null)
Image.network(
widget.arguments["image"],
fit: BoxFit.cover,
width: 80,
height: 80,
)
else
Image.asset(
"assets/image/default_1.png",
fit: BoxFit.cover,
width: 80,
height: 80,
),
Expanded(
child: Container(

10
lib/order/logistics_information_page.dart

@ -165,8 +165,16 @@ class _LogisticsInformationPage extends State<LogisticsInformationPage> {
Stack(
alignment: Alignment.bottomCenter,
children: [
if (widget.arguments["skuImg"] != null)
Image.network(
widget.arguments["skuImg"] ?? "assets/image/default_1.png",
widget.arguments["skuImg"],
width: 95.w,
height: 95.h,
fit: BoxFit.cover,
)
else
Image.asset(
"assets/image/default_1.png",
width: 95.w,
height: 95.h,
fit: BoxFit.cover,

6
lib/view_widget/custom_image.dart

@ -36,6 +36,12 @@ class MImage extends StatelessWidget {
"x${constraints.constrainHeight() * scaleIndex}/format/webp/blur/1x0/quality/75";
}
print("imageUrl: $imageUrl");
if (imageUrl == null || imageUrl == "") {
return Image.asset(
"assets/image/default_2_1.png",
fit: fit,
);
}
return CachedNetworkImage(
imageUrl: imageUrl,
cacheManager: DefaultCacheManager(),

Loading…
Cancel
Save