Browse Source

PayMethod 修改

wr_2024_invoice
zsw 7 months ago
parent
commit
5aa13a518e
  1. 2
      android/gradle/wrapper/gradle-wrapper.properties
  2. 8
      ios/ .xcodeproj/project.pbxproj
  3. 0
      ios/ .xcodeproj/project.xcworkspace/contents.xcworkspacedata
  4. 0
      ios/ .xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
  5. 0
      ios/ .xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
  6. 0
      ios/ .xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
  7. 6
      ios/Podfile.lock
  8. 96
      lib/settlement/settlement_view/pay_method.dart

2
android/gradle/wrapper/gradle-wrapper.properties vendored

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

8
ios/Runner.xcodeproj/project.pbxproj → ios/ .xcodeproj/project.pbxproj

@ -650,7 +650,7 @@
"$(PROJECT_DIR)/baidu",
"$(PROJECT_DIR)/Runner/baidu",
);
MARKETING_VERSION = 3.2.29;
MARKETING_VERSION = 3.2.30;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = (
"$(inherited)",
@ -849,7 +849,7 @@
"$(PROJECT_DIR)/baidu",
"$(PROJECT_DIR)/Runner/baidu",
);
MARKETING_VERSION = 3.2.29;
MARKETING_VERSION = 3.2.30;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = (
"$(inherited)",
@ -939,7 +939,7 @@
"$(PROJECT_DIR)/baidu",
"$(PROJECT_DIR)/Runner/baidu",
);
MARKETING_VERSION = 3.2.29;
MARKETING_VERSION = 3.2.30;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = (
"$(inherited)",
@ -970,7 +970,7 @@
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
97C146E91CF9000F007C117D /* Build configuration list for PBXProject " " */ = {
isa = XCConfigurationList;
buildConfigurations = (
97C147031CF9000F007C117D /* Debug */,

0
ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata → ios/ .xcodeproj/project.xcworkspace/contents.xcworkspacedata generated

0
ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist → ios/ .xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist

0
ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings → ios/ .xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings

0
ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme → ios/ .xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

6
ios/Podfile.lock

@ -75,8 +75,6 @@ PODS:
- mob_sharesdk/ShareSDKPlatforms/WeChat_Lite
- mob_sharesdk/ShareSDKUI
- SSZipArchive (2.4.3)
- thumbnails (0.0.1):
- Flutter
- tobias (0.0.1):
- Flutter
- TPNS-iOS (1.3.4.1)
@ -116,7 +114,6 @@ DEPENDENCIES:
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/ios`)
- sharesdk_plugin (from `.symlinks/plugins/sharesdk_plugin/ios`)
- SSZipArchive (~> 2.4.2)
- thumbnails (from `.symlinks/plugins/thumbnails/ios`)
- tobias (from `.symlinks/plugins/tobias/ios`)
- tpns_flutter_plugin (from `.symlinks/plugins/tpns_flutter_plugin/ios`)
- umeng_common_sdk (from `.symlinks/plugins/umeng_common_sdk/ios`)
@ -165,8 +162,6 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/shared_preferences_foundation/ios"
sharesdk_plugin:
:path: ".symlinks/plugins/sharesdk_plugin/ios"
thumbnails:
:path: ".symlinks/plugins/thumbnails/ios"
tobias:
:path: ".symlinks/plugins/tobias/ios"
tpns_flutter_plugin:
@ -202,7 +197,6 @@ SPEC CHECKSUMS:
shared_preferences_foundation: 986fc17f3d3251412d18b0265f9c64113a8c2472
sharesdk_plugin: f29a6f471ae1c253e96636d62106c3f8d793948c
SSZipArchive: fe6a26b2a54d5a0890f2567b5cc6de5caa600aef
thumbnails: bb4f4e9bb4b51c8ae4e6ad9a2fa81373f9b634ad
tobias: 2aded9b83e3663b907360a800d8e3c13284f25c5
TPNS-iOS: 36c335eff80670de6ede780ab827f679d78f64ff
tpns_flutter_plugin: ed7fae92efde473d5cb9fd33ac92caa2d64530a2

96
lib/settlement/settlement_view/pay_method.dart

@ -1,14 +1,12 @@
import 'dart:convert';
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/utils/font_weight.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../../retrofit/data/min_order_info.dart';
import '../../retrofit/data/settleOrderInfo.dart';
import '../../view_widget/settlement_tips_dialog.dart';
class PayMethod extends StatefulWidget {
final Function(int payChannel) payChannelCheck;
@ -95,6 +93,17 @@ class _PayMethod extends State<PayMethod> {
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
double m = double.parse(money);
if (m == null) {
m = 0;
}
double orderSum = double.parse(widget.settleOrderInfo?.orderSum ?? '0');
if (orderSum == null) {
orderSum = 0;
}
if (orderSum > m) {
return;
}
setState(() {
checkIndex = 1;
});
@ -104,7 +113,7 @@ class _PayMethod extends State<PayMethod> {
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
checkView(1),
checkView(1, isHide: (double.parse(widget.settleOrderInfo?.orderSum ?? '0') ?? 0) > (double.parse(money) ?? 0)),
Expanded(
child: Container(),
flex: 1,
@ -114,7 +123,7 @@ class _PayMethod extends State<PayMethod> {
style: TextStyle(
fontSize: 14.sp,
fontFamily: 'JDZhengHT',
color: Color(0xff353535),
color: (double.parse(widget.settleOrderInfo?.orderSum ?? '0') ?? 0) > (double.parse(money) ?? 0) ? Color(0x66353535) : Color(0xff353535),
fontWeight: MyFontWeight.medium,
),
),
@ -125,7 +134,7 @@ class _PayMethod extends State<PayMethod> {
S.of(context).huixiangqianbao,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xff353535),
color: (double.parse(widget.settleOrderInfo?.orderSum ?? '0') ?? 0) > (double.parse(money) ?? 0) ? Color(0x66353535) : Color(0xff353535),
fontWeight: MyFontWeight.semi_bold,
),
),
@ -140,6 +149,17 @@ class _PayMethod extends State<PayMethod> {
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
double balanceMoney = double.parse(balance);
if (balanceMoney == null) {
balanceMoney = 0;
}
double orderSum = double.parse(widget.settleOrderInfo?.orderSum ?? '0');
if (orderSum == null) {
orderSum = 0;
}
if (orderSum > balanceMoney) {
return;
}
setState(() {
checkIndex = 2;
});
@ -149,7 +169,7 @@ class _PayMethod extends State<PayMethod> {
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
checkView(2),
checkView(2, isHide: (double.parse(widget.settleOrderInfo?.orderSum ?? '0') ?? 0) > (double.parse(balance) ?? 0)),
Expanded(
child: Container(),
flex: 1,
@ -159,7 +179,7 @@ class _PayMethod extends State<PayMethod> {
style: TextStyle(
fontSize: 14.sp,
fontFamily: 'JDZhengHT',
color: Color(0xff353535),
color: (double.parse(widget.settleOrderInfo?.orderSum ?? '0') ?? 0) > (double.parse(balance) ?? 0) ? Color(0x66353535) : Color(0xff353535),
fontWeight: MyFontWeight.medium,
),
),
@ -170,7 +190,7 @@ class _PayMethod extends State<PayMethod> {
S.of(context).mendianyue,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xff353535),
color: (double.parse(widget.settleOrderInfo?.orderSum ?? '0') ?? 0) > (double.parse(balance) ?? 0) ? Color(0x66353535) : Color(0xff353535),
fontWeight: MyFontWeight.semi_bold,
),
),
@ -189,7 +209,11 @@ class _PayMethod extends State<PayMethod> {
if (greenMoney == null) {
greenMoney = 0;
}
if (widget.settleOrderInfo.orderNum > greenMoney) {
double orderSum = double.parse(widget.settleOrderInfo?.orderSum ?? '0');
if (orderSum == null) {
orderSum = 0;
}
if (orderSum > greenMoney) {
return;
}
setState(() {
@ -215,14 +239,14 @@ class _PayMethod extends State<PayMethod> {
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
checkView(3),
checkView(3, isHide: (double.parse(widget.settleOrderInfo?.orderSum ?? '0') ?? 0) > (double.parse(mGreenMoney) ?? 0)),
Spacer(flex: 1,),
Text(
"¥$mGreenMoney",
style: TextStyle(
fontSize: 14.sp,
fontFamily: 'JDZhengHT',
color: Color(0xff353535),
color: (double.parse(widget.settleOrderInfo?.orderSum ?? '0') ?? 0) > (double.parse(mGreenMoney) ?? 0) ? Color(0x66353535) : Color(0xff353535),
fontWeight: MyFontWeight.medium,
),
),
@ -233,7 +257,7 @@ class _PayMethod extends State<PayMethod> {
S.of(context).lvbizhifu,
style: TextStyle(
fontSize: 14.sp,
color: widget.settleOrderInfo.orderNum > (double.parse(mGreenMoney) ?? 0) ? Color(0x66353535) : Color(0xff353535),
color: (double.parse(widget.settleOrderInfo?.orderSum ?? '0') ?? 0) > (double.parse(mGreenMoney) ?? 0) ? Color(0x66353535) : Color(0xff353535),
fontWeight: MyFontWeight.semi_bold,
),
),
@ -248,17 +272,28 @@ class _PayMethod extends State<PayMethod> {
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
checkIndex = 4;
if(widget.promotions != "" || widget.coupons != "" || widget.useVipPriceSelect || widget.useBenefitSelect){
SmartDialog.show(
widget: SettlementTips(
() {},
text: "助农积分不参与任何活动优惠,请重新选择支付方式",
),
);
double raiseMoney = double.parse(mRaiseMoney);
if (raiseMoney == null) {
raiseMoney = 0;
}
double orderSum = double.parse(widget.settleOrderInfo?.orderSum ?? '0');
if (orderSum == null) {
orderSum = 0;
}
if (orderSum > raiseMoney) {
return;
}
setState(() {
checkIndex = 4;
// if(widget.promotions != "" || widget.coupons != "" || widget.useVipPriceSelect || widget.useBenefitSelect){
// SmartDialog.show(
// widget: SettlementTips(
// () {},
// text: "助农积分不参与任何活动优惠,请重新选择支付方式",
// ),
// );
// return;
// }
});
widget.payChannelCheck(7);
},
@ -266,9 +301,8 @@ class _PayMethod extends State<PayMethod> {
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
checkView(4),
Expanded(
child: Container(),
checkView(4, isHide: (double.parse(widget.settleOrderInfo?.orderSum ?? '0') ?? 0) > (double.parse(mRaiseMoney) ?? 0)),
Spacer(
flex: 1,
),
Text(
@ -276,7 +310,7 @@ class _PayMethod extends State<PayMethod> {
style: TextStyle(
fontSize: 14.sp,
fontFamily: 'JDZhengHT',
color: Color(0xff353535),
color: (double.parse(widget.settleOrderInfo?.orderSum ?? '0') ?? 0) > (double.parse(mRaiseMoney) ?? 0) ? Color(0x66353535) : Color(0xff353535),
fontWeight: MyFontWeight.medium,
),
),
@ -287,7 +321,7 @@ class _PayMethod extends State<PayMethod> {
S.of(context).zhunongjifen,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xff353535),
color: (double.parse(widget.settleOrderInfo?.orderSum ?? '0') ?? 0) > (double.parse(mRaiseMoney) ?? 0) ? Color(0x66353535) : Color(0xff353535),
fontWeight: MyFontWeight.semi_bold,
),
),
@ -333,7 +367,15 @@ class _PayMethod extends State<PayMethod> {
var checkIndex = 5;
Widget checkView(var index) {
Widget checkView(var index, {bool isHide = false}) {
if (isHide) {
return Container(
padding: EdgeInsets.only(right:36.w),
alignment: Alignment.center,
);
}
return Container(
padding: EdgeInsets.only(right:36.w),
alignment: Alignment.center,

Loading…
Cancel
Save