@@ -28,6 +28,8 @@ class _GoodsDetail extends State<GoodsDetail> {
28
28
29
29
int goodsCount = 0 ;
30
30
31
+ Map goodsMsgs;
32
+
31
33
@override
32
34
void didChangeDependencies () {
33
35
super .didChangeDependencies ();
@@ -46,6 +48,7 @@ class _GoodsDetail extends State<GoodsDetail> {
46
48
var cartData = data[1 ].data;
47
49
setState (() {
48
50
imgList = goodsMsg['gallery' ];
51
+ goodsMsgs = goodsMsg;
49
52
initLoading = false ;
50
53
goodsCount = cartData['cartTotal' ]['goodsCount' ];
51
54
});
@@ -56,6 +59,7 @@ class _GoodsDetail extends State<GoodsDetail> {
56
59
var goodsMsg = data[0 ].data;
57
60
setState (() {
58
61
imgList = goodsMsg['gallery' ];
62
+ goodsMsgs = goodsMsg;
59
63
initLoading = false ;
60
64
});
61
65
}
@@ -64,13 +68,12 @@ class _GoodsDetail extends State<GoodsDetail> {
64
68
@override
65
69
Widget build (BuildContext context) {
66
70
return new Scaffold (
67
- backgroundColor: Color .fromARGB (1 , 200 , 200 , 200 ),
68
71
appBar: buildAppBar ('母亲节礼物-舒适安睡组合' ),
69
72
body: Column (
70
73
children: < Widget > [
71
74
Expanded (
72
75
child: Container (
73
- color: Colors .white ,
76
+ color: Color . fromARGB ( 1 , 200 , 200 , 200 ) ,
74
77
child: buildContent (context),
75
78
),
76
79
),
@@ -178,6 +181,7 @@ class _GoodsDetail extends State<GoodsDetail> {
178
181
top: 0 ,
179
182
right: 0 ,
180
183
child: Container (
184
+ color: Colors .white,
181
185
child: Text (
182
186
'$goodsCount ' ,
183
187
style: TextStyle (
@@ -288,7 +292,15 @@ class _GoodsDetail extends State<GoodsDetail> {
288
292
} else {
289
293
return CustomScrollView (
290
294
slivers: < Widget > [
291
- buildOneWidget (buildSwiper (context, imgList)),
295
+ buildOneWidget (
296
+ buildSwiper (context, imgList),
297
+ ),
298
+ buildOneWidget (
299
+ buildGoodsLa (context),
300
+ ),
301
+ buildOneWidget (
302
+ buildGoodsMsg (context),
303
+ ),
292
304
],
293
305
);
294
306
}
@@ -333,4 +345,109 @@ class _GoodsDetail extends State<GoodsDetail> {
333
345
),
334
346
);
335
347
}
348
+
349
+ // 商品活动栏
350
+ Widget buildGoodsLa (BuildContext context) {
351
+ return Container (
352
+ color: Color .fromARGB (255 , 244 , 244 , 244 ),
353
+ padding: EdgeInsets .all (5 ),
354
+ child: Column (
355
+ children: < Widget > [
356
+ Row (
357
+ children: < Widget > [
358
+ Expanded (
359
+ child: Row (
360
+ mainAxisAlignment: MainAxisAlignment .center,
361
+ children: < Widget > [
362
+ Icon (
363
+ Icons .star,
364
+ color: Colors .red,
365
+ size: Rem .getPxToRem (26 ),
366
+ ),
367
+ Container (
368
+ child: Text (
369
+ '30天无忧退货' ,
370
+ style: TextStyle (fontSize: Rem .getPxToRem (26 )),
371
+ ),
372
+ )
373
+ ],
374
+ ),
375
+ ),
376
+ Expanded (
377
+ child: Row (
378
+ mainAxisAlignment: MainAxisAlignment .center,
379
+ children: < Widget > [
380
+ Icon (
381
+ Icons .star,
382
+ color: Colors .red,
383
+ size: Rem .getPxToRem (26 ),
384
+ ),
385
+ Text (
386
+ '满88元免邮费' ,
387
+ style: TextStyle (fontSize: Rem .getPxToRem (26 )),
388
+ ),
389
+ ],
390
+ ),
391
+ ),
392
+ Expanded (
393
+ child: Row (
394
+ mainAxisAlignment: MainAxisAlignment .center,
395
+ children: < Widget > [
396
+ Icon (
397
+ Icons .star,
398
+ color: Colors .red,
399
+ size: Rem .getPxToRem (26 ),
400
+ ),
401
+ Text (
402
+ '48小时快速退款' ,
403
+ style: TextStyle (fontSize: Rem .getPxToRem (26 )),
404
+ )
405
+ ],
406
+ ),
407
+ )
408
+ ],
409
+ )
410
+ ],
411
+ ),
412
+ );
413
+ }
414
+
415
+ // 商品信息
416
+ Widget buildGoodsMsg (BuildContext context) {
417
+ print (goodsMsgs['info' ]);
418
+ return Container (
419
+ color: Colors .white,
420
+ padding: EdgeInsets .all (10 ),
421
+ child: Column (
422
+ children: < Widget > [
423
+ Padding (
424
+ padding: EdgeInsets .only (bottom: 5 ),
425
+ child: Text (
426
+ goodsMsgs["info" ]['name' ],
427
+ style: TextStyle (
428
+ fontSize: Rem .getPxToRem (40 ),
429
+ ),
430
+ ),
431
+ ),
432
+ Padding (
433
+ padding: EdgeInsets .only (bottom: 5 ),
434
+ child: Text (
435
+ goodsMsgs["info" ]['goods_brief' ],
436
+ style: TextStyle (
437
+ color: Colors .grey,
438
+ fontSize: Rem .getPxToRem (30 ),
439
+ ),
440
+ ),
441
+ ),
442
+ Text (
443
+ '¥499' ,
444
+ style: TextStyle (
445
+ color: Colors .red,
446
+ fontSize: Rem .getPxToRem (40 ),
447
+ ),
448
+ ),
449
+ ],
450
+ ),
451
+ );
452
+ }
336
453
}
0 commit comments