Browse Source

Merge remote-tracking branch 'origin/remove_uniapp' into remove_uniapp

ff_new
fmk 3 years ago
parent
commit
90c0b99d45
  1. BIN
      assets/image/2x/yao_q.png
  2. BIN
      assets/image/3x/yao_q.png
  3. BIN
      assets/image/yao_q.png
  4. 1
      lib/article/hot_article_item.dart
  5. 2
      lib/home/home_page.dart
  6. 1
      lib/integral_store/integral_store_details_page.dart
  7. 129
      lib/main.dart
  8. 360
      lib/mine/invitation_record.dart
  9. 2
      lib/mine/mine_view/community_follow.dart
  10. 35
      lib/mine/mine_view/mine_item.dart
  11. 2
      lib/mine/recharge_page.dart
  12. 1
      lib/order/exchange_history_page.dart
  13. 4
      lib/order/order_detail_page.dart
  14. 1
      lib/order/order_history_page.dart
  15. 7
      lib/order/order_view/order_info.dart
  16. 49
      lib/order/order_view/order_status.dart
  17. 57
      lib/retrofit/data/invitation_list.dart
  18. 6
      lib/retrofit/data/user_info.dart
  19. 10
      lib/retrofit/min_api.dart
  20. 2
      lib/retrofit/min_api.g.dart
  21. 21
      lib/retrofit/retrofit_api.dart
  22. 29
      lib/retrofit/retrofit_api.g.dart

BIN
assets/image/2x/yao_q.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
assets/image/3x/yao_q.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
assets/image/yao_q.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

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 =

35
lib/mine/mine_view/mine_item.dart

@ -131,17 +131,30 @@ class _MineItem extends State<MineItem> {
),) ),)
], ],
), ),
Padding(padding:EdgeInsets.only(left:24), Row(
child: InkWell( children: [
onTap: () { Expanded(child:InkWell(
Navigator.of(context).pushNamed('/router/qr_share', arguments: {}); onTap: () {
}, Navigator.of(context).pushNamed('/router/qr_share', arguments: {});
child: mineItem( },
S.of(context).tuiguangma, child: mineItem(
"assets/image/icon_mine_promotion_code.png", 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( // mineItem(
// S.of(context).bangzhuyufankui, // S.of(context).bangzhuyufankui,
// "assets/image/icon_mine_feedback.png", // "assets/image/icon_mine_feedback.png",

2
lib/mine/recharge_page.dart

@ -382,7 +382,7 @@ class _RechargePage extends State<RechargePage> {
int amount = int.tryParse(money); int amount = int.tryParse(money);
if (checkIndex == 1) { if (checkIndex == 1) {
if (amount < 100) { if (amount < 100) {
SmartDialog.showToast(S.of(context).chongzhizuixiaojine(0.001), SmartDialog.showToast(S.of(context).chongzhizuixiaojine(100),
alignment: Alignment.center); alignment: Alignment.center);
return; return;
} }

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(),
}); });

4
lib/order/order_detail_page.dart

@ -40,6 +40,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
SharedPreferences.getInstance().then((value) { SharedPreferences.getInstance().then((value) {
apiService = ApiService( apiService = ApiService(
Dio(), Dio(),
showLoading: true,
context: context, context: context,
token: value.getString("token"), token: value.getString("token"),
); );
@ -66,6 +67,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
); );
minService = MinApiService( minService = MinApiService(
Dio(), Dio(),
showLoading:true,
context: context, context: context,
token: minToken, token: minToken,
tenant: tenant, tenant: tenant,
@ -173,7 +175,7 @@ class _OrderDetailPage extends State<OrderDetailPage> {
OrderCommodity(orderInfo), OrderCommodity(orderInfo),
/// ///
OrderInfoView(orderInfo), OrderInfoView(orderInfo,isTakeOut),
Container( Container(
height: 42.h, height: 42.h,

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(),
}); });

7
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'; import 'package:huixiang/utils/font_weight.dart';
class OrderInfoView extends StatefulWidget { class OrderInfoView extends StatefulWidget {
final OrderInfo orderInfo; final OrderInfo orderInfo;
final int isTakeOut;
OrderInfoView(this.orderInfo); OrderInfoView(this.orderInfo,this.isTakeOut);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -45,7 +45,8 @@ class _OrderInfoView extends State<OrderInfoView> {
S.of(context).dingdanhao, widget.orderInfo != null ? widget.orderInfo.id : ""), S.of(context).dingdanhao, widget.orderInfo != null ? widget.orderInfo.id : ""),
orderInfoItem(S.of(context).xiadanshijian, orderInfoItem(S.of(context).xiadanshijian,
widget.orderInfo != null ? widget.orderInfo.createTime : ""), 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).peisongfangshi,"美团配送"),
orderInfoItem( orderInfoItem(
S.of(context).beizhuxinxi, S.of(context).beizhuxinxi,

49
lib/order/order_view/order_status.dart

@ -33,7 +33,7 @@ class _OrderStatus extends State<OrderStatus> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( 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), padding: EdgeInsets.fromLTRB(16.w, 0, 16.w, 10.h),
child: Column( child: Column(
children: [ children: [
@ -80,15 +80,46 @@ class _OrderStatus extends State<OrderStatus> {
), ),
Row( Row(
mainAxisAlignment:MainAxisAlignment.spaceBetween, mainAxisAlignment:MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Text( Column(
widget.title, mainAxisAlignment:MainAxisAlignment.spaceBetween,
style: TextStyle( crossAxisAlignment: CrossAxisAlignment.start,
color: Colors.white, children: [
fontWeight: MyFontWeight.regular, Text(
fontSize: 15.sp, 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) if(widget.payStatus != 0)
Image.asset( Image.asset(

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

@ -21,15 +21,15 @@ import 'data/shoppingCart.dart';
part 'min_api.g.dart'; part 'min_api.g.dart';
const base_url = "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 baseUrl = "https://pos.api.lotus-wallet.com/app/"; ///
// 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/";///
@ -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 ??= 'https://pos.api.lotus-wallet.com/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';
@ -54,17 +55,14 @@ import 'data/wx_pay.dart';
part 'retrofit_api.g.dart'; part 'retrofit_api.g.dart';
const base_url = "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 baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///
// 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/";
@ -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 ??= 'https://pos.platform.lotus-wallet.com/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