|
|
@ -92,6 +92,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> { |
|
|
|
|
|
|
|
|
|
|
|
/// 查询店铺信息 |
|
|
|
/// 查询店铺信息 |
|
|
|
queryStoreInfo() async { |
|
|
|
queryStoreInfo() async { |
|
|
|
|
|
|
|
EasyLoading.show(status: S.current.zhengzaijiazai); |
|
|
|
SharedPreferences value = await SharedPreferences.getInstance(); |
|
|
|
SharedPreferences value = await SharedPreferences.getInstance(); |
|
|
|
if (apiService == null) |
|
|
|
if (apiService == null) |
|
|
|
apiService = ApiService( |
|
|
|
apiService = ApiService( |
|
|
@ -113,7 +114,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> { |
|
|
|
} |
|
|
|
} |
|
|
|
minLogin(); |
|
|
|
minLogin(); |
|
|
|
} |
|
|
|
} |
|
|
|
EasyLoading.dismiss(); |
|
|
|
// EasyLoading.dismiss(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// 小程序登录 |
|
|
|
/// 小程序登录 |
|
|
@ -145,7 +146,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> { |
|
|
|
this.shopCarGoods = value; |
|
|
|
this.shopCarGoods = value; |
|
|
|
setState(() {}); |
|
|
|
setState(() {}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
EasyLoading.dismiss(); |
|
|
|
// EasyLoading.dismiss(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
@ -163,6 +164,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> { |
|
|
|
selectSkus.add(element.attrValueList[0].attrValue); |
|
|
|
selectSkus.add(element.attrValueList[0].attrValue); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
EasyLoading.dismiss(); |
|
|
|
refreshController.refreshCompleted(); |
|
|
|
refreshController.refreshCompleted(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
refreshController.refreshFailed(); |
|
|
|
refreshController.refreshFailed(); |
|
|
@ -601,190 +603,187 @@ class _ShopDetailsPage extends State<ShopDetailsPage> { |
|
|
|
@override |
|
|
|
@override |
|
|
|
Widget build(BuildContext context) { |
|
|
|
Widget build(BuildContext context) { |
|
|
|
return Scaffold( |
|
|
|
return Scaffold( |
|
|
|
body: Container( |
|
|
|
body: Column( |
|
|
|
child: Column( |
|
|
|
children: [ |
|
|
|
children: [ |
|
|
|
Expanded( |
|
|
|
Expanded( |
|
|
|
child: SmartRefresher( |
|
|
|
child: SmartRefresher( |
|
|
|
controller: refreshController, |
|
|
|
controller: refreshController, |
|
|
|
enablePullDown: true, |
|
|
|
enablePullDown: true, |
|
|
|
enablePullUp: false, |
|
|
|
enablePullUp: false, |
|
|
|
header: MyHeader(), |
|
|
|
header: MyHeader(), |
|
|
|
footer: CustomFooter( |
|
|
|
footer: CustomFooter( |
|
|
|
builder: (context, mode) { |
|
|
|
builder: (context, mode) { |
|
|
|
return MyFooter(mode); |
|
|
|
return MyFooter(mode); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
onRefresh: () { |
|
|
|
|
|
|
|
setState(() { |
|
|
|
|
|
|
|
_onRefresh(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
physics: BouncingScrollPhysics(), |
|
|
|
), |
|
|
|
scrollController: scrollController, |
|
|
|
onRefresh: () { |
|
|
|
child: Container( |
|
|
|
setState(() { |
|
|
|
child: SingleChildScrollView( |
|
|
|
_onRefresh(); |
|
|
|
physics: BouncingScrollPhysics(), |
|
|
|
}); |
|
|
|
child: Column( |
|
|
|
}, |
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
physics: BouncingScrollPhysics(), |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
scrollController: scrollController, |
|
|
|
children: [ |
|
|
|
child: Container( |
|
|
|
buildProduct(), |
|
|
|
child: SingleChildScrollView( |
|
|
|
SizedBox( |
|
|
|
physics: BouncingScrollPhysics(), |
|
|
|
height: 16.h, |
|
|
|
child: Column( |
|
|
|
), |
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
Container( |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
width: double.infinity, |
|
|
|
children: [ |
|
|
|
// padding: EdgeInsets.symmetric(horizontal: 14.w,vertical: 16.h), |
|
|
|
buildProduct(), |
|
|
|
color: Colors.white, |
|
|
|
SizedBox( |
|
|
|
child: Column( |
|
|
|
height: 16.h, |
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
), |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
Container( |
|
|
|
children: [ |
|
|
|
width: double.infinity, |
|
|
|
Padding( |
|
|
|
color: Colors.white, |
|
|
|
padding: EdgeInsets.only(left: 14.w, top: 16.h), |
|
|
|
child: Column( |
|
|
|
child: Text( |
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
"商品详情", |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
style: TextStyle( |
|
|
|
children: [ |
|
|
|
fontSize: 15.sp, |
|
|
|
Padding( |
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
|
padding: EdgeInsets.only(left: 14.w, top: 16.h), |
|
|
|
color: Color(0xFF000000), |
|
|
|
child: Text( |
|
|
|
), |
|
|
|
"商品详情", |
|
|
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
|
|
fontSize: 15.sp, |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
|
|
|
|
|
color: Color(0xFF000000), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
SizedBox( |
|
|
|
), |
|
|
|
height: 14.h, |
|
|
|
SizedBox( |
|
|
|
), |
|
|
|
height: 14.h, |
|
|
|
Container( |
|
|
|
), |
|
|
|
color: Colors.white, |
|
|
|
Container( |
|
|
|
child: Html( |
|
|
|
color: Colors.white, |
|
|
|
data: miNiDetail?.details ?? "", |
|
|
|
child: Html( |
|
|
|
style: { |
|
|
|
data: miNiDetail?.details ?? "", |
|
|
|
'body': Style( |
|
|
|
style: { |
|
|
|
backgroundColor: Colors.white, |
|
|
|
'body': Style( |
|
|
|
padding: EdgeInsets.all(0), |
|
|
|
backgroundColor: Colors.white, |
|
|
|
margin: EdgeInsets.all(0)), |
|
|
|
|
|
|
|
'p': Style( |
|
|
|
|
|
|
|
margin: EdgeInsets.all(0), |
|
|
|
|
|
|
|
padding: EdgeInsets.all(0), |
|
|
|
padding: EdgeInsets.all(0), |
|
|
|
), |
|
|
|
margin: EdgeInsets.all(0)), |
|
|
|
}, |
|
|
|
'p': Style( |
|
|
|
customImageRenders: { |
|
|
|
margin: EdgeInsets.all(0), |
|
|
|
networkSourceMatcher(): networkImageRender( |
|
|
|
padding: EdgeInsets.all(0), |
|
|
|
loadingWidget: () { |
|
|
|
), |
|
|
|
return Container(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
customImageRenders: { |
|
|
|
), |
|
|
|
networkSourceMatcher(): networkImageRender( |
|
|
|
}, |
|
|
|
loadingWidget: () { |
|
|
|
), |
|
|
|
return Container(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
}, |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
) |
|
|
|
), |
|
|
|
], |
|
|
|
) |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
flex: 1, |
|
|
|
|
|
|
|
), |
|
|
|
), |
|
|
|
if (count() != 0) |
|
|
|
flex: 1, |
|
|
|
Stack( |
|
|
|
), |
|
|
|
alignment: Alignment.bottomLeft, |
|
|
|
if (count() != 0) |
|
|
|
children: [ |
|
|
|
Stack( |
|
|
|
Container( |
|
|
|
alignment: Alignment.bottomLeft, |
|
|
|
margin: EdgeInsets.symmetric(horizontal: 14), |
|
|
|
children: [ |
|
|
|
height: 45.h, |
|
|
|
Container( |
|
|
|
// color: Color(0xFFFAFAFA), |
|
|
|
margin: EdgeInsets.symmetric(horizontal: 14), |
|
|
|
decoration: BoxDecoration( |
|
|
|
height: 45.h, |
|
|
|
color: Color(0xFF383A38), |
|
|
|
// color: Color(0xFFFAFAFA), |
|
|
|
borderRadius: BorderRadius.circular(100), |
|
|
|
decoration: BoxDecoration( |
|
|
|
), |
|
|
|
color: Color(0xFF383A38), |
|
|
|
child: Row( |
|
|
|
borderRadius: BorderRadius.circular(100), |
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceAround, |
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
SizedBox( |
|
|
|
|
|
|
|
width: 45.w, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
Text.rich( |
|
|
|
|
|
|
|
TextSpan(children: [ |
|
|
|
|
|
|
|
TextSpan( |
|
|
|
|
|
|
|
text: "¥ ", |
|
|
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
|
|
|
color: Color(0xFFFFFFFF), |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.bold), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
TextSpan( |
|
|
|
|
|
|
|
text: shopCarGoods != null |
|
|
|
|
|
|
|
? shopCarGoods.cartSum |
|
|
|
|
|
|
|
: "0.0", |
|
|
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
|
|
fontSize: 20.sp, |
|
|
|
|
|
|
|
color: Color(0xFFFFFFFF), |
|
|
|
|
|
|
|
fontFamily: 'JDZhengHT', |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.medium), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
]), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
Spacer(), |
|
|
|
|
|
|
|
GestureDetector( |
|
|
|
|
|
|
|
onTap: () { |
|
|
|
|
|
|
|
toDownOrder(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
child: RoundButton( |
|
|
|
|
|
|
|
width: 103.w, |
|
|
|
|
|
|
|
height: 54.h, |
|
|
|
|
|
|
|
text: S.current.jiesuan, |
|
|
|
|
|
|
|
textColor: Colors.white, |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.bold, |
|
|
|
|
|
|
|
backgroup: Color(0xFF32A060), |
|
|
|
|
|
|
|
radius: 100, |
|
|
|
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 5.h), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
), |
|
|
|
Stack( |
|
|
|
child: Row( |
|
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceAround, |
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
|
|
children: [ |
|
|
|
children: [ |
|
|
|
InkWell( |
|
|
|
SizedBox( |
|
|
|
|
|
|
|
width: 45.w, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
Text.rich( |
|
|
|
|
|
|
|
TextSpan(children: [ |
|
|
|
|
|
|
|
TextSpan( |
|
|
|
|
|
|
|
text: "¥ ", |
|
|
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
|
|
|
color: Color(0xFFFFFFFF), |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.bold), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
TextSpan( |
|
|
|
|
|
|
|
text: shopCarGoods != null |
|
|
|
|
|
|
|
? shopCarGoods.cartSum |
|
|
|
|
|
|
|
: "0.0", |
|
|
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
|
|
fontSize: 20.sp, |
|
|
|
|
|
|
|
color: Color(0xFFFFFFFF), |
|
|
|
|
|
|
|
fontFamily: 'JDZhengHT', |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.medium), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
]), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
Spacer(), |
|
|
|
|
|
|
|
GestureDetector( |
|
|
|
onTap: () { |
|
|
|
onTap: () { |
|
|
|
if (count() != 0) showShoppingCart(); |
|
|
|
toDownOrder(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
child: Image.asset( |
|
|
|
child: RoundButton( |
|
|
|
"assets/image/shopping_bag.webp", |
|
|
|
width: 103.w, |
|
|
|
width: 66, |
|
|
|
height: 54.h, |
|
|
|
height: 66, |
|
|
|
text: S.current.jiesuan, |
|
|
|
fit: BoxFit.fitWidth, |
|
|
|
textColor: Colors.white, |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.bold, |
|
|
|
|
|
|
|
backgroup: Color(0xFF32A060), |
|
|
|
|
|
|
|
radius: 100, |
|
|
|
|
|
|
|
fontSize: 16.sp, |
|
|
|
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 5.h), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
if (count() != 0) |
|
|
|
|
|
|
|
Positioned( |
|
|
|
|
|
|
|
right: 5, |
|
|
|
|
|
|
|
// top: 14, |
|
|
|
|
|
|
|
child: RoundButton( |
|
|
|
|
|
|
|
width: 17.w, |
|
|
|
|
|
|
|
height: 17.h, |
|
|
|
|
|
|
|
text: "${count()}", |
|
|
|
|
|
|
|
textColor: Colors.white, |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
|
|
|
backgroup: Color(0xFFF65720), |
|
|
|
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
|
|
|
radius: 100, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
], |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
Stack( |
|
|
|
SizedBox( |
|
|
|
children: [ |
|
|
|
height: 30.h, |
|
|
|
InkWell( |
|
|
|
) |
|
|
|
onTap: () { |
|
|
|
], |
|
|
|
if (count() != 0) showShoppingCart(); |
|
|
|
), |
|
|
|
}, |
|
|
|
|
|
|
|
child: Image.asset( |
|
|
|
|
|
|
|
"assets/image/shopping_bag.webp", |
|
|
|
|
|
|
|
width: 66, |
|
|
|
|
|
|
|
height: 66, |
|
|
|
|
|
|
|
fit: BoxFit.fitWidth, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
if (count() != 0) |
|
|
|
|
|
|
|
Positioned( |
|
|
|
|
|
|
|
right: 5, |
|
|
|
|
|
|
|
// top: 14, |
|
|
|
|
|
|
|
child: RoundButton( |
|
|
|
|
|
|
|
width: 17.w, |
|
|
|
|
|
|
|
height: 17.h, |
|
|
|
|
|
|
|
text: "${count()}", |
|
|
|
|
|
|
|
textColor: Colors.white, |
|
|
|
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
|
|
|
backgroup: Color(0xFFF65720), |
|
|
|
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
|
|
|
radius: 100, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
SizedBox( |
|
|
|
|
|
|
|
height: 30.h, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
@ -828,7 +827,7 @@ class _ShopDetailsPage extends State<ShopDetailsPage> { |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
SizedBox( |
|
|
|
SizedBox( |
|
|
|
width: 2, |
|
|
|
width: 2.w, |
|
|
|
), |
|
|
|
), |
|
|
|
Expanded( |
|
|
|
Expanded( |
|
|
|
child: Text( |
|
|
|
child: Text( |
|
|
|