Browse Source

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

dart3_last
fmk 2 years ago
parent
commit
ec18602e1c
  1. 14
      lib/home/welfare_page.dart
  2. 2
      lib/retrofit/retrofit_api.dart
  3. 2
      lib/settlement/settlement.dart
  4. 2
      lib/settlement/settlement_view/activity_coupon_remarks.dart
  5. 8
      lib/view_widget/new_coupon_widget.dart
  6. 24
      lib/vip/vip_page.dart
  7. 8
      lib/vip/vip_view/vip_top.dart

14
lib/home/welfare_page.dart

@ -157,7 +157,7 @@ class _WelfarePage extends State<WelfarePage> {
appBar: MyAppBar(
background: Colors.transparent,
leadingColor: Colors.white,
title: "福利中心",
title: S.of(context).fulizhongxin,
titleColor: Colors.white,
titleSize: 18.sp,
brightness: Brightness.dark,
@ -520,7 +520,7 @@ class _WelfarePage extends State<WelfarePage> {
textBaseline: TextBaseline.alphabetic,
children: [
Text(
"¥",
cop.limitAmount != "0.00"?"¥":"",
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.medium,
@ -531,9 +531,9 @@ class _WelfarePage extends State<WelfarePage> {
height: 4.h,
),
Text(
coupon != null
cop.limitAmount != "0.00"?(coupon != null
? "${AppUtils.calculateDouble(double.tryParse(cop.limitAmount) ?? 0)}"
: "",
: "") :"",
style: TextStyle(
fontSize: 24.sp,
fontWeight: FontWeight.bold,
@ -555,10 +555,10 @@ class _WelfarePage extends State<WelfarePage> {
textBaseline: TextBaseline.alphabetic,
children: [
Text(
coupon != null
cop.discountPercent != 0 ? (coupon != null
? "${(cop.discountPercent / 10.0 >= 10) ? 10 : cop.discountPercent / 10.0}" ??
"0"
: "",
: ""):"",
style: TextStyle(
fontSize: 30.sp,
fontWeight: MyFontWeight.semi_bold,
@ -569,7 +569,7 @@ class _WelfarePage extends State<WelfarePage> {
height: 4.h,
),
Text(
"",
cop.discountPercent != 0 ? "" :"",
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold,

2
lib/retrofit/retrofit_api.dart

@ -537,7 +537,7 @@ abstract class ApiService {
Future<BaseData<VipCardHome>> vipCardIndex();
///VIP订阅/
@POST("/vipCard/orderVip/{id}")
@POST("/vipCard/orderVip")
Future<BaseData<dynamic>> orderVip(@Body() Map<String, dynamic> param);

2
lib/settlement/settlement.dart

@ -80,7 +80,7 @@ class _Settlement extends State<Settlement> {
int count1 = 0;
String productId;
bool orderButton = false;
bool useVipPriceSelect = false;
bool useVipPriceSelect = true;
@override
void initState() {

2
lib/settlement/settlement_view/activity_coupon_remarks.dart

@ -43,7 +43,7 @@ class ActivityCouponRemarks extends StatefulWidget {
}
class _ActivityCouponRemarks extends State<ActivityCouponRemarks> {
bool vipSelect = false;
bool vipSelect = true;
@override
Widget build(BuildContext context) {

8
lib/view_widget/new_coupon_widget.dart

@ -497,6 +497,7 @@ class NewCouponWidget extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
if(coupon?.limitAmount != "0.00")
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.baseline,
@ -532,16 +533,17 @@ class NewCouponWidget extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
// if(coupon.discountPercent != 0)
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.baseline,
textBaseline: TextBaseline.alphabetic,
children: [
Text(
coupon != null
coupon.discountPercent != 0?( coupon != null
? "${(coupon.discountPercent / 10.0 >= 10) ? 10 : coupon.discountPercent / 10.0}" ??
"0"
: "",
: ""):"",
style: TextStyle(
fontSize: 37.sp,
fontWeight: MyFontWeight.semi_bold,
@ -552,7 +554,7 @@ class NewCouponWidget extends StatelessWidget {
height: 4.h,
),
Text(
"",
"${coupon.discountPercent != 0 ? "":""}",
style: TextStyle(
fontSize: 20.sp,
fontWeight: MyFontWeight.semi_bold,

24
lib/vip/vip_page.dart

@ -44,6 +44,7 @@ class _VipPageState extends State<VipPage> with AutomaticKeepAliveClientMixin {
}
queryVipHome() async {
try{
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
@ -63,11 +64,9 @@ class _VipPageState extends State<VipPage> with AutomaticKeepAliveClientMixin {
_refreshController.refreshFailed();
SmartDialog.showToast(baseData.msg ?? "", alignment: Alignment.center);
}
}finally{
setState((){});
}
_onRefresh() {
queryVipHome();
}
@override
@ -77,20 +76,14 @@ class _VipPageState extends State<VipPage> with AutomaticKeepAliveClientMixin {
backgroundColor: Color(0xFFF9FAF7),
body: Container(
padding: EdgeInsets.only(bottom: 76.h),
child: Container(
child: FutureBuilder(
future:queryVipHome(),
builder: (context, snapshot) {
return SmartRefresher(
child: SmartRefresher(
controller: _refreshController,
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
physics: BouncingScrollPhysics(),
onRefresh: () {
setState(() {
_onRefresh();
});
queryVipHome();
},
child: SingleChildScrollView(
child: Container(
@ -98,7 +91,9 @@ class _VipPageState extends State<VipPage> with AutomaticKeepAliveClientMixin {
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
VipTop(vipHome,_onRefresh()),
VipTop(vipHome,(){
queryVipHome();
}),
if(vipHome !=null)
VipGoodsDiscount(vipHome),
@ -108,9 +103,6 @@ class _VipPageState extends State<VipPage> with AutomaticKeepAliveClientMixin {
),
),
),
);
},
),
),
),
);

8
lib/vip/vip_view/vip_top.dart

@ -20,9 +20,9 @@ import 'package:tobias/tobias.dart' as tobias;
class VipTop extends StatefulWidget {
final VipCardHome vipCardHome;
final Function onRefresh;
final Function queryVipHome;
VipTop(this.vipCardHome, this.onRefresh);
VipTop(this.vipCardHome, this.queryVipHome);
@override
State<StatefulWidget> createState() {
@ -42,7 +42,7 @@ class _VipTop extends State<VipTop> {
payListen = weChatResponseEventHandler.listen((event) async {
print("payCallback: ${event.errCode}");
if (event.errCode == 0) {
widget.onRefresh();
widget.queryVipHome();
SmartDialog.showToast("支付成功", alignment: Alignment.center);
} else {
SmartDialog.showToast("支付失败", alignment: Alignment.center);
@ -96,7 +96,7 @@ class _VipTop extends State<VipTop> {
tobias.aliPay(baseData.data["body"]).then((payRes) {
if (payRes['resultStatus'] == 9000 ||
payRes['resultStatus'] == '9000') {
widget.onRefresh();
widget.queryVipHome();
SmartDialog.showToast("支付成功",
alignment: Alignment.center);
} else {

Loading…
Cancel
Save