|
|
@@ -8,17 +8,13 @@ import 'package:bbyyy/my_tools/my_colors.dart';
|
|
|
import 'package:bbyyy/my_tools/my_cookie.dart';
|
|
|
import 'package:bbyyy/my_tools/my_views.dart';
|
|
|
import 'package:flutter/material.dart';
|
|
|
-import 'package:flutter_slidable/flutter_slidable.dart';
|
|
|
-import 'package:pull_to_refresh/pull_to_refresh.dart';
|
|
|
|
|
|
class RelatedProductsPage extends StatefulWidget {
|
|
|
@override
|
|
|
_RelatedProductsPageState createState() => _RelatedProductsPageState();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
class _RelatedProductsPageState extends State<RelatedProductsPage> {
|
|
|
-
|
|
|
List<GoodsBeanDataData> data = [];
|
|
|
|
|
|
@override
|
|
|
@@ -27,6 +23,7 @@ class _RelatedProductsPageState extends State<RelatedProductsPage> {
|
|
|
super.initState();
|
|
|
queryProducts();
|
|
|
}
|
|
|
+
|
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
|
return Scaffold(
|
|
|
@@ -37,82 +34,99 @@ class _RelatedProductsPageState extends State<RelatedProductsPage> {
|
|
|
child: data.length == 0
|
|
|
? SingleChildScrollView(child: noData())
|
|
|
: ListView.builder(
|
|
|
- itemBuilder: (c, index) {
|
|
|
- return GestureDetector(
|
|
|
- onTap: (){
|
|
|
- Navigator.pop(context,data[index]);
|
|
|
- },
|
|
|
- behavior: HitTestBehavior.translucent,
|
|
|
- child: Container(
|
|
|
- padding: EdgeInsets.only(left: 8, right: 8, bottom: 7, top: 18),
|
|
|
- decoration: BoxDecoration(
|
|
|
- color: Colors.white,
|
|
|
- borderRadius: BorderRadius.all(
|
|
|
- Radius.circular(4),
|
|
|
- ),
|
|
|
- ),
|
|
|
- margin: EdgeInsets.only(left: 10, right: 10, bottom: 10),
|
|
|
- child: Column(
|
|
|
- children: [
|
|
|
- Row(
|
|
|
- children: [
|
|
|
- ClipRRect(child: MyViews().netImg(imgURL(data[index].shopPic), 25, 25),borderRadius: BorderRadius.circular(12.5),),
|
|
|
- Container(
|
|
|
- margin: EdgeInsets.only(left: 10),
|
|
|
- child: Text(
|
|
|
- data[index].shopName,
|
|
|
- style: TextStyle(color: MyColors.c333333, fontSize: 14),
|
|
|
- ),
|
|
|
- ),
|
|
|
- ],
|
|
|
- ),
|
|
|
- Container(
|
|
|
- height: 0.5,
|
|
|
- color: MyColors.cE7E7E7,
|
|
|
- margin: EdgeInsets.only(top: 14),
|
|
|
- ),
|
|
|
- Row(
|
|
|
- children: [
|
|
|
- Container(
|
|
|
- child: MyViews().netImg(imgURL(data[index].coverPath), 50, 50,
|
|
|
- placeholder: 'images/svg/goodsDefImg.svg'),
|
|
|
- margin: EdgeInsets.only(right: 8, top: 11, bottom: 11),
|
|
|
+ itemBuilder: (c, index) {
|
|
|
+ return GestureDetector(
|
|
|
+ onTap: () {
|
|
|
+ Navigator.pop(context, data[index]);
|
|
|
+ },
|
|
|
+ behavior: HitTestBehavior.translucent,
|
|
|
+ child: Container(
|
|
|
+ padding: EdgeInsets.only(
|
|
|
+ left: 8, right: 8, bottom: 7, top: 18),
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: Colors.white,
|
|
|
+ borderRadius: BorderRadius.all(
|
|
|
+ Radius.circular(4),
|
|
|
),
|
|
|
- Expanded(
|
|
|
- child: Container(
|
|
|
- child: Column(
|
|
|
- children: [
|
|
|
- Text(
|
|
|
- '${data[index].title}',
|
|
|
- style: TextStyle(color: MyColors.c333333, fontSize: 13),
|
|
|
+ ),
|
|
|
+ margin:
|
|
|
+ EdgeInsets.only(left: 10, right: 10, bottom: 10),
|
|
|
+ child: Column(
|
|
|
+ children: [
|
|
|
+ Row(
|
|
|
+ children: [
|
|
|
+ ClipRRect(
|
|
|
+ child: MyViews().netImg(
|
|
|
+ imgURL(data[index].shopPic), 25, 25),
|
|
|
+ borderRadius: BorderRadius.circular(12.5),
|
|
|
+ ),
|
|
|
+ Container(
|
|
|
+ margin: EdgeInsets.only(left: 10),
|
|
|
+ child: Text(
|
|
|
+ data[index].shopName,
|
|
|
+ style: TextStyle(
|
|
|
+ color: MyColors.c333333,
|
|
|
+ fontSize: 14),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ Container(
|
|
|
+ height: 0.5,
|
|
|
+ color: MyColors.cE7E7E7,
|
|
|
+ margin: EdgeInsets.only(top: 14),
|
|
|
+ ),
|
|
|
+ Row(
|
|
|
+ children: [
|
|
|
+ Container(
|
|
|
+ child: MyViews().netImg(
|
|
|
+ imgURL(data[index].coverPath), 50, 50,
|
|
|
+ placeholder:
|
|
|
+ 'images/svg/goodsDefImg.svg'),
|
|
|
+ margin: EdgeInsets.only(
|
|
|
+ right: 8, top: 11, bottom: 11),
|
|
|
+ ),
|
|
|
+ Expanded(
|
|
|
+ child: Container(
|
|
|
+ child: Column(
|
|
|
+ children: [
|
|
|
+ Text(
|
|
|
+ '${data[index].title}',
|
|
|
+ style: TextStyle(
|
|
|
+ color: MyColors.c333333,
|
|
|
+ fontSize: 13),
|
|
|
+ ),
|
|
|
+ Row(
|
|
|
+ children: [
|
|
|
+ Text(
|
|
|
+ '¥${data[index].price}',
|
|
|
+ style: TextStyle(
|
|
|
+ color: MyColors.cFF4233,
|
|
|
+ fontSize: 12),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ mainAxisAlignment:
|
|
|
+ MainAxisAlignment.spaceBetween,
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ mainAxisAlignment:
|
|
|
+ MainAxisAlignment.spaceBetween,
|
|
|
+ crossAxisAlignment:
|
|
|
+ CrossAxisAlignment.start,
|
|
|
+ ),
|
|
|
+ height: 50,
|
|
|
),
|
|
|
- Row(
|
|
|
- children: [
|
|
|
- Text(
|
|
|
- '¥${data[index].price}',
|
|
|
- style: TextStyle(
|
|
|
- color: MyColors.cFF4233, fontSize: 12),
|
|
|
- ),
|
|
|
- ],
|
|
|
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
- )
|
|
|
- ],
|
|
|
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
- ),
|
|
|
- height: 50,
|
|
|
+ )
|
|
|
+ ],
|
|
|
),
|
|
|
- )
|
|
|
- ],
|
|
|
+ ],
|
|
|
+ ),
|
|
|
),
|
|
|
- ],
|
|
|
- ),
|
|
|
+ );
|
|
|
+ },
|
|
|
+ itemCount: data.length,
|
|
|
+ padding: EdgeInsets.only(top: 10),
|
|
|
),
|
|
|
- );
|
|
|
- },
|
|
|
- itemCount: data.length,
|
|
|
- padding: EdgeInsets.only(top: 10),
|
|
|
- ),
|
|
|
),
|
|
|
],
|
|
|
),
|
|
|
@@ -130,10 +144,10 @@ class _RelatedProductsPageState extends State<RelatedProductsPage> {
|
|
|
}, (response, hasError) {
|
|
|
if (!hasError) {
|
|
|
GoodsBeanEntity entity =
|
|
|
- GoodsBeanEntity().fromJson(json.decode(response.data.toString()));
|
|
|
+ GoodsBeanEntity().fromJson(json.decode(response.data.toString()));
|
|
|
data = entity.data.data;
|
|
|
setState(() {});
|
|
|
}
|
|
|
- }, (error) { });
|
|
|
+ }, (error) {});
|
|
|
}
|
|
|
}
|