Browse Source

邀请码分享更改;

登录页增加邀请码;
首页增加邀请成功弹窗;
ff_new
w-R 3 years ago
parent
commit
43d001ad7f
  1. 13
      lib/home/home_page.dart
  2. 8
      lib/login/login_page.dart
  3. 9
      lib/main_page.dart
  4. 6
      lib/mine/coupons_page.dart
  5. 371
      lib/retrofit/data/login_info.dart
  6. 3
      lib/retrofit/retrofit_api.dart
  7. 30
      lib/retrofit/retrofit_api.g.dart
  8. 35
      lib/view_widget/invite_success_dialog.dart

13
lib/home/home_page.dart

@ -20,6 +20,7 @@ import 'package:huixiang/retrofit/data/brand.dart';
import 'package:huixiang/retrofit/data/founder.dart'; import 'package:huixiang/retrofit/data/founder.dart';
import 'package:huixiang/retrofit/data/goods.dart'; import 'package:huixiang/retrofit/data/goods.dart';
import 'package:huixiang/retrofit/data/goods_category.dart'; import 'package:huixiang/retrofit/data/goods_category.dart';
import 'package:huixiang/retrofit/data/login_info.dart';
import 'package:huixiang/retrofit/data/page.dart'; import 'package:huixiang/retrofit/data/page.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/event_type.dart'; import 'package:huixiang/utils/event_type.dart';
@ -37,8 +38,9 @@ import 'home_view/shortcut_operation.dart';
class HomePage extends StatefulWidget { class HomePage extends StatefulWidget {
final Function changeTab; final Function changeTab;
final String invite; final String invite;
final List<CouponList> couponList;
HomePage(this.changeTab, {this.invite}); HomePage(this.changeTab, {this.invite,this.couponList});
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -59,17 +61,18 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
} }
}); });
if((widget.invite??"") != "") if((widget.invite??"") != "" || widget.couponList != null
&& widget.couponList.length > 0)
showInvite = true; showInvite = true;
} }
/// ///
inviteShowAlertDialog(invite) { inviteShowAlertDialog(invite,CouponList couponList) {
// //
showDialog( showDialog(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return InviteSuccessDialog(invite); return InviteSuccessDialog(invite,couponList);
}, },
); );
} }
@ -212,7 +215,7 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
} }
EasyLoading.dismiss(); EasyLoading.dismiss();
if(showInvite){ if(showInvite){
inviteShowAlertDialog(widget.invite); inviteShowAlertDialog(widget.invite,widget.couponList[0]);
showInvite = false; showInvite = false;
} }

8
lib/login/login_page.dart

@ -7,6 +7,7 @@ import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/main.dart'; import 'package:huixiang/main.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/login_info.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/retrofit/data/user_entity.dart'; import 'package:huixiang/retrofit/data/user_entity.dart';
import 'package:huixiang/utils/event_type.dart'; import 'package:huixiang/utils/event_type.dart';
@ -61,7 +62,6 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
Animation<double> doubleAnimation; Animation<double> doubleAnimation;
bool invitationCode = true; bool invitationCode = true;
isLogin() async { isLogin() async {
SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
@ -329,19 +329,19 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
"invite":invite, "invite":invite,
}; };
EasyLoading.show(status: S.of(context).zhengzaijiazai); EasyLoading.show(status: S.of(context).zhengzaijiazai);
BaseData value = await client.memberLogin(param).catchError((error) { BaseData<LoginInfo> value = await client.memberLogin(param).catchError((error) {
print(error); print(error);
SmartDialog.showToast("$error", alignment: Alignment.center); SmartDialog.showToast("$error", alignment: Alignment.center);
}); });
EasyLoading.show(status: S.of(context).zhengzaijiazai); EasyLoading.show(status: S.of(context).zhengzaijiazai);
Future.delayed(Duration(seconds:2), () { Future.delayed(Duration(seconds:2), () {
if (value !=null && value.isSuccess) { if (value !=null && value.isSuccess) {
saveUserJson(value.data); saveUserJson(value.data.authInfo.toJson());
eventBus.fire(EventType(3)); eventBus.fire(EventType(3));
Navigator.of(context).pushNamedAndRemoveUntil( Navigator.of(context).pushNamedAndRemoveUntil(
'/router/main_page', '/router/main_page',
(route) => false,arguments:{"invite":invite}); (route) => false,arguments:{"invite":invite,"couponList":value.data.couponList});
EasyLoading.dismiss(); EasyLoading.dismiss();
} else { } else {

9
lib/main_page.dart

@ -10,6 +10,7 @@ import 'package:huixiang/home/home_page.dart';
import 'package:huixiang/main.dart'; import 'package:huixiang/main.dart';
import 'package:huixiang/mine/mine_page.dart'; import 'package:huixiang/mine/mine_page.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/login_info.dart';
import 'package:huixiang/retrofit/data/user_info.dart'; 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/union/union_page.dart'; import 'package:huixiang/union/union_page.dart';
@ -18,7 +19,6 @@ import 'package:huixiang/utils/bridge.dart';
import 'package:huixiang/utils/event_type.dart'; import 'package:huixiang/utils/event_type.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/utils/native_event_handler.dart'; import 'package:huixiang/utils/native_event_handler.dart';
import 'package:huixiang/view_widget/invite_success_dialog.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:tpns_flutter_plugin/tpns_flutter_plugin.dart'; import 'package:tpns_flutter_plugin/tpns_flutter_plugin.dart';
@ -82,9 +82,12 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
pushRoute(); pushRoute();
String invite = ""; String invite = "";
var couponList;
if(widget.arguments != null && (widget.arguments["invite"]??"") != ""){ if(widget.arguments != null && (widget.arguments["invite"]??"") != ""
&& widget.arguments["couponList"] != null ){
invite = widget.arguments["invite"]; invite = widget.arguments["invite"];
couponList = widget.arguments["couponList"];
} }
_widgetOptions = <Widget>[ _widgetOptions = <Widget>[
// BrandPage(), // BrandPage(),
@ -92,7 +95,7 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
setState(() { setState(() {
pageController.jumpToPage(index); pageController.jumpToPage(index);
}); });
},invite:invite), },invite:invite,couponList:couponList),
// MainHomePage(), // MainHomePage(),
UnionPage(), UnionPage(),
CommunityPage(), CommunityPage(),

6
lib/mine/coupons_page.dart

@ -180,15 +180,13 @@ class _CouponsPage extends State<CouponsPage> {
"coupon": coupons[position].toJson(), "coupon": coupons[position].toJson(),
}); });
} else { } else {
showStoreSelector( showStoreSelector(coupons[position].storeList);
coupons[position].storeList);
} }
} }
}, },
() { () {
setState(() { setState(() {
coupons[position].isEx = coupons[position].isEx = !coupons[position].isEx;
!coupons[position].isEx;
}); });
}, },
type: 0, type: 0,

371
lib/retrofit/data/login_info.dart

@ -0,0 +1,371 @@
/// authInfo : {"token":"eyJ0eXAiOiJKc29uV2ViVG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX3R5cGUiOiJQTEFURk9STV9BUFAiLCJuYW1lIjoi5pav5Z-65LuUIiwidG9rZW5fdHlwZSI6InRva2VuIiwidXNlcmlkIjoiMTQ2Mzc1MTMwMjYzNzk0NDgzMiIsImFjY291bnQiOiIxNTM5Mjk0OTA5NyIsImV4cCI6MTY0MTAwMzg4NSwibmJmIjoxNjM4NDExODg1fQ.3ioTF8ofxKeoIlT_KriPHjjpJVzB3orh6rNCYrN5auA","tokenType":"token","refreshToken":"eyJ0eXAiOiJKc29uV2ViVG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaF90b2tlbiIsInVzZXJpZCI6IjE0NjM3NTEzMDI2Mzc5NDQ4MzIiLCJleHAiOjE2NDEwMDM4ODUsIm5iZiI6MTYzODQxMTg4NX0.kePPEJDAKhgGyJRzlo4OvZ_OWPYi4O6RFWsSc7cdmhU","name":"斯基仔","account":"15392949097","avatar":null,"workDescribe":null,"userId":"1463751302637944832","userType":"PLATFORM_APP","expire":"2592000","expiration":"2022-01-01 10:24:45","mobile":"15392949097"}
/// couponList : [{"id":"1463398002331746304","createTime":"2021-11-24 14:44:07","createUser":"1333246101196636160","updateTime":"2021-11-24 14:44:07","updateUser":"1333246101196636160","storeId":"0","couponName":"满10-2","bizType":1,"allProduct":true,"productSkuId":[],"fullAmount":"10.00","discountAmount":"2.00","fullNumber":1,"discountPercent":100,"sellPrice":"0.00","sellCount":0,"bizId":"","publishStartTime":"2021-11-24 12:00:00","publishEndTime":"2021-11-30 12:00:00","useStartTime":"2021-11-24 12:00:00","useEndTime":"2021-11-30 12:00:00","promotionId":"0","dateOrDay":false,"startAfterDays":0,"daysValidate":0,"centreDisplay":true,"tenantCode":"1175","isDelete":0,"storeName":"海峡姐妹奶茶店","number":1}]
class LoginInfo {
LoginInfo({
AuthInfo authInfo,
List<CouponList> couponList,}){
_authInfo = authInfo;
_couponList = couponList;
}
LoginInfo.fromJson(dynamic json) {
_authInfo = json['authInfo'] != null ? AuthInfo.fromJson(json['authInfo']) : null;
if (json['couponList'] != null) {
_couponList = [];
json['couponList'].forEach((v) {
_couponList.add(CouponList.fromJson(v));
});
}
}
AuthInfo _authInfo;
List<CouponList> _couponList;
AuthInfo get authInfo => _authInfo;
List<CouponList> get couponList => _couponList;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
if (_authInfo != null) {
map['authInfo'] = _authInfo.toJson();
}
if (_couponList != null) {
map['couponList'] = _couponList.map((v) => v.toJson()).toList();
}
return map;
}
}
/// id : "1463398002331746304"
/// createTime : "2021-11-24 14:44:07"
/// createUser : "1333246101196636160"
/// updateTime : "2021-11-24 14:44:07"
/// updateUser : "1333246101196636160"
/// storeId : "0"
/// couponName : "满10-2"
/// bizType : 1
/// allProduct : true
/// productSkuId : []
/// fullAmount : "10.00"
/// discountAmount : "2.00"
/// fullNumber : 1
/// discountPercent : 100
/// sellPrice : "0.00"
/// sellCount : 0
/// bizId : ""
/// publishStartTime : "2021-11-24 12:00:00"
/// publishEndTime : "2021-11-30 12:00:00"
/// useStartTime : "2021-11-24 12:00:00"
/// useEndTime : "2021-11-30 12:00:00"
/// promotionId : "0"
/// dateOrDay : false
/// startAfterDays : 0
/// daysValidate : 0
/// centreDisplay : true
/// tenantCode : "1175"
/// isDelete : 0
/// storeName : "海峡姐妹奶茶店"
/// number : 1
class CouponList {
CouponList({
String id,
String createTime,
String createUser,
String updateTime,
String updateUser,
String storeId,
String couponName,
int bizType,
bool allProduct,
// List<dynamic> productSkuId,
String fullAmount,
String discountAmount,
int fullNumber,
int discountPercent,
String sellPrice,
int sellCount,
String bizId,
String publishStartTime,
String publishEndTime,
String useStartTime,
String useEndTime,
String promotionId,
bool dateOrDay,
int startAfterDays,
int daysValidate,
bool centreDisplay,
String tenantCode,
int isDelete,
String storeName,
int number,}){
_id = id;
_createTime = createTime;
_createUser = createUser;
_updateTime = updateTime;
_updateUser = updateUser;
_storeId = storeId;
_couponName = couponName;
_bizType = bizType;
_allProduct = allProduct;
// _productSkuId = productSkuId;
_fullAmount = fullAmount;
_discountAmount = discountAmount;
_fullNumber = fullNumber;
_discountPercent = discountPercent;
_sellPrice = sellPrice;
_sellCount = sellCount;
_bizId = bizId;
_publishStartTime = publishStartTime;
_publishEndTime = publishEndTime;
_useStartTime = useStartTime;
_useEndTime = useEndTime;
_promotionId = promotionId;
_dateOrDay = dateOrDay;
_startAfterDays = startAfterDays;
_daysValidate = daysValidate;
_centreDisplay = centreDisplay;
_tenantCode = tenantCode;
_isDelete = isDelete;
_storeName = storeName;
_number = number;
}
CouponList.fromJson(dynamic json) {
_id = json['id'];
_createTime = json['createTime'];
_createUser = json['createUser'];
_updateTime = json['updateTime'];
_updateUser = json['updateUser'];
_storeId = json['storeId'];
_couponName = json['couponName'];
_bizType = json['bizType'];
_allProduct = json['allProduct'];
// if (json['productSkuId'] != null) {
// _productSkuId = [];
// json['productSkuId'].forEach((v) {
// _productSkuId.add(dynamic.fromJson(v));
// });
// }
_fullAmount = json['fullAmount'];
_discountAmount = json['discountAmount'];
_fullNumber = json['fullNumber'];
_discountPercent = json['discountPercent'];
_sellPrice = json['sellPrice'];
_sellCount = json['sellCount'];
_bizId = json['bizId'];
_publishStartTime = json['publishStartTime'];
_publishEndTime = json['publishEndTime'];
_useStartTime = json['useStartTime'];
_useEndTime = json['useEndTime'];
_promotionId = json['promotionId'];
_dateOrDay = json['dateOrDay'];
_startAfterDays = json['startAfterDays'];
_daysValidate = json['daysValidate'];
_centreDisplay = json['centreDisplay'];
_tenantCode = json['tenantCode'];
_isDelete = json['isDelete'];
_storeName = json['storeName'];
_number = json['number'];
}
String _id;
String _createTime;
String _createUser;
String _updateTime;
String _updateUser;
String _storeId;
String _couponName;
int _bizType;
bool _allProduct;
// List<dynamic> _productSkuId;
String _fullAmount;
String _discountAmount;
int _fullNumber;
int _discountPercent;
String _sellPrice;
int _sellCount;
String _bizId;
String _publishStartTime;
String _publishEndTime;
String _useStartTime;
String _useEndTime;
String _promotionId;
bool _dateOrDay;
int _startAfterDays;
int _daysValidate;
bool _centreDisplay;
String _tenantCode;
int _isDelete;
String _storeName;
int _number;
String get id => _id;
String get createTime => _createTime;
String get createUser => _createUser;
String get updateTime => _updateTime;
String get updateUser => _updateUser;
String get storeId => _storeId;
String get couponName => _couponName;
int get bizType => _bizType;
bool get allProduct => _allProduct;
// List<dynamic> get productSkuId => _productSkuId;
String get fullAmount => _fullAmount;
String get discountAmount => _discountAmount;
int get fullNumber => _fullNumber;
int get discountPercent => _discountPercent;
String get sellPrice => _sellPrice;
int get sellCount => _sellCount;
String get bizId => _bizId;
String get publishStartTime => _publishStartTime;
String get publishEndTime => _publishEndTime;
String get useStartTime => _useStartTime;
String get useEndTime => _useEndTime;
String get promotionId => _promotionId;
bool get dateOrDay => _dateOrDay;
int get startAfterDays => _startAfterDays;
int get daysValidate => _daysValidate;
bool get centreDisplay => _centreDisplay;
String get tenantCode => _tenantCode;
int get isDelete => _isDelete;
String get storeName => _storeName;
int get number => _number;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = _id;
map['createTime'] = _createTime;
map['createUser'] = _createUser;
map['updateTime'] = _updateTime;
map['updateUser'] = _updateUser;
map['storeId'] = _storeId;
map['couponName'] = _couponName;
map['bizType'] = _bizType;
map['allProduct'] = _allProduct;
// if (_productSkuId != null) {
// map['productSkuId'] = _productSkuId.map((v) => v.toJson()).toList();
// }
map['fullAmount'] = _fullAmount;
map['discountAmount'] = _discountAmount;
map['fullNumber'] = _fullNumber;
map['discountPercent'] = _discountPercent;
map['sellPrice'] = _sellPrice;
map['sellCount'] = _sellCount;
map['bizId'] = _bizId;
map['publishStartTime'] = _publishStartTime;
map['publishEndTime'] = _publishEndTime;
map['useStartTime'] = _useStartTime;
map['useEndTime'] = _useEndTime;
map['promotionId'] = _promotionId;
map['dateOrDay'] = _dateOrDay;
map['startAfterDays'] = _startAfterDays;
map['daysValidate'] = _daysValidate;
map['centreDisplay'] = _centreDisplay;
map['tenantCode'] = _tenantCode;
map['isDelete'] = _isDelete;
map['storeName'] = _storeName;
map['number'] = _number;
return map;
}
}
/// token : "eyJ0eXAiOiJKc29uV2ViVG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX3R5cGUiOiJQTEFURk9STV9BUFAiLCJuYW1lIjoi5pav5Z-65LuUIiwidG9rZW5fdHlwZSI6InRva2VuIiwidXNlcmlkIjoiMTQ2Mzc1MTMwMjYzNzk0NDgzMiIsImFjY291bnQiOiIxNTM5Mjk0OTA5NyIsImV4cCI6MTY0MTAwMzg4NSwibmJmIjoxNjM4NDExODg1fQ.3ioTF8ofxKeoIlT_KriPHjjpJVzB3orh6rNCYrN5auA"
/// tokenType : "token"
/// refreshToken : "eyJ0eXAiOiJKc29uV2ViVG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaF90b2tlbiIsInVzZXJpZCI6IjE0NjM3NTEzMDI2Mzc5NDQ4MzIiLCJleHAiOjE2NDEwMDM4ODUsIm5iZiI6MTYzODQxMTg4NX0.kePPEJDAKhgGyJRzlo4OvZ_OWPYi4O6RFWsSc7cdmhU"
/// name : "斯基仔"
/// account : "15392949097"
/// avatar : null
/// workDescribe : null
/// userId : "1463751302637944832"
/// userType : "PLATFORM_APP"
/// expire : "2592000"
/// expiration : "2022-01-01 10:24:45"
/// mobile : "15392949097"
class AuthInfo {
AuthInfo({
String token,
String tokenType,
String refreshToken,
String name,
String account,
dynamic avatar,
dynamic workDescribe,
String userId,
String userType,
String expire,
String expiration,
String mobile,}){
_token = token;
_tokenType = tokenType;
_refreshToken = refreshToken;
_name = name;
_account = account;
_avatar = avatar;
_workDescribe = workDescribe;
_userId = userId;
_userType = userType;
_expire = expire;
_expiration = expiration;
_mobile = mobile;
}
AuthInfo.fromJson(dynamic json) {
_token = json['token'];
_tokenType = json['tokenType'];
_refreshToken = json['refreshToken'];
_name = json['name'];
_account = json['account'];
_avatar = json['avatar'];
_workDescribe = json['workDescribe'];
_userId = json['userId'];
_userType = json['userType'];
_expire = json['expire'];
_expiration = json['expiration'];
_mobile = json['mobile'];
}
String _token;
String _tokenType;
String _refreshToken;
String _name;
String _account;
dynamic _avatar;
dynamic _workDescribe;
String _userId;
String _userType;
String _expire;
String _expiration;
String _mobile;
String get token => _token;
String get tokenType => _tokenType;
String get refreshToken => _refreshToken;
String get name => _name;
String get account => _account;
dynamic get avatar => _avatar;
dynamic get workDescribe => _workDescribe;
String get userId => _userId;
String get userType => _userType;
String get expire => _expire;
String get expiration => _expiration;
String get mobile => _mobile;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['token'] = _token;
map['tokenType'] = _tokenType;
map['refreshToken'] = _refreshToken;
map['name'] = _name;
map['account'] = _account;
map['avatar'] = _avatar;
map['workDescribe'] = _workDescribe;
map['userId'] = _userId;
map['userType'] = _userType;
map['expire'] = _expire;
map['expiration'] = _expiration;
map['mobile'] = _mobile;
return map;
}
}

3
lib/retrofit/retrofit_api.dart

@ -13,6 +13,7 @@ import 'package:huixiang/retrofit/data/article.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/comunity_comment.dart'; import 'package:huixiang/retrofit/data/comunity_comment.dart';
import 'package:huixiang/retrofit/data/coupon.dart'; import 'package:huixiang/retrofit/data/coupon.dart';
import 'package:huixiang/retrofit/data/login_info.dart';
import 'package:huixiang/retrofit/data/order_info.dart'; import 'package:huixiang/retrofit/data/order_info.dart';
import 'package:huixiang/view_widget/login_tips_dialog.dart'; import 'package:huixiang/view_widget/login_tips_dialog.dart';
import 'package:retrofit/retrofit.dart'; import 'package:retrofit/retrofit.dart';
@ -170,7 +171,7 @@ abstract class ApiService {
/// ///
@POST("/auth/platform/memberLogin") @POST("/auth/platform/memberLogin")
Future<BaseData> memberLogin(@Body() Map<String, dynamic> param); Future<BaseData<LoginInfo>> memberLogin(@Body() Map<String, dynamic> param);
/// ///
@GET("/auth/sendVerify/{mobile}") @GET("/auth/sendVerify/{mobile}")

30
lib/retrofit/retrofit_api.g.dart

@ -68,8 +68,30 @@ class _ApiService implements ApiService {
return value; return value;
} }
@override // @override
Future<BaseData<dynamic>> memberLogin(param) async { // Future<BaseData<dynamic>> memberLogin(param) async {
// ArgumentError.checkNotNull(param, 'param');
// const _extra = <String, dynamic>{};
// final queryParameters = <String, dynamic>{};
// final _data = <String, dynamic>{};
// _data.addAll(param ?? <String, dynamic>{});
// final _result = await _dio.request<Map<String, dynamic>>(
// '/auth/platform/memberLogin',
// queryParameters: queryParameters,
// options: RequestOptions(
// method: 'POST',
// headers: <String, dynamic>{},
// extra: _extra,
// baseUrl: baseUrl),
// data: _data);
// final value = BaseData<dynamic>.fromJson(
// _result.data,
// (json) => json as dynamic,
// );
// return value;
// }
@override
Future<BaseData<LoginInfo>> memberLogin(param) async {
ArgumentError.checkNotNull(param, 'param'); ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{}; const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
@ -84,9 +106,9 @@ class _ApiService implements ApiService {
extra: _extra, extra: _extra,
baseUrl: baseUrl), baseUrl: baseUrl),
data: _data); data: _data);
final value = BaseData<dynamic>.fromJson( final value = BaseData<LoginInfo>.fromJson(
_result.data, _result.data,
(json) => json as dynamic, (json) => LoginInfo.fromJson(json),
); );
return value; return value;
} }

35
lib/view_widget/invite_success_dialog.dart

@ -2,14 +2,16 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/login_info.dart';
import 'package:huixiang/utils/flutter_utils.dart'; import 'package:huixiang/utils/flutter_utils.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/round_button.dart'; import 'package:huixiang/view_widget/round_button.dart';
class InviteSuccessDialog extends StatefulWidget { class InviteSuccessDialog extends StatefulWidget {
final String invite; final String invite;
final CouponList couponList;
InviteSuccessDialog(this.invite); InviteSuccessDialog(this.invite,this.couponList);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -70,25 +72,30 @@ class _InviteSuccessDialog extends State<InviteSuccessDialog> {
height: 1.5.h), height: 1.5.h),
children: [ children: [
TextSpan( TextSpan(
text:"前进麦味10元代金劵一", text:"${widget.couponList.storeName}${widget.couponList.couponName} * ${widget.couponList.bizType}",
style: TextStyle(color: Color(0xFF32A060),fontSize: 14.sp,fontWeight: MyFontWeight.regular), style: TextStyle(color: Color(0xFF32A060),fontSize: 14.sp,fontWeight: MyFontWeight.regular),
), ),
] ]
),), ),),
SizedBox(height: 13,), SizedBox(height: 13,),
RoundButton( GestureDetector(
text: S.of(context).queren, onTap: (){
textColor: Colors.white, Navigator.of(context).pop();
width: 130.w,
height: 34.h,
padding: EdgeInsets.symmetric(vertical: 6.h),
fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold,
backgroup: Color(0xFF32A060),
radius: 4.w,
callback: () {
SmartDialog.dismiss();
}, },
child:RoundButton(
text: S.of(context).queren,
textColor: Colors.white,
width: 130.w,
height: 34.h,
padding: EdgeInsets.symmetric(vertical: 6.h),
fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold,
backgroup: Color(0xFF32A060),
radius: 4.w,
callback: () {
SmartDialog.dismiss();
},
),
), ),
SizedBox(height:20), SizedBox(height:20),
], ],

Loading…
Cancel
Save