From 43d001ad7fe437b32667bcd02725bbb9e928025b Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Thu, 2 Dec 2021 14:38:00 +0800 Subject: [PATCH] =?UTF-8?q?=E9=82=80=E8=AF=B7=E7=A0=81=E5=88=86=E4=BA=AB?= =?UTF-8?q?=E6=9B=B4=E6=94=B9;=20=E7=99=BB=E5=BD=95=E9=A1=B5=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E9=82=80=E8=AF=B7=E7=A0=81;=20=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=82=80=E8=AF=B7=E6=88=90=E5=8A=9F=E5=BC=B9?= =?UTF-8?q?=E7=AA=97;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/home/home_page.dart | 13 +- lib/login/login_page.dart | 8 +- lib/main_page.dart | 9 +- lib/mine/coupons_page.dart | 6 +- lib/retrofit/data/login_info.dart | 371 +++++++++++++++++++++ lib/retrofit/retrofit_api.dart | 3 +- lib/retrofit/retrofit_api.g.dart | 30 +- lib/view_widget/invite_success_dialog.dart | 35 +- 8 files changed, 440 insertions(+), 35 deletions(-) create mode 100644 lib/retrofit/data/login_info.dart diff --git a/lib/home/home_page.dart b/lib/home/home_page.dart index a73b5a5c..08b23ea3 100644 --- a/lib/home/home_page.dart +++ b/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/goods.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/retrofit_api.dart'; import 'package:huixiang/utils/event_type.dart'; @@ -37,8 +38,9 @@ import 'home_view/shortcut_operation.dart'; class HomePage extends StatefulWidget { final Function changeTab; final String invite; + final List couponList; - HomePage(this.changeTab, {this.invite}); + HomePage(this.changeTab, {this.invite,this.couponList}); @override State createState() { @@ -59,17 +61,18 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { } }); - if((widget.invite??"") != "") + if((widget.invite??"") != "" || widget.couponList != null + && widget.couponList.length > 0) showInvite = true; } ///邀请成功弹窗 - inviteShowAlertDialog(invite) { + inviteShowAlertDialog(invite,CouponList couponList) { //显示对话框 showDialog( context: context, builder: (BuildContext context) { - return InviteSuccessDialog(invite); + return InviteSuccessDialog(invite,couponList); }, ); } @@ -212,7 +215,7 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { } EasyLoading.dismiss(); if(showInvite){ - inviteShowAlertDialog(widget.invite); + inviteShowAlertDialog(widget.invite,widget.couponList[0]); showInvite = false; } diff --git a/lib/login/login_page.dart b/lib/login/login_page.dart index 6770a2ff..29c16194 100644 --- a/lib/login/login_page.dart +++ b/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:huixiang/main.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/data/user_entity.dart'; import 'package:huixiang/utils/event_type.dart'; @@ -61,7 +62,6 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { Animation doubleAnimation; bool invitationCode = true; - isLogin() async { SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); @@ -329,19 +329,19 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { "invite":invite, }; EasyLoading.show(status: S.of(context).zhengzaijiazai); - BaseData value = await client.memberLogin(param).catchError((error) { + BaseData value = await client.memberLogin(param).catchError((error) { print(error); SmartDialog.showToast("$error", alignment: Alignment.center); }); EasyLoading.show(status: S.of(context).zhengzaijiazai); Future.delayed(Duration(seconds:2), () { if (value !=null && value.isSuccess) { - saveUserJson(value.data); + saveUserJson(value.data.authInfo.toJson()); eventBus.fire(EventType(3)); Navigator.of(context).pushNamedAndRemoveUntil( '/router/main_page', - (route) => false,arguments:{"invite":invite}); + (route) => false,arguments:{"invite":invite,"couponList":value.data.couponList}); EasyLoading.dismiss(); } else { diff --git a/lib/main_page.dart b/lib/main_page.dart index d052c7de..7488d878 100644 --- a/lib/main_page.dart +++ b/lib/main_page.dart @@ -10,6 +10,7 @@ import 'package:huixiang/home/home_page.dart'; import 'package:huixiang/main.dart'; import 'package:huixiang/mine/mine_page.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/retrofit_api.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/font_weight.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:shared_preferences/shared_preferences.dart'; import 'package:tpns_flutter_plugin/tpns_flutter_plugin.dart'; @@ -82,9 +82,12 @@ class _MainPage extends State with WidgetsBindingObserver { pushRoute(); 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"]; + couponList = widget.arguments["couponList"]; } _widgetOptions = [ // BrandPage(), @@ -92,7 +95,7 @@ class _MainPage extends State with WidgetsBindingObserver { setState(() { pageController.jumpToPage(index); }); - },invite:invite), + },invite:invite,couponList:couponList), // MainHomePage(), UnionPage(), CommunityPage(), diff --git a/lib/mine/coupons_page.dart b/lib/mine/coupons_page.dart index 4d4bd1c2..65a27988 100644 --- a/lib/mine/coupons_page.dart +++ b/lib/mine/coupons_page.dart @@ -180,15 +180,13 @@ class _CouponsPage extends State { "coupon": coupons[position].toJson(), }); } else { - showStoreSelector( - coupons[position].storeList); + showStoreSelector(coupons[position].storeList); } } }, () { setState(() { - coupons[position].isEx = - !coupons[position].isEx; + coupons[position].isEx = !coupons[position].isEx; }); }, type: 0, diff --git a/lib/retrofit/data/login_info.dart b/lib/retrofit/data/login_info.dart new file mode 100644 index 00000000..a0107eca --- /dev/null +++ b/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,}){ + _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; + + AuthInfo get authInfo => _authInfo; + List get couponList => _couponList; + + Map toJson() { + final map = {}; + 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 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 _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 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 toJson() { + final map = {}; + 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 toJson() { + final map = {}; + 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; + } + +} \ No newline at end of file diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index 1b78be14..8eb3fdb8 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/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/comunity_comment.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/view_widget/login_tips_dialog.dart'; import 'package:retrofit/retrofit.dart'; @@ -170,7 +171,7 @@ abstract class ApiService { /// 用户登录 @POST("/auth/platform/memberLogin") - Future memberLogin(@Body() Map param); + Future> memberLogin(@Body() Map param); ///发送验证码 @GET("/auth/sendVerify/{mobile}") diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index 05bf5876..495e870e 100644 --- a/lib/retrofit/retrofit_api.g.dart +++ b/lib/retrofit/retrofit_api.g.dart @@ -68,8 +68,30 @@ class _ApiService implements ApiService { return value; } - @override - Future> memberLogin(param) async { + // @override + // Future> memberLogin(param) async { + // ArgumentError.checkNotNull(param, 'param'); + // const _extra = {}; + // final queryParameters = {}; + // final _data = {}; + // _data.addAll(param ?? {}); + // final _result = await _dio.request>( + // '/auth/platform/memberLogin', + // queryParameters: queryParameters, + // options: RequestOptions( + // method: 'POST', + // headers: {}, + // extra: _extra, + // baseUrl: baseUrl), + // data: _data); + // final value = BaseData.fromJson( + // _result.data, + // (json) => json as dynamic, + // ); + // return value; + // } + @override + Future> memberLogin(param) async { ArgumentError.checkNotNull(param, 'param'); const _extra = {}; final queryParameters = {}; @@ -84,9 +106,9 @@ class _ApiService implements ApiService { extra: _extra, baseUrl: baseUrl), data: _data); - final value = BaseData.fromJson( + final value = BaseData.fromJson( _result.data, - (json) => json as dynamic, + (json) => LoginInfo.fromJson(json), ); return value; } diff --git a/lib/view_widget/invite_success_dialog.dart b/lib/view_widget/invite_success_dialog.dart index 1fc53535..5a7d382e 100644 --- a/lib/view_widget/invite_success_dialog.dart +++ b/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_smart_dialog/flutter_smart_dialog.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/font_weight.dart'; import 'package:huixiang/view_widget/round_button.dart'; class InviteSuccessDialog extends StatefulWidget { final String invite; + final CouponList couponList; - InviteSuccessDialog(this.invite); + InviteSuccessDialog(this.invite,this.couponList); @override State createState() { @@ -70,25 +72,30 @@ class _InviteSuccessDialog extends State { height: 1.5.h), children: [ TextSpan( - text:"前进麦味10元代金劵一张", + text:"${widget.couponList.storeName}${widget.couponList.couponName} * ${widget.couponList.bizType}张", style: TextStyle(color: Color(0xFF32A060),fontSize: 14.sp,fontWeight: MyFontWeight.regular), ), ] ),), SizedBox(height: 13,), - 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(); + GestureDetector( + onTap: (){ + Navigator.of(context).pop(); }, + 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), ],