Browse Source

UI修改

dart3_last
fff 2 weeks ago
parent
commit
e661c02314
  1. 2
      lib/community/community_course.dart
  2. 3
      lib/community/order_page.dart
  3. 29
      lib/home/help_farmers/help_farmers_page.dart
  4. 26
      lib/home/points_mall_page.dart
  5. 122
      lib/home/welfare_exchange.dart
  6. 259
      lib/home/welfare_page.dart
  7. 33
      lib/im/chat_friend_group.dart
  8. 3
      lib/im/contact_share.dart
  9. 105
      lib/im/im_view/friend_groip_list.dart
  10. 19
      lib/mine/mine_page.dart
  11. 22
      lib/mine/mine_view/calendar_page.dart
  12. 6
      lib/mine/mine_view/community_follow.dart
  13. 33
      lib/mine/mine_view/mine_calendar.dart
  14. 6
      lib/mine/mine_view/mine_item.dart
  15. 80
      lib/mine/mine_view/mine_navbar.dart
  16. 10
      lib/mine/mine_view/mine_order.dart
  17. 2
      lib/mine/mine_wallet_page.dart
  18. 72
      lib/order/order_history_page.dart
  19. 643
      lib/qr/invite_friends.dart

2
lib/community/community_course.dart

@ -221,7 +221,7 @@ class _CommunityCourse extends State<CommunityCourse>
bannerData,
),
SizedBox(height: 28.h),
SizedBox(height: 18.h),
///
HomeClass(

3
lib/community/order_page.dart

@ -12,8 +12,7 @@ class OrderPage extends StatefulWidget {
}
}
class _OrderPage extends State<OrderPage>
with SingleTickerProviderStateMixin,AutomaticKeepAliveClientMixin {
class _OrderPage extends State<OrderPage> with SingleTickerProviderStateMixin,AutomaticKeepAliveClientMixin {
TabController? tabcontroller;
List<String> lables = [

29
lib/home/help_farmers/help_farmers_page.dart

@ -52,8 +52,6 @@ class _HelpFarmersPage extends State<HelpFarmersPage> {
try {
BaseListData<Farmers>? baseData =
await apiService?.getConfig().catchError((error) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type),
alignment: Alignment.center);
networkStatus = -1;
refreshController.refreshFailed();
return BaseListData<Farmers>()..isSuccess = false;
@ -79,6 +77,30 @@ class _HelpFarmersPage extends State<HelpFarmersPage> {
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.transparent,
appBar: networkStatus == 2
? AppBar(
backgroundColor: Color(0xFF32A060),
leading: InkWell(
child: Icon(
Icons.arrow_back,
color: Colors.white,
),
onTap: () {
Navigator.of(context).pop();
},
),
title: Text(
S.of(context).zhunongzhuanqu,
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 17.sp,
color: Colors.white,
),
),
centerTitle: true,
elevation: 0,
)
: null,
body: networkStatus == 0
? recommendSm()
: (networkStatus == 2
@ -91,7 +113,8 @@ class _HelpFarmersPage extends State<HelpFarmersPage> {
fontSize: 16.sp,
margin:
EdgeInsets.only(top: 120.h, left: 60.w, right: 60.w),
))
),
)
: NestedScrollView(
headerSliverBuilder: (context, inner) {
return [

26
lib/home/points_mall_page.dart

@ -71,18 +71,16 @@ class _PointsMallPage extends State<PointsMallPage>
BaseData<PageInfo<BannerData>>? banner = await client?.queryBanner({
"model": {"type": "CREDIT_INDEX"},
}).catchError((onError) {
return Future.value(null);
return BaseData<PageInfo<BannerData>>()..isSuccess = false;
});
if ((banner?.isSuccess ?? false) &&
(banner?.data?.records?.isNotEmpty ?? false)) {
if ((banner?.isSuccess ?? false) && (banner?.data?.records?.isNotEmpty ?? false)) {
bannerData.clear();
bannerData.addAll(banner?.data?.records ?? []);
}
BaseData<UserInfo>? baseData =
await client?.queryInfo().catchError((onError) {
return Future.value(null);
BaseData<UserInfo>? baseData = await client?.queryInfo().catchError((onError) {
return BaseData<UserInfo>()..isSuccess = false;
});
if (baseData?.isSuccess ?? false) {
userInfo = baseData!.data;
@ -98,13 +96,11 @@ class _PointsMallPage extends State<PointsMallPage>
);
final SharedPreferences value = await SharedPreferences.getInstance();
client = ApiService(Dio(),
context: context, token: value.getString('token'), showLoading: false);
client = ApiService(Dio(), context: context, token: value.getString('token'), showLoading: false);
await queryUser();
BaseData<PageInfo<GoodsCategory>>? dataCategory =
await client?.goodsCategory({
BaseData<PageInfo<GoodsCategory>>? dataCategory = await client?.goodsCategory({
"current": 1,
"map": {},
"model": {"pageNum": 1, "pageSize": 20, "searchKey": ""},
@ -114,11 +110,10 @@ class _PointsMallPage extends State<PointsMallPage>
}).catchError((onError) {
_refreshController.loadFailed();
_refreshController.refreshFailed();
return Future.value(null);
return BaseData<PageInfo<GoodsCategory>>()..isSuccess = false;
});
if ((dataCategory?.isSuccess ?? false) &&
(dataCategory?.data?.records?.isNotEmpty ?? false)) {
if ((dataCategory?.isSuccess ?? false) && (dataCategory?.data?.records?.isNotEmpty ?? false)) {
gooodsCategorys.clear();
gooodsCategorys.add(GoodsCategory()..name = S.of(context).quanbu);
gooodsCategorys.addAll(dataCategory?.data?.records ?? []);
@ -132,11 +127,10 @@ class _PointsMallPage extends State<PointsMallPage>
"pageSize": 10,
"state": 1
};
BaseData<PageInfo<Goods>>? baseData =
await client?.creditGoods(param).catchError((onError) {
BaseData<PageInfo<Goods>>? baseData = await client?.creditGoods(param).catchError((onError) {
_refreshController.loadFailed();
_refreshController.refreshFailed();
return Future.value(null);
return BaseData<PageInfo<Goods>>()..isSuccess = false;
});
SmartDialog.dismiss();
if (baseData?.isSuccess ?? false) {

122
lib/home/welfare_exchange.dart

@ -66,7 +66,7 @@ class _WelfareExchange extends State<WelfareExchange>
queryUser() async {
BaseData<UserInfo>? baseData =
await apiService?.queryInfo().catchError((onError) {
return Future.value(null);
return BaseData<UserInfo>()..isSuccess = false;
});
if (baseData?.isSuccess ?? false) {
userInfo = baseData!.data;
@ -99,7 +99,7 @@ class _WelfareExchange extends State<WelfareExchange>
"state": 1
}).catchError((onError) {
refreshController.refreshFailed();
return Future.value(null);
return BaseData<PageInfo<Goods>>()..isSuccess = false;
});
if (goodsData?.isSuccess ?? false) {
gooods.clear();
@ -117,7 +117,7 @@ class _WelfareExchange extends State<WelfareExchange>
}).catchError((onError) {
refreshController.loadFailed();
refreshController.refreshFailed();
return Future.value(null);
return BaseData<PageInfo<GoodsCategory>>()..isSuccess = false;
});
if ((dataCategory?.isSuccess ?? false) &&
@ -139,7 +139,7 @@ class _WelfareExchange extends State<WelfareExchange>
await apiService?.creditGoods(param).catchError((onError) {
refreshController.loadFailed();
refreshController.refreshFailed();
return Future.value(null);
return BaseData<PageInfo<Goods>>()..isSuccess = false;
});
if (pageGoods?.isSuccess ?? false) {
if (pageNum == 1) {
@ -169,6 +169,7 @@ class _WelfareExchange extends State<WelfareExchange>
@override
Widget build(BuildContext context) {
super.build(context);
return Scaffold(
backgroundColor: Colors.white,
body: NestedScrollView(
@ -176,12 +177,14 @@ class _WelfareExchange extends State<WelfareExchange>
return [
SliverAppBar(
pinned: true,
backgroundColor: Colors.white,
backgroundColor: Color(0xFF277D4B),
elevation: 0,
title: Text(
S.of(context).fuliduihuan,
style:
TextStyle(fontWeight: FontWeight.w500, color: Colors.white),
style: TextStyle(
fontWeight: FontWeight.w500,
color: Colors.white,
),
),
centerTitle: true,
leading: GestureDetector(
@ -199,35 +202,45 @@ class _WelfareExchange extends State<WelfareExchange>
),
),
),
toolbarHeight: kToolbarHeight,
collapsedHeight: kToolbarHeight + MediaQuery.of(context).padding.top,
flexibleSpace: FlexibleSpaceBar(
background: Stack(
children: [
Container(
// padding: EdgeInsets.only(top: 40.h),
height: 172.h,
decoration: BoxDecoration(
// border: Border.all(color: Colors.white,width: 0.5),
color: Color(0xFF277D4B),
shape: BoxShape.rectangle,
borderRadius: BorderRadius.only(
bottomRight: Radius.circular(40.r),
bottomLeft: Radius.circular(40.r),
background: Stack(
children: [
Positioned.fill(
top: kToolbarHeight + MediaQuery.of(context).padding.top,
child: Container(
// padding: EdgeInsets.only(top: 40.h),
height: 172.h - (kToolbarHeight + MediaQuery.of(context).padding.top),
decoration: BoxDecoration(
color: Colors.white,
),
padding: EdgeInsets.only(bottom: 75.h),
child: Container(
decoration: BoxDecoration(
color: Color(0xFF277D4B),
shape: BoxShape.rectangle,
borderRadius: BorderRadius.only(
bottomRight: Radius.circular(40.r),
bottomLeft: Radius.circular(40.r),
),
),
),
),
),
),
Container(
alignment: Alignment.topCenter,
margin: EdgeInsets.only(top: 110.h),
child: pointUser(),
),
],
)),
expandedHeight:
MediaQuery.of(context).size.height >= 750 ? 245.h : 258.h,
Container(
alignment: Alignment.topCenter,
margin: EdgeInsets.only(top: 110.h),
child: pointUser(),
),
],
),
),
expandedHeight: MediaQuery.of(context).size.height >= 750 ? 245.h : 258.h,
bottom: PreferredSize(
preferredSize: Size(double.infinity, 0),
child: DefaultTabController(
length: gooodsCategorys == null ? 0 : gooodsCategorys.length,
length: gooodsCategorys.length,
child: Container(
color: Colors.white,
alignment: Alignment.centerLeft,
@ -251,10 +264,7 @@ class _WelfareExchange extends State<WelfareExchange>
unselectedLabelColor: Color(0xff4D4D4D),
indicatorSize: TabBarIndicatorSize.label,
//
tabs: gooodsCategorys
?.map((e) => MyTab(text: "${e.name}"))
.toList() ??
[],
tabs: gooodsCategorys.map((e) => MyTab(text: "${e.name}")).toList(),
onTap: (index) {
categoryId = gooodsCategorys[index].id;
pageNum = 1;
@ -281,9 +291,9 @@ class _WelfareExchange extends State<WelfareExchange>
onRefresh: _onRefresh,
child: Container(
color: Colors.white,
padding: EdgeInsets.only(top: 15.h),
child: pointList(),
)),
),
),
),
);
}
@ -291,16 +301,17 @@ class _WelfareExchange extends State<WelfareExchange>
Widget pointUser() {
return Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(4.r)),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 1),
blurRadius: 8,
spreadRadius: 0,
)
]),
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(4.r)),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 1),
blurRadius: 8,
spreadRadius: 0,
),
],
),
margin: EdgeInsets.all(16),
padding: EdgeInsets.all(16),
child: Row(
@ -352,9 +363,7 @@ class _WelfareExchange extends State<WelfareExchange>
),
)
: Text(
userInfo == null
? ""
: AppUtils.phoneEncode(userInfo?.phone ?? ""),
userInfo == null ? "" : AppUtils.phoneEncode(userInfo?.phone ?? ""),
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
@ -469,11 +478,11 @@ class _WelfareExchange extends State<WelfareExchange>
),
)
: GridView.builder(
itemCount: goods?.length ?? 0,
itemCount: goods.length,
padding: EdgeInsets.only(
left: 16.w,
right: 16.w,
top: 18.h,
left: 12.w,
right: 12.w,
top: 16.h,
bottom: 16.h,
),
shrinkWrap: true,
@ -482,12 +491,11 @@ class _WelfareExchange extends State<WelfareExchange>
//Widget数量
crossAxisCount: 2,
//Widget之间间距
crossAxisSpacing: 11.w,
crossAxisSpacing: 12.w,
//Widget之间间距
mainAxisSpacing: 16.w,
mainAxisSpacing: 12.w,
//Widget宽高比例 0.59
childAspectRatio:
200 / (285 / 2 + (285 / 2) * AppUtils.textScale(context)),
childAspectRatio: 200 / (285 / 2 + (285 / 2) * AppUtils.textScale(context)),
),
itemBuilder: (context, index) {
return GestureDetector(

259
lib/home/welfare_page.dart

@ -4,6 +4,8 @@ import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:flutter_swiper_view/flutter_swiper_view.dart';
import 'package:get/get.dart';
import 'package:get/utils.dart';
import 'package:huixiang/data/base_data.dart';
import 'package:huixiang/data/coupon.dart';
import 'package:huixiang/data/goods.dart';
@ -208,7 +210,6 @@ class _WelfarePage extends State<WelfarePage> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
weekCoupons(),
Container(
color: Colors.white,
padding: EdgeInsets.only(left: 14, right: 14),
@ -219,7 +220,6 @@ class _WelfarePage extends State<WelfarePage> {
],
),
)
// activityTask(),
],
),
@ -234,117 +234,116 @@ class _WelfarePage extends State<WelfarePage> {
///
Widget weekCoupons() {
return Container(
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(6),
topRight: Radius.circular(6),
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(6),
topRight: Radius.circular(6),
),
color: Colors.white,
boxShadow: [
BoxShadow(
color: Color(0x08213303).withAlpha(12),
offset: Offset(0, 2),
blurRadius: 3,
spreadRadius: 0,
),
color: Colors.white,
boxShadow: [
BoxShadow(
color: Color(0x08213303).withAlpha(12),
offset: Offset(0, 2),
blurRadius: 3,
spreadRadius: 0,
],
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.symmetric(
horizontal: 17.w,
vertical: 16.h,
),
],
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.symmetric(horizontal: 17.w, vertical: 16.h),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
S.of(context).lingquanzhongxin,
style: TextStyle(
color: Color(0xFF0D0D0D),
fontSize: 15.sp,
fontWeight: MyFontWeight.bold,
),
),
Text(
S.of(context).meizhousangengxin,
style: TextStyle(
color: Color(0xFF4D4D4D),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
],
)),
coupon.length == 0
? NoDataView(
src: "assets/image/ka.webp",
isShowBtn: false,
text: S.of(context).haimeiyouyouhuiquankeyilingqu,
fontSize: 16.sp,
)
: Container(
height: coupon[0].length >= 3 ? 350.h : 250.h,
child: Swiper(
onIndexChanged: (it) {
swiperIndex = it;
},
index: couponIndex,
viewportFraction: 0.9,
scale: 0.7,
key: UniqueKey(),
pagination: SwiperPagination(
alignment: Alignment.bottomCenter,
builder: DotSwiperPaginationBuilder(
size: 8,
activeSize: 8,
space: 5,
activeColor: Colors.black,
color: Colors.black.withAlpha(76),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
S.of(context).lingquanzhongxin,
style: TextStyle(
color: Color(0xFF0D0D0D),
fontSize: 15.sp,
fontWeight: MyFontWeight.bold,
),
),
Text(
S.of(context).meizhousangengxin,
style: TextStyle(
color: Color(0xFF4D4D4D),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
],
),
),
coupon.length == 0
? NoDataView(
src: "assets/image/ka.webp",
isShowBtn: false,
text: S.of(context).haimeiyouyouhuiquankeyilingqu,
fontSize: 16.sp,
)
: Container(
// height: coupon[0].length >= 3 ? 350.h : 250.h,
height: coupon[0].length >= 3 ? 111.h * 3 : 111.h * 2,
child: Swiper(
onIndexChanged: (it) {
swiperIndex = it;
},
index: couponIndex,
viewportFraction: (Get.width - 28) / Get.width,
scale: 0.7,
key: UniqueKey(),
pagination: SwiperPagination(
alignment: Alignment.bottomCenter,
margin: EdgeInsets.only(bottom: 15.h),
builder: DotSwiperPaginationBuilder(
size: 8,
activeSize: 8,
space: 5,
activeColor: Colors.black,
color: Colors.black.withAlpha(76),
),
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return Column(
children: [
Container(
child: weekList(coupon[position]),
),
],
);
},
itemCount: coupon.length ?? 0,
),
)
],
));
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return weekList(coupon[position]);
},
itemCount: coupon.length,
),
)
],
),
);
}
Widget weekList(List<Coupon> cops) {
return Expanded(
child: (cops?.isEmpty ?? true)
? NoDataView(
src: "assets/image/ka.webp",
isShowBtn: false,
text: S.of(context).haimeiyouyouhuiquankeyilingqu,
fontSize: 16.sp,
)
: ListView.builder(
padding: EdgeInsets.zero,
itemCount: cops.length ?? 0,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {},
child: weekCoupon(cops[position]),
);
},
),
);
return (cops.isEmpty)
? NoDataView(
src: "assets/image/ka.webp",
isShowBtn: false,
text: S.of(context).haimeiyouyouhuiquankeyilingqu,
fontSize: 16.sp,
)
: ListView.builder(
padding: EdgeInsets.zero,
itemCount: cops.length,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {},
child: weekCoupon(cops[position]),
);
},
);
}
///
@ -408,7 +407,7 @@ class _WelfarePage extends State<WelfarePage> {
? Color(0xFFB3B3B3)
: Color(0xFF4D4D4D),
),
)
),
],
),
),
@ -421,7 +420,7 @@ class _WelfarePage extends State<WelfarePage> {
Container(
margin: EdgeInsets.only(bottom: 12),
child: weekBtn(cop),
)
),
],
),
],
@ -625,7 +624,10 @@ class _WelfarePage extends State<WelfarePage> {
receiveCoupon(cop.id);
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 2.h),
padding: EdgeInsets.symmetric(
horizontal: 12.w,
vertical: 2.h,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(3),
color: Color(0xFF32A060),
@ -647,18 +649,23 @@ class _WelfarePage extends State<WelfarePage> {
child: InkWell(
onTap: () {
if (cop.bizType == 5 || cop.bizType == 3) {
Navigator.of(context)
.pushNamed('/router/write_off_page', arguments: {
"couponId": cop.id,
"coupon": cop,
});
Navigator.of(context).pushNamed(
'/router/write_off_page',
arguments: {
"couponId": cop.id,
"coupon": cop,
},
);
} else {
showStoreSelector(cop.storeList);
}
},
child: Container(
// height: 19.h,
padding: EdgeInsets.symmetric(horizontal: 8.w, vertical: 1.h),
padding: EdgeInsets.symmetric(
horizontal: 8.w,
vertical: 1.h,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(3),
border: Border.all(
@ -692,11 +699,12 @@ class _WelfarePage extends State<WelfarePage> {
showAlertDialog();
} else {
SmartDialog.show(
clickMaskDismiss: false,
builder: (ctx) => SettlementTips(
() {},
text: "${baseData?.msg}",
));
clickMaskDismiss: false,
builder: (ctx) => SettlementTips(
() {},
text: "${baseData?.msg}",
),
);
}
}
@ -723,7 +731,7 @@ class _WelfarePage extends State<WelfarePage> {
///
Widget inviteFriends() {
return Container(
margin: EdgeInsets.only(top: 24.h, bottom: 20.h),
margin: EdgeInsets.only(top: 14.h, bottom: 20.h),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
@ -762,7 +770,7 @@ class _WelfarePage extends State<WelfarePage> {
Widget benefitExchange() {
return Container(
width: double.infinity,
margin: EdgeInsets.only(top: 24.h, bottom: 20.h),
margin: EdgeInsets.only(top: 14.h, bottom: 20.h),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
@ -801,9 +809,6 @@ class _WelfarePage extends State<WelfarePage> {
],
),
),
SizedBox(
height: 12,
),
(goods.length == 0)
? NoDataView(
src: "assets/image/xiao_fei.webp",
@ -815,9 +820,7 @@ class _WelfarePage extends State<WelfarePage> {
: GridView.builder(
itemCount: goods.length > 6 ? 6 : goods.length,
padding: EdgeInsets.only(
// left: 16.w,
// right: 16.w,
top: 18.h,
top: 12.h,
bottom: 16.h,
),
shrinkWrap: true,

33
lib/im/chat_friend_group.dart

@ -35,8 +35,8 @@ class _ChatFriendGroup extends State<ChatFriendGroup>
void initState() {
super.initState();
tabController = TabController(length: 3, vsync: this, initialIndex: 0);
tabController?.addListener(() {
if(!(tabController?.indexIsChanging ?? false))
tabController.addListener(() {
if(!(tabController.indexIsChanging))
setState(() {});
});
loadFinish();
@ -87,11 +87,11 @@ class _ChatFriendGroup extends State<ChatFriendGroup>
Align(
alignment: Alignment.centerLeft,
child: Theme(
data: ThemeData(
splashColor: Colors.transparent, //
highlightColor: Colors.transparent, //
),
child: TabBar(
data: ThemeData(
splashColor: Colors.transparent, //
highlightColor: Colors.transparent, //
),
child: TabBar(
controller: tabController,
isScrollable: true,
//
@ -100,6 +100,9 @@ class _ChatFriendGroup extends State<ChatFriendGroup>
fontSize: 16.sp,
fontWeight: FontWeight.bold,
),
tabAlignment: TabAlignment.start,
dividerColor: Colors.transparent,
dividerHeight: 0,
unselectedLabelStyle: TextStyle(
fontSize: 15.sp,
fontWeight: FontWeight.normal,
@ -107,8 +110,15 @@ class _ChatFriendGroup extends State<ChatFriendGroup>
//
unselectedLabelColor: Color(0XFFA29E9E),
indicator: CustomUnderlineTabIndicator(
insets: EdgeInsets.only(top: 10.w, bottom: 2.w),
borderSide: BorderSide(width: 5.w, color: Color(0XFF32A060)),),
insets: EdgeInsets.only(
top: 10.w,
bottom: 2.w,
),
borderSide: BorderSide(
width: 5.w,
color: Color(0XFF32A060),
),
),
indicatorSize: TabBarIndicatorSize.label,
//
tabs: <Widget>[
@ -116,7 +126,8 @@ class _ChatFriendGroup extends State<ChatFriendGroup>
MyTab(text: S.of(context).guanzhu),
MyTab(text: S.of(context).fensi),
],
)),
),
),
),
Expanded(
child: TabBarView(
@ -127,7 +138,7 @@ class _ChatFriendGroup extends State<ChatFriendGroup>
FriendGroupList(_allKey[2],"true","粉丝"),
],
),
)
),
],
),
),

3
lib/im/contact_share.dart

@ -74,7 +74,8 @@ class _ContactsShare extends State<ContactsShare> {
fontSize: 17.sp,
color: Color(0xFF0D0D0D),
fontWeight: MyFontWeight.regular,
)),
),
),
),
mineFollowList(),
],

105
lib/im/im_view/friend_groip_list.dart

@ -74,13 +74,13 @@ class _FriendGroupList extends State<FriendGroupList> {
///
queryFollowList() async {
SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
if (apiService == null)
apiService = ApiService(
Dio(),
context: context,
token: sharedPreferences.getString("token"),
showLoading: false,
);
apiService ??= ApiService(
Dio(),
context: context,
token: sharedPreferences.getString("token"),
showLoading: false,
);
BaseData<PageInfo<Follow>>? baseData = await apiService?.followList({
"isMyFans": widget.isMyFans,
"pageNum": pageNum,
@ -88,6 +88,7 @@ class _FriendGroupList extends State<FriendGroupList> {
}).catchError((error) {
_refreshController.refreshFailed();
_refreshController.loadFailed();
return BaseData<PageInfo<Follow>>()..isSuccess = false;
});
if (baseData?.isSuccess ?? false) {
if (pageNum == 1) {
@ -104,13 +105,13 @@ class _FriendGroupList extends State<FriendGroupList> {
///
queryMutualFollowList() async {
SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
if (apiService == null)
apiService = ApiService(
Dio(),
context: context,
token: sharedPreferences.getString("token"),
showLoading: false,
);
apiService ??= ApiService(
Dio(),
context: context,
token: sharedPreferences.getString("token"),
showLoading: false,
);
BaseData<PageInfo<Follow>>? baseData = await apiService?.mutualFollowList({
"isMyFans": widget.isMyFans,
"pageNum": 1,
@ -118,6 +119,7 @@ class _FriendGroupList extends State<FriendGroupList> {
}).catchError((error) {
_refreshController.refreshFailed();
_refreshController.loadFailed();
return BaseData<PageInfo<Follow>>()..isSuccess = false;
});
if (baseData?.isSuccess ?? false) {
if (pageNum == 1) {
@ -146,7 +148,11 @@ class _FriendGroupList extends State<FriendGroupList> {
? "目前暂无${widget.title}"
: ("目前暂无${widget.title}${widget.title == "粉丝" ? "听说多发动态可以涨粉哦" : "可以在社群广场中关注自己喜欢的人哦"}~"),
fontSize: 16.sp,
margin: EdgeInsets.only(top: 120.h, left: 60.w, right: 60.w),
margin: EdgeInsets.only(
top: 120.h,
left: 60.w,
right: 60.w,
),
)
: Expanded(
child: ListView.builder(
@ -184,33 +190,39 @@ class _FriendGroupList extends State<FriendGroupList> {
Widget friendGroupItem(Follow list) {
return Container(
margin: EdgeInsets.only(left: 16.w, right: 16.w, bottom: 24.h),
child: Row(children: [
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100),
),
child: MImage(
list?.avatar ?? "",
isCircle: true,
width: 54.h,
height: 54.h,
fit: BoxFit.cover,
errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp",
),
margin: EdgeInsets.only(
left: 16.w,
right: 16.w,
bottom: 24.h,
),
Padding(
padding: EdgeInsets.only(left:12.w),
child: Text(
list?.nickname ?? "",
style: TextStyle(
fontSize: 16.sp,
color: Color(0xFF060606),
fontWeight: FontWeight.w500),
child: Row(children: [
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100),
),
child: MImage(
list.avatar ?? "",
isCircle: true,
width: 54.h,
height: 54.h,
fit: BoxFit.cover,
errorSrc: "assets/image/default_1.webp",
fadeSrc: "assets/image/default_1.webp",
),
),
)
]),
Padding(
padding: EdgeInsets.only(left:12.w),
child: Text(
list.nickname ?? "",
style: TextStyle(
fontSize: 16.sp,
color: Color(0xFF060606),
fontWeight: FontWeight.w500,
),
),
)
],
),
);
}
@ -220,8 +232,10 @@ class _FriendGroupList extends State<FriendGroupList> {
behavior: HitTestBehavior.opaque,
onTap:(){Navigator.of(context).pushNamed('/router/im_search');},
child: Container(
margin: EdgeInsets.fromLTRB(16.w, 0, 16.w, 24.h),
padding: EdgeInsets.symmetric(vertical: 13.h),
margin: EdgeInsets.fromLTRB(
16.w, 0, 16.w,12.h,
),
padding: EdgeInsets.symmetric(vertical: 12.h),
decoration: BoxDecoration(
color: Color(0xFFFDFCFC),
borderRadius: BorderRadius.circular(4),
@ -229,7 +243,10 @@ class _FriendGroupList extends State<FriendGroupList> {
child: Row(
children: [
Padding(
padding: EdgeInsets.only(left: 15.w, right: 5.w),
padding: EdgeInsets.only(
left: 15.w,
right: 5.w,
),
child: Image.asset(
"assets/image/icon_search.webp",
width: 14.h,
@ -246,7 +263,7 @@ class _FriendGroupList extends State<FriendGroupList> {
),
),
],
)
),
),
);
}

19
lib/mine/mine_page.dart

@ -43,8 +43,7 @@ class MinePage extends StatefulWidget {
}
}
class MinePageState extends State<MinePage>
with AutomaticKeepAliveClientMixin, ParseErrorLogger {
class MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin, ParseErrorLogger {
ApiService? apiService;
UserInfo? userInfo;
List<Rank> ranks = [];
@ -113,8 +112,7 @@ class MinePageState extends State<MinePage>
errorLogger: this,
);
BaseListData<Rank>? rankData =
await apiService?.rankList().catchError((onError) {
BaseListData<Rank>? rankData = await apiService?.rankList().catchError((onError) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(onError.type),
alignment: Alignment.center);
_refreshController.refreshFailed();
@ -128,7 +126,7 @@ class MinePageState extends State<MinePage>
BaseData<UserInfo>? baseDate =
await apiService?.queryInfo().catchError((onError) {
_refreshController.refreshFailed();
return Future.value(null);
return BaseData<UserInfo>()..isSuccess = false;
});
if (baseDate?.isSuccess ?? false) {
userInfo = baseDate?.data;
@ -181,7 +179,7 @@ class MinePageState extends State<MinePage>
"state": 1
}).catchError((error) {
_refreshController.refreshFailed();
return Future.value(null);
return BaseData<PageInfo<Coupon>>()..isSuccess = false;
});
if (baseData?.isSuccess ?? false) {
couponNum = baseData?.data?.total;
@ -213,7 +211,7 @@ class MinePageState extends State<MinePage>
BaseData<SocialInfo>? baseData =
await apiService?.socialInfo().catchError((onError) {
_refreshController.refreshFailed();
return Future.value(null);
return BaseData<SocialInfo>()..isSuccess = false;
});
if (baseData?.isSuccess ?? false) {
infoNumber = baseData?.data;
@ -351,9 +349,8 @@ class MinePageState extends State<MinePage>
);
},
child: Container(
margin: EdgeInsets.only(left: 16.w, right: 16.w, bottom: 30.h),
padding:
EdgeInsets.only(left: 12.w, top: 12.h, right: 10.w, bottom: 17.h),
margin: EdgeInsets.only(left: 16.w, right: 16.w, bottom: 16.h),
padding: EdgeInsets.only(left: 12.w, top: 12.h, right: 10.w, bottom: 17.h),
width: double.infinity,
decoration: BoxDecoration(
color: Colors.white,
@ -455,7 +452,7 @@ class MinePageState extends State<MinePage>
Widget spreadImage() {
return Container(
width: double.infinity,
margin: EdgeInsets.only(bottom: 24.h),
margin: EdgeInsets.only(bottom: 16.h),
height: 85.h,
child: activityBannerData.isNotEmpty
? Swiper(

22
lib/mine/mine_view/calendar_page.dart

@ -62,21 +62,33 @@ class _CalendarPage extends State<CalendarPage> with TickerProviderStateMixin {
return TableCalendar(
startingDayOfWeek: StartingDayOfWeek.monday,
availableGestures: AvailableGestures.none,
daysOfWeekHeight: 22,
headerStyle: HeaderStyle(
titleCentered: false,
headerMargin: EdgeInsets.only(
left: 12,
),
leftChevronVisible: false,
rightChevronVisible: false,
formatButtonVisible: false,
),
calendarStyle: CalendarStyle(
outsideDaysVisible: false,
selectedDecoration: BoxDecoration().copyWith(color: Color(0xFF32A060)),
selectedTextStyle: TextStyle().copyWith(color: Color(0xFF333333)),
todayTextStyle: TextStyle().copyWith(color: Color(0xFFD5EBDE)),
selectedDecoration: BoxDecoration().copyWith(
color: Color(0xFF32A060),
),
selectedTextStyle: TextStyle().copyWith(
color: Color(0xFF333333),
),
todayTextStyle: TextStyle().copyWith(
color: Color(0xFFD5EBDE),
),
),
daysOfWeekStyle: DaysOfWeekStyle(
weekendStyle: TextStyle().copyWith(color: Color(0xFF4D4D4D)),
),
weekendStyle: TextStyle().copyWith(
color: Color(0xFF4D4D4D),
),
),
onDaySelected: _onDaySelected,
// onVisibleDaysChanged: _onVisibleDaysChanged,
onCalendarCreated: _onCalendarCreated,

6
lib/mine/mine_view/community_follow.dart

@ -73,6 +73,8 @@ class _CommunityFollow extends State<CommunityFollow>
fontSize: 17.sp,
fontWeight: FontWeight.bold,
),
dividerHeight: 0,
dividerColor: Colors.transparent,
unselectedLabelStyle: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.medium,
@ -86,7 +88,9 @@ class _CommunityFollow extends State<CommunityFollow>
MyTab(
text: "关注${infoNumber?.follow ?? "0"}",
),
MyTab(text: "粉丝${infoNumber?.fans ?? "0"}"),
MyTab(
text: "粉丝${infoNumber?.fans ?? "0"}",
),
],
),
),

33
lib/mine/mine_view/mine_calendar.dart

@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:huixiang/utils/constant.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'calendar_page.dart';
@ -14,10 +15,11 @@ class _MineCalendar extends State<MineCalendar> {
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.fromLTRB(14.w, 0.h, 14.w, 30.h),
padding: EdgeInsets.only(top: 12.h,left: 12,),
margin: EdgeInsets.fromLTRB(
14.w, 0.h, 14.w, 30.h,
),
alignment: Alignment.center,
decoration: BoxDecoration(
// color: Colors.white,
image: DecorationImage(
fit: BoxFit.cover,
image: AssetImage("assets/image/s_bg.webp"),
@ -29,7 +31,7 @@ class _MineCalendar extends State<MineCalendar> {
offset: Offset(0, 2),
blurRadius: 4,
spreadRadius: 0,
)
),
],
),
child: Stack(
@ -38,38 +40,25 @@ class _MineCalendar extends State<MineCalendar> {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
12.d,
GestureDetector(
onTap: (){
// Navigator.of(context).pushNamed('/router/mine_greenery');
},
child: Row(
children: [
Expanded(child: Text(
12.vd,
Text(
"我的${DateTime.now().month}月足迹日历",
style: TextStyle(
color: Color(0xFF0D0D0D),
fontWeight: MyFontWeight.semi_bold,
fontSize: 15.sp,
),
),),
// Text(
// "查看绿叶",
// style: TextStyle(
// color: Color(0xFF000000),
// fontWeight: MyFontWeight.regular,
// fontSize: 15.sp,
// ),
// ),
// Icon(
// Icons.navigate_next,
// size: 24,
// color: Colors.black,
// ),
// SizedBox(width:12,),
),
],
),
),
SizedBox(height: 12,),
CalendarPage(),
],
),
@ -80,7 +69,7 @@ class _MineCalendar extends State<MineCalendar> {
fit: BoxFit.fill,
),
],
)
),
);
}
}

6
lib/mine/mine_view/mine_item.dart

@ -20,7 +20,7 @@ class _MineItem extends State<MineItem> {
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.fromLTRB(16.w, 0.h, 16.w, 30.h),
margin: EdgeInsets.fromLTRB(16.w, 0.h, 16.w, 16.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
@ -37,7 +37,9 @@ class _MineItem extends State<MineItem> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.only(left: 16, top: 16, bottom: 13, right: 16),
padding: EdgeInsets.only(
left: 16, top: 16, bottom: 13, right: 16,
),
child: Text(
S.of(context).qita,
style: TextStyle(

80
lib/mine/mine_view/mine_navbar.dart

@ -13,9 +13,7 @@ class MineNavbar extends StatefulWidget {
final SocialInfo? infoNumber;
final GestureTapCallback toIntegralPage;
final Function queryCoupon;
MineNavbar(this.couponNum,this.userInfo,this.infoNumber,this.toIntegralPage,this.queryCoupon);
@override
State<StatefulWidget> createState() {
return _MineNavbar();
@ -26,7 +24,9 @@ class _MineNavbar extends State<MineNavbar> {
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.fromLTRB(13.5.w, 15.h, 13.5.w,30.h),
margin: EdgeInsets.fromLTRB(
13.5.w, 15.h, 13.5.w, 15.h,
),
padding: EdgeInsets.only(
top: 26.h,
bottom: 24.h,
@ -53,8 +53,7 @@ class _MineNavbar extends State<MineNavbar> {
child: InkWell(
onTap: () {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
value.getString("token") == "") {
if (value.getString("token") == null || value.getString("token") == "") {
LoginTipsDialog().show(context);
return;
}
@ -75,8 +74,7 @@ class _MineNavbar extends State<MineNavbar> {
child: InkWell(
onTap: () {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
value.getString("token") == "") {
if (value.getString("token") == null || value.getString("token") == "") {
LoginTipsDialog().show(context);
return;
}
@ -133,19 +131,32 @@ class _MineNavbar extends State<MineNavbar> {
),
Container(
width: double.infinity,
margin: EdgeInsets.only(top:17.h,left: 16.w,right: 16.w,bottom: 27.h),
child: Flex(
children: List.generate(120, (_) {
return SizedBox(
width: 1,
height: 1,
child: DecoratedBox(
decoration: BoxDecoration(color: Color(0xFFEDEDED)),
),
margin: EdgeInsets.symmetric(
vertical: 12,
horizontal: 15,
),
child: LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
double width = constraints.constrainWidth();
return Flex(
children: List.generate(width ~/ 4, (_) {
return Container(
width: 2,
height: 1,
margin: EdgeInsets.symmetric(
horizontal: 1,
),
child: DecoratedBox(
decoration: BoxDecoration(
color: Color(0xFFEDEDED),
),
),
);
}),
mainAxisAlignment: MainAxisAlignment.spaceBetween,
direction: Axis.horizontal,
);
}),
mainAxisAlignment: MainAxisAlignment.spaceBetween,
direction: Axis.horizontal,
}
),
),
Row(
@ -194,15 +205,19 @@ class _MineNavbar extends State<MineNavbar> {
child: InkWell(
onTap: () {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
value.getString("token") == "") {
LoginTipsDialog().show(context);
return;
}
Navigator.of(context).pushNamed('/router/communityFollow',arguments: {
"status":0
});
});},
if (value.getString("token") == null ||
value.getString("token") == "") {
LoginTipsDialog().show(context);
return;
}
Navigator.of(context).pushNamed(
'/router/communityFollow',
arguments: {
"status":0
},
);
});
},
child: mineBottomItem(
"${widget.infoNumber?.follow ?? "0"}",
S.of(context).guanzhu,
@ -219,9 +234,12 @@ class _MineNavbar extends State<MineNavbar> {
LoginTipsDialog().show(context);
return;
}
Navigator.of(context).pushNamed('/router/communityFollow',arguments: {
"status":1
});
Navigator.of(context).pushNamed(
'/router/communityFollow',
arguments: {
"status":1
},
);
});
},
child: mineBottomItem(

10
lib/mine/mine_view/mine_order.dart

@ -82,12 +82,16 @@ class _MineOrderView extends State<MineOrderView> {
toOrderHistory(int status) {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
value.getString("token") == "") {
if (value.getString("token") == null || value.getString("token") == "") {
LoginTipsDialog().show(context);
return;
}
Navigator.of(context).pushNamed('/router/order_history_page', arguments: {"status":status});
Navigator.of(context).pushNamed(
'/router/order_history_page',
arguments: {
"status":status,
},
);
});
}

2
lib/mine/mine_wallet_page.dart

@ -158,7 +158,7 @@ class _MineWalletPage extends State<MineWalletPage> {
Widget balance() {
return Container(
width: double.infinity,
margin: EdgeInsets.fromLTRB(14.w, 16.h, 14.w, 8.h),
margin: EdgeInsets.fromLTRB(14.w, 16.h, 14.w, 0),
padding: EdgeInsets.only(bottom: 12.h),
decoration: BoxDecoration(
color: Color(0xFF32A060),

72
lib/order/order_history_page.dart

@ -6,6 +6,7 @@ import 'package:huixiang/data/base_data.dart';
import 'package:huixiang/data/order_info.dart';
import 'package:huixiang/data/order_product_vo.dart';
import 'package:huixiang/data/page.dart';
import 'package:huixiang/data/user_info.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/order/order_utils.dart';
import 'package:huixiang/order/order_view/order_pay_selected.dart';
@ -26,8 +27,6 @@ import 'package:retrofit/retrofit.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:shimmer/shimmer.dart';
import '../data/user_info.dart';
class OrderHistoryPage extends StatefulWidget {
final Map? arguments;
@ -67,7 +66,7 @@ class _OrderHistoryPage extends State<OrderHistoryPage>
titleSize: 18.sp,
background: Color(0xFFFFFFFF),
leadingColor: Colors.black,
toolbarHeight: kToolbarHeight + MediaQuery.of(context).padding.top,
toolbarHeight: kToolbarHeight,
bottom: PreferredSize(
preferredSize: Size(double.infinity, 38.h),
child: Theme(
@ -86,6 +85,8 @@ class _OrderHistoryPage extends State<OrderHistoryPage>
fontSize: 16.sp,
fontWeight: FontWeight.normal,
),
dividerHeight: 0,
dividerColor: Colors.transparent,
labelStyle: TextStyle(
color: Colors.black,
fontSize: 16.sp,
@ -176,8 +177,8 @@ class _OrderHistoryList extends State<OrderHistoryList>
networkStatus = -1;
refreshController.refreshFailed();
refreshController.loadFailed();
return BaseData<PageInfo<OrderInfo>>()..isSuccess = false;
});
if (baseData?.isSuccess ?? false) {
if (baseData!.data != null &&
(baseData.data!.records?.isNotEmpty ?? false)) {
@ -201,8 +202,10 @@ class _OrderHistoryList extends State<OrderHistoryList>
networkStatus = 1;
} else {
if (baseData?.msg?.isNotEmpty ?? false)
SmartDialog.showToast("${baseData!.msg}",
alignment: Alignment.center);
SmartDialog.showToast(
"${baseData!.msg}",
alignment: Alignment.center,
);
refreshController.refreshFailed();
refreshController.loadFailed();
}
@ -215,7 +218,7 @@ class _OrderHistoryList extends State<OrderHistoryList>
apiService?.minLogin(orderInfo.storeId ?? "").catchError((onError) {
debugPrint("${onError}");
}).then((baseData) {
if (baseData?.isSuccess ?? false) {
if (baseData.isSuccess ?? false) {
Map<String, dynamic> minStoreInfo = baseData.data;
String minToken = minStoreInfo["token"];
String tenant = orderInfo.tenantCode ?? "";
@ -228,22 +231,25 @@ class _OrderHistoryList extends State<OrderHistoryList>
},
);
paySelected(
orderInfo,
MinApiService(
Dio(),
context: context,
token: minToken,
tenant: tenant,
storeId: storeId,
errorLogger: this,
));
orderInfo,
MinApiService(
Dio(),
context: context,
token: minToken,
tenant: tenant,
storeId: storeId,
errorLogger: this,
),
);
}
});
}
queryDetails(id) async {
BaseData<OrderInfo>? baseData =
await apiService?.orderDetail(id).catchError((error) {});
await apiService?.orderDetail(id).catchError((error) {
return BaseData<OrderInfo>()..isSuccess = false;
});
if (baseData?.isSuccess ?? false) {
return baseData!.data;
}
@ -251,7 +257,9 @@ class _OrderHistoryList extends State<OrderHistoryList>
queryUserBalance() async {
BaseData<UserInfo>? baseData =
await apiService?.queryInfo().catchError((onError) {});
await apiService?.queryInfo().catchError((onError) {
return BaseData<UserInfo>()..isSuccess = false;
});
if (baseData?.isSuccess ?? false) {
userInfo = baseData!.data;
if (mounted) setState(() {});
@ -294,7 +302,9 @@ class _OrderHistoryList extends State<OrderHistoryList>
orderCancel(String orderId) async {
BaseData? baseData =
await apiService?.orderCancel(orderId).catchError((onError) {});
await apiService?.orderCancel(orderId).catchError((onError) {
return BaseData()..isSuccess = false;
});
if (baseData?.isSuccess ?? false) {
SmartDialog.showToast("订单取消成功");
_onRefresh();
@ -304,15 +314,6 @@ class _OrderHistoryList extends State<OrderHistoryList>
}
aginOrder(OrderInfo orderInfo) {
// Navigator.of(context).pushNamed(
// '/router/union_detail_page',
// arguments: {"id": storeId},
// );
// String storeId = (orderInfo != null &&
// orderInfo.storeVO != null)
// ? (orderInfo.storeVO.id ?? "")
// : "";
if (orderInfo.storeVO?.posType?.code == "NORMALSTORE") {
Scan.toScan(
context,
@ -370,15 +371,18 @@ class _OrderHistoryList extends State<OrderHistoryList>
itemBuilder: (context, position) {
return InkWell(
onTap: () {
Navigator.of(context).pushNamed('/router/order_details',
arguments: {
"id": orderInfos[position].id,
"jumpState": 2
});
Navigator.of(context).pushNamed(
'/router/order_details',
arguments: {
"id": orderInfos[position].id,
"jumpState": 2
},
);
},
child: orderItem(orderInfos[position]),
);
})
},
)
: NoDataView(
src: "assets/image/ding_dan.webp",
isShowBtn: false,

643
lib/qr/invite_friends.dart

@ -1,7 +1,9 @@
import 'dart:convert';
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/data/base_data.dart';
@ -10,6 +12,7 @@ import 'package:huixiang/data/page.dart';
import 'package:huixiang/data/user_info.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/constant.dart';
import 'package:huixiang/utils/flutter_utils.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/classic_header.dart';
@ -116,44 +119,30 @@ class _InviteFriends extends State<InviteFriends> {
return Scaffold(
backgroundColor: Colors.white,
appBar: AppBar(
shadowColor: Colors.white,
backgroundColor: Colors.white,
leading: GestureDetector(
child: Icon(
Icons.clear,
color: Colors.black,
),
onTap: () {
Navigator.of(context).pop();
}),
title: Text(
S.of(context).yaoqinghaoyou,
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 17.sp,
color: Color(0xFF000000),
),
shadowColor: Colors.white,
backgroundColor: Colors.white,
leading: GestureDetector(
child: Icon(
Icons.arrow_back_ios_new_rounded,
color: Colors.black,
),
centerTitle: true,
elevation: 0.0,
//
scrolledUnderElevation: 0.0
// actions: [
// GestureDetector(
// child: Container(
// margin: EdgeInsets.only(right: 14),
// padding:EdgeInsets.only(left:70,right: 20),
// child: Icon(
// Icons.more_horiz,
// color: Colors.black,
// ),
// ),
// onTap: () {
// // Navigator.of(context).pop();
// // share();
// })
// ],
onTap: () {
Navigator.of(context).pop();
},
),
title: Text(
S.of(context).yaoqinghaoyou,
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 17.sp,
color: Color(0xFF000000),
),
),
centerTitle: true,
elevation: 0.0,
//
scrolledUnderElevation: 0.0,
),
body: SmartRefresher(
controller: refreshController,
enablePullDown: true,
@ -192,19 +181,20 @@ class _InviteFriends extends State<InviteFriends> {
Widget invite() {
return Container(
width: double.infinity,
height: 370.h,
margin: EdgeInsets.only(bottom: 20.h),
margin: EdgeInsets.only(
bottom: 16.h,
),
child: Column(
children: [
Image.asset(
"assets/image/invite_friends.webp",
height: 300.h,
width: double.infinity,
fit: BoxFit.fill,
),
SizedBox(
height: 12.h,
Container(
child: Image.asset(
"assets/image/invite_friends.webp",
width: double.infinity,
fit: BoxFit.fitWidth,
alignment: Alignment.topCenter,
),
),
26.d,
GestureDetector(
onTap: () {
widgetToUrl();
@ -213,7 +203,7 @@ class _InviteFriends extends State<InviteFriends> {
width: double.infinity,
height: 52.h,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(26),
borderRadius: BorderRadius.circular(26.h),
color: Color(0xFF32A060),
),
margin: EdgeInsets.symmetric(horizontal: 14.w),
@ -237,11 +227,11 @@ class _InviteFriends extends State<InviteFriends> {
fontSize: 16.sp,
color: Color(0xFFFFFFFF),
),
)
),
],
),
),
)
),
],
),
);
@ -255,372 +245,216 @@ class _InviteFriends extends State<InviteFriends> {
borderRadius: BorderRadius.circular(6),
color: Color(0xFFFFFFFF),
),
margin: EdgeInsets.only(bottom: 12.h, left: 14.h, right: 14.h),
margin: EdgeInsets.only(
bottom: 12.h,
left: 14.h,
right: 14.h,
),
padding: EdgeInsets.all(6),
child: Column(
// mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
decoration: BoxDecoration(
image: DecorationImage(
decoration: BoxDecoration(
image: DecorationImage(
fit: BoxFit.cover,
image: AssetImage("assets/image/invite_bj.webp"),
),
),
height: 54.h,
width: double.infinity,
alignment: Alignment.center,
child: Text(
S.of(context).huodongguize,
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 16.sp,
color: Color(0xFF32A060),
),
),
),
SizedBox(
height: 12.h,
),
Row(
children: [
Spacer(),
Image.asset(
"assets/image/invite_wx.webp",
width: 42.h,
height: 42.h,
fit: BoxFit.cover,
),
Expanded(
child: dashedLine(),
),
Image.asset(
"assets/image/yq_zt.webp",
width: 42.h,
height: 42.h,
fit: BoxFit.cover,
),
Expanded(
child: dashedLine(),
),
Image.asset(
"assets/image/zt_m.webp",
width: 42.h,
height: 42.h,
fit: BoxFit.cover,
),
Expanded(
child: dashedLine(),
),
Image.asset(
"assets/image/invite_q.webp",
width: 42.h,
height: 42.h,
fit: BoxFit.cover,
),
Spacer(),
],
),
Row(
children: [
Spacer(),
Container(
alignment: Alignment.center,
width: 42.h,
child: Image.asset(
"assets/image/invite_1.webp",
width: 24.h,
height: 24.h,
fit: BoxFit.cover,
),
),
Spacer(),
Container(
alignment: Alignment.center,
width: 42.h,
child: Image.asset(
"assets/image/invite_2.webp",
width: 24.h,
height: 24.h,
fit: BoxFit.cover,
),
),
Spacer(),
Container(
alignment: Alignment.center,
width: 42.h,
child: Image.asset(
"assets/image/invite_3.webp",
width: 24.h,
height: 24.h,
fit: BoxFit.cover,
),
),
Spacer(),
Container(
alignment: Alignment.center,
width: 42.h,
child: Image.asset(
"assets/image/invite_4.webp",
width: 24.h,
height: 24.h,
fit: BoxFit.cover,
image: AssetImage("assets/image/invite_bj.webp"),
),
),
height: 54.h,
width: double.infinity,
alignment: Alignment.center,
child: Text(
S.of(context).huodongguize,
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 16.sp,
color: Color(0xFF32A060),
),
)),
SizedBox(
height: 17.h,
Spacer(),
],
),
IntrinsicHeight(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
"assets/image/invite_wx.webp",
width: 42.h,
height: 42.h,
fit: BoxFit.cover,
),
Container(
width: 50.w,
child: Flex(
children: List.generate(8, (_) {
return SizedBox(
width: 3,
height: 1,
child: DecoratedBox(
decoration:
BoxDecoration(color: Color(0xFF32A060)),
),
);
}),
mainAxisAlignment: MainAxisAlignment.spaceBetween,
direction: Axis.horizontal,
),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
"assets/image/invite_1.webp",
width: 24.h,
height: 24.h,
fit: BoxFit.cover,
),
Container(
width: 44.w,
child: Flex(
children: List.generate(0, (_) {
return SizedBox(
width: 3.w,
height: 1.h,
child: DecoratedBox(
decoration:
BoxDecoration(color: Colors.white),
),
);
}),
mainAxisAlignment: MainAxisAlignment.spaceBetween,
direction: Axis.horizontal,
),
),
],
),
SizedBox(height: 8.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: 50.w,
child: Text(
"分享链接给好友",
style: TextStyle(
fontSize: 12.sp,
height: 1.3.h,
fontWeight: MyFontWeight.regular,
color: Color(0xFF181818),
),
),
),
Container(
width: 43.w,
child: Flex(
children: List.generate(0, (_) {
return SizedBox(
width: 3.w,
height: 1.h,
child: DecoratedBox(
decoration:
BoxDecoration(color: Colors.white),
),
);
}),
mainAxisAlignment: MainAxisAlignment.spaceBetween,
direction: Axis.horizontal,
),
),
],
),
],
)),
Expanded(
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
"assets/image/yq_zt.webp",
width: 42.h,
height: 42.h,
fit: BoxFit.cover,
),
Container(
width: 50.w,
child: Flex(
children: List.generate(8, (_) {
return SizedBox(
width: 3.w,
height: 1.w,
child: DecoratedBox(
decoration:
BoxDecoration(color: Color(0xFF32A060)),
),
);
}),
mainAxisAlignment: MainAxisAlignment.spaceBetween,
direction: Axis.horizontal,
),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
"assets/image/invite_2.webp",
width: 24.h,
height: 24.h,
fit: BoxFit.cover,
),
Container(
width: 44.w,
child: Flex(
children: List.generate(0, (_) {
return SizedBox(
width: 3.w,
height: 1.h,
child: DecoratedBox(
decoration:
BoxDecoration(color: Colors.white),
),
);
}),
mainAxisAlignment: MainAxisAlignment.spaceBetween,
direction: Axis.horizontal,
),
),
],
),
SizedBox(height: 8.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: 50.w,
child: Text(
"好友注册并获得10元优惠券",
style: TextStyle(
fontSize: 12.sp,
height: 1.3.h,
fontWeight: MyFontWeight.regular,
color: Color(0xFF181818),
),
),
),
Container(
width: 43.w,
child: Flex(
children: List.generate(0, (_) {
return SizedBox(
width: 3.w,
height: 1.h,
child: DecoratedBox(
decoration:
BoxDecoration(color: Colors.white),
),
);
}),
mainAxisAlignment: MainAxisAlignment.spaceBetween,
direction: Axis.horizontal,
),
),
],
),
],
)),
Expanded(
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
"assets/image/zt_m.webp",
width: 42.h,
height: 42.h,
fit: BoxFit.cover,
),
Container(
width: 50.w,
child: Flex(
children: List.generate(8, (_) {
return SizedBox(
width: 3.w,
height: 1.h,
child: DecoratedBox(
decoration:
BoxDecoration(color: Color(0xFF32A060)),
),
);
}),
mainAxisAlignment: MainAxisAlignment.spaceBetween,
direction: Axis.horizontal,
),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
"assets/image/invite_3.webp",
width: 24.h,
height: 24.h,
fit: BoxFit.cover,
),
Container(
width: 44.w,
child: Flex(
children: List.generate(0, (_) {
return SizedBox(
width: 3.w,
height: 1.h,
child: DecoratedBox(
decoration:
BoxDecoration(color: Colors.white),
),
);
}),
mainAxisAlignment: MainAxisAlignment.spaceBetween,
direction: Axis.horizontal,
),
),
],
),
SizedBox(height: 8.h),
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: 50.w,
child: Text(
"好友完成首单",
style: TextStyle(
fontSize: 12.sp,
height: 1.3.h,
fontWeight: MyFontWeight.regular,
color: Color(0xFF181818),
),
),
),
Container(
width: 43.w,
child: Flex(
children: List.generate(0, (_) {
return SizedBox(
width: 3.w,
height: 1.h,
child: DecoratedBox(
decoration:
BoxDecoration(color: Colors.white),
),
);
}),
mainAxisAlignment: MainAxisAlignment.spaceBetween,
direction: Axis.horizontal,
),
),
],
),
],
)),
Column(
children: [
Image.asset(
"assets/image/invite_q.webp",
width: 42.h,
height: 42.h,
fit: BoxFit.cover,
),
Image.asset(
"assets/image/invite_4.webp",
width: 24.h,
height: 24.h,
fit: BoxFit.cover,
),
SizedBox(height: 8.h),
Container(
width: 50.w,
child: Text(
"邀请达成获得奖励",
style: TextStyle(
fontSize: 12.sp,
height: 1.3.h,
fontWeight: MyFontWeight.regular,
color: Color(0xFF181818),
),
),
)
],
SizedBox(height: 8.h),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Spacer(),
Expanded(
flex: 3,
child: Text(
"分享链接给好友",
style: TextStyle(
fontSize: 12.sp,
height: 1.3.h,
fontWeight: MyFontWeight.regular,
color: Color(0xFF181818),
),
),
],
),
),
Spacer(),
Expanded(
flex: 3,
child: Text(
"好友注册并获得10元优惠券",
style: TextStyle(
fontSize: 12.sp,
height: 1.3.h,
fontWeight: MyFontWeight.regular,
color: Color(0xFF181818),
),
),
),
Spacer(),
Expanded(
flex: 3,
child: Text(
"好友完成首单",
style: TextStyle(
fontSize: 12.sp,
height: 1.3.h,
fontWeight: MyFontWeight.regular,
color: Color(0xFF181818),
),
),
),
Spacer(),
Expanded(
flex: 3,
child: Text(
"邀请达成获得奖励",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 12.sp,
height: 1.3.h,
fontWeight: MyFontWeight.regular,
color: Color(0xFF181818),
),
),
),
Spacer(),
],
),
],
),
);
}
dashedLine() {
return LayoutBuilder(
builder: (ctx, c) {
double width = c.constrainWidth();
return Flex(
children: List.generate(
width ~/ 4,
(_) {
return Container(
width: 2,
margin: EdgeInsets.symmetric(horizontal: 1),
height: 1,
child: DecoratedBox(
decoration: BoxDecoration(color: Color(0xFF32A060)),
),
);
},
),
mainAxisAlignment: MainAxisAlignment.spaceBetween,
direction: Axis.horizontal,
);
},
);
}
///
Widget achievement() {
return Container(
@ -630,8 +464,17 @@ class _InviteFriends extends State<InviteFriends> {
borderRadius: BorderRadius.circular(6),
color: Color(0xFFFFFFFF),
),
margin: EdgeInsets.only(bottom: 12.h, left: 14.h, right: 14.h),
padding: EdgeInsets.only(top: 6.h, left: 6, right: 6, bottom: 16.h),
margin: EdgeInsets.only(
bottom: 12.h,
left: 14.h,
right: 14.h,
),
padding: EdgeInsets.only(
top: 6.h,
left: 6,
right: 6,
bottom: 16.h,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,

Loading…
Cancel
Save