After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 7.3 KiB |
After Width: | Height: | Size: 1014 B |
After Width: | Height: | Size: 844 B |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 105 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 6.0 KiB |
After Width: | Height: | Size: 6.2 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 986 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 302 B |
After Width: | Height: | Size: 750 B |
After Width: | Height: | Size: 696 B |
After Width: | Height: | Size: 4.8 KiB |
After Width: | Height: | Size: 822 B |
@ -0,0 +1,26 @@
|
||||
import 'package:flutter/cupertino.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
|
||||
class FarmersTab extends Decoration { |
||||
@override |
||||
BoxPainter createBoxPainter([VoidCallback onChanged]) { |
||||
return _CustomBoxPainter(); |
||||
} |
||||
} |
||||
|
||||
class _CustomBoxPainter extends BoxPainter { |
||||
@override |
||||
void paint(Canvas canvas, Offset offset, ImageConfiguration configuration) { |
||||
///每个Tab的宽高 |
||||
Size tabSize = Size(32.w, 32.w); |
||||
final Offset tabOffset = Offset(offset.dx+((configuration.size.width-32.w)/2),offset.dy); |
||||
final Rect rect = tabOffset & tabSize; |
||||
final Paint paint = Paint(); |
||||
paint.color = Color(0xFFFFFFFF); |
||||
paint.style = PaintingStyle.stroke; |
||||
paint.strokeCap = StrokeCap.round; |
||||
paint.strokeWidth = 3; |
||||
///画Tab矩形 |
||||
canvas.drawArc(rect, 1, 1.2, false, paint); |
||||
} |
||||
} |
@ -0,0 +1,305 @@
|
||||
import 'package:dio/dio.dart'; |
||||
import 'package:flutter/cupertino.dart'; |
||||
import 'package:flutter/material.dart'; |
||||
import 'package:flutter_easyloading/flutter_easyloading.dart'; |
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; |
||||
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; |
||||
import 'package:huixiang/home/help_farmers/farmers_tab.dart'; |
||||
import 'package:huixiang/retrofit/retrofit_api.dart'; |
||||
import 'package:huixiang/view_widget/classic_header.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
import 'package:huixiang/view_widget/my_footer.dart'; |
||||
import 'package:pull_to_refresh/pull_to_refresh.dart'; |
||||
import 'package:shared_preferences/shared_preferences.dart'; |
||||
|
||||
import '../../generated/l10n.dart'; |
||||
import '../../retrofit/data/base_data.dart'; |
||||
import '../../retrofit/data/farmers_list.dart'; |
||||
import '../../utils/flutter_utils.dart'; |
||||
import '../../utils/font_weight.dart'; |
||||
import '../../view_widget/custom_image.dart'; |
||||
import '../../view_widget/my_tab.dart'; |
||||
import '../../view_widget/no_data_view.dart'; |
||||
|
||||
class HelpFarmersPage extends StatefulWidget { |
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _HelpFarmersPage(); |
||||
} |
||||
} |
||||
|
||||
class _HelpFarmersPage extends State<HelpFarmersPage> { |
||||
ApiService apiService; |
||||
final RefreshController refreshController = RefreshController(); |
||||
List<FarmersList> farmersList = []; |
||||
int tabIndex = 0; |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
SharedPreferences.getInstance().then((value) => { |
||||
apiService = ApiService( |
||||
Dio(), |
||||
context: context, |
||||
token: value.getString('token'), |
||||
// showLoading: true |
||||
), |
||||
queryConfig(), |
||||
}); |
||||
} |
||||
|
||||
///助农列表 |
||||
queryConfig() async { |
||||
try{ |
||||
if (apiService == null) { |
||||
SharedPreferences value = await SharedPreferences.getInstance(); |
||||
apiService = ApiService( |
||||
Dio(), |
||||
context: context, |
||||
token: value.getString("token"), |
||||
); |
||||
} |
||||
BaseData<List<FarmersList>> baseData = |
||||
await apiService.getConfig().catchError((error) { |
||||
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type), |
||||
alignment: Alignment.center); |
||||
refreshController.refreshFailed(); |
||||
}); |
||||
if (baseData != null && baseData.isSuccess) { |
||||
farmersList.clear(); |
||||
farmersList.addAll(baseData.data); |
||||
refreshController.refreshCompleted(); |
||||
} else { |
||||
refreshController.refreshFailed(); |
||||
} |
||||
}finally{ |
||||
setState(() {}); |
||||
EasyLoading.dismiss(); |
||||
} |
||||
|
||||
} |
||||
|
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return Scaffold( |
||||
backgroundColor: Colors.transparent, |
||||
body: NestedScrollView( |
||||
headerSliverBuilder: (context, inner) { |
||||
return [ |
||||
SliverAppBar( |
||||
pinned: true, |
||||
backgroundColor: Colors.white, |
||||
elevation: 0, |
||||
leading: GestureDetector( |
||||
onTap: () { |
||||
Navigator.of(context).pop(); |
||||
}, |
||||
child: Container( |
||||
alignment: Alignment.centerRight, |
||||
margin: EdgeInsets.only(left: 10.w), |
||||
padding: EdgeInsets.all(6), |
||||
child: Icon( |
||||
Icons.arrow_back_ios, |
||||
color: Colors.white, |
||||
size: 24, |
||||
), |
||||
), |
||||
), |
||||
///去掉返回按钮 |
||||
// automaticallyImplyLeading: false, |
||||
centerTitle: true, |
||||
flexibleSpace: FlexibleSpaceBar( |
||||
background: MImage( |
||||
(farmersList.isNotEmpty)?farmersList[tabIndex]?.agriculturaListImg : "", |
||||
fit: BoxFit.fill, |
||||
width: double.infinity, |
||||
height: 354.h, |
||||
errorSrc: "assets/image/default_1.webp", |
||||
fadeSrc: "assets/image/default_1.webp", |
||||
)), |
||||
expandedHeight: 354.h, |
||||
bottom: PreferredSize( |
||||
preferredSize: Size(double.infinity, 0), |
||||
child: DefaultTabController( |
||||
length: farmersList.length, |
||||
child: Container( |
||||
alignment: Alignment.center, |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.vertical( |
||||
top: Radius.circular(16), |
||||
), |
||||
color: Color(0xFF32A060), |
||||
), |
||||
padding: EdgeInsets.only(top:7.h,bottom: 7.h), |
||||
child: TabBar( |
||||
isScrollable: true, |
||||
//可滚动 |
||||
indicatorColor: Colors.white, |
||||
labelColor: Colors.white, |
||||
labelStyle: TextStyle( |
||||
fontSize: 16.sp, |
||||
fontWeight: FontWeight.bold, |
||||
), |
||||
unselectedLabelStyle: TextStyle( |
||||
fontSize: 14.sp, |
||||
fontWeight: MyFontWeight.regular, |
||||
), |
||||
indicator: FarmersTab(), |
||||
// controller: tabController, |
||||
//未选中文字颜色 |
||||
unselectedLabelColor: Colors.white, |
||||
indicatorSize: TabBarIndicatorSize.label, |
||||
//指示器与文字等宽 |
||||
tabs: farmersList == null |
||||
? [] |
||||
: farmersList |
||||
.map((e) => MyTab(text: e.typeName)) |
||||
.toList(), |
||||
onTap: (index) { |
||||
// queryConfig("AgriculturalList"); |
||||
tabIndex = index; |
||||
queryConfig(); |
||||
setState(() {}); |
||||
}, |
||||
), |
||||
), |
||||
), |
||||
), |
||||
), |
||||
]; |
||||
}, |
||||
body: recommend(), |
||||
), |
||||
); |
||||
} |
||||
|
||||
///为你推荐 |
||||
Widget recommend() { |
||||
return Container( |
||||
color: Colors.white, |
||||
padding: EdgeInsets.symmetric(horizontal: 10.w), |
||||
child: (farmersList.isNotEmpty && farmersList[tabIndex].goodList.length == 0) |
||||
? NoDataView( |
||||
src: "assets/image/xiao_fei.webp", |
||||
isShowBtn: false, |
||||
text: "当前分类暂无商品", |
||||
fontSize: 16.sp, |
||||
margin: EdgeInsets.only(top: 120.h, left: 60.w, right: 60.w), |
||||
) |
||||
: StaggeredGridView.countBuilder( |
||||
crossAxisCount: 2, |
||||
shrinkWrap: true, |
||||
itemCount: (farmersList != null && farmersList.isNotEmpty) ? farmersList[tabIndex].goodList.length : 0, |
||||
mainAxisSpacing: 10, |
||||
crossAxisSpacing: 10, |
||||
physics: BouncingScrollPhysics(), |
||||
itemBuilder: (context, position) { |
||||
return GestureDetector( |
||||
onTap: () { |
||||
Navigator.of(context) |
||||
.pushNamed('/router/shop_details_page', arguments: { |
||||
"id": farmersList[tabIndex].goodList[position].id, |
||||
"storeId": farmersList[tabIndex].goodList[position].storeId, |
||||
}); |
||||
}, |
||||
child: recommendItem(farmersList[tabIndex].goodList[position]), |
||||
); |
||||
}, |
||||
staggeredTileBuilder: (position) { |
||||
return StaggeredTile.fit(1); |
||||
}, |
||||
), |
||||
); |
||||
} |
||||
|
||||
Widget recommendItem(GoodList goodList) { |
||||
return Container( |
||||
width: 173, |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(6), |
||||
boxShadow: [ |
||||
BoxShadow( |
||||
color: Color(0x1A213303), |
||||
offset: Offset(0, 2), |
||||
blurRadius: 4, |
||||
spreadRadius: 0, |
||||
) |
||||
], |
||||
color: Colors.white, |
||||
), |
||||
child: Column( |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
MImage( |
||||
goodList.productImg ?? "", |
||||
fit: BoxFit.fill, |
||||
width:double.infinity, |
||||
height: 174, |
||||
radius: BorderRadius.only( |
||||
topLeft: Radius.circular(6), |
||||
topRight: Radius.circular(6), |
||||
), |
||||
errorSrc: "assets/image/default_1.webp", |
||||
fadeSrc: "assets/image/default_1.webp", |
||||
), |
||||
Padding( |
||||
padding: EdgeInsets.only(top: 7.h, left: 10.w, bottom: 8.h), |
||||
child: Text( |
||||
goodList?.productName ?? "", |
||||
maxLines: 2, |
||||
overflow: TextOverflow.ellipsis, |
||||
style: TextStyle( |
||||
fontSize: 14.sp, |
||||
height: 1.3.h, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF0D0D0D), |
||||
), |
||||
), |
||||
), |
||||
Padding( |
||||
padding: EdgeInsets.only(left: 10.w, bottom: 12.h), |
||||
child:Row( |
||||
children: [ |
||||
Text( |
||||
AppUtils.calculateDouble(double.tryParse(goodList?.price) ?? 0), |
||||
style: TextStyle( |
||||
fontSize:24.sp, |
||||
fontFamily: 'APPHT', |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF32A060), |
||||
), |
||||
), |
||||
Container( |
||||
margin: EdgeInsets.only(left: 8.w), |
||||
padding: EdgeInsets.symmetric(vertical:3.h,horizontal: 9.w), |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(100), |
||||
boxShadow: [ |
||||
BoxShadow( |
||||
color: Color(0x1A213303), |
||||
offset: Offset(0, 2), |
||||
blurRadius: 4, |
||||
spreadRadius: 0, |
||||
) |
||||
], |
||||
color: Color(0xFF32A060), |
||||
), |
||||
child: |
||||
Text( |
||||
S.of(context).zhunongjifen, |
||||
style: TextStyle( |
||||
fontSize:12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Colors.white, |
||||
), |
||||
), |
||||
) |
||||
], |
||||
), |
||||
), |
||||
], |
||||
), |
||||
); |
||||
} |
||||
} |
@ -0,0 +1,222 @@
|
||||
import 'package:flutter/cupertino.dart'; |
||||
import 'package:flutter/material.dart'; |
||||
import 'package:huixiang/retrofit/retrofit_api.dart'; |
||||
import 'package:huixiang/utils/font_weight.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
|
||||
import '../../generated/l10n.dart'; |
||||
|
||||
class HappyHelpFarmers extends StatefulWidget { |
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _HappyHelpFarmers(); |
||||
} |
||||
} |
||||
|
||||
class _HappyHelpFarmers extends State<HappyHelpFarmers> { |
||||
ApiService apiService; |
||||
|
||||
@override |
||||
void initState() { |
||||
super.initState(); |
||||
} |
||||
|
||||
|
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return Container( |
||||
margin: EdgeInsets.only(left:10.w,right: 10.w,bottom: 24.h), |
||||
child:Column( |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
mainAxisAlignment: MainAxisAlignment.start, |
||||
children: [ |
||||
Text( |
||||
S.of(context).zhunongzhuanqu, |
||||
style: TextStyle( |
||||
color: Color(0xFF0D0D0D), |
||||
fontSize: 15.sp, |
||||
fontWeight: FontWeight.bold, |
||||
), |
||||
), |
||||
SizedBox(height: 16.w,), |
||||
GestureDetector( |
||||
behavior: HitTestBehavior.translucent, |
||||
onTap: (){ |
||||
Navigator.of(context).pushNamed('/router/help_farmers_page'); |
||||
}, |
||||
child: Container( |
||||
padding: EdgeInsets.only(top: 12.h,left: 13.w,right: 7.w,bottom:20.h), |
||||
decoration: BoxDecoration( |
||||
borderRadius: BorderRadius.circular(6), |
||||
color: Colors.white, |
||||
boxShadow: [ |
||||
BoxShadow( |
||||
color: Color(0x08203303).withAlpha(3), |
||||
offset: Offset(0, 2), |
||||
blurRadius: 4, |
||||
spreadRadius: 0, |
||||
) |
||||
], |
||||
), |
||||
child: Column( |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
mainAxisAlignment: MainAxisAlignment.start, |
||||
children: [ |
||||
Row( |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
mainAxisAlignment: MainAxisAlignment.start, |
||||
children: [ |
||||
Image.asset( |
||||
"assets/image/help_farmers_logo.webp", |
||||
fit: BoxFit.fill, |
||||
width: 109.w, |
||||
height: 62.h, |
||||
), |
||||
SizedBox(width: 8.w,), |
||||
Expanded(child: Column( |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Text( |
||||
S.of(context).kuailezhunong, |
||||
style: TextStyle( |
||||
color: Color(0xFF0D0D0D), |
||||
fontSize: 14.sp, |
||||
fontWeight: FontWeight.bold, |
||||
), |
||||
), |
||||
SizedBox(height:5.h,), |
||||
Text( |
||||
S.of(context).zhunong1, |
||||
style: TextStyle( |
||||
color: Color(0xFF4D4D4D), |
||||
fontSize: 11.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
), |
||||
) |
||||
], |
||||
)), |
||||
Text( |
||||
S.of(context).jinruzhuanqu, |
||||
style: TextStyle( |
||||
color: Color(0xFF4D4D4D), |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
), |
||||
), |
||||
Image.asset( |
||||
"assets/image/icon_right_z.webp", |
||||
fit: BoxFit.fill, |
||||
width: 13, |
||||
height: 13, |
||||
color: Color(0xFF353535), |
||||
), |
||||
], |
||||
), |
||||
SizedBox(height:20.h,), |
||||
Row( |
||||
children: [ |
||||
SizedBox(width:7.w,), |
||||
Expanded(child: Column( |
||||
children: [ |
||||
Image.asset( |
||||
"assets/image/farmers_zp.webp", |
||||
fit: BoxFit.fill, |
||||
width: 40, |
||||
height: 40, |
||||
), |
||||
SizedBox(height: 10.h,), |
||||
Text( |
||||
S.of(context).shengxianzhaipei, |
||||
style: TextStyle( |
||||
color: Color(0xFF4D4D4D), |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
), |
||||
), |
||||
], |
||||
),), |
||||
Container( |
||||
color: Color(0xFF32A060), |
||||
width: 0.5.w, |
||||
height: 66.h, |
||||
), |
||||
Expanded(child:Column( |
||||
children: [ |
||||
Image.asset( |
||||
"assets/image/farmers_cg.webp", |
||||
fit: BoxFit.fill, |
||||
width: 40, |
||||
height: 40, |
||||
), |
||||
SizedBox(height: 10.h,), |
||||
Text( |
||||
S.of(context).shangpincaigou, |
||||
style: TextStyle( |
||||
color: Color(0xFF4D4D4D), |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
), |
||||
), |
||||
], |
||||
)), |
||||
Container( |
||||
color: Color(0xFF32A060), |
||||
width: 0.5.w, |
||||
height: 66.h, |
||||
), |
||||
Expanded(child:Column( |
||||
children: [ |
||||
Image.asset( |
||||
"assets/image/farmers_cy.webp", |
||||
fit: BoxFit.fill, |
||||
width: 40, |
||||
height: 40, |
||||
), |
||||
SizedBox(height: 10.h,), |
||||
Text( |
||||
S.of(context).canyingfuwu, |
||||
style: TextStyle( |
||||
color: Color(0xFF4D4D4D), |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
), |
||||
), |
||||
|
||||
], |
||||
)), |
||||
Container( |
||||
color: Color(0xFF32A060), |
||||
width: 0.5.w, |
||||
height: 66.h, |
||||
), |
||||
Expanded(child:Column( |
||||
children: [ |
||||
Image.asset( |
||||
"assets/image/farmers_tj.webp", |
||||
fit: BoxFit.fill, |
||||
width: 40, |
||||
height: 40, |
||||
), |
||||
SizedBox(height:10.h,), |
||||
Text( |
||||
S.of(context).qiyetuanjian, |
||||
style: TextStyle( |
||||
color: Color(0xFF4D4D4D), |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
), |
||||
), |
||||
], |
||||
)), |
||||
SizedBox(width:13.w,), |
||||
], |
||||
) |
||||
], |
||||
), |
||||
), |
||||
) |
||||
], |
||||
), |
||||
); |
||||
} |
||||
} |
@ -0,0 +1,614 @@
|
||||
/// goodList : [{"productImg":"https://pos.upload.lotus-wallet.com/1178/2022/04/7dfa5c3e-b23e-4424-b886-f1dbb4f15ba1.jpg","productSkuVOList":[{"ticketStyle":"","productId":"1517366419690356736","isDelete":0,"ticketDays":"0","setMeal":"","updateUser":"1347839370706550784","skuPrice":"8.00","skuStock":1,"weight":0,"updateTime":"2022-04-22 12:55:20","ticketType":"","sort":50,"storeId":"1347853925696405504","version":0,"deliveries":0,"volume":0,"autoRenewSkuStock":0,"skuNameStr":"份","createTime":"2022-04-22 12:55:20","createUser":"1347839370706550784","id":"1517366419740688384","applyPrice":"8.00","skuAttrList":[{"attrValueId":"1517366419723911168","isDelete":0,"updateUser":"1347839370706550784","updateTime":"2022-04-22 12:55:20","attrId":"1517366419715522560","createTime":"2022-04-22 12:55:20","createUser":"1347839370706550784","id":"1517366419753271296","skuId":"1517366419740688384"}],"skuCode":"P202204221255202"}],"thumbnailImg":"https://pos.upload.lotus-wallet.com/1178/2022/06/9295bf3f-9d8b-4d5c-857e-4f80327ddc74.jpg","tenantCode":"1178","storeId":"1347853925696405504","productName":"苋菜","posShow":false,"price":"8.00","sellCount":27,"details":"","id":"1517366419690356736","applyPrice":"8.00","stock":1,"status":0,"info":""}] |
||||
/// typeName : "蔬菜宅配" |
||||
|
||||
class FarmersList { |
||||
FarmersList({ |
||||
List<GoodList> goodList, |
||||
String typeName, |
||||
String agriculturaListImg, |
||||
}) { |
||||
_goodList = goodList; |
||||
_typeName = typeName; |
||||
_agriculturaListImg = agriculturaListImg; |
||||
} |
||||
|
||||
FarmersList.fromJson(dynamic json) { |
||||
if (json['goodList'] != null) { |
||||
_goodList = []; |
||||
json['goodList'].forEach((v) { |
||||
_goodList.add(GoodList.fromJson(v)); |
||||
}); |
||||
} |
||||
_typeName = json['typeName']; |
||||
_agriculturaListImg = json['agriculturaListImg']; |
||||
} |
||||
|
||||
List<GoodList> _goodList; |
||||
String _typeName; |
||||
String _agriculturaListImg; |
||||
|
||||
FarmersList copyWith({ |
||||
List<GoodList> goodList, |
||||
String typeName, |
||||
String agriculturaListImg, |
||||
}) => |
||||
FarmersList( |
||||
goodList: goodList ?? _goodList, |
||||
typeName: typeName ?? _typeName, |
||||
agriculturaListImg: agriculturaListImg ?? _agriculturaListImg, |
||||
); |
||||
|
||||
List<GoodList> get goodList => _goodList; |
||||
|
||||
String get typeName => _typeName; |
||||
|
||||
String get agriculturaListImg => _agriculturaListImg; |
||||
|
||||
Map<String, dynamic> toJson() { |
||||
final map = <String, dynamic>{}; |
||||
if (_goodList != null) { |
||||
map['goodList'] = _goodList.map((v) => v.toJson()).toList(); |
||||
} |
||||
map['typeName'] = _typeName; |
||||
map['agriculturaListImg'] = _agriculturaListImg; |
||||
return map; |
||||
} |
||||
} |
||||
|
||||
/// productImg : "https://pos.upload.lotus-wallet.com/1178/2022/04/7dfa5c3e-b23e-4424-b886-f1dbb4f15ba1.jpg" |
||||
/// productSkuVOList : [{"ticketStyle":"","productId":"1517366419690356736","isDelete":0,"ticketDays":"0","setMeal":"","updateUser":"1347839370706550784","skuPrice":"8.00","skuStock":1,"weight":0,"updateTime":"2022-04-22 12:55:20","ticketType":"","sort":50,"storeId":"1347853925696405504","version":0,"deliveries":0,"volume":0,"autoRenewSkuStock":0,"skuNameStr":"份","createTime":"2022-04-22 12:55:20","createUser":"1347839370706550784","id":"1517366419740688384","applyPrice":"8.00","skuAttrList":[{"attrValueId":"1517366419723911168","isDelete":0,"updateUser":"1347839370706550784","updateTime":"2022-04-22 12:55:20","attrId":"1517366419715522560","createTime":"2022-04-22 12:55:20","createUser":"1347839370706550784","id":"1517366419753271296","skuId":"1517366419740688384"}],"skuCode":"P202204221255202"}] |
||||
/// thumbnailImg : "https://pos.upload.lotus-wallet.com/1178/2022/06/9295bf3f-9d8b-4d5c-857e-4f80327ddc74.jpg" |
||||
/// tenantCode : "1178" |
||||
/// storeId : "1347853925696405504" |
||||
/// productName : "苋菜" |
||||
/// posShow : false |
||||
/// price : "8.00" |
||||
/// sellCount : 27 |
||||
/// details : "" |
||||
/// id : "1517366419690356736" |
||||
/// applyPrice : "8.00" |
||||
/// stock : 1 |
||||
/// status : 0 |
||||
/// info : "" |
||||
|
||||
class GoodList { |
||||
GoodList({ |
||||
String productImg, |
||||
List<ProductSkuVoList> productSkuVOList, |
||||
String thumbnailImg, |
||||
String tenantCode, |
||||
String storeId, |
||||
String productName, |
||||
bool posShow, |
||||
String price, |
||||
num sellCount, |
||||
String details, |
||||
String id, |
||||
String applyPrice, |
||||
dynamic stock, |
||||
dynamic status, |
||||
String info, |
||||
}) { |
||||
_productImg = productImg; |
||||
_productSkuVOList = productSkuVOList; |
||||
_thumbnailImg = thumbnailImg; |
||||
_tenantCode = tenantCode; |
||||
_storeId = storeId; |
||||
_productName = productName; |
||||
_posShow = posShow; |
||||
_price = price; |
||||
_sellCount = sellCount; |
||||
_details = details; |
||||
_id = id; |
||||
_applyPrice = applyPrice; |
||||
_stock = stock; |
||||
_status = status; |
||||
_info = info; |
||||
} |
||||
|
||||
GoodList.fromJson(dynamic json) { |
||||
_productImg = json['productImg']; |
||||
if (json['productSkuVOList'] != null) { |
||||
_productSkuVOList = []; |
||||
json['productSkuVOList'].forEach((v) { |
||||
_productSkuVOList.add(ProductSkuVoList.fromJson(v)); |
||||
}); |
||||
} |
||||
_thumbnailImg = json['thumbnailImg']; |
||||
_tenantCode = json['tenantCode']; |
||||
_storeId = json['storeId']; |
||||
_productName = json['productName']; |
||||
_posShow = json['posShow']; |
||||
_price = json['price']; |
||||
_sellCount = json['sellCount']; |
||||
_details = json['details']; |
||||
_id = json['id']; |
||||
_applyPrice = json['applyPrice']; |
||||
_stock = json['stock']; |
||||
_status = json['status']; |
||||
_info = json['info']; |
||||
} |
||||
|
||||
String _productImg; |
||||
List<ProductSkuVoList> _productSkuVOList; |
||||
String _thumbnailImg; |
||||
String _tenantCode; |
||||
String _storeId; |
||||
String _productName; |
||||
bool _posShow; |
||||
String _price; |
||||
num _sellCount; |
||||
String _details; |
||||
String _id; |
||||
String _applyPrice; |
||||
dynamic _stock; |
||||
dynamic _status; |
||||
String _info; |
||||
|
||||
GoodList copyWith({ |
||||
String productImg, |
||||
List<ProductSkuVoList> productSkuVOList, |
||||
String thumbnailImg, |
||||
String tenantCode, |
||||
String storeId, |
||||
String productName, |
||||
bool posShow, |
||||
String price, |
||||
num sellCount, |
||||
String details, |
||||
String id, |
||||
String applyPrice, |
||||
dynamic stock, |
||||
dynamic status, |
||||
String info, |
||||
}) => |
||||
GoodList( |
||||
productImg: productImg ?? _productImg, |
||||
productSkuVOList: productSkuVOList ?? _productSkuVOList, |
||||
thumbnailImg: thumbnailImg ?? _thumbnailImg, |
||||
tenantCode: tenantCode ?? _tenantCode, |
||||
storeId: storeId ?? _storeId, |
||||
productName: productName ?? _productName, |
||||
posShow: posShow ?? _posShow, |
||||
price: price ?? _price, |
||||
sellCount: sellCount ?? _sellCount, |
||||
details: details ?? _details, |
||||
id: id ?? _id, |
||||
applyPrice: applyPrice ?? _applyPrice, |
||||
stock: stock ?? _stock, |
||||
status: status ?? _status, |
||||
info: info ?? _info, |
||||
); |
||||
|
||||
String get productImg => _productImg; |
||||
|
||||
List<ProductSkuVoList> get productSkuVOList => _productSkuVOList; |
||||
|
||||
String get thumbnailImg => _thumbnailImg; |
||||
|
||||
String get tenantCode => _tenantCode; |
||||
|
||||
String get storeId => _storeId; |
||||
|
||||
String get productName => _productName; |
||||
|
||||
bool get posShow => _posShow; |
||||
|
||||
String get price => _price; |
||||
|
||||
num get sellCount => _sellCount; |
||||
|
||||
String get details => _details; |
||||
|
||||
String get id => _id; |
||||
|
||||
String get applyPrice => _applyPrice; |
||||
|
||||
dynamic get stock => _stock; |
||||
|
||||
dynamic get status => _status; |
||||
|
||||
String get info => _info; |
||||
|
||||
Map<String, dynamic> toJson() { |
||||
final map = <String, dynamic>{}; |
||||
map['productImg'] = _productImg; |
||||
if (_productSkuVOList != null) { |
||||
map['productSkuVOList'] = |
||||
_productSkuVOList.map((v) => v.toJson()).toList(); |
||||
} |
||||
map['thumbnailImg'] = _thumbnailImg; |
||||
map['tenantCode'] = _tenantCode; |
||||
map['storeId'] = _storeId; |
||||
map['productName'] = _productName; |
||||
map['posShow'] = _posShow; |
||||
map['price'] = _price; |
||||
map['sellCount'] = _sellCount; |
||||
map['details'] = _details; |
||||
map['id'] = _id; |
||||
map['applyPrice'] = _applyPrice; |
||||
map['stock'] = _stock; |
||||
map['status'] = _status; |
||||
map['info'] = _info; |
||||
return map; |
||||
} |
||||
} |
||||
|
||||
/// ticketStyle : "" |
||||
/// productId : "1517366419690356736" |
||||
/// isDelete : 0 |
||||
/// ticketDays : "0" |
||||
/// setMeal : "" |
||||
/// updateUser : "1347839370706550784" |
||||
/// skuPrice : "8.00" |
||||
/// skuStock : 1 |
||||
/// weight : 0 |
||||
/// updateTime : "2022-04-22 12:55:20" |
||||
/// ticketType : "" |
||||
/// sort : 50 |
||||
/// storeId : "1347853925696405504" |
||||
/// version : 0 |
||||
/// deliveries : 0 |
||||
/// volume : 0 |
||||
/// autoRenewSkuStock : 0 |
||||
/// skuNameStr : "份" |
||||
/// createTime : "2022-04-22 12:55:20" |
||||
/// createUser : "1347839370706550784" |
||||
/// id : "1517366419740688384" |
||||
/// applyPrice : "8.00" |
||||
/// skuAttrList : [{"attrValueId":"1517366419723911168","isDelete":0,"updateUser":"1347839370706550784","updateTime":"2022-04-22 12:55:20","attrId":"1517366419715522560","createTime":"2022-04-22 12:55:20","createUser":"1347839370706550784","id":"1517366419753271296","skuId":"1517366419740688384"}] |
||||
/// skuCode : "P202204221255202" |
||||
|
||||
class ProductSkuVoList { |
||||
ProductSkuVoList({ |
||||
String ticketStyle, |
||||
String productId, |
||||
num isDelete, |
||||
String ticketDays, |
||||
String setMeal, |
||||
String updateUser, |
||||
String skuPrice, |
||||
num skuStock, |
||||
num weight, |
||||
String updateTime, |
||||
String ticketType, |
||||
num sort, |
||||
String storeId, |
||||
num version, |
||||
num deliveries, |
||||
num volume, |
||||
num autoRenewSkuStock, |
||||
String skuNameStr, |
||||
String createTime, |
||||
String createUser, |
||||
String id, |
||||
String applyPrice, |
||||
List<SkuAttrList> skuAttrList, |
||||
String skuCode, |
||||
}) { |
||||
_ticketStyle = ticketStyle; |
||||
_productId = productId; |
||||
_isDelete = isDelete; |
||||
_ticketDays = ticketDays; |
||||
_setMeal = setMeal; |
||||
_updateUser = updateUser; |
||||
_skuPrice = skuPrice; |
||||
_skuStock = skuStock; |
||||
_weight = weight; |
||||
_updateTime = updateTime; |
||||
_ticketType = ticketType; |
||||
_sort = sort; |
||||
_storeId = storeId; |
||||
_version = version; |
||||
_deliveries = deliveries; |
||||
_volume = volume; |
||||
_autoRenewSkuStock = autoRenewSkuStock; |
||||
_skuNameStr = skuNameStr; |
||||
_createTime = createTime; |
||||
_createUser = createUser; |
||||
_id = id; |
||||
_applyPrice = applyPrice; |
||||
_skuAttrList = skuAttrList; |
||||
_skuCode = skuCode; |
||||
} |
||||
|
||||
ProductSkuVoList.fromJson(dynamic json) { |
||||
_ticketStyle = json['ticketStyle']; |
||||
_productId = json['productId']; |
||||
_isDelete = json['isDelete']; |
||||
_ticketDays = json['ticketDays']; |
||||
_setMeal = json['setMeal']; |
||||
_updateUser = json['updateUser']; |
||||
_skuPrice = json['skuPrice']; |
||||
_skuStock = json['skuStock']; |
||||
_weight = json['weight']; |
||||
_updateTime = json['updateTime']; |
||||
_ticketType = json['ticketType']; |
||||
_sort = json['sort']; |
||||
_storeId = json['storeId']; |
||||
_version = json['version']; |
||||
_deliveries = json['deliveries']; |
||||
_volume = json['volume']; |
||||
_autoRenewSkuStock = json['autoRenewSkuStock']; |
||||
_skuNameStr = json['skuNameStr']; |
||||
_createTime = json['createTime']; |
||||
_createUser = json['createUser']; |
||||
_id = json['id']; |
||||
_applyPrice = json['applyPrice']; |
||||
if (json['skuAttrList'] != null) { |
||||
_skuAttrList = []; |
||||
json['skuAttrList'].forEach((v) { |
||||
_skuAttrList.add(SkuAttrList.fromJson(v)); |
||||
}); |
||||
} |
||||
_skuCode = json['skuCode']; |
||||
} |
||||
|
||||
String _ticketStyle; |
||||
String _productId; |
||||
num _isDelete; |
||||
String _ticketDays; |
||||
String _setMeal; |
||||
String _updateUser; |
||||
String _skuPrice; |
||||
num _skuStock; |
||||
num _weight; |
||||
String _updateTime; |
||||
String _ticketType; |
||||
num _sort; |
||||
String _storeId; |
||||
num _version; |
||||
num _deliveries; |
||||
num _volume; |
||||
num _autoRenewSkuStock; |
||||
String _skuNameStr; |
||||
String _createTime; |
||||
String _createUser; |
||||
String _id; |
||||
String _applyPrice; |
||||
List<SkuAttrList> _skuAttrList; |
||||
String _skuCode; |
||||
|
||||
ProductSkuVoList copyWith({ |
||||
String ticketStyle, |
||||
String productId, |
||||
num isDelete, |
||||
String ticketDays, |
||||
String setMeal, |
||||
String updateUser, |
||||
String skuPrice, |
||||
num skuStock, |
||||
num weight, |
||||
String updateTime, |
||||
String ticketType, |
||||
num sort, |
||||
String storeId, |
||||
num version, |
||||
num deliveries, |
||||
num volume, |
||||
num autoRenewSkuStock, |
||||
String skuNameStr, |
||||
String createTime, |
||||
String createUser, |
||||
String id, |
||||
String applyPrice, |
||||
List<SkuAttrList> skuAttrList, |
||||
String skuCode, |
||||
}) => |
||||
ProductSkuVoList( |
||||
ticketStyle: ticketStyle ?? _ticketStyle, |
||||
productId: productId ?? _productId, |
||||
isDelete: isDelete ?? _isDelete, |
||||
ticketDays: ticketDays ?? _ticketDays, |
||||
setMeal: setMeal ?? _setMeal, |
||||
updateUser: updateUser ?? _updateUser, |
||||
skuPrice: skuPrice ?? _skuPrice, |
||||
skuStock: skuStock ?? _skuStock, |
||||
weight: weight ?? _weight, |
||||
updateTime: updateTime ?? _updateTime, |
||||
ticketType: ticketType ?? _ticketType, |
||||
sort: sort ?? _sort, |
||||
storeId: storeId ?? _storeId, |
||||
version: version ?? _version, |
||||
deliveries: deliveries ?? _deliveries, |
||||
volume: volume ?? _volume, |
||||
autoRenewSkuStock: autoRenewSkuStock ?? _autoRenewSkuStock, |
||||
skuNameStr: skuNameStr ?? _skuNameStr, |
||||
createTime: createTime ?? _createTime, |
||||
createUser: createUser ?? _createUser, |
||||
id: id ?? _id, |
||||
applyPrice: applyPrice ?? _applyPrice, |
||||
skuAttrList: skuAttrList ?? _skuAttrList, |
||||
skuCode: skuCode ?? _skuCode, |
||||
); |
||||
|
||||
String get ticketStyle => _ticketStyle; |
||||
|
||||
String get productId => _productId; |
||||
|
||||
num get isDelete => _isDelete; |
||||
|
||||
String get ticketDays => _ticketDays; |
||||
|
||||
String get setMeal => _setMeal; |
||||
|
||||
String get updateUser => _updateUser; |
||||
|
||||
String get skuPrice => _skuPrice; |
||||
|
||||
num get skuStock => _skuStock; |
||||
|
||||
num get weight => _weight; |
||||
|
||||
String get updateTime => _updateTime; |
||||
|
||||
String get ticketType => _ticketType; |
||||
|
||||
num get sort => _sort; |
||||
|
||||
String get storeId => _storeId; |
||||
|
||||
num get version => _version; |
||||
|
||||
num get deliveries => _deliveries; |
||||
|
||||
num get volume => _volume; |
||||
|
||||
num get autoRenewSkuStock => _autoRenewSkuStock; |
||||
|
||||
String get skuNameStr => _skuNameStr; |
||||
|
||||
String get createTime => _createTime; |
||||
|
||||
String get createUser => _createUser; |
||||
|
||||
String get id => _id; |
||||
|
||||
String get applyPrice => _applyPrice; |
||||
|
||||
List<SkuAttrList> get skuAttrList => _skuAttrList; |
||||
|
||||
String get skuCode => _skuCode; |
||||
|
||||
Map<String, dynamic> toJson() { |
||||
final map = <String, dynamic>{}; |
||||
map['ticketStyle'] = _ticketStyle; |
||||
map['productId'] = _productId; |
||||
map['isDelete'] = _isDelete; |
||||
map['ticketDays'] = _ticketDays; |
||||
map['setMeal'] = _setMeal; |
||||
map['updateUser'] = _updateUser; |
||||
map['skuPrice'] = _skuPrice; |
||||
map['skuStock'] = _skuStock; |
||||
map['weight'] = _weight; |
||||
map['updateTime'] = _updateTime; |
||||
map['ticketType'] = _ticketType; |
||||
map['sort'] = _sort; |
||||
map['storeId'] = _storeId; |
||||
map['version'] = _version; |
||||
map['deliveries'] = _deliveries; |
||||
map['volume'] = _volume; |
||||
map['autoRenewSkuStock'] = _autoRenewSkuStock; |
||||
map['skuNameStr'] = _skuNameStr; |
||||
map['createTime'] = _createTime; |
||||
map['createUser'] = _createUser; |
||||
map['id'] = _id; |
||||
map['applyPrice'] = _applyPrice; |
||||
if (_skuAttrList != null) { |
||||
map['skuAttrList'] = _skuAttrList.map((v) => v.toJson()).toList(); |
||||
} |
||||
map['skuCode'] = _skuCode; |
||||
return map; |
||||
} |
||||
} |
||||
|
||||
/// attrValueId : "1517366419723911168" |
||||
/// isDelete : 0 |
||||
/// updateUser : "1347839370706550784" |
||||
/// updateTime : "2022-04-22 12:55:20" |
||||
/// attrId : "1517366419715522560" |
||||
/// createTime : "2022-04-22 12:55:20" |
||||
/// createUser : "1347839370706550784" |
||||
/// id : "1517366419753271296" |
||||
/// skuId : "1517366419740688384" |
||||
|
||||
class SkuAttrList { |
||||
SkuAttrList({ |
||||
String attrValueId, |
||||
num isDelete, |
||||
String updateUser, |
||||
String updateTime, |
||||
String attrId, |
||||
String createTime, |
||||
String createUser, |
||||
String id, |
||||
String skuId, |
||||
}) { |
||||
_attrValueId = attrValueId; |
||||
_isDelete = isDelete; |
||||
_updateUser = updateUser; |
||||
_updateTime = updateTime; |
||||
_attrId = attrId; |
||||
_createTime = createTime; |
||||
_createUser = createUser; |
||||
_id = id; |
||||
_skuId = skuId; |
||||
} |
||||
|
||||
SkuAttrList.fromJson(dynamic json) { |
||||
_attrValueId = json['attrValueId']; |
||||
_isDelete = json['isDelete']; |
||||
_updateUser = json['updateUser']; |
||||
_updateTime = json['updateTime']; |
||||
_attrId = json['attrId']; |
||||
_createTime = json['createTime']; |
||||
_createUser = json['createUser']; |
||||
_id = json['id']; |
||||
_skuId = json['skuId']; |
||||
} |
||||
|
||||
String _attrValueId; |
||||
num _isDelete; |
||||
String _updateUser; |
||||
String _updateTime; |
||||
String _attrId; |
||||
String _createTime; |
||||
String _createUser; |
||||
String _id; |
||||
String _skuId; |
||||
|
||||
SkuAttrList copyWith({ |
||||
String attrValueId, |
||||
num isDelete, |
||||
String updateUser, |
||||
String updateTime, |
||||
String attrId, |
||||
String createTime, |
||||
String createUser, |
||||
String id, |
||||
String skuId, |
||||
}) => |
||||
SkuAttrList( |
||||
attrValueId: attrValueId ?? _attrValueId, |
||||
isDelete: isDelete ?? _isDelete, |
||||
updateUser: updateUser ?? _updateUser, |
||||
updateTime: updateTime ?? _updateTime, |
||||
attrId: attrId ?? _attrId, |
||||
createTime: createTime ?? _createTime, |
||||
createUser: createUser ?? _createUser, |
||||
id: id ?? _id, |
||||
skuId: skuId ?? _skuId, |
||||
); |
||||
|
||||
String get attrValueId => _attrValueId; |
||||
|
||||
num get isDelete => _isDelete; |
||||
|
||||
String get updateUser => _updateUser; |
||||
|
||||
String get updateTime => _updateTime; |
||||
|
||||
String get attrId => _attrId; |
||||
|
||||
String get createTime => _createTime; |
||||
|
||||
String get createUser => _createUser; |
||||
|
||||
String get id => _id; |
||||
|
||||
String get skuId => _skuId; |
||||
|
||||
Map<String, dynamic> toJson() { |
||||
final map = <String, dynamic>{}; |
||||
map['attrValueId'] = _attrValueId; |
||||
map['isDelete'] = _isDelete; |
||||
map['updateUser'] = _updateUser; |
||||
map['updateTime'] = _updateTime; |
||||
map['attrId'] = _attrId; |
||||
map['createTime'] = _createTime; |
||||
map['createUser'] = _createUser; |
||||
map['id'] = _id; |
||||
map['skuId'] = _skuId; |
||||
return map; |
||||
} |
||||
} |
@ -0,0 +1,79 @@
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
import 'package:flutter/material.dart'; |
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; |
||||
import 'package:huixiang/generated/l10n.dart'; |
||||
import 'package:huixiang/utils/font_weight.dart'; |
||||
|
||||
class SettlementTips extends StatefulWidget { |
||||
final Function tips; |
||||
final String text; |
||||
SettlementTips(this.tips, {this.text}); |
||||
|
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _SettlementTips(); |
||||
} |
||||
} |
||||
|
||||
class _SettlementTips extends State<SettlementTips> { |
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return Material( |
||||
type: MaterialType.transparency, |
||||
child: Center( |
||||
child: Container( |
||||
width: MediaQuery.of(context).size.width - 80.w, |
||||
height: 165.h, |
||||
decoration: BoxDecoration( |
||||
color: Colors.white, |
||||
borderRadius: BorderRadius.circular(8), |
||||
), |
||||
child: Column( |
||||
children: [ |
||||
Container( |
||||
width: double.infinity, |
||||
height:109.h, |
||||
alignment: Alignment.center, |
||||
padding: EdgeInsets.all(10), |
||||
child: Text( |
||||
widget.text ?? S.of(context).querenyaoshanchudangqianpinglunma, |
||||
style: TextStyle( |
||||
fontSize: 15.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF353535), |
||||
), |
||||
), |
||||
), |
||||
Container( |
||||
color: Color(0x1A000000), |
||||
height: 1.h, |
||||
), |
||||
Container( |
||||
height: 55.h, |
||||
child: InkWell( |
||||
onTap: () { |
||||
SmartDialog.dismiss(); |
||||
widget.tips(); |
||||
}, |
||||
child: Container( |
||||
width: double.infinity, |
||||
height: 90.h, |
||||
alignment: Alignment.center, |
||||
child: Text( |
||||
S.of(context).queren, |
||||
style: TextStyle( |
||||
fontSize: 16.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
color: Color(0xFF32A060), |
||||
), |
||||
), |
||||
), |
||||
), |
||||
), |
||||
], |
||||
), |
||||
), |
||||
), |
||||
); |
||||
} |
||||
} |