diff --git a/assets/image/2x/yao_q.png b/assets/image/2x/yao_q.png new file mode 100644 index 00000000..0a43148e Binary files /dev/null and b/assets/image/2x/yao_q.png differ diff --git a/assets/image/3x/yao_q.png b/assets/image/3x/yao_q.png new file mode 100644 index 00000000..cabb787d Binary files /dev/null and b/assets/image/3x/yao_q.png differ diff --git a/assets/image/yao_q.png b/assets/image/yao_q.png new file mode 100644 index 00000000..d683294c Binary files /dev/null and b/assets/image/yao_q.png differ diff --git a/lib/article/hot_article_item.dart b/lib/article/hot_article_item.dart index 921bb401..497052c2 100644 --- a/lib/article/hot_article_item.dart +++ b/lib/article/hot_article_item.dart @@ -91,6 +91,7 @@ class _TouTiao extends State { Dio(), context: context, token: value.getString("token"), + showLoading: true ); } BaseData> baseData = diff --git a/lib/home/home_page.dart b/lib/home/home_page.dart index 1e4e1d6e..e707abc9 100644 --- a/lib/home/home_page.dart +++ b/lib/home/home_page.dart @@ -267,8 +267,6 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { totalMsg += element.number; }); }); - // refreshController.loadComplete(); - // refreshController.refreshCompleted(); } EasyLoading.dismiss(); } diff --git a/lib/integral_store/integral_store_details_page.dart b/lib/integral_store/integral_store_details_page.dart index 812533ec..03755908 100644 --- a/lib/integral_store/integral_store_details_page.dart +++ b/lib/integral_store/integral_store_details_page.dart @@ -13,7 +13,6 @@ import 'package:huixiang/retrofit/data/user_info.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/custom_image.dart'; -import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; diff --git a/lib/main.dart b/lib/main.dart index c05021fb..bda98505 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -77,6 +77,7 @@ import 'home/guide_page.dart'; import 'home/home_view/activity_list.dart'; import 'main_page.dart'; import 'message/system_details.dart'; +import 'mine/invitation_record.dart'; import 'mine/manage_address_page.dart'; import 'mine/mine_view/community_follow.dart'; import 'mine/mine_vip/binding_assistant_card.dart'; @@ -170,72 +171,72 @@ class MyApp extends StatelessWidget { Widget build(BuildContext context) { return MediaQuery( data: const MediaQueryData( - size: Size(375, 812), - ), - child:ScreenUtilInit( - designSize: Size(375, 812), - builder: () => MaterialApp( - debugShowCheckedModeBanner: false, - theme: ThemeData( - primarySwatch: Colors.blue, - textTheme: TextTheme( - button: TextStyle(fontSize: 24.sp), - bodyText1: TextStyle(fontSize: 12.sp), - bodyText2: TextStyle(fontSize: 16.sp), - ), + size: Size(375, 812), ), - localeResolutionCallback: (locale, supportedLocales) { - print("locale: $locale"); - print("supportedLocales: $supportedLocales"); - return appLocale ?? locale; - }, - localizationsDelegates: [ - GlobalMaterialLocalizations.delegate, - GlobalCupertinoLocalizations.delegate, - GlobalWidgetsLocalizations.delegate, - S.delegate - ], - localeListResolutionCallback: - (List locales, Iterable supportedLocales) { - print("locale: ${locales[0]}"); - return appLocale ?? locales[0]; - }, - supportedLocales: S.delegate.supportedLocales, - home: (isFirst ?? true) ? GuidePage() : LoginPage(), - builder: EasyLoading.init( - builder: (context, widget) { - ScreenUtil.setContext(context); - return MediaQuery( - data: MediaQuery.of(context).copyWith( - textScaleFactor: AppUtils.textScale(context), + child: ScreenUtilInit( + designSize: Size(375, 812), + builder: () => MaterialApp( + debugShowCheckedModeBanner: false, + theme: ThemeData( + primarySwatch: Colors.blue, + textTheme: TextTheme( + button: TextStyle(fontSize: 24.sp), + bodyText1: TextStyle(fontSize: 12.sp), + bodyText2: TextStyle(fontSize: 16.sp), ), - child: FlutterSmartDialog(child: widget), - ); - }, - ), - onGenerateRoute: (settings) { - final String name = settings.name; - final Function pageContentBuilder = routers[name]; - if (pageContentBuilder != null) { - final Route route = CupertinoPageRoute( - builder: (context) { - return pageContentBuilder(context, - arguments: settings.arguments); + ), + localeResolutionCallback: (locale, supportedLocales) { + print("locale: $locale"); + print("supportedLocales: $supportedLocales"); + return appLocale ?? locale; + }, + localizationsDelegates: [ + GlobalMaterialLocalizations.delegate, + GlobalCupertinoLocalizations.delegate, + GlobalWidgetsLocalizations.delegate, + S.delegate + ], + localeListResolutionCallback: + (List locales, Iterable supportedLocales) { + print("locale: ${locales[0]}"); + return appLocale ?? locales[0]; + }, + supportedLocales: S.delegate.supportedLocales, + home: (isFirst ?? true) ? GuidePage() : LoginPage(), + builder: EasyLoading.init( + builder: (context, widget) { + ScreenUtil.setContext(context); + return MediaQuery( + data: MediaQuery.of(context).copyWith( + textScaleFactor: AppUtils.textScale(context), + ), + child: FlutterSmartDialog(child: widget), + ); }, - settings: settings, - ); - return route; - } - return MaterialPageRoute( - //未找到页面配置进入登录页 - builder: (context) { - return LoginPage(); + ), + onGenerateRoute: (settings) { + final String name = settings.name; + final Function pageContentBuilder = routers[name]; + if (pageContentBuilder != null) { + final Route route = CupertinoPageRoute( + builder: (context) { + return pageContentBuilder(context, + arguments: settings.arguments); + }, + settings: settings, + ); + return route; + } + return MaterialPageRoute( + //未找到页面配置进入登录页 + builder: (context) { + return LoginPage(); + }, + settings: settings, + ); }, - settings: settings, - ); - }, - ), - )); + ), + )); } } @@ -340,5 +341,7 @@ Map routers = { '/router/photo_view_gallery_screen': (context, {arguments}) => PhotoViewGalleryScreen(), '/router/system_details': (context, {arguments}) => - SystemDetails(arguments:arguments), + SystemDetails(arguments: arguments), + '/router/invitation_record': (context, {arguments}) => + InvitationRecord(), }; diff --git a/lib/mine/invitation_record.dart b/lib/mine/invitation_record.dart new file mode 100644 index 00000000..c77a0b23 --- /dev/null +++ b/lib/mine/invitation_record.dart @@ -0,0 +1,360 @@ +import 'dart:convert'; + +import 'package:dio/dio.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/data/invitation_list.dart'; +import 'package:huixiang/retrofit/data/page.dart'; +import 'package:huixiang/retrofit/data/user_info.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/utils/flutter_utils.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +class InvitationRecord extends StatefulWidget { + @override + State createState() { + return _InvitationRecord(); + } +} + +class _InvitationRecord extends State + with AutomaticKeepAliveClientMixin { + ApiService apiService; + RefreshController _refreshController = RefreshController(); + List invitationList = []; + UserInfo userInfo; + int pageNum = 1; + + @override + void initState() { + super.initState(); + SharedPreferences.getInstance().then((value) { + apiService = ApiService(Dio(), + context: context, token: value.getString("token"), pay: true); + queryInviteMember(); + queryUserInfo(); + }); + } + + ///邀请记录 + queryInviteMember() async { + if (apiService == null) { + SharedPreferences value = await SharedPreferences.getInstance(); + apiService = ApiService( + Dio(), + context: context, + token: value.getString("token"), + ); + } + BaseData> baseData = + await apiService.inviteMemberList({ + "searchKey": "", + "pageNum": 1, + "pageSize": 100, + }).catchError((error) { + _refreshController.refreshFailed(); + }); + if (baseData != null && baseData.isSuccess) { + if (pageNum == 1) { + invitationList.clear(); + } + invitationList.addAll(baseData.data.list); + setState(() { + _refreshController.refreshCompleted(); + }); + } else { + _refreshController.refreshFailed(); + } + } + + queryUserInfo() async { + if (apiService == null) { + SharedPreferences value = await SharedPreferences.getInstance(); + apiService = ApiService( + Dio(), + context: context, + token: value.getString("token"), + ); + } + BaseData baseDate = + await apiService.queryInfo().catchError((onError) { + _refreshController.refreshFailed(); + }); + if (baseDate != null && baseDate.isSuccess) { + setState(() { + userInfo = baseDate.data; + }); + SharedPreferences.getInstance().then( + (value) => { + value.setString('user', jsonEncode(baseDate.data)), + }, + ); + _refreshController.refreshCompleted(); + } else { + _refreshController.refreshFailed(); + } + EasyLoading.dismiss(); + } + + @override + Widget build(BuildContext context) { + super.build(context); + return Stack( + children: [ + Container( + color: Color(0xFFF7F7F7), + ), + Stack( + children: [ + Container( + // padding: EdgeInsets.only(top: 40.h), + height: 230.h, + decoration: BoxDecoration( + gradient: new LinearGradient( + begin: Alignment.centerRight, + end: Alignment.centerLeft, + colors: [ + Color(0xFFE8F5E9), + Color(0xFFE5F7FF), + ]), + ), + ), + Container( + padding: EdgeInsets.only( + top: MediaQuery.of(context).padding.top, + left: 16.w, + right: 16.w), + child: Column( + children: [ + GestureDetector( + onTap: (){ + Navigator.of(context).pop(); + }, + child:Padding( + padding: EdgeInsets.only(top: 15.h, bottom: 30.h), + child: Row( + children: [ + Icon( + Icons.arrow_back_ios, + size: 24, + ), + SizedBox( + width: 1.w, + ), + Text( + "我的邀请记录", + style: TextStyle( + fontSize: 18.sp, + color: Color(0xFF000000), + fontWeight: MyFontWeight.semi_bold, + ), + ), + ], + )) + ), + Container( + margin: EdgeInsets.only(bottom: 16.h), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ), + ], + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + child: Container( + color: Colors.transparent, + padding: EdgeInsets.all(16), + child: Column( + children: [ + Text( + (userInfo?.todayInviteNumber ?? 0).toString(), + style: TextStyle( + color: Color(0xFF000000), + fontSize: 30.sp, + fontWeight: MyFontWeight.medium, + ), + ), + SizedBox( + height: 4, + ), + Text( + "今日邀请", + style: TextStyle( + color: Color(0xFF808080), + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ], + ))), + Container( + width: 1.w, + height: 32.h, + margin: EdgeInsets.only(left: 20.w, right: 20.w), + color: Color(0xFFD2D2D2), + ), + Expanded( + child: Container( + color: Colors.transparent, + padding: EdgeInsets.all(16), + child: Column( + children: [ + Text( + (userInfo?.inviteNumber ?? 0).toString(), + style: TextStyle( + color: Color(0xFF000000), + fontSize: 30.sp, + fontWeight: MyFontWeight.medium, + ), + ), + SizedBox( + height: 4, + ), + Text( + "累计邀请", + style: TextStyle( + color: Color(0xFF808080), + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ], + ))), + ], + ), + ), + Expanded( + child: Container( + width: double.infinity, + padding: EdgeInsets.only( + top: 20.h, left: 16.w, right: 16.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ), + ], + ), + child: Column( + children: [ + Text( + "邀请记录", + style: TextStyle( + color: Color(0xFF353535), + fontSize: 16.sp, + fontWeight: MyFontWeight.semi_bold, + ), + ), + SizedBox( + height: 8.h, + ), + Container( + width: 34.w, + height: 2.h, + margin: EdgeInsets.only(bottom: 20.h), + color: Color(0xFF32A060), + ), + Row( + children: [ + Expanded( + child: Text( + S.of(context).shoujihao, + style: TextStyle( + color: Color(0xFF353535), + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ), + Text( + "注册时间", + style: TextStyle( + color: Color(0xFF353535), + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + ), + ), + ], + ), + Expanded(child: + ListView.builder( + itemCount:invitationList.length, + shrinkWrap: true, + physics: BouncingScrollPhysics(), + scrollDirection: Axis.vertical, + padding: EdgeInsets.symmetric(vertical: 8.h), + itemBuilder: (context, position) { + return Container( + child: invitationItem(invitationList[position]), + ); + }, + ),) + ], + ))), + ], + )), + ], + ), + ], + ); + } + + Widget invitationItem(InvitationList invitationList) { + return Container( + child: Column(children: [ + Padding(padding: EdgeInsets.symmetric(vertical: 12.h), + child: + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded(child:Text( + AppUtils.phoneEncode(invitationList?.phone ?? ""), + style: TextStyle( + color: Color(0xFF000000), + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + ), + ),), + Text( + invitationList?.createTime ?? "", + style: TextStyle( + color: Color(0xFF000000), + fontSize: 14.sp, + fontWeight: MyFontWeight.medium, + ), + ) + ], + ),), + Container( + width:double.infinity, + height:1.h, + color: Color(0xFFF7F7F7), + ), + ])); + } + + @override + bool get wantKeepAlive => true; +} diff --git a/lib/mine/mine_view/community_follow.dart b/lib/mine/mine_view/community_follow.dart index 76381d92..5b56f089 100644 --- a/lib/mine/mine_view/community_follow.dart +++ b/lib/mine/mine_view/community_follow.dart @@ -38,7 +38,7 @@ class _CommunityFollow extends State Dio(), context: context, token: value.getString("token"), - showLoading: false, + showLoading: true ); BaseData baseData = diff --git a/lib/mine/mine_view/mine_item.dart b/lib/mine/mine_view/mine_item.dart index 450338a0..c3d37113 100644 --- a/lib/mine/mine_view/mine_item.dart +++ b/lib/mine/mine_view/mine_item.dart @@ -131,17 +131,30 @@ class _MineItem extends State { ),) ], ), - Padding(padding:EdgeInsets.only(left:24), - child: InkWell( - onTap: () { - Navigator.of(context).pushNamed('/router/qr_share', arguments: {}); - }, - child: mineItem( - S.of(context).tuiguangma, - "assets/image/icon_mine_promotion_code.png", - ), - ),) - + Row( + children: [ + Expanded(child:InkWell( + onTap: () { + Navigator.of(context).pushNamed('/router/qr_share', arguments: {}); + }, + child: mineItem( + S.of(context).tuiguangma, + "assets/image/icon_mine_promotion_code.png", + ), + ),), + Expanded(child:InkWell( + onTap: () { + Navigator.of(context).pushNamed('/router/invitation_record', arguments: {}); + }, + child: mineItem( + "邀请记录", + "assets/image/yao_q.png", + ), + ),), + Expanded(child:Container()), + Expanded(child:Container()) + ], + ), // mineItem( // S.of(context).bangzhuyufankui, // "assets/image/icon_mine_feedback.png", diff --git a/lib/mine/recharge_page.dart b/lib/mine/recharge_page.dart index 17af36a4..e44217cc 100644 --- a/lib/mine/recharge_page.dart +++ b/lib/mine/recharge_page.dart @@ -382,7 +382,7 @@ class _RechargePage extends State { int amount = int.tryParse(money); if (checkIndex == 1) { if (amount < 100) { - SmartDialog.showToast(S.of(context).chongzhizuixiaojine(0.001), + SmartDialog.showToast(S.of(context).chongzhizuixiaojine(100), alignment: Alignment.center); return; } diff --git a/lib/order/exchange_history_page.dart b/lib/order/exchange_history_page.dart index 805d9822..36f293c0 100644 --- a/lib/order/exchange_history_page.dart +++ b/lib/order/exchange_history_page.dart @@ -128,6 +128,7 @@ class _ExchangeHistoryList extends State { super.initState(); SharedPreferences.getInstance().then((value) => { apiService = ApiService(Dio(), + showLoading: true, context: context, token: value.getString('token')), queryHistory(), }); diff --git a/lib/order/order_detail_page.dart b/lib/order/order_detail_page.dart index 149dc7be..807fcdfa 100644 --- a/lib/order/order_detail_page.dart +++ b/lib/order/order_detail_page.dart @@ -40,6 +40,7 @@ class _OrderDetailPage extends State { SharedPreferences.getInstance().then((value) { apiService = ApiService( Dio(), + showLoading: true, context: context, token: value.getString("token"), ); @@ -66,6 +67,7 @@ class _OrderDetailPage extends State { ); minService = MinApiService( Dio(), + showLoading:true, context: context, token: minToken, tenant: tenant, @@ -173,7 +175,7 @@ class _OrderDetailPage extends State { OrderCommodity(orderInfo), ///显示订单信息 - OrderInfoView(orderInfo), + OrderInfoView(orderInfo,isTakeOut), Container( height: 42.h, diff --git a/lib/order/order_history_page.dart b/lib/order/order_history_page.dart index 3d003bae..0e2dc417 100644 --- a/lib/order/order_history_page.dart +++ b/lib/order/order_history_page.dart @@ -213,6 +213,7 @@ class _OrderHistoryList extends State SharedPreferences.getInstance().then((value) => { apiService = ApiService(Dio(), + showLoading: true, context: context, token: value.getString("token")), queryOrder(), }); diff --git a/lib/order/order_view/order_info.dart b/lib/order/order_view/order_info.dart index 945ead9a..388ec949 100644 --- a/lib/order/order_view/order_info.dart +++ b/lib/order/order_view/order_info.dart @@ -7,10 +7,10 @@ import 'package:huixiang/retrofit/data/order_info.dart'; import 'package:huixiang/utils/font_weight.dart'; class OrderInfoView extends StatefulWidget { - final OrderInfo orderInfo; + final int isTakeOut; - OrderInfoView(this.orderInfo); + OrderInfoView(this.orderInfo,this.isTakeOut); @override State createState() { @@ -45,7 +45,8 @@ class _OrderInfoView extends State { S.of(context).dingdanhao, widget.orderInfo != null ? widget.orderInfo.id : ""), orderInfoItem(S.of(context).xiadanshijian, widget.orderInfo != null ? widget.orderInfo.createTime : ""), - orderInfoItem(S.of(context).peisongfangshi,(widget.orderInfo != null && widget.orderInfo.logisticsName != "") ? widget.orderInfo.logisticsName : "美团配送"), + orderInfoItem(S.of(context).peisongfangshi, widget.isTakeOut == 0 + ? S.of(context).ziqu :(widget.orderInfo != null && widget.orderInfo.logisticsName != "") ? widget.orderInfo.logisticsName : "美团配送"), // orderInfoItem(S.of(context).peisongfangshi,"美团配送"), orderInfoItem( S.of(context).beizhuxinxi, diff --git a/lib/order/order_view/order_status.dart b/lib/order/order_view/order_status.dart index 598ede2f..8cc5e8e7 100644 --- a/lib/order/order_view/order_status.dart +++ b/lib/order/order_view/order_status.dart @@ -33,7 +33,7 @@ class _OrderStatus extends State { @override Widget build(BuildContext context) { return Container( - height: widget.orderStatus >= 4 ? 118.h : 118.h, + height: widget.orderStatus >= 4 ? 120.h : 120.h, padding: EdgeInsets.fromLTRB(16.w, 0, 16.w, 10.h), child: Column( children: [ @@ -80,15 +80,46 @@ class _OrderStatus extends State { ), Row( mainAxisAlignment:MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.center, children: [ - Text( - widget.title, - style: TextStyle( - color: Colors.white, - fontWeight: MyFontWeight.regular, - fontSize: 15.sp, - ), + Column( + mainAxisAlignment:MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + widget.title, + style: TextStyle( + color: Colors.white, + fontWeight: MyFontWeight.regular, + fontSize: 15.sp, + ), + ), + if(widget.title == S.of(context).shangjiazhengzaipeican) + Container( + margin: EdgeInsets.only(top:5), + padding: EdgeInsets.only(top:2,left:4,right:4,bottom:2), + decoration: BoxDecoration( + color: Color(0xFF32A060), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(15), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ), + ], + borderRadius: BorderRadius.circular(15), + ), + child: Text( + S.of(context).qudanhao(":" + widget.orderInfo.dayFlowCode), + style: TextStyle( + color:Colors.white, + fontWeight: MyFontWeight.regular, + fontSize: 14.sp, + ), + ), + ), + ], ), if(widget.payStatus != 0) Image.asset( diff --git a/lib/retrofit/data/invitation_list.dart b/lib/retrofit/data/invitation_list.dart new file mode 100644 index 00000000..3cc572a5 --- /dev/null +++ b/lib/retrofit/data/invitation_list.dart @@ -0,0 +1,57 @@ +/// mid : "1484477944838488064" +/// nickname : "回乡_888888" +/// avatar : "" +/// phone : "15447898756" +/// isFollow : null +/// createTime : "2022-01-21 18:48:17" + +class InvitationList { + InvitationList({ + String mid, + String nickname, + String avatar, + String phone, + dynamic isFollow, + String createTime,}){ + _mid = mid; + _nickname = nickname; + _avatar = avatar; + _phone = phone; + _isFollow = isFollow; + _createTime = createTime; +} + + InvitationList.fromJson(dynamic json) { + _mid = json['mid']; + _nickname = json['nickname']; + _avatar = json['avatar']; + _phone = json['phone']; + _isFollow = json['isFollow']; + _createTime = json['createTime']; + } + String _mid; + String _nickname; + String _avatar; + String _phone; + dynamic _isFollow; + String _createTime; + + String get mid => _mid; + String get nickname => _nickname; + String get avatar => _avatar; + String get phone => _phone; + dynamic get isFollow => _isFollow; + String get createTime => _createTime; + + Map toJson() { + final map = {}; + map['mid'] = _mid; + map['nickname'] = _nickname; + map['avatar'] = _avatar; + map['phone'] = _phone; + map['isFollow'] = _isFollow; + map['createTime'] = _createTime; + return map; + } + +} \ No newline at end of file diff --git a/lib/retrofit/data/user_info.dart b/lib/retrofit/data/user_info.dart index 51a39e55..751f6b72 100644 --- a/lib/retrofit/data/user_info.dart +++ b/lib/retrofit/data/user_info.dart @@ -36,6 +36,8 @@ class UserInfo { String points; bool isBind; String masterId; + int inviteNumber; + int todayInviteNumber; String masterCardRankName; MemberRank memberRankVo; @@ -58,6 +60,8 @@ class UserInfo { ..points = json['points'] as String ..isBind = json['isBind'] as bool ..masterId = json['masterId'] as String + ..inviteNumber = json['inviteNumber'] as int + ..todayInviteNumber = json['todayInviteNumber'] as int ..masterCardRankName = json['masterCardRankName'] as String ..memberRankVo = json['memberRankVo'] == null ? null @@ -81,6 +85,8 @@ class UserInfo { 'points': this.points, 'isBind': this.isBind, 'masterId': this.masterId, + "inviteNumber": this.inviteNumber, + "todayInviteNumber": this.todayInviteNumber, 'masterCardRankName': this.masterCardRankName, 'memberRankVo': this.memberRankVo == null ? "" : this.memberRankVo.toJson(), }; diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index 823d1620..ec58b78d 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -21,15 +21,15 @@ import 'data/shoppingCart.dart'; part 'min_api.g.dart'; -const base_url = "https://pos.api.lotus-wallet.com/app/"; ///正式 -const baseUrl = "https://pos.api.lotus-wallet.com/app/"; ///正式 +// const base_url = "https://pos.api.lotus-wallet.com/app/"; ///正式 +// const baseUrl = "https://pos.api.lotus-wallet.com/app/"; ///正式 // const base_url = "http://user.prod.kunqi.lotus-wallet.com/app/"; ///222 // const baseUrl = "http://user.prod.kunqi.lotus-wallet.com/app/"; ///222 -// const base_url = "http://192.168.10.236:8765/app/";///费韬 -// const baseUrl = "http://192.168.10.236:8765/app/";///费韬 +const base_url = "http://192.168.10.236:8765/app/";///费韬 +const baseUrl = "http://192.168.10.236:8765/app/";///费韬 // const base_url = "http://192.168.10.88:8765/app/";///詹云久 @@ -49,7 +49,7 @@ abstract class MinApiService { String token, String tenant, String storeId, - bool showLoading = true, + bool showLoading = false, }) { Map headers = (token == null || token == "") ? {} : {'token': "Bearer $token"}; diff --git a/lib/retrofit/min_api.g.dart b/lib/retrofit/min_api.g.dart index 02d9988a..1c1cc751 100644 --- a/lib/retrofit/min_api.g.dart +++ b/lib/retrofit/min_api.g.dart @@ -9,7 +9,7 @@ part of 'min_api.dart'; class _MinApiService implements MinApiService { _MinApiService(this._dio, {this.baseUrl}) { ArgumentError.checkNotNull(_dio, '_dio'); - baseUrl ??= 'https://pos.api.lotus-wallet.com/app/'; + baseUrl ??= 'http://192.168.10.236:8765/app/'; } final Dio _dio; diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index adc8711d..5c404dc9 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -33,6 +33,7 @@ import 'data/goods.dart'; import 'data/goods_category.dart'; import 'data/headlines_list.dart'; import 'data/headlines_list_details.dart'; +import 'data/invitation_list.dart'; import 'data/logistics.dart'; import 'data/member_comment_list.dart'; import 'data/message.dart'; @@ -54,17 +55,14 @@ import 'data/wx_pay.dart'; part 'retrofit_api.g.dart'; -const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///正式 -const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///正式 +// const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///正式 +// const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///正式 // const base_url = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222 // const baseUrl = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222 -// const base_url = "http://192.168.10.236:8766/app/"; ///费韬 -// const baseUrl = "http://192.168.10.236:8766/app/"; ///费韬 - -// const base_url = "http://192.168.10.159:8766/app/"; ///费韬 -// const baseUrl = "http://192.168.10.159:8766/app/"; ///费韬 +const base_url = "http://192.168.10.236:8766/app/"; ///费韬 +const baseUrl = "http://192.168.10.236:8766/app/"; ///费韬 // const base_url = "http://192.168.10.37:8766/app/"; // const baseUrl = "http://192.168.10.37:8766/app/"; @@ -80,14 +78,14 @@ abstract class ApiService { String baseUrl, BuildContext context, String token, - bool showLoading = true, + bool showLoading = false, bool pay = false, }) { Map headers = (token == null || token == "") ? {} : {'token': "Bearer $token"}; - // if (pay) { + if (pay) { headers["Environment"] = "app"; - // } + } dio.options = BaseOptions( connectTimeout: 60000, receiveTimeout: 60000, @@ -488,5 +486,8 @@ abstract class ApiService { @GET("/information/category/{id}") Future> headlinesDetails(@Path("id") String id); + /// 我的邀请会员列表 + @POST("/member/inviteMemberList") + Future>> inviteMemberList(@Body() Map map); } diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index 5735110a..fd2b2232 100644 --- a/lib/retrofit/retrofit_api.g.dart +++ b/lib/retrofit/retrofit_api.g.dart @@ -9,7 +9,7 @@ part of 'retrofit_api.dart'; class _ApiService implements ApiService { _ApiService(this._dio, {this.baseUrl}) { ArgumentError.checkNotNull(_dio, '_dio'); - baseUrl ??= 'https://pos.platform.lotus-wallet.com/app/'; + baseUrl ??= 'http://192.168.10.236:8766/app/'; } final Dio _dio; @@ -1801,4 +1801,31 @@ class _ApiService implements ApiService { return value; } + @override + Future>> inviteMemberList(map) async { + ArgumentError.checkNotNull(map, 'map'); + const _extra = {}; + final queryParameters = {}; + final _data = {}; + _data.addAll(map ?? {}); + final _result = await _dio.request>( + '/member/inviteMemberList', + queryParameters: queryParameters, + options: RequestOptions( + method: 'POST', + headers: {}, + extra: _extra, + baseUrl: baseUrl), + data: _data); + final value = BaseData>.fromJson( + _result.data, + (json) => PageInfo.fromJson( + json, + (json) => InvitationList.fromJson(json), + ), + ); + return value; + } + + }