Browse Source

UI调整

dart3_last
fff 2 weeks ago
parent
commit
85cfc42cf7
  1. 6
      lib/community/community_child_list.dart
  2. 4
      lib/community/community_child_page.dart
  3. 17
      lib/community/community_course.dart
  4. 71
      lib/community/community_view/class_list_view.dart
  5. 15
      lib/community/community_view/class_title_tab.dart
  6. 42
      lib/community/community_view/home_class.dart
  7. 3
      lib/constant.dart
  8. 22
      lib/data/home_rank.dart
  9. 27
      lib/data/home_rank.g.dart
  10. 131
      lib/home/home_page.dart
  11. 13
      lib/home/home_view/home_recommend_goods.dart
  12. 22
      lib/home/home_view/top_selling_list.dart
  13. 12
      lib/home/home_view/union_entry.dart
  14. 1
      lib/im/chat_details_page.dart
  15. 5
      lib/im/im_view/im_page.dart
  16. 105
      lib/mine/mine_vip/mine_vip_core.dart
  17. 2
      lib/retrofit/min_api.g.dart
  18. 61
      lib/view_widget/custom_image.dart
  19. 22
      pubspec.yaml

6
lib/community/community_child_list.dart

@ -45,7 +45,9 @@ class _CommunityChildList extends State<CommunityChildList> {
if(isLoadMore){ if(isLoadMore){
pageNum += 1; pageNum += 1;
isLoadMore = false; isLoadMore = false;
}else pageNum = 1; } else {
pageNum = 1;
}
BaseData<PageInfo<ComunityComment>>? baseData = await apiService?.trendList({ BaseData<PageInfo<ComunityComment>>? baseData = await apiService?.trendList({
"onlyFollow": widget.typeStr == "关注" ? true : false, "onlyFollow": widget.typeStr == "关注" ? true : false,
"onlyMe": false, "onlyMe": false,
@ -55,8 +57,8 @@ class _CommunityChildList extends State<CommunityChildList> {
}).catchError((error) { }).catchError((error) {
refreshController.refreshFailed(); refreshController.refreshFailed();
refreshController.loadFailed(); refreshController.loadFailed();
return BaseData<PageInfo<ComunityComment>>()..isSuccess = false;
}); });
refreshController.refreshCompleted(); refreshController.refreshCompleted();
refreshController.loadComplete(); refreshController.loadComplete();
if (baseData?.isSuccess ?? false) { if (baseData?.isSuccess ?? false) {

4
lib/community/community_child_page.dart

@ -98,8 +98,10 @@ class CommunityChildPageState extends State<CommunityChildPage>
AppUtils.dioErrorTypeToString(error.type), AppUtils.dioErrorTypeToString(error.type),
alignment: Alignment.center, alignment: Alignment.center,
); );
return Future.value(null); refreshController.refreshFailed();
return BaseData<PageInfo<ComunityComment>>()..isSuccess = false;
}); });
refreshController.refreshCompleted();
if (baseData?.isSuccess ?? false) { if (baseData?.isSuccess ?? false) {
if (baseData?.data?.list?.isNotEmpty ?? false) if (baseData?.data?.list?.isNotEmpty ?? false)
articles.forEach((element) { articles.forEach((element) {

17
lib/community/community_course.dart

@ -97,8 +97,7 @@ class _CommunityCourse extends State<CommunityCourse>
/// ///
classListAsync() async { classListAsync() async {
BaseListData<CategorySelect>? baseData = BaseListData<CategorySelect>? baseData = await apiService?.categoryList().catchError((onError) {
await apiService?.categoryList().catchError((onError) {
return BaseListData<CategorySelect>()..isSuccess = false; return BaseListData<CategorySelect>()..isSuccess = false;
}); });
if (baseData?.isSuccess ?? false) { if (baseData?.isSuccess ?? false) {
@ -183,11 +182,7 @@ class _CommunityCourse extends State<CommunityCourse>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
super.build(context); super.build(context);
return Stack( return SmartRefresher(
children: [
Positioned(
child: Container(
child: SmartRefresher(
controller: refreshController, controller: refreshController,
enablePullDown: true, enablePullDown: true,
enablePullUp: false, enablePullUp: false,
@ -216,14 +211,6 @@ class _CommunityCourse extends State<CommunityCourse>
), ),
), ),
), ),
),
),
bottom: 0,
top: 0,
left: 0,
right: 0,
),
],
); );
} }

71
lib/community/community_view/class_list_view.dart

@ -28,40 +28,12 @@ class _ClassListView extends State<ClassListView> {
fontSize: 16.sp, fontSize: 16.sp,
margin: EdgeInsets.only(left: 60.w, right: 60.w, bottom: 30), margin: EdgeInsets.only(left: 60.w, right: 60.w, bottom: 30),
) )
: : Container(
// GridView.builder( padding: EdgeInsets.symmetric(
// itemCount:widget.classList == null ? 0 : widget.classList.length, horizontal: 8,
// padding: EdgeInsets.only( vertical: 8,
// left: 16.w, ),
// right: 16.w, child: StaggeredGrid.count(
// top: 13.h,
// bottom: 16.h,
// ),
// shrinkWrap: true,
// physics: NeverScrollableScrollPhysics(),
// gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
// //Widget数量
// crossAxisCount:2,
// //Widget之间间距
// crossAxisSpacing: 11.w,
// //Widget之间间距
// mainAxisSpacing: 16.w,
// //Widget宽高比例 0.59
// childAspectRatio:
// 225 / (281 / 2 + (281 / 2) * AppUtils.textScale(context)),
// ),
// itemBuilder: (context, index) {
// return GestureDetector(
// onTap: () {
// Navigator.of(context).pushNamed('/router/class_details',
// arguments: {"id": widget.classList[index].id})
// .then((value) => {widget.classList[index].viewers = value != null?value:widget.classList[index].viewers+1});
// },
// child: classListItem(widget.classList[index]),
// );
// },
// );
StaggeredGrid.count(
crossAxisCount: 2, crossAxisCount: 2,
mainAxisSpacing: 8, mainAxisSpacing: 8,
crossAxisSpacing: 8, crossAxisSpacing: 8,
@ -71,21 +43,19 @@ class _ClassListView extends State<ClassListView> {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
'/router/class_details', '/router/class_details',
arguments: {"id": e.id}, arguments: {"id": e.id},
).then((value) => ).then((value) => {e.viewers = (value as int?) ?? (e.viewers ?? 0) + 1});
{e.viewers = (value as int?) ?? (e.viewers ?? 0) + 1});
}, },
child: classListItem(e), child: classListItem(e),
); );
}).toList(), }).toList(),
),
); );
} }
Widget classListItem(Course classList) { Widget classListItem(Course classList) {
return Container( return Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.vertical( borderRadius: BorderRadius.circular(8),
bottom: Radius.circular(4),
),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.black.withAlpha(10), color: Colors.black.withAlpha(10),
@ -96,31 +66,15 @@ class _ClassListView extends State<ClassListView> {
], ],
color: Colors.white, color: Colors.white,
), ),
margin: EdgeInsets.symmetric(
vertical: 3,
),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Stack( Stack(
alignment: Alignment(0.9, 0.9), alignment: Alignment(0.9, 0.9),
children: [ children: [
Container( ClipRRect(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(10),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
color: Color.fromARGB(90, 0, 0, 0),
),
child: ClipRRect(
child: Opacity( child: Opacity(
opacity: 0.7, opacity: 1,
child: MImage( child: MImage(
classList.coverImg ?? "", classList.coverImg ?? "",
width: double.infinity, width: double.infinity,
@ -131,8 +85,7 @@ class _ClassListView extends State<ClassListView> {
), ),
), ),
borderRadius: BorderRadius.vertical( borderRadius: BorderRadius.vertical(
top: Radius.circular(4), top: Radius.circular(8),
),
), ),
), ),
Container( Container(

15
lib/community/community_view/class_title_tab.dart

@ -16,8 +16,7 @@ class ClassTitleTab extends StatefulWidget {
} }
} }
class _ClassTitleTab extends State<ClassTitleTab> class _ClassTitleTab extends State<ClassTitleTab> with SingleTickerProviderStateMixin,AutomaticKeepAliveClientMixin {
with SingleTickerProviderStateMixin,AutomaticKeepAliveClientMixin {
TabController? tabController; TabController? tabController;
@override @override
@ -29,10 +28,11 @@ class _ClassTitleTab extends State<ClassTitleTab>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
super.build(context);
return Container( return Container(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
child: DefaultTabController( child: DefaultTabController(
length: widget.classSelectList?.length ?? 0, length: widget.classSelectList.length,
child: TabBar( child: TabBar(
isScrollable: true, isScrollable: true,
// //
@ -42,6 +42,12 @@ class _ClassTitleTab extends State<ClassTitleTab>
fontSize: 14.sp, fontSize: 14.sp,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
tabAlignment: TabAlignment.start,
padding: EdgeInsets.symmetric(
horizontal: 5.w,
),
dividerHeight: 0,
dividerColor: Colors.transparent,
unselectedLabelStyle: TextStyle( unselectedLabelStyle: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
@ -54,7 +60,7 @@ class _ClassTitleTab extends State<ClassTitleTab>
widget.notifyClassSelectList(index); widget.notifyClassSelectList(index);
}, },
// //
tabs: widget.classSelectList?.map((e) => MyTab(text: "${e.name}")).toList() ?? [], tabs: widget.classSelectList.map((e) => MyTab(text: "${e.name}")).toList(),
), ),
), ),
); );
@ -62,4 +68,5 @@ class _ClassTitleTab extends State<ClassTitleTab>
@override @override
bool get wantKeepAlive => true; bool get wantKeepAlive => true;
} }

42
lib/community/community_view/home_class.dart

@ -26,11 +26,6 @@ class _HomeClass extends State<HomeClass> {
final TextEditingController editingController = TextEditingController(); final TextEditingController editingController = TextEditingController();
@override
void initState() {
super.initState();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ListView.builder( return ListView.builder(
@ -48,7 +43,6 @@ class _HomeClass extends State<HomeClass> {
Widget collectItem(CollectClass collectList) { Widget collectItem(CollectClass collectList) {
return Container( return Container(
margin: EdgeInsets.symmetric( margin: EdgeInsets.symmetric(
horizontal: 6.w,
vertical: 10.h, vertical: 10.h,
), ),
child: Column( child: Column(
@ -68,10 +62,10 @@ class _HomeClass extends State<HomeClass> {
Container( Container(
height: 195.h, height: 195.h,
margin: EdgeInsets.only(top: 10.h), margin: EdgeInsets.only(top: 10.h),
child: ListView.builder( child: ListView.separated(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
padding: EdgeInsets.symmetric(horizontal: 10.w), padding: EdgeInsets.symmetric(horizontal: 10),
itemCount: widget.collectMap[collectList.id]?.length ?? 0, itemCount: widget.collectMap[collectList.id]?.length ?? 0,
itemBuilder: (context, position) { itemBuilder: (context, position) {
return GestureDetector( return GestureDetector(
@ -80,7 +74,8 @@ class _HomeClass extends State<HomeClass> {
'/router/class_details', '/router/class_details',
arguments: { arguments: {
"id": widget.collectMap[collectList.id]![position].id "id": widget.collectMap[collectList.id]![position].id
}).then((value) { },
).then((value) {
int viewer = widget.collectMap[collectList.id]![position].viewers ?? 0; int viewer = widget.collectMap[collectList.id]![position].viewers ?? 0;
widget.collectMap[collectList.id]![position].viewers = value != null ? int.parse("${value}") : (viewer + 1); widget.collectMap[collectList.id]![position].viewers = value != null ? int.parse("${value}") : (viewer + 1);
}); });
@ -88,6 +83,9 @@ class _HomeClass extends State<HomeClass> {
child: classItem(widget.collectMap[collectList.id]![position]), child: classItem(widget.collectMap[collectList.id]![position]),
); );
}, },
separatorBuilder: (BuildContext context, int index) {
return SizedBox(width: 10);
},
), ),
), ),
], ],
@ -112,9 +110,6 @@ class _HomeClass extends State<HomeClass> {
], ],
color: Colors.white, color: Colors.white,
), ),
margin: EdgeInsets.symmetric(
horizontal: 6.w,
),
child: Column( child: Column(
children: [ children: [
Stack( Stack(
@ -123,25 +118,7 @@ class _HomeClass extends State<HomeClass> {
Stack( Stack(
alignment: Alignment(0.9, 0.9), alignment: Alignment(0.9, 0.9),
children: [ children: [
Container( ClipRRect(
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(4),
topRight: Radius.circular(4),
),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(10),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
color: Color.fromARGB(90, 0, 0, 0),
),
child: ClipRRect(
child: Opacity(
opacity: 0.7,
child: MImage( child: MImage(
collect.coverImg ?? "", collect.coverImg ?? "",
width: double.infinity, width: double.infinity,
@ -150,12 +127,10 @@ class _HomeClass extends State<HomeClass> {
errorSrc: "assets/image/default_1.webp", errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp", fadeSrc: "assets/image/default_1.webp",
), ),
),
borderRadius: BorderRadius.vertical( borderRadius: BorderRadius.vertical(
top: Radius.circular(4), top: Radius.circular(4),
), ),
), ),
),
Container( Container(
padding: EdgeInsets.only(left: 4), padding: EdgeInsets.only(left: 4),
child: Row( child: Row(
@ -276,4 +251,5 @@ class _HomeClass extends State<HomeClass> {
), ),
); );
} }
} }

3
lib/constant.dart

@ -20,7 +20,8 @@ const serviceMiniBaseUrl = "https://pos.api.yixinhuixiang.com/app/";
///线 ///线
/// app接口的请求地址 /// app接口的请求地址
const localBaseUrl = "http://192.168.10.54:8766/app/"; /// // const localBaseUrl = "http://192.168.10.54:8766/app/"; ///
const localBaseUrl = "https://pos.platform.yixinhuixiang.com/app/"; ///
///线 ///线
const serviceBaseUrl = "https://pos.platform.yixinhuixiang.com/app/"; const serviceBaseUrl = "https://pos.platform.yixinhuixiang.com/app/";

22
lib/data/home_rank.dart

@ -6,9 +6,9 @@ part 'home_rank.g.dart';
@JsonSerializable(explicitToJson: true) @JsonSerializable(explicitToJson: true)
class HomeRank { class HomeRank {
List<CommodityList>? commodityList = []; List<Commoditys>? CommodityList = [];
List<CommodityZone>? commodityZone = []; List<CommodityZones>? CommodityZone = [];
String? commodityListImg = ''; String? CommodityListImg = '';
HomeRank(); HomeRank();
@ -19,16 +19,16 @@ class HomeRank {
} }
@JsonSerializable(explicitToJson: true) @JsonSerializable(explicitToJson: true)
class CommodityList { class Commoditys {
List<GoodList>? goodList = []; List<GoodList>? goodList = [];
String? typeName = ''; String? typeName = '';
CommodityList(); Commoditys();
factory CommodityList.fromJson(Map<String, dynamic> json) => _$CommodityListFromJson(json); factory Commoditys.fromJson(Map<String, dynamic> json) => _$CommoditysFromJson(json);
Map<String, dynamic> toJson() => _$CommodityListToJson(this); Map<String, dynamic> toJson() => _$CommoditysToJson(this);
} }
@JsonSerializable(explicitToJson: true) @JsonSerializable(explicitToJson: true)
class CommodityZone { class CommodityZones {
String? productImg = ''; String? productImg = '';
List<ProductSkuVOList>? productSkuVOList = []; List<ProductSkuVOList>? productSkuVOList = [];
String? thumbnailImg = ''; String? thumbnailImg = '';
@ -45,11 +45,11 @@ class CommodityZone {
String? storeId = ''; String? storeId = '';
String? tenantCode = ''; String? tenantCode = '';
CommodityZone(); CommodityZones();
factory CommodityZone.fromJson(Map<String, dynamic> json) => _$CommodityZoneFromJson(json); factory CommodityZones.fromJson(Map<String, dynamic> json) => _$CommodityZonesFromJson(json);
Map<String, dynamic> toJson() => _$CommodityZoneToJson(this); Map<String, dynamic> toJson() => _$CommodityZonesToJson(this);
} }

27
lib/data/home_rank.g.dart

@ -7,35 +7,34 @@ part of 'home_rank.dart';
// ************************************************************************** // **************************************************************************
HomeRank _$HomeRankFromJson(Map<String, dynamic> json) => HomeRank() HomeRank _$HomeRankFromJson(Map<String, dynamic> json) => HomeRank()
..commodityList = (json['commodityList'] as List<dynamic>?) ..CommodityList = (json['CommodityList'] as List<dynamic>?)
?.map((e) => CommodityList.fromJson(e as Map<String, dynamic>)) ?.map((e) => Commoditys.fromJson(e as Map<String, dynamic>))
.toList() .toList()
..commodityZone = (json['commodityZone'] as List<dynamic>?) ..CommodityZone = (json['CommodityZone'] as List<dynamic>?)
?.map((e) => CommodityZone.fromJson(e as Map<String, dynamic>)) ?.map((e) => CommodityZones.fromJson(e as Map<String, dynamic>))
.toList() .toList()
..commodityListImg = json['commodityListImg'] as String?; ..CommodityListImg = json['CommodityListImg'] as String?;
Map<String, dynamic> _$HomeRankToJson(HomeRank instance) => <String, dynamic>{ Map<String, dynamic> _$HomeRankToJson(HomeRank instance) => <String, dynamic>{
'commodityList': instance.commodityList?.map((e) => e.toJson()).toList(), 'CommodityList': instance.CommodityList?.map((e) => e.toJson()).toList(),
'commodityZone': instance.commodityZone?.map((e) => e.toJson()).toList(), 'CommodityZone': instance.CommodityZone?.map((e) => e.toJson()).toList(),
'commodityListImg': instance.commodityListImg, 'CommodityListImg': instance.CommodityListImg,
}; };
CommodityList _$CommodityListFromJson(Map<String, dynamic> json) => Commoditys _$CommoditysFromJson(Map<String, dynamic> json) => Commoditys()
CommodityList()
..goodList = (json['goodList'] as List<dynamic>?) ..goodList = (json['goodList'] as List<dynamic>?)
?.map((e) => GoodList.fromJson(e as Map<String, dynamic>)) ?.map((e) => GoodList.fromJson(e as Map<String, dynamic>))
.toList() .toList()
..typeName = json['typeName'] as String?; ..typeName = json['typeName'] as String?;
Map<String, dynamic> _$CommodityListToJson(CommodityList instance) => Map<String, dynamic> _$CommoditysToJson(Commoditys instance) =>
<String, dynamic>{ <String, dynamic>{
'goodList': instance.goodList?.map((e) => e.toJson()).toList(), 'goodList': instance.goodList?.map((e) => e.toJson()).toList(),
'typeName': instance.typeName, 'typeName': instance.typeName,
}; };
CommodityZone _$CommodityZoneFromJson(Map<String, dynamic> json) => CommodityZones _$CommodityZonesFromJson(Map<String, dynamic> json) =>
CommodityZone() CommodityZones()
..productImg = json['productImg'] as String? ..productImg = json['productImg'] as String?
..productSkuVOList = (json['productSkuVOList'] as List<dynamic>?) ..productSkuVOList = (json['productSkuVOList'] as List<dynamic>?)
?.map((e) => ProductSkuVOList.fromJson(e as Map<String, dynamic>)) ?.map((e) => ProductSkuVOList.fromJson(e as Map<String, dynamic>))
@ -54,7 +53,7 @@ CommodityZone _$CommodityZoneFromJson(Map<String, dynamic> json) =>
..storeId = json['storeId'] as String? ..storeId = json['storeId'] as String?
..tenantCode = json['tenantCode'] as String?; ..tenantCode = json['tenantCode'] as String?;
Map<String, dynamic> _$CommodityZoneToJson(CommodityZone instance) => Map<String, dynamic> _$CommodityZonesToJson(CommodityZones instance) =>
<String, dynamic>{ <String, dynamic>{
'productImg': instance.productImg, 'productImg': instance.productImg,
'productSkuVOList': 'productSkuVOList':

131
lib/home/home_page.dart

@ -176,6 +176,7 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
dioErrorType = onError.type; dioErrorType = onError.type;
refreshController.loadFailed(); refreshController.loadFailed();
refreshController.refreshFailed(); refreshController.refreshFailed();
return BaseData<PageInfo<BannerData>>()..isSuccess = false;
}); });
if (baseData?.isSuccess ?? false) { if (baseData?.isSuccess ?? false) {
bannerData = baseData?.data?.records ?? []; bannerData = baseData?.data?.records ?? [];
@ -191,7 +192,9 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
try { try {
BaseData<PageInfo<BannerData>>? baseData = await apiService?.queryBanner({ BaseData<PageInfo<BannerData>>? baseData = await apiService?.queryBanner({
"model": {"type": "HOME_STORE_PAGE"}, "model": {"type": "HOME_STORE_PAGE"},
}).catchError((onError) {}); }).catchError((onError) {
return BaseData<PageInfo<BannerData>>()..isSuccess = false;
});
if (baseData?.isSuccess ?? false) { if (baseData?.isSuccess ?? false) {
activityBannerData = baseData!.data?.records ?? []; activityBannerData = baseData!.data?.records ?? [];
} }
@ -206,7 +209,7 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
_loadCount = 0; _loadCount = 0;
SmartDialog.dismiss(); SmartDialog.dismiss();
String toastText = AppUtils.dioErrorTypeToString(dioErrorType); String toastText = AppUtils.dioErrorTypeToString(dioErrorType);
if (toastText.isNotEmpty ?? false) { if (toastText.isNotEmpty) {
SmartDialog.showToast(toastText, alignment: Alignment.center); SmartDialog.showToast(toastText, alignment: Alignment.center);
} }
if (refreshController.isRefresh) refreshController.refreshCompleted(); if (refreshController.isRefresh) refreshController.refreshCompleted();
@ -217,8 +220,9 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
/// ///
queryRecommendRank() async { queryRecommendRank() async {
try { try {
BaseData<HomeRank>? rank = BaseData<HomeRank>? rank = await apiService?.recommendRank().catchError((onError) {
await apiService?.recommendRank().catchError((onError) {}); return BaseData<HomeRank>()..isSuccess = false;
});
if (rank?.isSuccess ?? false) { if (rank?.isSuccess ?? false) {
homeRank = rank!.data; homeRank = rank!.data;
} }
@ -230,15 +234,16 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
/// ///
queryGoodsCategory() async { queryGoodsCategory() async {
try { try {
BaseData<PageInfo<GoodsCategory>>? dataCategory = BaseData<PageInfo<GoodsCategory>>? dataCategory = await apiService?.goodsCategory({
await apiService?.goodsCategory({
"current": 1, "current": 1,
"map": {}, "map": {},
"model": {"pageNum": 1, "pageSize": 20, "searchKey": ""}, "model": {"pageNum": 1, "pageSize": 20, "searchKey": ""},
"order": "descending", "order": "descending",
"size": 20, "size": 20,
"sort": "sortOrder" "sort": "sortOrder"
}).catchError((onError) {}); }).catchError((onError) {
return BaseData<PageInfo<GoodsCategory>>()..isSuccess = false;
});
if ((dataCategory?.isSuccess ?? false) && if ((dataCategory?.isSuccess ?? false) &&
(dataCategory!.data?.records?.isNotEmpty ?? false)) { (dataCategory!.data?.records?.isNotEmpty ?? false)) {
gooodsCategorys.clear(); gooodsCategorys.clear();
@ -265,8 +270,10 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
"pageSize": 100, "pageSize": 100,
"state": 1 "state": 1
}; };
BaseData<PageInfo<Goods>>? pageGoods = BaseData<PageInfo<Goods>>? pageGoods = await apiService?.creditGoods(param)
await apiService?.creditGoods(param).catchError((onError) {}); .catchError((onError) {
return BaseData<PageInfo<Goods>>()..isSuccess = false;
});
if (pageGoods?.isSuccess ?? false) { if (pageGoods?.isSuccess ?? false) {
goods = pageGoods?.data?.list ?? []; goods = pageGoods?.data?.list ?? [];
} }
@ -283,8 +290,9 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
/// ///
queryUserBalance() async { queryUserBalance() async {
try { try {
BaseData<UserInfo>? baseData = BaseData<UserInfo>? baseData = await apiService?.queryInfo().catchError((onError) {
await apiService?.queryInfo().catchError((onError) {}); return BaseData<UserInfo>()..isSuccess = false;
});
if (baseData?.isSuccess ?? false) { if (baseData?.isSuccess ?? false) {
userInfo = baseData!.data; userInfo = baseData!.data;
mRaiseMoney = double.tryParse("${userInfo?.raiseMoney}") ?? 0; mRaiseMoney = double.tryParse("${userInfo?.raiseMoney}") ?? 0;
@ -318,8 +326,9 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
/// ///
queryActivity() async { queryActivity() async {
BaseData<ActivityPos>? baseData = BaseData<ActivityPos>? baseData = await apiService?.appPopup().catchError((onError) {
await apiService?.appPopup().catchError((onError) {}); return BaseData<ActivityPos>()..isSuccess = false;
});
if (baseData?.isSuccess ?? false) { if (baseData?.isSuccess ?? false) {
if (baseData!.data?.enabled ?? true) if (baseData!.data?.enabled ?? true)
posterShowAlertDialog(baseData.data, widget.firstLoginCouponList); posterShowAlertDialog(baseData.data, widget.firstLoginCouponList);
@ -337,8 +346,9 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
); );
}); });
} }
BaseData? baseData = BaseData? baseData = await apiService?.wiped(memberCouponId).catchError((onError) {
await apiService?.wiped(memberCouponId).catchError((onError) {}); return BaseData()..isSuccess = false;
});
if (baseData?.isSuccess ?? false) { if (baseData?.isSuccess ?? false) {
SmartDialog.showToast("核销成功", alignment: Alignment.center); SmartDialog.showToast("核销成功", alignment: Alignment.center);
} else { } else {
@ -354,7 +364,9 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
"pageSize": 10, "pageSize": 10,
"searchKey": "", "searchKey": "",
"state": 0 "state": 0
}).catchError((onError) {}); }).catchError((onError) {
return BaseData<PageInfo<Coupon>>()..isSuccess = false;
});
if (baseData?.isSuccess ?? false) { if (baseData?.isSuccess ?? false) {
coupons = baseData!.data?.list ?? []; coupons = baseData!.data?.list ?? [];
} }
@ -390,81 +402,6 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
super.build(context); super.build(context);
return Column( return Column(
children: [ children: [
// MyAppBar(
// title: "首页",
// leading: false,
// actions: [
// Container(
// height: 24,
// alignment: Alignment.center,
// margin: EdgeInsets.only(
// right: 12.w,
// ),
// child: GestureDetector(
// onTap: () {
// Navigator.of(context).pushNamed('/router/system_msg_page').then((value) {
// setState(() {
// totalMsg = 0;
// });
// });
// // Navigator.of(context).pushNamed('/router/web_turntable_activity');
// },
// child: Container(
// height: 24,
// alignment:Alignment.center,
// child:Stack(
// children: [
// SvgPicture.asset(
// "assets/svg/tixing.svg",
// width: 24,
// height: 24,
// ),
// if(totalMsg != 0)
// Container(
// width:36,
// alignment: Alignment.topRight,
// child:Container(
// width:22,
// height:14,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(100),
// border: Border.all(
// width: 1,
// color: Colors.white,
// style: BorderStyle.solid,
// ),
// color:Color(0xFFFF441A),
// ),
// child:RoundButton(
// text:totalMsg.toString(),
// textColor: Colors.white,
// fontWeight: MyFontWeight.regular,
// backgroup: Color(0xFFFF441A),
// fontSize:8.sp,
// radius: 100,
// )
// ),
// )
// ],
// ),
// )
// )
// ),
// Container(
// margin: EdgeInsets.only(right: 16.w),
// child: GestureDetector(
// onTap: () {
// toScan();
// },
// child: SvgPicture.asset(
// "assets/svg/saoyisao.svg",
// width: 24,
// height: 24,
// ),
// ),
// ),
// ],
// ),
Expanded( Expanded(
child: Container( child: Container(
child: SmartRefresher( child: SmartRefresher(
@ -505,10 +442,10 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
if (coupons.length != 0) DiscountZone(coupons), if (coupons.length != 0) DiscountZone(coupons),
///- ///-
if (homeRank?.commodityZone?.isNotEmpty ?? false) if (homeRank?.CommodityZone?.isNotEmpty ?? false)
HomeRecommendGoods(homeRank), HomeRecommendGoods(homeRank),
if (homeRank?.commodityZone?.isEmpty ?? true) if (homeRank?.CommodityZone?.isEmpty ?? true)
SizedBox( SizedBox(
height: 20.h, height: 20.h,
), ),
@ -521,7 +458,7 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
WelfareCore(), WelfareCore(),
/// ///
if (homeRank?.commodityList?.isNotEmpty ?? false) if (homeRank?.CommodityList?.isNotEmpty ?? false)
TopSellingList(homeRank), TopSellingList(homeRank),
// /// // ///
@ -558,7 +495,8 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
}, },
), ),
], ],
)), ),
),
), ),
), ),
), ),
@ -595,14 +533,13 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
onTap: () { onTap: () {
bannerClick(bannerData[position]); bannerClick(bannerData[position]);
}, },
child: Container(
child: MImage( child: MImage(
bannerData[position].imgUrl ?? "", bannerData[position].imgUrl ?? "",
fit: BoxFit.cover, fit: BoxFit.cover,
aspectRatio: 1.25,
errorSrc: "assets/image/default_2_1.webp", errorSrc: "assets/image/default_2_1.webp",
fadeSrc: "assets/image/default_2_1.webp", fadeSrc: "assets/image/default_2_1.webp",
), ),
),
); );
}, },
itemCount: bannerData.length, itemCount: bannerData.length,

13
lib/home/home_view/home_recommend_goods.dart

@ -44,32 +44,31 @@ class _HomeRecommendGoods extends State<HomeRecommendGoods> {
child: ListView.builder( child: ListView.builder(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
itemCount: widget.homeRank?.commodityZone?.length ?? 0, itemCount: widget.homeRank?.CommodityZone?.length ?? 0,
itemBuilder: (context, position) { itemBuilder: (context, position) {
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
String storeId = widget.homeRank!.commodityZone![position].storeId ?? ""; String storeId = widget.homeRank!.CommodityZone![position].storeId ?? "";
miniLogin(apiService!, storeId, (token) { miniLogin(apiService!, storeId, (token) {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
'/router/store_order', '/router/store_order',
arguments: { arguments: {
"id": widget.homeRank!.commodityZone![position].storeId, "id": widget.homeRank!.CommodityZone![position].storeId,
"tenant": widget.homeRank!.commodityZone![position].tenantCode, "tenant": widget.homeRank!.CommodityZone![position].tenantCode,
"storeName": "", "storeName": "",
"miniToken": token, "miniToken": token,
}, },
); );
}); });
}, },
child: child: recommendGoodsItem(widget.homeRank!.CommodityZone![position]),
recommendGoodsItem(widget.homeRank!.commodityZone![position]),
); );
}, },
), ),
); );
} }
Widget recommendGoodsItem(CommodityZone commodityZone) { Widget recommendGoodsItem(CommodityZones commodityZone) {
return Container( return Container(
width: 158.w, width: 158.w,
margin: EdgeInsets.only( margin: EdgeInsets.only(

22
lib/home/home_view/top_selling_list.dart

@ -37,7 +37,7 @@ class _TopSellingList extends State<TopSellingList> {
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6), borderRadius: BorderRadius.circular(6),
image: DecorationImage( image: DecorationImage(
image: NetworkImage(widget.homeRank?.commodityListImg ?? ""), image: NetworkImage(widget.homeRank?.CommodityListImg ?? ""),
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),
@ -70,12 +70,12 @@ class _TopSellingList extends State<TopSellingList> {
child: ListView.builder( child: ListView.builder(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
itemCount: widget.homeRank?.commodityList?.length ?? 0, itemCount: widget.homeRank?.CommodityList?.length ?? 0,
itemBuilder: (context, position) { itemBuilder: (context, position) {
return GestureDetector( return GestureDetector(
onTap: () {}, onTap: () {},
child: hotSaleItem( child: hotSaleItem(
widget.homeRank!.commodityList![position], position), widget.homeRank!.CommodityList![position], position),
); );
}, },
), ),
@ -85,9 +85,8 @@ class _TopSellingList extends State<TopSellingList> {
); );
} }
Widget hotSaleItem(CommodityList commodityList, index) { Widget hotSaleItem(Commoditys commodityList, index) {
int itemLength = int itemLength = (widget.homeRank?.CommodityList?[index].goodList?.length ?? 0);
(widget.homeRank?.commodityList?[index].goodList?.length ?? 0);
return Container( return Container(
width: 290.w, width: 290.w,
decoration: BoxDecoration( decoration: BoxDecoration(
@ -121,15 +120,15 @@ class _TopSellingList extends State<TopSellingList> {
itemBuilder: (context, position) { itemBuilder: (context, position) {
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
String storeId = widget.homeRank!.commodityList![index] String storeId = widget.homeRank!.CommodityList![index]
.goodList![position].storeId ?? ""; .goodList![position].storeId ?? "";
miniLogin(apiService!, storeId, (token) { miniLogin(apiService!, storeId, (token) {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
'/router/store_order', '/router/store_order',
arguments: { arguments: {
"id": widget.homeRank!.commodityList![index] "id": widget.homeRank!.CommodityList![index]
.goodList![position].storeId, .goodList![position].storeId,
"tenant": widget.homeRank!.commodityList![index] "tenant": widget.homeRank!.CommodityList![index]
.goodList![position].tenantCode, .goodList![position].tenantCode,
"storeName": "", "storeName": "",
"miniToken": token, "miniToken": token,
@ -137,10 +136,7 @@ class _TopSellingList extends State<TopSellingList> {
); );
}); });
}, },
child: rankingItem( child: rankingItem(widget.homeRank!.CommodityList![index].goodList![position], position),
widget
.homeRank!.commodityList![index].goodList![position],
position),
); );
}, },
), ),

12
lib/home/home_view/union_entry.dart

@ -27,7 +27,6 @@ class _UnionEntry extends State<UnionEntry> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
height: 120.h,
width: double.infinity, width: double.infinity,
margin: EdgeInsets.only( margin: EdgeInsets.only(
top: 14.h, top: 14.h,
@ -35,6 +34,7 @@ class _UnionEntry extends State<UnionEntry> {
right: 9.w, right: 9.w,
left: 9.w, left: 9.w,
), ),
child: IntrinsicHeight(
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@ -58,6 +58,8 @@ class _UnionEntry extends State<UnionEntry> {
], ],
borderRadius: BorderRadius.circular(6.r), borderRadius: BorderRadius.circular(6.r),
), ),
child: AspectRatio(
aspectRatio: 1,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@ -82,6 +84,7 @@ class _UnionEntry extends State<UnionEntry> {
), ),
), ),
), ),
),
Expanded( Expanded(
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
@ -101,6 +104,8 @@ class _UnionEntry extends State<UnionEntry> {
], ],
borderRadius: BorderRadius.circular(6.r), borderRadius: BorderRadius.circular(6.r),
), ),
child: AspectRatio(
aspectRatio: 1,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@ -125,6 +130,7 @@ class _UnionEntry extends State<UnionEntry> {
), ),
), ),
), ),
),
Expanded( Expanded(
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
@ -144,6 +150,8 @@ class _UnionEntry extends State<UnionEntry> {
], ],
borderRadius: BorderRadius.circular(6.r), borderRadius: BorderRadius.circular(6.r),
), ),
child: AspectRatio(
aspectRatio: 1,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@ -168,8 +176,10 @@ class _UnionEntry extends State<UnionEntry> {
), ),
), ),
), ),
),
], ],
), ),
),
); );
} }
} }

1
lib/im/chat_details_page.dart

@ -902,7 +902,6 @@ class _ChatDetailsPage extends State<ChatDetailsPage>
showMessageMenu(context, _buttonKey, messages[position]); showMessageMenu(context, _buttonKey, messages[position]);
}, },
onTap: () { onTap: () {
debugPrint("imageUrl: ${imageUrl}");
if (imageUrl.contains(messages[position].attach)) { if (imageUrl.contains(messages[position].attach)) {
ImagePickers.previewImages(imageUrl, imageUrl.indexOf(messages[position].attach)); ImagePickers.previewImages(imageUrl, imageUrl.indexOf(messages[position].attach));
} }

5
lib/im/im_view/im_page.dart

@ -435,7 +435,7 @@ class _IMPage extends State<IMPage> implements OnChatMessage {
}, },
child: Container( child: Container(
margin: EdgeInsets.fromLTRB(16.w, 0, 16.w, 16.h), margin: EdgeInsets.fromLTRB(16.w, 0, 16.w, 16.h),
padding: EdgeInsets.symmetric(vertical: 13.h), padding: EdgeInsets.symmetric(vertical: 10.h),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFFFDFCFC), color: Color(0xFFFDFCFC),
borderRadius: BorderRadius.circular(4), borderRadius: BorderRadius.circular(4),
@ -460,7 +460,8 @@ class _IMPage extends State<IMPage> implements OnChatMessage {
), ),
), ),
], ],
)), ),
),
); );
} }

105
lib/mine/mine_vip/mine_vip_core.dart

@ -110,7 +110,7 @@ class _MineVipCore extends State<MineVipCore> {
await apiService?.rankList().catchError((onError) { await apiService?.rankList().catchError((onError) {
refreshController.refreshFailed(); refreshController.refreshFailed();
refreshController.loadFailed(); refreshController.loadFailed();
return Future.value(null); return BaseListData<Rank>()..isSuccess = false;
}); });
if (rankData?.isSuccess ?? false) { if (rankData?.isSuccess ?? false) {
ranks.clear(); ranks.clear();
@ -138,7 +138,7 @@ class _MineVipCore extends State<MineVipCore> {
await apiService?.benefitList().catchError((onError) { await apiService?.benefitList().catchError((onError) {
refreshController.refreshFailed(); refreshController.refreshFailed();
refreshController.loadFailed(); refreshController.loadFailed();
return Future.value(null); return BaseListData<VipBenefit>()..isSuccess = false;
}); });
if (baseData?.isSuccess ?? false) { if (baseData?.isSuccess ?? false) {
setState(() { setState(() {
@ -158,7 +158,7 @@ class _MineVipCore extends State<MineVipCore> {
await apiService?.vipBenefit().catchError((onError) { await apiService?.vipBenefit().catchError((onError) {
refreshController.refreshFailed(); refreshController.refreshFailed();
refreshController.loadFailed(); refreshController.loadFailed();
return Future.value(null); return BaseData<VipRuleDetails>()..isSuccess = false;
}); });
if (baseData?.isSuccess ?? false) { if (baseData?.isSuccess ?? false) {
setState(() { setState(() {
@ -181,8 +181,9 @@ class _MineVipCore extends State<MineVipCore> {
// } // }
// } // }
BaseData<WxPay>? baseData = await apiService?.rankBuy( BaseData<WxPay>? baseData = await apiService?.rankBuy({
{"buyType": 2, "rankId": ranks[checkIndex].id}).catchError((onError) { "buyType": 2, "rankId": ranks[checkIndex].id,
}).catchError((onError) {
return BaseData<WxPay>()..isSuccess = false; return BaseData<WxPay>()..isSuccess = false;
}); });
if (baseData?.isSuccess ?? false) { if (baseData?.isSuccess ?? false) {
@ -248,6 +249,7 @@ class _MineVipCore extends State<MineVipCore> {
SizedBox(height: 40.h), SizedBox(height: 40.h),
Container( Container(
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded( Expanded(
child: GestureDetector( child: GestureDetector(
@ -278,13 +280,13 @@ class _MineVipCore extends State<MineVipCore> {
), ),
Container( Container(
alignment: Alignment.center, alignment: Alignment.center,
margin: EdgeInsets.only(right: 16.w), margin: EdgeInsets.only(right: 16.w, bottom: 10.h),
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
// Navigator.of(context).pushNamed('/router/integral_detailed_page'); // Navigator.of(context).pushNamed('/router/integral_detailed_page');
}, },
child: Text( child: Text(
"${S.of(context).dangqianzhukadengji} : ${userInfo?.masterCardRankName}", "${S.of(context).dangqianzhukadengji} : ${userInfo?.masterCardRankName ?? userInfo?.memberRankVo?.rankName ?? ""}",
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 16.sp, fontSize: 16.sp,
@ -363,7 +365,6 @@ class _MineVipCore extends State<MineVipCore> {
itemCount: (ranks.isNotEmpty) ? ranks.length : 1, itemCount: (ranks.isNotEmpty) ? ranks.length : 1,
), ),
), ),
/// ///
Container( Container(
margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0), margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0),
@ -415,7 +416,6 @@ class _MineVipCore extends State<MineVipCore> {
], ],
), ),
), ),
/// ///
Container( Container(
margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0), margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0),
@ -474,7 +474,6 @@ class _MineVipCore extends State<MineVipCore> {
], ],
), ),
), ),
/// ///
Container( Container(
margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0), margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0),
@ -535,7 +534,6 @@ class _MineVipCore extends State<MineVipCore> {
], ],
), ),
), ),
/// ///
Container( Container(
margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0), margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0),
@ -605,12 +603,11 @@ class _MineVipCore extends State<MineVipCore> {
], ],
), ),
), ),
)), ),
),
], ],
), ),
if (ranks.length > checkIndex && if (ranks.length > checkIndex && widget.arguments["rankLevel"] < ranks[checkIndex].level && ranks[checkIndex].price != "0.00")
widget.arguments["rankLevel"] < ranks[checkIndex].level &&
ranks[checkIndex].price != "0.00")
Align( Align(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
child: InkWell( child: InkWell(
@ -651,11 +648,9 @@ class _MineVipCore extends State<MineVipCore> {
Widget vipCar(int position) { Widget vipCar(int position) {
return Container( return Container(
margin: EdgeInsets.fromLTRB(16.w, 16.h, 8.w, 8.h), margin: EdgeInsets.fromLTRB(12.w, 8.h, 12.w, 8.h),
width: MediaQuery.of(context).size.width - 32.w, width: MediaQuery.of(context).size.width - 24.w,
height: ((MediaQuery.of(context).size.width - 32.w) / height: ((MediaQuery.of(context).size.width - 16.w) / 2.11 * AppUtils.textScale(context)),
2.11 *
AppUtils.textScale(context)),
decoration: BoxDecoration( decoration: BoxDecoration(
gradient: LinearGradient( gradient: LinearGradient(
colors: [ colors: [
@ -678,14 +673,13 @@ class _MineVipCore extends State<MineVipCore> {
], ],
), ),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
height: 86.w, height: 86,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -718,10 +712,7 @@ class _MineVipCore extends State<MineVipCore> {
child: Text( child: Text(
"VIP ${ranks[position].rankName ?? ""}", "VIP ${ranks[position].rankName ?? ""}",
style: TextStyle( style: TextStyle(
color: Color(int.parse( color: Color(int.parse((ranks[position].textColor ?? "").replaceAll("#", "FF"), radix: 16)),
(ranks[position].textColor ?? "")
.replaceAll("#", "FF"),
radix: 16)),
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
fontSize: 22.sp, fontSize: 22.sp,
), ),
@ -731,11 +722,11 @@ class _MineVipCore extends State<MineVipCore> {
), ),
), ),
Container( Container(
margin: EdgeInsets.only(right: 11.w, bottom: 9.h), margin: EdgeInsets.only(right: 11.w, bottom: 9),
child: Image.asset( child: Image.asset(
"assets/image/icon_mine_huixiang_logo.webp", "assets/image/icon_mine_huixiang_logo.webp",
width: 86.w, width: 86,
height: 86.w, height: 86,
fit: BoxFit.contain, fit: BoxFit.contain,
), ),
), ),
@ -749,41 +740,26 @@ class _MineVipCore extends State<MineVipCore> {
bottom: 12.h, bottom: 12.h,
), ),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
if (userInfo?.memberRankVo?.rankName != if (userInfo?.memberRankVo?.rankName != ranks[position].rankName || (userInfo?.memberRankVo?.rankName == "共创会员" && ranks[position].rankName == "共创会员"))
ranks[position].rankName ||
(userInfo?.memberRankVo?.rankName == "共创会员" &&
ranks[position].rankName == "共创会员"))
Align( Align(
alignment: Alignment.centerRight, alignment: Alignment.centerRight,
child: Text( child: Text(
(ranks[position].rankName == "共创会员") (ranks[position].rankName == "共创会员") ? (userInfo?.memberRankVo?.rankName == "共创会员" ? "永久VIP"
? (userInfo?.memberRankVo?.rankName == "共创会员"
? "永久VIP"
: "${AppUtils.calculateDouble(double.tryParse("${ranks[position].price}") ?? 0)}/") : "${AppUtils.calculateDouble(double.tryParse("${ranks[position].price}") ?? 0)}/")
: (ranks[position].originScore ?? 0).toString(), : (ranks[position].originScore ?? 0).toString(),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
color: Color(int.parse( color: Color(int.parse((ranks[position].textColor ?? "").replaceAll("#", "FF"), radix: 16)),
(ranks[position].textColor ?? "") fontWeight: ranks[position].rankName == "共创会员" ? MyFontWeight.regular : MyFontWeight.bold,
.replaceAll("#", "FF"), fontSize: ranks[position].rankName == "共创会员" ? 14.sp : 20.sp,
radix: 16)),
fontWeight: ranks[position].rankName == "共创会员"
? MyFontWeight.regular
: MyFontWeight.bold,
fontSize: ranks[position].rankName == "共创会员"
? 14.sp
: 20.sp,
), ),
), ),
), ),
if (userInfo?.memberRankVo?.rankName == if (userInfo?.memberRankVo?.rankName == ranks[position].rankName && (userInfo?.memberRankVo?.rankName != "共创会员" && ranks[position].rankName != "共创会员")) ... [
ranks[position].rankName &&
(userInfo?.memberRankVo?.rankName != "共创会员" &&
ranks[position].rankName != "共创会员"))
Padding( Padding(
padding: EdgeInsets.only(bottom: 12.h), padding: EdgeInsets.only(bottom: 8),
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
@ -833,12 +809,8 @@ class _MineVipCore extends State<MineVipCore> {
], ],
), ),
), ),
if (userInfo?.memberRankVo?.rankName ==
ranks[position].rankName &&
(userInfo?.memberRankVo?.rankName != "共创会员" &&
ranks[position].rankName != "共创会员"))
Container( Container(
height: 8.h, height: 8,
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.circular(6.5), borderRadius: BorderRadius.circular(6.5),
child: LinearProgressIndicator( child: LinearProgressIndicator(
@ -862,38 +834,29 @@ class _MineVipCore extends State<MineVipCore> {
), ),
), ),
), ),
],
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Text( Text(
S.of(context).kaitongriqi( S.of(context).kaitongriqi((widget.arguments["createTime"] != null && widget.arguments["createTime"] != "") ? widget.arguments["createTime"].split(" ")[0] : widget.arguments["createTime"]),
(widget.arguments["createTime"] != null &&
widget.arguments["createTime"] != "")
? widget.arguments["createTime"].split(" ")[0]
: widget.arguments["createTime"]),
style: TextStyle( style: TextStyle(
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
fontSize: 12.sp, fontSize: 12.sp,
color: Color(int.parse( color: Color(int.parse(("${ranks[position].textColor}").replaceAll("#", "FF"), radix: 16)),
("${ranks[position].textColor}") ),
.replaceAll("#", "FF"),
radix: 16))),
), ),
Icon( Icon(
Icons.qr_code, Icons.qr_code,
size: 24, size: 24,
color: Color(int.parse( color: Color(int.parse(("${ranks[position].textColor}").replaceAll("#", "FF"), radix: 16)),
("${ranks[position].textColor}")
.replaceAll("#", "FF"),
radix: 16)),
), ),
], ],
), ),
], ],
), ),
), ),
flex: 1,
), ),
], ],
), ),

2
lib/retrofit/min_api.g.dart

@ -14,7 +14,7 @@ class _MinApiService implements MinApiService {
this.baseUrl, this.baseUrl,
this.errorLogger, this.errorLogger,
}) { }) {
baseUrl ??= 'https://pos.api.yixinhuixiang.com/app/'; baseUrl ??= 'http://192.168.10.54:8765/app/';
} }
final Dio _dio; final Dio _dio;

61
lib/view_widget/custom_image.dart

@ -16,13 +16,13 @@ class MImage extends StatelessWidget {
final bool isCircle; final bool isCircle;
final bool noCompress;// final bool noCompress;//
double scaleIndex = 2.5; double scaleIndex = 1.5;
MImage( MImage(
this.src, { this.src, {
this.errorSrc = "assets/image/default_2_1.webp", this.errorSrc = "assets/image/default_2_1.webp",
this.fadeSrc = "assets/image/default_2_1.webp", this.fadeSrc = "assets/image/default_2_1.webp",
this.aspectRatio = 1, this.aspectRatio = 0,
this.width, this.width,
this.height, this.height,
this.fit = BoxFit.cover, this.fit = BoxFit.cover,
@ -38,57 +38,45 @@ class MImage extends StatelessWidget {
double getImageWidth(context, double widgetWidth) { double getImageWidth(context, double widgetWidth) {
double width = MediaQuery.of(context).size.width; double width = MediaQuery.of(context).size.width;
if (widgetWidth < (width / 3)) { if (widgetWidth > 700) {
return 300; return width;
} else if (widgetWidth < (width / 2)) { } else if (widgetWidth > 300) {
return 700; return 700;
} else { } else {
return width; return 300;
} }
} }
double getImageHeiget(context, double widgetHeiget) { double getImageHeight(context, double widgetHeight) {
double height = MediaQuery.of(context).size.height; if (widgetHeight > 700) {
if (widgetHeiget < (height / 3)) { return 1000;
return 600; } else if (widgetHeight > 300) {
} else if (widgetHeiget < (height / 2)) { return 700;
return 1400;
} else { } else {
return height; return 300;
} }
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
Widget image = LayoutBuilder( Widget image = LayoutBuilder(
builder: (context, constraints) { builder: (ctx, constraints) {
String? imageUrl = ""; String? imageUrl = "";
/// ///
// if (src != null && src != "" && src.startsWith("http")) { int _w = ((getImageWidth(ctx, constraints.constrainWidth())) * scaleIndex).toInt();
// String oper = src.contains("?") ? "" :"?"; int _h = ((getImageHeight(ctx, constraints.constrainHeight())) * scaleIndex).toInt();
// imageUrl =
// "$src$oper/imageMogr2/thumbnail/${constraints.constrainWidth() * scaleIndex}"
// "x${constraints.constrainHeight() * scaleIndex}/format/webp/quality/100";
// }
int _w = ((constraints.constrainWidth()==double.infinity
? MediaQuery.of(context).size.width
: getImageWidth(context, constraints.constrainWidth())) * scaleIndex).toInt();
int _h = ((constraints.constrainHeight()==double.infinity
? MediaQuery.of(context).size.height
: getImageHeiget(context, constraints.constrainHeight())) * scaleIndex).toInt();
/// ///
if (src.startsWith("http")) { if (src.startsWith("http")) {
if(noCompress) if (noCompress) {
imageUrl = src; imageUrl = src;
else } else {
imageUrl = "$src?imageView2/1/w/${_w}/h/${_h}/format/jpg/q/75"; imageUrl = "$src?imageView2/0/w/${_w}/format/jpg/q/100";
}
} }
// print("imageUrl:$imageUrl"); debugPrint("imageUrl: $imageUrl");
// print("constrainWidth: ${constraints.constrainWidth()}");
// print("constrainHeight: ${constraints.constrainHeight()}");
if (imageUrl?.isEmpty ?? true) { if (imageUrl.isEmpty) {
return Image.asset( return Image.asset(
"assets/image/default_2_1.webp", "assets/image/default_2_1.webp",
fit: fit, fit: fit,
@ -97,7 +85,7 @@ class MImage extends StatelessWidget {
Widget? cachedNetworkImage; Widget? cachedNetworkImage;
if (src.startsWith("http")) { if (src.startsWith("http")) {
cachedNetworkImage = Image( cachedNetworkImage = Image(
image: ResizeImage(NetworkToFileImage( image: NetworkToFileImage(
url: imageUrl, url: imageUrl,
file: fileFromDocsDir("resize${(noCompress?"noCompress":"$_w$_h")}${src.replaceAll("https:", "") file: fileFromDocsDir("resize${(noCompress?"noCompress":"$_w$_h")}${src.replaceAll("https:", "")
.replaceAll("http:", "") .replaceAll("http:", "")
@ -105,8 +93,6 @@ class MImage extends StatelessWidget {
.replaceAll("/", "")}"), .replaceAll("/", "")}"),
debug: true, debug: true,
), ),
width: _w,
height: _h),
errorBuilder: (context, error, stackTrace) { errorBuilder: (context, error, stackTrace) {
return Image.asset( return Image.asset(
errorSrc, errorSrc,
@ -133,7 +119,6 @@ class MImage extends StatelessWidget {
); );
}, },
); );
var clipRRect; var clipRRect;
if (isCircle) { if (isCircle) {
clipRRect = ClipOval(clipBehavior: Clip.antiAlias, child: image); clipRRect = ClipOval(clipBehavior: Clip.antiAlias, child: image);
@ -143,7 +128,7 @@ class MImage extends StatelessWidget {
child: image, child: image,
); );
} }
if (aspectRatio != null && aspectRatio > 0) { if (aspectRatio > 0) {
return SizedBox( return SizedBox(
width: width, width: width,
height: height, height: height,

22
pubspec.yaml

@ -34,9 +34,9 @@ dependencies:
intl: ^0.18.1 intl: ^0.18.1
fluwx: ^4.5.0 fluwx: ^4.6.3
get: ^4.6.6 get: ^4.6.6
tobias: ^3.3.1 tobias: ^3.3.2
#pdf展示 #pdf展示
flutter_pdfview: ^1.4.0 flutter_pdfview: ^1.4.0
@ -63,7 +63,7 @@ dependencies:
permission_handler: ^11.3.0 permission_handler: ^11.3.0
geolocator: ^7.0.0 geolocator: ^7.7.1
# location: ^3.2.4 # location: ^3.2.4
dio: ^5.7.0 dio: ^5.7.0
@ -92,7 +92,7 @@ dependencies:
barcode_widget: ^2.0.4 barcode_widget: ^2.0.4
qr_flutter: any qr_flutter: any
url_launcher: ^6.2.5 url_launcher: ^6.3.1
#多图, 裁剪 #多图, 裁剪
image_pickers: 2.0.4+8 image_pickers: 2.0.4+8
@ -101,7 +101,7 @@ dependencies:
# qrscan: ^0.3.1 # qrscan: ^0.3.1
scan: ^1.6.0 scan: ^1.6.0
path_provider: ^2.1.2 path_provider: ^2.1.4
network_to_file_image: ^7.0.0 network_to_file_image: ^7.0.0
image_gallery_saver: ^2.0.3 image_gallery_saver: ^2.0.3
@ -137,9 +137,9 @@ dependencies:
flutter_slidable: ^3.0.1 flutter_slidable: ^3.0.1
emoji_picker_flutter: ^2.1.0 emoji_picker_flutter: ^2.1.1
mqtt_client: ^10.2.0 mqtt_client: ^10.3.0
shimmer: ^3.0.0 shimmer: ^3.0.0
@ -153,16 +153,16 @@ dependencies:
widgetpicker: ^0.1.1 widgetpicker: ^0.1.1
# floor: ^1.4.2 # floor: ^1.4.2
sqflite: ^2.3.3+1 sqflite: ^2.3.3+1
webview_flutter: ^4.7.0 webview_flutter: ^4.8.0
syncfusion_flutter_datepicker: ^24.2.9 syncfusion_flutter_datepicker: ^24.2.9
protobuf: ^3.1.0 protobuf: ^3.1.0
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter
retrofit_generator: ^8.1.0 retrofit_generator: ^8.2.1
build_runner: ^2.4.8 build_runner: ^2.4.9
json_serializable: ^6.7.1 json_serializable: ^6.8.0
flutter: flutter:

Loading…
Cancel
Save