Browse Source

邀请码功能更新;

核销功能更新;
核销后关闭二维码;
社群合并更改;
ff_new
w-R 3 years ago
parent
commit
3dc3211a2e
  1. 4
      lib/community/community_child_page.dart
  2. 2
      lib/generated/intl/messages_zh_Hant_CN.dart
  3. 2
      lib/generated/intl/messages_zh_TW.dart
  4. 24
      lib/home/home_page.dart
  5. 1
      lib/home/huixiang_brand_page.dart
  6. 2
      lib/l10n/intl_zh_Hant_CN.arb
  7. 2
      lib/l10n/intl_zh_TW.arb
  8. 8
      lib/login/login_page.dart
  9. 8
      lib/mine/coupons_page.dart
  10. 12
      lib/mine/invitation_record.dart
  11. 4
      lib/mine/mine_card_page.dart
  12. 31
      lib/mine/mine_view/mine_view.dart
  13. 2
      lib/mine/roll_center_page.dart
  14. 2
      lib/order/order_history_page.dart
  15. 66
      lib/order/write_off_page.dart
  16. 10
      lib/qr/qr_share.dart
  17. 120
      lib/retrofit/data/coupon_detail.dart
  18. 4
      lib/retrofit/min_api.dart
  19. 13
      lib/retrofit/retrofit_api.dart
  20. 43
      lib/retrofit/retrofit_api.g.dart
  21. 70
      lib/settlement/settlement.dart
  22. 4
      lib/settlement/settlement_view/activity_coupon_remarks.dart
  23. 2
      lib/view_widget/invite_success_dialog.dart
  24. 5
      lib/view_widget/new_coupon_widget.dart

4
lib/community/community_child_page.dart

@ -143,7 +143,9 @@ class _CommunityChildPage extends State<CommunityChildPage> with AutomaticKeepAl
"businessId": articles[position].id,
"userId": userId,
},
);
).then((value) {
_onRefresh();
});
},
);
},

2
lib/generated/intl/messages_zh_Hant_CN.dart

@ -65,7 +65,7 @@ class MessageLookup extends MessageLookupByLibrary {
static m22(zhe) => "全場${zhe}";
static m23(num) => "${num}";
static m23(num) => "${num}";
static m24(ren) => "¥${ren}/人";

2
lib/generated/intl/messages_zh_TW.dart

@ -65,7 +65,7 @@ class MessageLookup extends MessageLookupByLibrary {
static m22(zhe) => "全場${zhe}";
static m23(num) => "${num}";
static m23(num) => "${num}";
static m24(ren) => "¥${ren}/人";

24
lib/home/home_page.dart

@ -1,8 +1,10 @@
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:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:huixiang/generated/l10n.dart';
@ -271,6 +273,24 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
EasyLoading.dismiss();
}
///
queryWiped(memberCouponId) async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
}
BaseData baseData = await apiService.wiped(memberCouponId);
if (baseData != null && baseData.isSuccess) {
SmartDialog.showToast("核销成功", alignment: Alignment.center);
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}
_onRefresh(){
queryHome();
queryMsgStats();
@ -483,6 +503,10 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
///
activityShowAlertDialog(result.toString());
return;
}if(result.toString().contains("type\":\"wiped")){
///
queryWiped(jsonDecode(result.toString())["memberCouponId"]);
return;
}
// String result = await scanner.scan();
Uri uri = Uri.parse(result);

1
lib/home/huixiang_brand_page.dart

@ -51,7 +51,6 @@ class _BrandPage extends State<BrandPage>
Dio(),
context: context,
token: value.getString('token'),
showLoading: false,
);
BaseData<BrandData> baseData =

2
lib/l10n/intl_zh_Hant_CN.arb

@ -338,7 +338,7 @@
"chakanwuliu": "查看物流",
"zailaiyidan": "再來一單",
"shanchudingdan": "刪除訂單",
"qudanhao": "取號{num}",
"qudanhao": "取號{num}",
"lingquchenggong": "領取成功",
"dianwolingqu": "點我領取",
"chengweidianpuzhuanshuhuiyuan": "成為專屬會員,享專屬權益",

2
lib/l10n/intl_zh_TW.arb

@ -338,7 +338,7 @@
"chakanwuliu": "查看物流",
"zailaiyidan": "再來一單",
"shanchudingdan": "刪除訂單",
"qudanhao": "取號{num}",
"qudanhao": "取號{num}",
"lingquchenggong": "領取成功",
"dianwolingqu": "點我領取",
"chengweidianpuzhuanshuhuiyuan": "成為專屬會員,享專屬權益",

8
lib/login/login_page.dart

@ -706,7 +706,7 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
),
),
Container(
height: 40.h,
height:35.h,
width: MediaQuery.of(context).size.width - 80.h,
// margin: EdgeInsets.only(top: 12.h),
child: TextField(
@ -773,7 +773,7 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
),
),
Container(
height: 40.h,
height:35.h,
width: MediaQuery.of(context).size.width - 80.h,
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
@ -923,7 +923,7 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
),
),
Container(
height: 40.h,
height:35.h,
width: MediaQuery.of(context).size.width - 80.h,
child: TextField(
style: TextStyle(
@ -949,7 +949,7 @@ class _MyLoginPageState extends State<LoginPage> with TickerProviderStateMixin {
),
),
textInputAction: TextInputAction.next,
inputFormatters: [LengthLimitingTextInputFormatter(11)],
inputFormatters: [LengthLimitingTextInputFormatter(6)],
cursorColor: Colors.grey,
maxLines: 1,
),

8
lib/mine/coupons_page.dart

@ -1,3 +1,5 @@
import 'dart:convert';
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -172,12 +174,14 @@ class _CouponsPage extends State<CouponsPage> {
if (type == 1) {
receiveCoupon(coupons[position].id);
} else {
if (coupons[position].bizType == 5) {
if (coupons[position].bizType == 5 || coupons[position].bizType == 3) {
Navigator.of(context).pushNamed(
'/router/write_off_page',
arguments: {
"couponId": coupons[position].id,
"coupon": coupons[position].toJson(),
"coupon": jsonEncode(coupons[position]),
}).then((value) {
_onRefresh();
});
} else {
showStoreSelector(coupons[position].storeList);

12
lib/mine/invitation_record.dart

@ -13,6 +13,9 @@ 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:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:huixiang/view_widget/no_data_view.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
@ -27,6 +30,7 @@ class _InvitationRecord extends State<InvitationRecord>
with AutomaticKeepAliveClientMixin {
ApiService apiService;
RefreshController _refreshController = RefreshController();
ScrollController scrollController = ScrollController();
List<InvitationList> invitationList = [];
UserInfo userInfo;
int pageNum = 1;
@ -132,6 +136,7 @@ class _InvitationRecord extends State<InvitationRecord>
right: 16.w),
child: Column(
children: [
GestureDetector(
onTap: (){
Navigator.of(context).pop();
@ -298,6 +303,13 @@ class _InvitationRecord extends State<InvitationRecord>
],
),
Expanded(child:
(invitationList.length == null || invitationList.length == 0)
? NoDataView(
isShowBtn: false,
text:"还没有邀请记录哦~",
fontSize: 16.sp,
margin: EdgeInsets.only(top: 120.h),
):
ListView.builder(
itemCount:invitationList.length,
shrinkWrap: true,

4
lib/mine/mine_card_page.dart

@ -46,13 +46,13 @@ class _MineCardPage extends State<MineCardPage>
indicatorSize: TabBarIndicatorSize.label,
//
tabs: <Widget>[
MyTab(text: S.of(context).huiyuanka),
MyTab(text: S.of(context).quanbao),
MyTab(text: S.of(context).huiyuanka),
],
),
),
body: TabBarView(
children: [VipCardPage(), CouponsPage()],
children: [CouponsPage(),VipCardPage(), ],
),
),
);

31
lib/mine/mine_view/mine_view.dart

@ -1,7 +1,13 @@
import 'dart:convert';
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/user_info.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/activity_coupons.dart';
import 'package:huixiang/view_widget/custom_image.dart';
@ -9,6 +15,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/login_tips_dialog.dart';
import 'package:huixiang/view_widget/request_permission.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:shared_preferences/shared_preferences.dart';
// import 'package:qrscan/qrscan.dart' as scanner;
class MineView extends StatefulWidget {
@ -25,6 +32,26 @@ class MineView extends StatefulWidget {
}
class _MineView extends State<MineView> {
ApiService apiService;
///
queryWiped(memberCouponId) async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
}
BaseData baseData = await apiService.wiped(memberCouponId);
if (baseData != null && baseData.isSuccess) {
SmartDialog.showToast("核销成功", alignment: Alignment.center);
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}
@override
Widget build(BuildContext context) {
return Column(
@ -98,6 +125,10 @@ class _MineView extends State<MineView> {
///
activityShowAlertDialog(result.toString());
return;
}if(result.toString().contains("type\":\"wiped")){
///
queryWiped(jsonDecode(result.toString())["memberCouponId"]);
return;
}
// String result = await scanner.scan();
Uri uri = Uri.parse(result);

2
lib/mine/roll_center_page.dart

@ -128,7 +128,7 @@ class _RollCenterPage extends State<RollCenterPage> {
if (type == 1) {
receiveCoupon(coupons[position].id);
} else {
if (coupons[position].bizType == 5) {
if (coupons[position].bizType == 5 || coupons[position].bizType == 3) {
Navigator.of(context).pushNamed(
'/router/write_off_page',
arguments: {

2
lib/order/order_history_page.dart

@ -200,7 +200,7 @@ class _OrderHistoryList extends State<OrderHistoryList>
} else {
current += 1;
}
setState(() {});
// setState(() {});
} else {
refreshController.refreshFailed();
refreshController.loadFailed();

66
lib/order/write_off_page.dart

@ -1,12 +1,20 @@
import 'dart:convert';
import 'package:barcode_widget/barcode_widget.dart';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/coupon.dart';
import 'package:huixiang/retrofit/data/coupon_detail.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/separator.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:qr_flutter/qr_flutter.dart';
import 'package:shared_preferences/shared_preferences.dart';
class WriteOffPage extends StatefulWidget {
final arguments;
@ -20,14 +28,44 @@ class WriteOffPage extends StatefulWidget {
}
class _WriteOffPage extends State<WriteOffPage> {
Coupon coupon;
dynamic coupon;
ApiService apiService;
CouponDetail queryCoupon;
@override
void initState() {
super.initState();
coupon = Coupon.fromJson(widget.arguments["coupon"]);
coupon = jsonDecode(widget.arguments["coupon"]);
if (mounted) setState(() {});
queryCouponDetail(coupon["memberCouponId"]);
}
////
queryCouponDetail(memberCouponId) async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
}
BaseData baseData = await apiService.couponDetail(memberCouponId);
if (baseData != null && baseData.isSuccess) {
setState(() {
queryCoupon = baseData.data;
if(queryCoupon.status==2){
Navigator.of(context).pop(true);
}
else Future.delayed(Duration(seconds: 1), () {
queryCouponDetail(coupon["memberCouponId"]);
});
});
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}
@override
@ -61,7 +99,7 @@ class _WriteOffPage extends State<WriteOffPage> {
child: Column(
children: [
Text(
coupon != null ? coupon.couponName : "",
coupon != null ? coupon["couponName"] : "",
style: TextStyle(
fontSize: 16.sp,
fontWeight: FontWeight.bold,
@ -71,8 +109,8 @@ class _WriteOffPage extends State<WriteOffPage> {
height: 8.h,
),
Text(
(coupon.useStartTime == null || coupon.useEndTime == null) ? "" : S.of(context).youxiaoqi(
"${coupon.useStartTime.replaceAll("-", ".").split(" ")[0]}-${coupon.useEndTime.replaceAll("-", ".").split(" ")[0]}"),
(coupon["useStartTime"] == null || coupon["useEndTime"] == null) ? "" : S.of(context).youxiaoqi(
"${coupon["useStartTime"].replaceAll("-", ".").split(" ")[0]}-${coupon["useEndTime"].replaceAll("-", ".").split(" ")[0]}"),
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF353535),
@ -103,11 +141,11 @@ class _WriteOffPage extends State<WriteOffPage> {
children: [
Text(
coupon != null
? "${coupon.id.substring(0, 4)} "
"${coupon.id.substring(4, 8)} "
"${coupon.id.substring(8, 12)} "
"${coupon.id.substring(12, 16)} "
"${coupon.id.substring(16, coupon.id.length)}"
? "${coupon["memberCouponId"].substring(0, 4)} "
"${coupon["memberCouponId"].substring(4, 8)} "
"${coupon["memberCouponId"].substring(8, 12)} "
"${coupon["memberCouponId"].substring(12, 16)} "
"${coupon["memberCouponId"].substring(16, coupon["memberCouponId"].length)}"
: "",
style: TextStyle(
fontSize: 14.sp,
@ -115,12 +153,12 @@ class _WriteOffPage extends State<WriteOffPage> {
? 10
: (MediaQuery.of(context).size.width -
64.w) /
(((coupon.id.length) * 4)),
(((coupon["memberCouponId"].length) * 4)),
letterSpacing: coupon == null
? 8
: (MediaQuery.of(context).size.width -
64.w) /
(((coupon.id.length) * 4)),
(((coupon["memberCouponId"].length) * 4)),
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF353535),
),
@ -130,7 +168,7 @@ class _WriteOffPage extends State<WriteOffPage> {
),
BarcodeWidget(
barcode: Barcode.code128(useCode128C: true),
data: coupon != null ? coupon.id : "",
data: coupon != null ? coupon["memberCouponId"] : "",
height: 72.h,
color: Colors.black,
drawText: false,
@ -139,7 +177,7 @@ class _WriteOffPage extends State<WriteOffPage> {
height: 16.h,
),
Expanded(child: QrImage(
data: coupon != null ? coupon.id : "",
data: "{\"type\":\"wiped\",\"memberCouponId\":\"${coupon["memberCouponId"]}\"}",
version: QrVersions.auto,
size: 200.w,
gapless: true,

10
lib/qr/qr_share.dart

@ -29,7 +29,8 @@ class _QrSharePage extends State<QrSharePage> {
SharedPreferences.getInstance().then((value) {
if (value.getString('user') != null && value.getString('user') != "") {
phone = UserInfo.fromJson(jsonDecode(value.getString('user'))).inviteCode;
phone =
UserInfo.fromJson(jsonDecode(value.getString('user'))).inviteCode;
setState(() {});
}
});
@ -116,7 +117,7 @@ class _QrSharePage extends State<QrSharePage> {
Container(
margin: EdgeInsets.only(left: 16.w, right: 24.w),
child: GestureDetector(
child: Text(
child: SelectableText(
// S.of(context).baocunsaoma,
phone,
textAlign: TextAlign.center,
@ -127,8 +128,7 @@ class _QrSharePage extends State<QrSharePage> {
),
),
onTap: this.copy(phone),
)
),
)),
// Container(
// width: 152.w,
// height: 152.w,
@ -228,7 +228,7 @@ class _QrSharePage extends State<QrSharePage> {
}
copy(String phone) {
print("..."+phone);
print("..." + phone);
Clipboard.setData(ClipboardData(text: phone));
}
}

120
lib/retrofit/data/coupon_detail.dart

@ -0,0 +1,120 @@
/// id : "1493050078934335488"
/// createTime : "2022-02-14 10:30:53"
/// createUser : "1307141152536788992"
/// updateTime : "2022-02-14 10:30:53"
/// updateUser : "1307141152536788992"
/// mid : "1486626867212451840"
/// couponId : "1435510333782360064"
/// receiveTime : "2022-02-14 10:30:53"
/// useTime : null
/// useTimeStart : "2022-02-14 10:30:53"
/// useTimeEnd : "2022-02-15 10:30:53"
/// status : 1
/// isDeleted : false
/// tenantCode : "1166"
/// couponCode : ""
class CouponDetail {
CouponDetail({
String id,
String createTime,
String createUser,
String updateTime,
String updateUser,
String mid,
String couponId,
String receiveTime,
dynamic useTime,
String useTimeStart,
String useTimeEnd,
int status,
bool isDeleted,
String tenantCode,
String couponCode,}){
_id = id;
_createTime = createTime;
_createUser = createUser;
_updateTime = updateTime;
_updateUser = updateUser;
_mid = mid;
_couponId = couponId;
_receiveTime = receiveTime;
_useTime = useTime;
_useTimeStart = useTimeStart;
_useTimeEnd = useTimeEnd;
_status = status;
_isDeleted = isDeleted;
_tenantCode = tenantCode;
_couponCode = couponCode;
}
CouponDetail.fromJson(dynamic json) {
_id = json['id'];
_createTime = json['createTime'];
_createUser = json['createUser'];
_updateTime = json['updateTime'];
_updateUser = json['updateUser'];
_mid = json['mid'];
_couponId = json['couponId'];
_receiveTime = json['receiveTime'];
_useTime = json['useTime'];
_useTimeStart = json['useTimeStart'];
_useTimeEnd = json['useTimeEnd'];
_status = json['status'];
_isDeleted = json['isDeleted'];
_tenantCode = json['tenantCode'];
_couponCode = json['couponCode'];
}
String _id;
String _createTime;
String _createUser;
String _updateTime;
String _updateUser;
String _mid;
String _couponId;
String _receiveTime;
dynamic _useTime;
String _useTimeStart;
String _useTimeEnd;
int _status;
bool _isDeleted;
String _tenantCode;
String _couponCode;
String get id => _id;
String get createTime => _createTime;
String get createUser => _createUser;
String get updateTime => _updateTime;
String get updateUser => _updateUser;
String get mid => _mid;
String get couponId => _couponId;
String get receiveTime => _receiveTime;
dynamic get useTime => _useTime;
String get useTimeStart => _useTimeStart;
String get useTimeEnd => _useTimeEnd;
int get status => _status;
bool get isDeleted => _isDeleted;
String get tenantCode => _tenantCode;
String get couponCode => _couponCode;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = _id;
map['createTime'] = _createTime;
map['createUser'] = _createUser;
map['updateTime'] = _updateTime;
map['updateUser'] = _updateUser;
map['mid'] = _mid;
map['couponId'] = _couponId;
map['receiveTime'] = _receiveTime;
map['useTime'] = _useTime;
map['useTimeStart'] = _useTimeStart;
map['useTimeEnd'] = _useTimeEnd;
map['status'] = _status;
map['isDeleted'] = _isDeleted;
map['tenantCode'] = _tenantCode;
map['couponCode'] = _couponCode;
return map;
}
}

4
lib/retrofit/min_api.dart

@ -61,8 +61,8 @@ abstract class MinApiService {
}
headers["Environment"] = "app";
dio.options = BaseOptions(
connectTimeout: 60000,
receiveTimeout: 60000,
connectTimeout: 15000,
receiveTimeout: 15000,
headers: headers,
responseType: ResponseType.json,
);

13
lib/retrofit/retrofit_api.dart

@ -25,6 +25,7 @@ import 'data/brand_data.dart';
import 'data/category_select_list.dart';
import 'data/chapter.dart';
import 'data/collect_class_list.dart';
import 'data/coupon_detail.dart';
import 'data/course_details.dart';
import 'data/course_list.dart';
import 'data/exchange_order.dart';
@ -87,8 +88,8 @@ abstract class ApiService {
headers["Environment"] = "app";
}
dio.options = BaseOptions(
connectTimeout: 60000,
receiveTimeout: 60000,
connectTimeout: 20000,
receiveTimeout: 20000,
headers: headers,
responseType: ResponseType.json,
);
@ -490,4 +491,12 @@ abstract class ApiService {
@POST("/member/inviteMemberList")
Future<BaseData<PageInfo<InvitationList>>> inviteMemberList(@Body() Map<String, dynamic> map);
///
@GET("/coupon/wiped/{memberCouponId}")
Future<BaseData> wiped(@Path("memberCouponId") String memberCouponId);
///
@GET("coupon/detail/")
Future<BaseData<CouponDetail>> couponDetail(@Path("") String memberCouponId);
}

43
lib/retrofit/retrofit_api.g.dart

@ -1827,5 +1827,48 @@ class _ApiService implements ApiService {
return value;
}
@override
Future<BaseData<dynamic>> wiped(memberCouponId) async {
ArgumentError.checkNotNull(memberCouponId, 'memberCouponId');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/coupon/wiped/$memberCouponId',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
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<CouponDetail>> couponDetail(memberCouponId) async {
ArgumentError.checkNotNull(memberCouponId, 'memberCouponId');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'coupon/detail/$memberCouponId',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<CouponDetail>.fromJson(
_result.data,
(json) => CouponDetail.fromJson(json),
);
return value;
}
}

70
lib/settlement/settlement.dart

@ -20,7 +20,6 @@ import 'package:huixiang/retrofit/data/wx_pay.dart';
import 'package:huixiang/retrofit/min_api.dart';
import 'package:huixiang/settlement/settlement_view/activity_coupon_remarks.dart';
import 'package:huixiang/settlement/settlement_view/distribution.dart';
import 'package:huixiang/settlement/settlement_view/edit_phone.dart';
import 'package:huixiang/settlement/settlement_view/pay_method.dart';
import 'package:huixiang/settlement/settlement_view/settlement_activity.dart';
import 'package:huixiang/settlement/settlement_view/settlement_coupon.dart';
@ -53,7 +52,7 @@ class _Settlement extends State<Settlement> {
SettleOrderInfo settleOrderInfo;
MinOrderInfo minOrderInfo;
int selectedBtn = 0;
String remakers = "口味、面包硬度等";
String remakers = "";
String parentCode = "";
String parentId = "";
int payChannel = 4;
@ -74,8 +73,8 @@ class _Settlement extends State<Settlement> {
parentId = widget.arguments["parentId"] ?? "";
storeInfo = widget.arguments["storeInfo"];
numberOfPeople = widget.arguments["numberOfPeople"] ?? 0;
promotions=widget.arguments["pName"]??"";
coupons=widget.arguments["cName"]??"";
promotions = widget.arguments["pName"] ?? "";
coupons = widget.arguments["cName"] ?? "";
if (tableId == 0) {
placeOrder = true;
}
@ -84,14 +83,13 @@ class _Settlement extends State<Settlement> {
String minToken = value.getString("minToken");
String tenant = value.getString("tenant");
String storeId = value.getString("storeId");
minService = MinApiService(
Dio(),
minService = MinApiService(Dio(),
context: context,
token: minToken,
tenant: tenant,
storeId: storeId,
);
if(promotions != null && promotions != "" || tableId <=0){
showLoading: true);
if (promotions != null && promotions != "" || tableId <= 0) {
queryOrderInfo(
address != null ? address.id : null,
selectedBtn,
@ -99,7 +97,7 @@ class _Settlement extends State<Settlement> {
0,
widget.arguments["pid"],
);
}else if(coupons != null && coupons != "" || tableId <=0){
} else if (coupons != null && coupons != "" || tableId <= 0) {
queryOrderInfo(
address != null ? address.id : null,
selectedBtn,
@ -107,8 +105,7 @@ class _Settlement extends State<Settlement> {
0,
null,
);
}
else
} else
queryOrderInfo(null, selectedBtn, null, 0, null);
});
@ -142,7 +139,6 @@ class _Settlement extends State<Settlement> {
queryOrderDetails(parentId);
}
});
}
}
@ -220,8 +216,7 @@ class _Settlement extends State<Settlement> {
if (baseDate != null && baseDate.isSuccess) {
setState(() {
baseDate.data.forEach((element) {
if(element.id == addId)
address = element;
if (element.id == addId) address = element;
});
});
@ -259,9 +254,13 @@ class _Settlement extends State<Settlement> {
placeOrderFirst.payChannel = payChannel;
placeOrderFirst.promotionInfoDTO = PromotionInfoDTOBean();
placeOrderFirst.promotionInfoDTO.promotionId =
(promotion != null && tableId <= 0) ? promotion.id : widget.arguments["pid"]??"";
(promotion != null && tableId <= 0)
? promotion.id
: widget.arguments["pid"] ?? "";
placeOrderFirst.promotionInfoDTO.couponId =
(couponListBean != null && tableId <= 0) ? couponListBean.id : widget.arguments["cid"]??"";
(couponListBean != null && tableId <= 0)
? couponListBean.id
: widget.arguments["cid"] ?? "";
placeOrderFirst.recMobile =
(mobile == null || mobile == "") ? mobile : storeInfo.headMobile;
placeOrderFirst.shoppingCartSkuItemList = settleOrderInfo.orderProductList;
@ -282,10 +281,8 @@ class _Settlement extends State<Settlement> {
placeOrder = true;
this.downOrder = baseData.data;
querySettlement();
}
else{
SmartDialog.showToast(baseData.msg,
alignment: Alignment.center);
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
} else {
///
@ -361,8 +358,7 @@ class _Settlement extends State<Settlement> {
sign: wxPay.sign,
);
}
}
else {
} else {
BaseData baseData = await minService
.settlementApi(placeOrderFirst.toJson())
.catchError((error) {
@ -429,26 +425,15 @@ class _Settlement extends State<Settlement> {
child: Container(
child: Column(
children: [
DistributionMode(
(addressId,
isTake,
memberCouponId,
orderId,
promotionId){
DistributionMode((addressId, isTake,
memberCouponId, orderId, promotionId) {
setState(() {
this.selectedBtn = 0;
});
queryOrderInfo(addressId,
isTake,
memberCouponId,
orderId,
promotionId);
},
queryAddress,
storeInfo,
address,
selectedAddress
),
queryOrderInfo(addressId, isTake,
memberCouponId, orderId, promotionId);
}, queryAddress, storeInfo, address,
selectedAddress),
SizedBox(
height: 16,
@ -477,7 +462,8 @@ class _Settlement extends State<Settlement> {
promotions,
couponCount(),
placeOrder,
remakers, () {
remakers,
() {
Navigator.of(context).pushNamed(
'/router/edit_remarks_page',
arguments: {},
@ -487,7 +473,8 @@ class _Settlement extends State<Settlement> {
})
});
},
tableId,),
tableId,
),
if (placeOrder)
@ -629,7 +616,6 @@ class _Settlement extends State<Settlement> {
0,
promotion != null ? promotion.id : null,
);
}
}
}

4
lib/settlement/settlement_view/activity_coupon_remarks.dart

@ -200,11 +200,11 @@ class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
),
Expanded(
child: Text(
widget.remark,
widget.remark != ""? widget.remark:"口味、面包硬度等",
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF353535),
color: Color(0xFFA29E9E),
fontWeight: MyFontWeight.semi_bold,
),
),

2
lib/view_widget/invite_success_dialog.dart

@ -64,7 +64,7 @@ class _InviteSuccessDialog extends State<InviteSuccessDialog> {
textAlign: TextAlign.center,
text: TextSpan(
text:
"通过${widget.invite.substring(0, 3)}****${widget.invite.substring(7, 11)}的邀请码完成邀请,获得",
"通过${widget.invite}的邀请码完成邀请,获得",
style: TextStyle(
color: Color(0xFF1A1A1A),
fontSize: 14.sp,

5
lib/view_widget/new_coupon_widget.dart

@ -254,8 +254,7 @@ class NewCouponWidget extends StatelessWidget {
),
Text(
S.of(context).manyuankeyong(coupon != null
? double.tryParse("${coupon.fullAmount}" ?? "0")
.toInt()
? ("${coupon.fullAmount}" ?? "0")
.toString()
: ""),
style: TextStyle(
@ -436,7 +435,7 @@ class NewCouponWidget extends StatelessWidget {
color: Color(0xFF32A060),
),
child: Text(
(coupon.bizType == 5)
(coupon.bizType == 5 || coupon.bizType == 3)
? S.of(context).quhexiao
: S.of(context).qushiyong,
style: TextStyle(

Loading…
Cancel
Save