Browse Source

充值页增加推荐门店选择;(废弃原充值列表(rechargeAct),用新接口(rechargeActList),增加门店列表,推荐板块是否显示开关)

更改部分实体类类型解析错误(主要更改个人信息那块,如:粉丝,关注等字段);
更改下单备注,非预约商品,不传“预约门店”文本;
new_revision_app
wurong 2 years ago
parent
commit
f9c2f9af6f
  1. BIN
      assets/image/2x/recharge_z.webp
  2. BIN
      assets/image/3x/recharge_z.webp
  3. BIN
      assets/image/recharge_z.webp
  4. 2
      lib/mine/personal_page.dart
  5. 421
      lib/mine/recharge_page.dart
  6. 24
      lib/retrofit/data/member_Infor.dart
  7. 4
      lib/retrofit/data/miNiDetail.dart
  8. 155
      lib/retrofit/data/rechargeActLists.dart
  9. 6
      lib/retrofit/data/settleOrderInfo.dart
  10. 18
      lib/retrofit/data/social_info.dart
  11. 8
      lib/retrofit/data/user_info.dart
  12. 5
      lib/retrofit/retrofit_api.dart
  13. 14
      lib/retrofit/retrofit_api.g.dart
  14. 74
      lib/settlement/settlement.dart
  15. 8
      lib/view_widget/recharge_details_dialog.dart

BIN
assets/image/2x/recharge_z.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 894 B

BIN
assets/image/3x/recharge_z.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
assets/image/recharge_z.webp

Binary file not shown.

After

Width:  |  Height:  |  Size: 658 B

2
lib/mine/personal_page.dart

@ -85,6 +85,7 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
BaseData<MemberInfor> baseData =
await apiService.memberDetail(id).catchError((error) {
refreshController.refreshFailed();
debugPrint(error);
});
if (baseData != null && baseData.isSuccess) {
setState(() {
@ -126,6 +127,7 @@ class _PersonalPage extends State<PersonalPage> with WidgetsBindingObserver {
"pageSize": 10,
"searchKey": searchKey ?? ""
}).catchError((error) {
debugPrint(error);
if (searchKey == null) {
refreshController.refreshFailed();
refreshController.loadFailed();

421
lib/mine/recharge_page.dart

@ -10,6 +10,7 @@ import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:fluwx/fluwx.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/rechargeActLists.dart';
import 'package:huixiang/retrofit/data/recharge_list.dart';
import 'package:huixiang/retrofit/data/user_info.dart';
import 'package:huixiang/retrofit/data/vip_benefit_list.dart';
@ -42,12 +43,14 @@ class _RechargePage extends State<RechargePage> {
List<VipBenefitList> vipBenefitList = [];
Color color = Colors.black;
double discount = 100;
List<RechargeList> rechargeA;
// List<RechargeList> rechargeA;
int selectIndex = 0;
UserInfo userInfo;
String mBalance = "0";
dynamic payListen;
RechargeActLists rechargeActLists;
int selectStoreIndex = 0;
String recommendName;
@override
void initState() {
@ -58,7 +61,7 @@ class _RechargePage extends State<RechargePage> {
context: context, token: value.getString("token"), pay: true);
queryBenefitList();
queryRuleDetails();
queryRechargeList();
queryRechargeActList();
queryUserBalance();
});
payListen = weChatResponseEventHandler.listen((event) async {
@ -67,8 +70,7 @@ class _RechargePage extends State<RechargePage> {
queryUserBalance();
Navigator.of(context).pop();
SmartDialog.showToast("充值成功", alignment: Alignment.center);
}
else{
} else {
SmartDialog.showToast("充值失败", alignment: Alignment.center);
return;
}
@ -78,8 +80,7 @@ class _RechargePage extends State<RechargePage> {
@override
void dispose() {
super.dispose();
if(payListen!=null)
payListen.cancel();
if (payListen != null) payListen.cancel();
}
///
@ -125,7 +126,7 @@ class _RechargePage extends State<RechargePage> {
}
///
queryRechargeList() async {
queryRechargeActList() async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
@ -134,11 +135,11 @@ class _RechargePage extends State<RechargePage> {
token: value.getString("token"),
);
}
BaseData<List<RechargeList>> baseData =
await apiService.rechargeAct().catchError((onError) {});
BaseData<RechargeActLists> baseData =
await apiService.rechargeActList().catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
setState(() {
rechargeA = baseData.data;
rechargeActLists = baseData.data;
});
}
EasyLoading.dismiss();
@ -215,7 +216,8 @@ class _RechargePage extends State<RechargePage> {
fontSize: 15.sp,
color: Color(0xFF181818),
fontFamily: 'JDZhengHT',
fontWeight: MyFontWeight.semi_bold),
fontWeight:
MyFontWeight.semi_bold),
)),
Text.rich(
TextSpan(children: [
@ -269,11 +271,10 @@ class _RechargePage extends State<RechargePage> {
)),
Container(
width: double.infinity,
margin: EdgeInsets.only(
bottom: 22.h, left: 16, right: 16),
margin: EdgeInsets.only(left: 16, right: 16),
padding: EdgeInsets.only(
top: 20.h,
bottom: 20.h,
bottom: 24.h,
),
// decoration: BoxDecoration(
// color: Colors.white,
@ -327,7 +328,7 @@ class _RechargePage extends State<RechargePage> {
],
),
),
SizedBox(height:10.h),
SizedBox(height: 10.h),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
@ -337,9 +338,9 @@ class _RechargePage extends State<RechargePage> {
},
child: Row(
mainAxisAlignment:
MainAxisAlignment.start,
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [
Image.asset(
"assets/image/icon_alipay.webp"),
@ -363,6 +364,48 @@ class _RechargePage extends State<RechargePage> {
],
),
),
if((rechargeActLists?.isOpen ?? false) == true)
GestureDetector(
onTap: () {
showRecommendStore();
},
child: Container(
padding: EdgeInsets.only(
left: 14.w,
right: 16.w,
top: 14.h,
bottom: 14.h),
margin: EdgeInsets.only(
bottom: 22.h, left: 14.w, right: 14.w),
decoration: BoxDecoration(
color: Color(0xFFFAFAFA),
borderRadius: BorderRadius.circular(4),
),
child: Row(
children: [
Image.asset(
"assets/image/recharge_z.webp",
width: 16.w,
height: 17.h,
fit: BoxFit.fill,
),
SizedBox(width: 8.w),
Expanded(
child: Text(
recommendName ??"为喜爱门店打call!(可选)",
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
color: (recommendName != null) ?Color(0xFF32A060):Color(0xFF868686),
),
)),
Icon(
Icons.arrow_forward_ios,
size: 16,
),
],
)),
),
Align(
alignment: Alignment.bottomCenter,
child: GestureDetector(
@ -508,7 +551,7 @@ class _RechargePage extends State<RechargePage> {
Widget rechargeList() {
return ListView.builder(
padding: EdgeInsets.zero,
itemCount: rechargeA == null ? 0 : rechargeA.length,
itemCount: (rechargeActLists != null && (rechargeActLists?.preferentialList?.length ?? 0) > 0) ? rechargeActLists.preferentialList.length : 0,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
@ -519,22 +562,24 @@ class _RechargePage extends State<RechargePage> {
selectIndex = position;
});
},
child: rechargeItem(rechargeA[position], position));
child: rechargeItem(rechargeActLists.preferentialList[position], position));
},
);
}
Widget rechargeItem(RechargeList rechargeA, index) {
Widget rechargeItem(PreferentialList preferentialList, index) {
return Container(
width: double.infinity,
height: 69.h,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
border: Border.all(
color: selectIndex == index ? Color(0xFF32A060) :Color(0xFFFAFAFA),
width: selectIndex == index ? 1 :0,
color:
selectIndex == index ? Color(0xFF32A060) : Color(0xFFFAFAFA),
width: selectIndex == index ? 1 : 0,
),
color: selectIndex == index ? Color(0XFFF0FAF4) :Color(0xFFFAFAFA)),
color:
selectIndex == index ? Color(0XFFF0FAF4) : Color(0xFFFAFAFA)),
margin: EdgeInsets.only(bottom: 14.w),
padding: EdgeInsets.only(left: 16),
child: Flex(
@ -549,16 +594,20 @@ class _RechargePage extends State<RechargePage> {
text: "储值 ",
style: TextStyle(
fontSize: 12.sp,
color:selectIndex == index ? Color(0xFF4D4D4D):Color(0xFF868686),
color: selectIndex == index
? Color(0xFF4D4D4D)
: Color(0xFF868686),
fontWeight: MyFontWeight.regular),
),
TextSpan(
text:
"${AppUtils.calculateDouble(double.tryParse(rechargeA.rechargeMoney) ?? 0)}",
"${AppUtils.calculateDouble(double.tryParse(preferentialList.rechargeMoney) ?? 0)}",
style: TextStyle(
fontSize: 18.sp,
fontFamily: 'JDZhengHT',
color: selectIndex == index ? Color(0xFF353535) : Color(0xFF868686),
color: selectIndex == index
? Color(0xFF353535)
: Color(0xFF868686),
fontWeight: MyFontWeight.semi_bold),
),
]),
@ -567,74 +616,81 @@ class _RechargePage extends State<RechargePage> {
Container(
width: 1.w,
height: 37.h,
color: selectIndex == index ? Color(0xFF32A060):Color(0xFF979797),
color:
selectIndex == index ? Color(0xFF32A060) : Color(0xFF979797),
margin: EdgeInsets.only(right: 16.w, left: 12),
),
Expanded(
flex: 2,
child:Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text.rich(
TextSpan(children: [
TextSpan(
text: "实际到账 ",
style: TextStyle(
fontSize: 12.sp,
color: selectIndex == index ? Color(0xFF353535) : Color(0xFF868686),
fontWeight: MyFontWeight.regular),
Expanded(
flex: 2,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text.rich(
TextSpan(children: [
TextSpan(
text: "实际到账 ",
style: TextStyle(
fontSize: 12.sp,
color: selectIndex == index
? Color(0xFF353535)
: Color(0xFF868686),
fontWeight: MyFontWeight.regular),
),
TextSpan(
text:
"${AppUtils.calculateDouble((double.tryParse(preferentialList.rechargeMoney) ?? 0) + (double.tryParse(preferentialList.giftdMoney) ?? 0) + ((double.tryParse(preferentialList.rechargeMoney) ?? 0) - ((double.tryParse(preferentialList.rechargeMoney) ?? 0) * (discount / 100))))}",
style: TextStyle(
fontSize: 18.sp,
fontFamily: 'JDZhengHT',
color: selectIndex == index
? Color(0xFF353535)
: Color(0xFF868686),
fontWeight: MyFontWeight.semi_bold),
),
]),
),
TextSpan(
text:
"${AppUtils.calculateDouble((double.tryParse(rechargeA.rechargeMoney) ?? 0) + (double.tryParse(rechargeA.giftdMoney) ?? 0) + ((double.tryParse(rechargeA.rechargeMoney) ?? 0) - ((double.tryParse(rechargeA.rechargeMoney) ?? 0) * (discount / 100))))}",
style: TextStyle(
fontSize: 18.sp,
fontFamily: 'JDZhengHT',
color: selectIndex == index ? Color(0xFF353535) : Color(0xFF868686),
fontWeight: MyFontWeight.semi_bold),
SizedBox(
height: 4.h,
),
]),
),
SizedBox(
height: 4.h,
),
GestureDetector(
onTap: (){
setState(() {
if(selectIndex == index)
showRecharge(index);
});
},
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"充值说明",
style: TextStyle(
color: selectIndex == index ?Color(0xFF4D4D4D) : Color(0xFF868686),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
Icon(
Icons.chevron_right,
size: 20,
color: selectIndex == index ? Color(0xFF353535) : Color(0xFF868686),
),
],
)
),
],
))
GestureDetector(
onTap: () {
setState(() {
if (selectIndex == index) showRecharge(index);
});
},
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
"充值说明",
style: TextStyle(
color: selectIndex == index
? Color(0xFF4D4D4D)
: Color(0xFF868686),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
Icon(
Icons.chevron_right,
size: 20,
color: selectIndex == index
? Color(0xFF353535)
: Color(0xFF868686),
),
],
)),
],
))
],
));
}
Widget checkView(var index) {
return Container(
padding: EdgeInsets.only(right: 16.w,left: 46.w),
padding: EdgeInsets.only(right: 16.w, left: 46.w),
alignment: Alignment.center,
child: Image.asset(
checkIndex != index
@ -648,15 +704,153 @@ class _RechargePage extends State<RechargePage> {
///
showRecharge(index) {
showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
builder: (context) {
return RechargeWidget(rechargeA[index]);
});
}
showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
builder: (context) {
return RechargeWidget(rechargeActLists.preferentialList[index]);
});
}
///
showRecommendStore() {
showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
builder: (BuildContext context) {
return StatefulBuilder(builder: (
context,
state,
) {
return Container(
height: 321.h,
decoration: BoxDecoration(
color: Color(0xFFFAFAFA),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(6),
topRight: Radius.circular(6),
),
),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Container(
alignment: Alignment.center,
margin: EdgeInsets.symmetric(vertical: 12),
child: Text(
"选择推荐门店",
style: TextStyle(
fontWeight: MyFontWeight.bold,
fontSize: 15.sp,
color: Color(0xFF353535),
),
),
)),
GestureDetector(
onTap: () {
setState(() {
Navigator.of(context).pop();
});
},
child: Icon(
Icons.clear,
color: Colors.black,
size: 18,
),
),
SizedBox(width: 14),
],
),
Container(
height: 1,
color: Color(0xFFF2F2F2),
margin: EdgeInsets.only(bottom: 13.h),
),
Expanded(
child: ListView.builder(
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
state(() {
selectStoreIndex = position;
});
},
child: recommendStoreItem(position),
);
},
itemCount: rechargeActLists.channels.length ?? 0,
)),
GestureDetector(
onTap: () {
setState(() {
recommendName =
rechargeActLists.channels[selectStoreIndex];
Navigator.of(context).pop();
});
},
child: Container(
width: double.infinity,
height: 40.h,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(100),
color: Color(0xFF32A060),
),
alignment: Alignment.center,
margin: EdgeInsets.only(
top: 14.h, bottom: 30.h, left: 16.w, right: 16.w),
child: Text(
S.of(context).queding,
style: TextStyle(
fontWeight: MyFontWeight.bold,
fontSize: 16.sp,
color: Color(0xFFFFFFFF),
),
),
),
),
],
),
);
});
},);
}
Widget recommendStoreItem(index) {
return Container(
height: 52,
margin: EdgeInsets.only(bottom: 12, left: 14, right: 14),
width: double.infinity,
decoration: BoxDecoration(
borderRadius: new BorderRadius.circular(6),
border: Border.all(
color:
selectStoreIndex == index ? Color(0xFF32A060) : Color(0xFFF7F7F7),
width: selectStoreIndex == index ? 1 : 0,
),
color:
selectStoreIndex == index ? Color(0xFFF0FAF4) : Color(0xFFF7F7F7),
),
alignment: Alignment.centerLeft,
padding: EdgeInsets.only(
left: 12,
),
child: Text(
rechargeActLists?.channels[index] ?? "",
style: TextStyle(
fontWeight: MyFontWeight.bold,
fontSize: 14.sp,
color: selectStoreIndex == index ? Color(0xFF32A060) : Colors.black,
),
),
);
}
///
recharge() async {
// String money = controller.text;
// if (money == null || money == "") {
@ -673,11 +867,12 @@ class _RechargePage extends State<RechargePage> {
// }
BaseData<dynamic> baseData = await apiService.recharge({
"amount": 0,
"rechargeActId": rechargeA[selectIndex].id,
"rechargeType": checkIndex
"rechargeActId": rechargeActLists.preferentialList[selectIndex].id,
"rechargeType": checkIndex,
"channel": recommendName,
}).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
if(checkIndex==2){
if (checkIndex == 2) {
if (Platform.isAndroid) {
if (!(await Min.isInitialize())) {
// app的充值支付使用同一个WXPayEntryActivity回调
@ -701,22 +896,26 @@ class _RechargePage extends State<RechargePage> {
timeStamp: int.tryParse(wxPay.timeStamp),
sign: wxPay.sign,
);
}else{
tobias.isAliPayInstalled().then((value) => { //
if (!value) {
SmartDialog.showToast("请安装支付宝", alignment: Alignment.center)
}else{
tobias.aliPay(baseData.data["body"]).then((payRes) {
if (payRes['resultStatus'] == 9000 ||
payRes['resultStatus'] == '9000') {
SmartDialog.showToast("充值成功", alignment: Alignment.center);
Navigator.of(context).pop();
} else {
SmartDialog.showToast(payRes['memo'], alignment: Alignment.center);
}
})
}
});
} else {
tobias.isAliPayInstalled().then((value) => {
//
if (!value)
{SmartDialog.showToast("请安装支付宝", alignment: Alignment.center)}
else
{
tobias.aliPay(baseData.data["body"]).then((payRes) {
if (payRes['resultStatus'] == 9000 ||
payRes['resultStatus'] == '9000') {
SmartDialog.showToast("充值成功",
alignment: Alignment.center);
Navigator.of(context).pop();
} else {
SmartDialog.showToast(payRes['memo'],
alignment: Alignment.center);
}
})
}
});
}
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);

24
lib/retrofit/data/member_Infor.dart

@ -31,10 +31,10 @@ class MemberInfor {
int age,
String signature,
String background,
int follow,
int fans,
int trendTotal,
int gainLikeTotal,}){
String follow,
String fans,
String trendTotal,
String gainLikeTotal,}){
_id = id;
_nickname = nickname;
_headimg = headimg;
@ -86,10 +86,10 @@ class MemberInfor {
int _age;
String _signature;
String _background;
int _follow;
int _fans;
int _trendTotal;
int _gainLikeTotal;
String _follow;
String _fans;
String _trendTotal;
String _gainLikeTotal;
String get id => _id;
String get nickname => _nickname;
@ -104,10 +104,10 @@ class MemberInfor {
int get age => _age;
String get signature => _signature;
String get background => _background;
int get follow => _follow;
int get fans => _fans;
int get trendTotal => _trendTotal;
int get gainLikeTotal => _gainLikeTotal;
String get follow => _follow;
String get fans => _fans;
String get trendTotal => _trendTotal;
String get gainLikeTotal => _gainLikeTotal;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};

4
lib/retrofit/data/miNiDetail.dart

@ -946,8 +946,8 @@ class StoreDTOBean {
String storeName;
String nickName;
String logo;
int productCount;
int soldNum;
dynamic productCount;
dynamic soldNum;
static StoreDTOBean fromJson(Map<String, dynamic> map) {
if (map == null) return null;

155
lib/retrofit/data/rechargeActLists.dart

@ -0,0 +1,155 @@
/// preferentialList : [{"id":"1506553893994102784","rechargeMoney":"100.00","giftdMoney":"0.00","gitfdCouponId":null,"tenantCode":"admin","createTime":"2022-11-11 10:10:31","isDeleted":0,"rechargeType":0,"remark":"<p>充值说明:<br />平台充值根据用户在平台的会员等级享有不同的充值权益。<br />银卡用户享1.1倍充值会员权益,即充值100元账户110元。<br />金卡用户享1.2倍充值会员权益,即充值100元账户120元。<br />共创用户享1.3倍充值会员权益,即充值100元账户130元。<br />平台充值金可在平台上所有品牌和门店使用,包含:农场火锅、海峡姐妹、前进麦味、百年川椒、农场煮意、一心回乡生态农场等。<br />储值活动不与其他活动同享</p>","sortValue":1},{"id":"1506553858271215616","rechargeMoney":"300.00","giftdMoney":"0.00","gitfdCouponId":null,"tenantCode":"admin","createTime":"2022-11-21 19:56:39","isDeleted":0,"rechargeType":0,"remark":"<p>平台充值根据用户在平台的会员等级享有不同的充值权益。<br />银卡用户享1.1倍充值会员权益,即充值100元账户110元。<br />金卡用户享1.2倍充值会员权益,即充值100元账户120元。<br />共创用户享1.3倍充值会员权益,即充值100元账户130元。<br />平台充值金可在平台上所有品牌和门店使用,包含:农场火锅、海峡姐妹、前进麦味、百年川椒、农场煮意、一心回乡生态农场等。</p>","sortValue":2},{"id":"1506553832157478912","rechargeMoney":"500.00","giftdMoney":"0.00","gitfdCouponId":null,"tenantCode":"admin","createTime":"2022-11-21 19:56:48","isDeleted":0,"rechargeType":0,"remark":"<p>平台充值根据用户在平台的会员等级享有不同的充值权益。<br />银卡用户享1.1倍充值会员权益,即充值100元账户110元。<br />金卡用户享1.2倍充值会员权益,即充值100元账户120元。<br />共创用户享1.3倍充值会员权益,即充值100元账户130元。<br />平台充值金可在平台上所有品牌和门店使用,包含:农场火锅、海峡姐妹、前进麦味、百年川椒、农场煮意、一心回乡生态农场等。</p>","sortValue":3},{"id":"1506553759084314624","rechargeMoney":"800.00","giftdMoney":"0.00","gitfdCouponId":null,"tenantCode":"admin","createTime":"2022-06-10 11:14:39","isDeleted":0,"rechargeType":0,"remark":"<p>平台充值根据用户在平台的会员等级享有不同的充值权益。<br />银卡用户享1.1倍充值会员权益,即充值100元账户110元。<br />金卡用户享1.2倍充值会员权益,即充值100元账户120元。<br />共创用户享1.3倍充值会员权益,即充值100元账户130元。<br />平台充值金可在平台上所有品牌和门店使用,包含:农场火锅、海峡姐妹、前进麦味、百年川椒、农场煮意、一心回乡生态农场等。</p>","sortValue":4},{"id":"1506553705988620288","rechargeMoney":"1000.00","giftdMoney":"0.00","gitfdCouponId":null,"tenantCode":"admin","createTime":"2022-11-21 19:56:55","isDeleted":0,"rechargeType":0,"remark":"<p>充值说明:<br />平台充值根据用户在平台的会员等级享有不同的充值权益。<br />银卡用户享1.1倍充值会员权益,即充值100元账户110元。<br />金卡用户享1.2倍充值会员权益,即充值100元账户120元。<br />共创用户享1.3倍充值会员权益,即充值100元账户130元。<br />平台充值金可在平台上所有品牌和门店使用,包含:农场火锅、海峡姐妹、前进麦味、百年川椒、农场煮意、一心回乡生态农场等。</p>","sortValue":5},{"id":"1506553668529291264","rechargeMoney":"1500.00","giftdMoney":"0.00","gitfdCouponId":null,"tenantCode":"admin","createTime":"2022-06-10 11:14:52","isDeleted":0,"rechargeType":0,"remark":"<p>充值说明:<br />平台充值根据用户在平台的会员等级享有不同的充值权益。<br />银卡用户享1.1倍充值会员权益,即充值100元账户110元。<br />金卡用户享1.2倍充值会员权益,即充值100元账户120元。<br />共创用户享1.3倍充值会员权益,即充值100元账户130元。<br />平台充值金可在平台上所有品牌和门店使用,包含:农场火锅、海峡姐妹、前进麦味、百年川椒、农场煮意、一心回乡生态农场等。</p>","sortValue":6}]
/// channels : ["海峡","回乡","boom"]
/// isOpen : false
class RechargeActLists {
RechargeActLists({
List<PreferentialList> preferentialList,
List<String> channels,
bool isOpen,}){
_preferentialList = preferentialList;
_channels = channels;
_isOpen = isOpen;
}
RechargeActLists.fromJson(dynamic json) {
if (json['preferentialList'] != null) {
_preferentialList = [];
json['preferentialList'].forEach((v) {
_preferentialList.add(PreferentialList.fromJson(v));
});
}
_channels = json['channels'] != null ? json['channels'].cast<String>() : [];
_isOpen = json['isOpen'];
}
List<PreferentialList> _preferentialList;
List<String> _channels;
bool _isOpen;
RechargeActLists copyWith({ List<PreferentialList> preferentialList,
List<String> channels,
bool isOpen,
}) => RechargeActLists( preferentialList: preferentialList ?? _preferentialList,
channels: channels ?? _channels,
isOpen: isOpen ?? _isOpen,
);
List<PreferentialList> get preferentialList => _preferentialList;
List<String> get channels => _channels;
bool get isOpen => _isOpen;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
if (_preferentialList != null) {
map['preferentialList'] = _preferentialList.map((v) => v.toJson()).toList();
}
map['channels'] = _channels;
map['isOpen'] = _isOpen;
return map;
}
}
/// id : "1506553893994102784"
/// rechargeMoney : "100.00"
/// giftdMoney : "0.00"
/// gitfdCouponId : null
/// tenantCode : "admin"
/// createTime : "2022-11-11 10:10:31"
/// isDeleted : 0
/// rechargeType : 0
/// remark : "<p>充值说明:<br />平台充值根据用户在平台的会员等级享有不同的充值权益。<br />银卡用户享1.1倍充值会员权益,即充值100元账户110元。<br />金卡用户享1.2倍充值会员权益,即充值100元账户120元。<br />共创用户享1.3倍充值会员权益,即充值100元账户130元。<br />平台充值金可在平台上所有品牌和门店使用,包含:农场火锅、海峡姐妹、前进麦味、百年川椒、农场煮意、一心回乡生态农场等。<br />储值活动不与其他活动同享</p>"
/// sortValue : 1
class PreferentialList {
PreferentialList({
String id,
String rechargeMoney,
String giftdMoney,
dynamic gitfdCouponId,
String tenantCode,
String createTime,
num isDeleted,
num rechargeType,
String remark,
num sortValue,}){
_id = id;
_rechargeMoney = rechargeMoney;
_giftdMoney = giftdMoney;
_gitfdCouponId = gitfdCouponId;
_tenantCode = tenantCode;
_createTime = createTime;
_isDeleted = isDeleted;
_rechargeType = rechargeType;
_remark = remark;
_sortValue = sortValue;
}
PreferentialList.fromJson(dynamic json) {
_id = json['id'];
_rechargeMoney = json['rechargeMoney'];
_giftdMoney = json['giftdMoney'];
_gitfdCouponId = json['gitfdCouponId'];
_tenantCode = json['tenantCode'];
_createTime = json['createTime'];
_isDeleted = json['isDeleted'];
_rechargeType = json['rechargeType'];
_remark = json['remark'];
_sortValue = json['sortValue'];
}
String _id;
String _rechargeMoney;
String _giftdMoney;
dynamic _gitfdCouponId;
String _tenantCode;
String _createTime;
num _isDeleted;
num _rechargeType;
String _remark;
num _sortValue;
PreferentialList copyWith({ String id,
String rechargeMoney,
String giftdMoney,
dynamic gitfdCouponId,
String tenantCode,
String createTime,
num isDeleted,
num rechargeType,
String remark,
num sortValue,
}) => PreferentialList( id: id ?? _id,
rechargeMoney: rechargeMoney ?? _rechargeMoney,
giftdMoney: giftdMoney ?? _giftdMoney,
gitfdCouponId: gitfdCouponId ?? _gitfdCouponId,
tenantCode: tenantCode ?? _tenantCode,
createTime: createTime ?? _createTime,
isDeleted: isDeleted ?? _isDeleted,
rechargeType: rechargeType ?? _rechargeType,
remark: remark ?? _remark,
sortValue: sortValue ?? _sortValue,
);
String get id => _id;
String get rechargeMoney => _rechargeMoney;
String get giftdMoney => _giftdMoney;
dynamic get gitfdCouponId => _gitfdCouponId;
String get tenantCode => _tenantCode;
String get createTime => _createTime;
num get isDeleted => _isDeleted;
num get rechargeType => _rechargeType;
String get remark => _remark;
num get sortValue => _sortValue;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = _id;
map['rechargeMoney'] = _rechargeMoney;
map['giftdMoney'] = _giftdMoney;
map['gitfdCouponId'] = _gitfdCouponId;
map['tenantCode'] = _tenantCode;
map['createTime'] = _createTime;
map['isDeleted'] = _isDeleted;
map['rechargeType'] = _rechargeType;
map['remark'] = _remark;
map['sortValue'] = _sortValue;
return map;
}
}

6
lib/retrofit/data/settleOrderInfo.dart

@ -22,6 +22,8 @@ class SettleOrderInfo {
bool isRaise;
int selectDiscount;
bool useVipPriceSelect = false;
String vipDiscountAmount;
static SettleOrderInfo fromJson(Map<String, dynamic> map) {
if (map == null) return null;
@ -51,6 +53,7 @@ class SettleOrderInfo {
settleOrderInfoBean.usePlateMoney = map['usePlateMoney'];
settleOrderInfoBean.isRaise = map['isRaise'];
settleOrderInfoBean.selectDiscount = map['selectDiscount'];
settleOrderInfoBean.vipDiscountAmount = map['vipDiscountAmount'];
return settleOrderInfoBean;
}
@ -73,7 +76,8 @@ class SettleOrderInfo {
"memberCouponId": memberCouponId,
"usePlateMoney":usePlateMoney,
"isRaise":isRaise,
"selectDiscount":selectDiscount
"selectDiscount":selectDiscount,
"vipDiscountAmount":vipDiscountAmount
};

18
lib/retrofit/data/social_info.dart

@ -3,9 +3,9 @@
class SocialInfo {
SocialInfo({
int fans,
int follow,
int achievementNumber}){
dynamic fans,
dynamic follow,
dynamic achievementNumber}){
_fans = fans;
_follow = follow;
_achievementNumber = achievementNumber;
@ -16,13 +16,13 @@ class SocialInfo {
_follow = json['follow'];
_achievementNumber = json['achievementNumber'];
}
int _fans;
int _follow;
int _achievementNumber;
dynamic _fans;
dynamic _follow;
dynamic _achievementNumber;
int get fans => _fans;
int get follow => _follow;
int get achievementNumber => _achievementNumber;
dynamic get fans => _fans;
dynamic get follow => _follow;
dynamic get achievementNumber => _achievementNumber;
set fans(int value) {

8
lib/retrofit/data/user_info.dart

@ -41,8 +41,8 @@ class UserInfo {
String raiseExpireTime;
bool isBind;
String masterId;
int inviteNumber;
int todayInviteNumber;
dynamic inviteNumber;
dynamic todayInviteNumber;
String masterCardRankName;
MemberRank memberRankVo;
String inviteCode;
@ -76,8 +76,8 @@ class UserInfo {
..raiseExpireTime = json['raiseExpireTime'] as String
..isBind = json['isBind'] as bool
..masterId = json['masterId'] as String
..inviteNumber = json['inviteNumber'] as int
..todayInviteNumber = json['todayInviteNumber'] as int
..inviteNumber = json['inviteNumber'] as dynamic
..todayInviteNumber = json['todayInviteNumber'] as dynamic
..masterCardRankName = json['masterCardRankName'] as String
..inviteCode = json['inviteCode'] as String
..signature = json['signature'] as String

5
lib/retrofit/retrofit_api.dart

@ -47,6 +47,7 @@ import 'data/message.dart';
import 'data/msg_stats.dart';
import 'data/page.dart';
import 'data/rank.dart';
import 'data/rechargeActLists.dart';
import 'data/recharge_list.dart';
import 'data/second_card_list.dart';
import 'data/sign_info.dart';
@ -215,8 +216,8 @@ abstract class ApiService {
Future<BaseData<dynamic>> recharge(@Body() Map<String, dynamic> param);
///
@GET("/wallet/rechargeAct")
Future<BaseData<List<RechargeList>>> rechargeAct();
@GET("/wallet/rechargeActList")
Future<BaseData<RechargeActLists>> rechargeActList();
///
@GET("/coupon/receive?couponId={couponId}")

14
lib/retrofit/retrofit_api.g.dart

@ -301,12 +301,12 @@ class _ApiService implements ApiService {
}
@override
Future<BaseData<List<RechargeList>>> rechargeAct() async {
Future<BaseData<RechargeActLists>> rechargeActList() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/wallet/rechargeAct',
'/wallet/rechargeActList',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
@ -314,12 +314,10 @@ class _ApiService implements ApiService {
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<List<RechargeList>>.fromJson(
_result.data,
(json) => (json as List<dynamic>)
.map<RechargeList>(
(i) => RechargeList.fromJson(i as Map<String, dynamic>))
.toList());
final value = BaseData<RechargeActLists>.fromJson(
_result.data,
(json) => RechargeActLists.fromJson(json),
);
return value;
}

74
lib/settlement/settlement.dart

@ -136,13 +136,13 @@ class _Settlement extends State<Settlement> {
queryOrderInfo(
address != null ? address.id : null,
selectedBtn,
null,
0,
widget.arguments["pid"] ?? (productId ?? ""),
0,
widget.arguments["pid"] ?? (productId ?? 0),
productSkuId ?? "",
actProductId ?? "",
actProductSkuId ?? "",
useVipPriceSelect,
// useVipPriceSelect,
count1,
payChannel,
tableId);
@ -152,11 +152,11 @@ class _Settlement extends State<Settlement> {
selectedBtn,
widget.arguments["cid"],
0,
productId ?? null,
productId ?? 0,
productSkuId ?? "",
actProductId ?? "",
actProductSkuId ?? "",
useVipPriceSelect,
// useVipPriceSelect,
count1,
payChannel,
tableId);
@ -164,13 +164,13 @@ class _Settlement extends State<Settlement> {
queryOrderInfo(
null,
selectedBtn,
null,
0,
productId ?? null,
0,
productId ?? 0,
productSkuId ?? "",
actProductId ?? "",
actProductSkuId ?? "",
useVipPriceSelect,
// useVipPriceSelect,
count1,
payChannel,
tableId);
@ -192,7 +192,7 @@ class _Settlement extends State<Settlement> {
productSkuId,
actProductId,
actProductSkuId,
useVipPriceSelect,
// useVipPriceSelect,
buyNum,
payChannel,
tableId) async {
@ -208,10 +208,11 @@ class _Settlement extends State<Settlement> {
"productSkuId": productSkuId,
"actProductId": actProductId,
"actProductSkuId": actProductSkuId,
"useVipPrice": useVipPriceSelect,
// "useVipPrice": useVipPriceSelect,
"buyNum": buyNum,
"payChannel": payChannel,
"tableId": tableId
"tableId": tableId,
"discountType":"AUTO"
}).catchError((error) {});
this.promotion = null;
promotions = "";
@ -252,7 +253,7 @@ class _Settlement extends State<Settlement> {
productSkuId ?? "",
actProductId ?? "",
actProductSkuId ?? "",
useVipPriceSelect,
// useVipPriceSelect,
count1,
settleOrderInfo.isRaise ? 7 : payChannel,
tableId);
@ -329,13 +330,13 @@ class _Settlement extends State<Settlement> {
queryOrderInfo(
address.id,
selectedBtn,
null,
0,
productId ?? null,
0,
productId ?? 0,
productSkuId ?? "",
actProductId ?? "",
actProductSkuId ?? "",
useVipPriceSelect,
// useVipPriceSelect,
count1,
payChannel,
tableId);
@ -381,13 +382,13 @@ class _Settlement extends State<Settlement> {
await queryOrderInfo(
address.id,
selectedBtn,
null,
0,
productId ?? null,
0,
productId ?? 0,
productSkuId ?? "",
actProductId ?? "",
actProductSkuId ?? "",
useVipPriceSelect,
// useVipPriceSelect,
count1,
payChannel,
tableId);
@ -409,13 +410,13 @@ class _Settlement extends State<Settlement> {
queryOrderInfo(
address.id,
selectedBtn,
null,
0,
productId ?? null,
0,
productId ?? 0,
productSkuId ?? "",
actProductId ?? "",
actProductSkuId ?? "",
useVipPriceSelect,
// useVipPriceSelect,
count1,
payChannel,
tableId);
@ -506,9 +507,9 @@ class _Settlement extends State<Settlement> {
placeOrderFirst.isTakeOut = selectedBtn;
placeOrderFirst.notes = remakers +
(reservationTime ?? "") +
(subscribeParam == null
? ""
: "预约门店:${((subscribeParam?.stores?.length ?? 0) == 1 ? (subscribeParam.stores[0]) : (subscribeStoresName ?? ""))}");
((subscribeParam?.isEnableSubscribe ?? false) == true
? "预约门店:${((subscribeParam?.stores?.length ?? 0) == 1 ? (subscribeParam.stores[0]) : (subscribeStoresName ?? ""))}"
: "");
placeOrderFirst.numberOfPeople = "$numberOfPeople";
placeOrderFirst.orderSource = 2;
placeOrderFirst.orderType = "0";
@ -787,11 +788,11 @@ class _Settlement extends State<Settlement> {
isTake,
memberCouponId,
orderId,
promotionId ?? (productId ?? ""),
promotionId ?? (productId ?? 0),
productSkuId ?? "",
actProductId ?? "",
actProductSkuId ?? "",
useVipPriceSelect,
// useVipPriceSelect,
count1,
payChannel,
tableId ?? 0);
@ -942,7 +943,7 @@ class _Settlement extends State<Settlement> {
if (subscribeParam != null && ((subscribeParam.isEnableSubscribe ?? false) ==
true) &&
(reservationTime == null ||
subscribeStoresName == null)) {
((subscribeParam.stores.length ==1 ? subscribeParam.stores[0] : subscribeStoresName) == null))) {
SmartDialog.showToast(
(reservationTime == null)
? "请选择预约时间"
@ -988,7 +989,7 @@ class _Settlement extends State<Settlement> {
productSkuId ?? "",
actProductId ?? "",
actProductSkuId ?? "",
useVipPriceSelect,
// useVipPriceSelect,
count1,
payChannel,
tableId);
@ -1003,13 +1004,13 @@ class _Settlement extends State<Settlement> {
queryOrderInfo(
address?.id,
selectedBtn,
null,
0,
productId ?? null,
0,
productId ?? 0,
productSkuId ?? "",
actProductId ?? "",
actProductSkuId ?? "",
useVipPriceSelect,
// useVipPriceSelect,
count1,
payChannel,
tableId);
@ -1061,11 +1062,11 @@ class _Settlement extends State<Settlement> {
selectedBtn,
couponBean?.id,
0,
productId ?? null,
productId ?? 0,
productSkuId ?? "",
actProductId ?? "",
actProductSkuId ?? "",
useVipPriceSelect,
// useVipPriceSelect,
count1,
payChannel,
tableId);
@ -1092,13 +1093,13 @@ class _Settlement extends State<Settlement> {
queryOrderInfo(
address?.id,
selectedBtn,
null,
0,
0,
(pro.id ?? "") ?? productId,
productSkuId ?? "",
actProductId ?? "",
actProductSkuId ?? "",
useVipPriceSelect,
// useVipPriceSelect,
count1,
payChannel,
tableId);
@ -1236,8 +1237,7 @@ class _Settlement extends State<Settlement> {
GestureDetector(
onTap: (){
setState(() {
subscribeStoresName =
subscribeParam.stores[storesIndex];
subscribeStoresName = subscribeParam.stores[storesIndex];
});
Navigator.of(context).pop();
},

8
lib/view_widget/recharge_details_dialog.dart

@ -11,9 +11,11 @@ import 'package:huixiang/view_widget/border_text.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/round_button.dart';
import '../retrofit/data/rechargeActLists.dart';
class RechargeWidget extends StatefulWidget {
final RechargeList rechargeA;
RechargeWidget(this.rechargeA);
final PreferentialList preferentialList;
RechargeWidget(this.preferentialList);
@override
State<StatefulWidget> createState() {
return _RechargeWidget();
@ -87,7 +89,7 @@ class _RechargeWidget extends State<RechargeWidget> {
child: Container(
color: Colors.white,
child: Html(
data: widget.rechargeA.remark ?? "",
data: widget.preferentialList.remark ?? "",
customImageRenders: {
networkSourceMatcher(): networkImageRender(
loadingWidget: () {

Loading…
Cancel
Save