Browse Source

增加邀请记录;

接口请求默认不要Loading
ff_new
w-R 3 years ago
parent
commit
9b3019fb89
  1. 1
      lib/article/hot_article_item.dart
  2. 2
      lib/home/home_page.dart
  3. 1
      lib/integral_store/integral_store_details_page.dart
  4. 129
      lib/main.dart
  5. 360
      lib/mine/invitation_record.dart
  6. 2
      lib/mine/mine_view/community_follow.dart
  7. 2
      lib/mine/mine_view/mine_item.dart
  8. 1
      lib/order/exchange_history_page.dart
  9. 1
      lib/order/order_history_page.dart
  10. 57
      lib/retrofit/data/invitation_list.dart
  11. 6
      lib/retrofit/data/user_info.dart
  12. 10
      lib/retrofit/min_api.dart
  13. 2
      lib/retrofit/min_api.g.dart
  14. 21
      lib/retrofit/retrofit_api.dart
  15. 29
      lib/retrofit/retrofit_api.g.dart

1
lib/article/hot_article_item.dart

@ -91,6 +91,7 @@ class _TouTiao extends State<TouTiao> {
Dio(), Dio(),
context: context, context: context,
token: value.getString("token"), token: value.getString("token"),
showLoading: true
); );
} }
BaseData<PageInfo<BannerData>> baseData = BaseData<PageInfo<BannerData>> baseData =

2
lib/home/home_page.dart

@ -267,8 +267,6 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
totalMsg += element.number; totalMsg += element.number;
}); });
}); });
// refreshController.loadComplete();
// refreshController.refreshCompleted();
} }
EasyLoading.dismiss(); EasyLoading.dismiss();
} }

1
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/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/custom_image.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:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';

129
lib/main.dart

@ -77,6 +77,7 @@ import 'home/guide_page.dart';
import 'home/home_view/activity_list.dart'; import 'home/home_view/activity_list.dart';
import 'main_page.dart'; import 'main_page.dart';
import 'message/system_details.dart'; import 'message/system_details.dart';
import 'mine/invitation_record.dart';
import 'mine/manage_address_page.dart'; import 'mine/manage_address_page.dart';
import 'mine/mine_view/community_follow.dart'; import 'mine/mine_view/community_follow.dart';
import 'mine/mine_vip/binding_assistant_card.dart'; import 'mine/mine_vip/binding_assistant_card.dart';
@ -170,72 +171,72 @@ class MyApp extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MediaQuery( return MediaQuery(
data: const MediaQueryData( data: const MediaQueryData(
size: Size(375, 812), 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),
),
), ),
localeResolutionCallback: (locale, supportedLocales) { child: ScreenUtilInit(
print("locale: $locale"); designSize: Size(375, 812),
print("supportedLocales: $supportedLocales"); builder: () => MaterialApp(
return appLocale ?? locale; debugShowCheckedModeBanner: false,
}, theme: ThemeData(
localizationsDelegates: [ primarySwatch: Colors.blue,
GlobalMaterialLocalizations.delegate, textTheme: TextTheme(
GlobalCupertinoLocalizations.delegate, button: TextStyle(fontSize: 24.sp),
GlobalWidgetsLocalizations.delegate, bodyText1: TextStyle(fontSize: 12.sp),
S.delegate bodyText2: TextStyle(fontSize: 16.sp),
],
localeListResolutionCallback:
(List<Locale> locales, Iterable<Locale> 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), ),
); localeResolutionCallback: (locale, supportedLocales) {
}, print("locale: $locale");
), print("supportedLocales: $supportedLocales");
onGenerateRoute: (settings) { return appLocale ?? locale;
final String name = settings.name; },
final Function pageContentBuilder = routers[name]; localizationsDelegates: [
if (pageContentBuilder != null) { GlobalMaterialLocalizations.delegate,
final Route route = CupertinoPageRoute( GlobalCupertinoLocalizations.delegate,
builder: (context) { GlobalWidgetsLocalizations.delegate,
return pageContentBuilder(context, S.delegate
arguments: settings.arguments); ],
localeListResolutionCallback:
(List<Locale> locales, Iterable<Locale> 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, ),
); onGenerateRoute: (settings) {
return route; final String name = settings.name;
} final Function pageContentBuilder = routers[name];
return MaterialPageRoute( if (pageContentBuilder != null) {
// final Route route = CupertinoPageRoute(
builder: (context) { builder: (context) {
return LoginPage(); 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<String, WidgetBuilder> routers = <String, WidgetBuilder>{
'/router/photo_view_gallery_screen': (context, {arguments}) => '/router/photo_view_gallery_screen': (context, {arguments}) =>
PhotoViewGalleryScreen(), PhotoViewGalleryScreen(),
'/router/system_details': (context, {arguments}) => '/router/system_details': (context, {arguments}) =>
SystemDetails(arguments:arguments), SystemDetails(arguments: arguments),
'/router/invitation_record': (context, {arguments}) =>
InvitationRecord(),
}; };

360
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<StatefulWidget> createState() {
return _InvitationRecord();
}
}
class _InvitationRecord extends State<InvitationRecord>
with AutomaticKeepAliveClientMixin {
ApiService apiService;
RefreshController _refreshController = RefreshController();
List<InvitationList> 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<PageInfo<InvitationList>> 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<UserInfo> 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;
}

2
lib/mine/mine_view/community_follow.dart

@ -38,7 +38,7 @@ class _CommunityFollow extends State<CommunityFollow>
Dio(), Dio(),
context: context, context: context,
token: value.getString("token"), token: value.getString("token"),
showLoading: false, showLoading: true
); );
BaseData<SocialInfo> baseData = BaseData<SocialInfo> baseData =

2
lib/mine/mine_view/mine_item.dart

@ -144,7 +144,7 @@ class _MineItem extends State<MineItem> {
),), ),),
Expanded(child:InkWell( Expanded(child:InkWell(
onTap: () { onTap: () {
Navigator.of(context).pushNamed('/router/qr_share', arguments: {}); Navigator.of(context).pushNamed('/router/invitation_record', arguments: {});
}, },
child: mineItem( child: mineItem(
"邀请记录", "邀请记录",

1
lib/order/exchange_history_page.dart

@ -128,6 +128,7 @@ class _ExchangeHistoryList extends State<ExchangeHistoryList> {
super.initState(); super.initState();
SharedPreferences.getInstance().then((value) => { SharedPreferences.getInstance().then((value) => {
apiService = ApiService(Dio(), apiService = ApiService(Dio(),
showLoading: true,
context: context, token: value.getString('token')), context: context, token: value.getString('token')),
queryHistory(), queryHistory(),
}); });

1
lib/order/order_history_page.dart

@ -213,6 +213,7 @@ class _OrderHistoryList extends State<OrderHistoryList>
SharedPreferences.getInstance().then((value) => { SharedPreferences.getInstance().then((value) => {
apiService = ApiService(Dio(), apiService = ApiService(Dio(),
showLoading: true,
context: context, token: value.getString("token")), context: context, token: value.getString("token")),
queryOrder(), queryOrder(),
}); });

57
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<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['mid'] = _mid;
map['nickname'] = _nickname;
map['avatar'] = _avatar;
map['phone'] = _phone;
map['isFollow'] = _isFollow;
map['createTime'] = _createTime;
return map;
}
}

6
lib/retrofit/data/user_info.dart

@ -36,6 +36,8 @@ class UserInfo {
String points; String points;
bool isBind; bool isBind;
String masterId; String masterId;
int inviteNumber;
int todayInviteNumber;
String masterCardRankName; String masterCardRankName;
MemberRank memberRankVo; MemberRank memberRankVo;
@ -58,6 +60,8 @@ class UserInfo {
..points = json['points'] as String ..points = json['points'] as String
..isBind = json['isBind'] as bool ..isBind = json['isBind'] as bool
..masterId = json['masterId'] as String ..masterId = json['masterId'] as String
..inviteNumber = json['inviteNumber'] as int
..todayInviteNumber = json['todayInviteNumber'] as int
..masterCardRankName = json['masterCardRankName'] as String ..masterCardRankName = json['masterCardRankName'] as String
..memberRankVo = json['memberRankVo'] == null ..memberRankVo = json['memberRankVo'] == null
? null ? null
@ -81,6 +85,8 @@ class UserInfo {
'points': this.points, 'points': this.points,
'isBind': this.isBind, 'isBind': this.isBind,
'masterId': this.masterId, 'masterId': this.masterId,
"inviteNumber": this.inviteNumber,
"todayInviteNumber": this.todayInviteNumber,
'masterCardRankName': this.masterCardRankName, 'masterCardRankName': this.masterCardRankName,
'memberRankVo': this.memberRankVo == null ? "" : this.memberRankVo.toJson(), 'memberRankVo': this.memberRankVo == null ? "" : this.memberRankVo.toJson(),
}; };

10
lib/retrofit/min_api.dart

@ -28,12 +28,12 @@ part 'min_api.g.dart';
// const base_url = "http://user.prod.kunqi.lotus-wallet.com/app/"; ///222 // const base_url = "http://user.prod.kunqi.lotus-wallet.com/app/"; ///222
// const baseUrl = "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 base_url = "http://192.168.10.236:8765/app/";///
// const baseUrl = "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/";/// // const base_url = "http://192.168.10.88:8765/app/";///
const baseUrl = "http://192.168.10.88:8765/app/";/// // const baseUrl = "http://192.168.10.88:8765/app/";///
// const base_url = "http://192.168.10.37:8766/app/"; // const base_url = "http://192.168.10.37:8766/app/";
@ -49,7 +49,7 @@ abstract class MinApiService {
String token, String token,
String tenant, String tenant,
String storeId, String storeId,
bool showLoading = true, bool showLoading = false,
}) { }) {
Map<String, dynamic> headers = Map<String, dynamic> headers =
(token == null || token == "") ? {} : {'token': "Bearer $token"}; (token == null || token == "") ? {} : {'token': "Bearer $token"};

2
lib/retrofit/min_api.g.dart

@ -9,7 +9,7 @@ part of 'min_api.dart';
class _MinApiService implements MinApiService { class _MinApiService implements MinApiService {
_MinApiService(this._dio, {this.baseUrl}) { _MinApiService(this._dio, {this.baseUrl}) {
ArgumentError.checkNotNull(_dio, '_dio'); ArgumentError.checkNotNull(_dio, '_dio');
baseUrl ??= 'http://192.168.10.88:8765/app/'; baseUrl ??= 'http://192.168.10.236:8765/app/';
} }
final Dio _dio; final Dio _dio;

21
lib/retrofit/retrofit_api.dart

@ -33,6 +33,7 @@ import 'data/goods.dart';
import 'data/goods_category.dart'; import 'data/goods_category.dart';
import 'data/headlines_list.dart'; import 'data/headlines_list.dart';
import 'data/headlines_list_details.dart'; import 'data/headlines_list_details.dart';
import 'data/invitation_list.dart';
import 'data/logistics.dart'; import 'data/logistics.dart';
import 'data/member_comment_list.dart'; import 'data/member_comment_list.dart';
import 'data/message.dart'; import 'data/message.dart';
@ -60,18 +61,15 @@ part 'retrofit_api.g.dart';
// const base_url = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222 // const base_url = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222
// const baseUrl = "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 base_url = "http://192.168.10.236:8766/app/"; ///
// const baseUrl = "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.37:8766/app/"; // const base_url = "http://192.168.10.37:8766/app/";
// const baseUrl = "http://192.168.10.37:8766/app/"; // const baseUrl = "http://192.168.10.37:8766/app/";
const base_url = "http://192.168.10.88:8766/app/";/// // const base_url = "http://192.168.10.88:8766/app/";///
const baseUrl = "http://192.168.10.88:8766/app/";/// // const baseUrl = "http://192.168.10.88:8766/app/";///
@RestApi(baseUrl: baseUrl) @RestApi(baseUrl: baseUrl)
abstract class ApiService { abstract class ApiService {
@ -80,14 +78,14 @@ abstract class ApiService {
String baseUrl, String baseUrl,
BuildContext context, BuildContext context,
String token, String token,
bool showLoading = true, bool showLoading = false,
bool pay = false, bool pay = false,
}) { }) {
Map<String, dynamic> headers = Map<String, dynamic> headers =
(token == null || token == "") ? {} : {'token': "Bearer $token"}; (token == null || token == "") ? {} : {'token': "Bearer $token"};
// if (pay) { if (pay) {
headers["Environment"] = "app"; headers["Environment"] = "app";
// } }
dio.options = BaseOptions( dio.options = BaseOptions(
connectTimeout: 60000, connectTimeout: 60000,
receiveTimeout: 60000, receiveTimeout: 60000,
@ -488,5 +486,8 @@ abstract class ApiService {
@GET("/information/category/{id}") @GET("/information/category/{id}")
Future<BaseData<HeadlinesListDetails>> headlinesDetails(@Path("id") String id); Future<BaseData<HeadlinesListDetails>> headlinesDetails(@Path("id") String id);
///
@POST("/member/inviteMemberList")
Future<BaseData<PageInfo<InvitationList>>> inviteMemberList(@Body() Map<String, dynamic> map);
} }

29
lib/retrofit/retrofit_api.g.dart

@ -9,7 +9,7 @@ part of 'retrofit_api.dart';
class _ApiService implements ApiService { class _ApiService implements ApiService {
_ApiService(this._dio, {this.baseUrl}) { _ApiService(this._dio, {this.baseUrl}) {
ArgumentError.checkNotNull(_dio, '_dio'); ArgumentError.checkNotNull(_dio, '_dio');
baseUrl ??= 'http://192.168.10.88:8766/app/'; baseUrl ??= 'http://192.168.10.236:8766/app/';
} }
final Dio _dio; final Dio _dio;
@ -1801,4 +1801,31 @@ class _ApiService implements ApiService {
return value; return value;
} }
@override
Future<BaseData<PageInfo<InvitationList>>> inviteMemberList(map) async {
ArgumentError.checkNotNull(map, 'map');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(map ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'/member/inviteMemberList',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<PageInfo<InvitationList>>.fromJson(
_result.data,
(json) => PageInfo<InvitationList>.fromJson(
json,
(json) => InvitationList.fromJson(json),
),
);
return value;
}
} }

Loading…
Cancel
Save