|
|
@ -65,6 +65,12 @@ class _ServiceSubscriptionPage extends State<ServiceSubscriptionPage> { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
|
|
|
void dispose() { |
|
|
|
|
|
|
|
super.dispose(); |
|
|
|
|
|
|
|
if (payListen != null) payListen.cancel(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
///服务套餐列表 |
|
|
|
///服务套餐列表 |
|
|
|
queryTenantList({isSing = true}) async { |
|
|
|
queryTenantList({isSing = true}) async { |
|
|
|
if (isSing) |
|
|
|
if (isSing) |
|
|
@ -115,7 +121,6 @@ class _ServiceSubscriptionPage extends State<ServiceSubscriptionPage> { |
|
|
|
BaseData<TenantPackageCalculateDetails> baseData = |
|
|
|
BaseData<TenantPackageCalculateDetails> baseData = |
|
|
|
await businessService.tenantPackageCalculate({ |
|
|
|
await businessService.tenantPackageCalculate({ |
|
|
|
"packageId": int.tryParse(tenantPackageList[serviceType]?.id ?? 0), |
|
|
|
"packageId": int.tryParse(tenantPackageList[serviceType]?.id ?? 0), |
|
|
|
"payChannel": payType, |
|
|
|
|
|
|
|
"packageSale": { |
|
|
|
"packageSale": { |
|
|
|
"packagePrice": tenantPackageList[serviceType] |
|
|
|
"packagePrice": tenantPackageList[serviceType] |
|
|
|
?.tenantPackageSale[selectIndex] |
|
|
|
?.tenantPackageSale[selectIndex] |
|
|
@ -186,14 +191,24 @@ class _ServiceSubscriptionPage extends State<ServiceSubscriptionPage> { |
|
|
|
int.tryParse(tenantPackageCalculateDetails?.packageId ?? 0), |
|
|
|
int.tryParse(tenantPackageCalculateDetails?.packageId ?? 0), |
|
|
|
"payChannel": payType, |
|
|
|
"payChannel": payType, |
|
|
|
"packageSale": { |
|
|
|
"packageSale": { |
|
|
|
"packagePrice": tenantPackageCalculateDetails?.totalFee ?? "", |
|
|
|
"packagePrice": tenantPackageList[serviceType] |
|
|
|
"expirationTime": tenantPackageCalculateDetails?.expirationTime ?? "", |
|
|
|
?.tenantPackageSale[selectIndex] |
|
|
|
"duration": tenantPackageCalculateDetails?.duration ?? 0 |
|
|
|
?.packagePrice ?? |
|
|
|
|
|
|
|
"", |
|
|
|
|
|
|
|
"originalPackagePrice": tenantPackageList[serviceType] |
|
|
|
|
|
|
|
?.tenantPackageSale[selectIndex] |
|
|
|
|
|
|
|
?.originalPackagePrice ?? |
|
|
|
|
|
|
|
"", |
|
|
|
|
|
|
|
"duration": tenantPackageList[serviceType] |
|
|
|
|
|
|
|
?.tenantPackageSale[selectIndex] |
|
|
|
|
|
|
|
?.duration ?? |
|
|
|
|
|
|
|
0, |
|
|
|
} |
|
|
|
} |
|
|
|
}).catchError((error) { |
|
|
|
}).catchError((error) { |
|
|
|
networkError = AppUtils.dioErrorTypeToString(error.type); |
|
|
|
networkError = AppUtils.dioErrorTypeToString(error.type); |
|
|
|
networkStatus = -1; |
|
|
|
networkStatus = -1; |
|
|
|
setState(() {});}); |
|
|
|
setState(() {}); |
|
|
|
|
|
|
|
}); |
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
if (payType == 1) { |
|
|
|
if (payType == 1) { |
|
|
|
if (Platform.isAndroid) { |
|
|
|
if (Platform.isAndroid) { |
|
|
@ -231,15 +246,15 @@ class _ServiceSubscriptionPage extends State<ServiceSubscriptionPage> { |
|
|
|
payRes['resultStatus'] == '9000') { |
|
|
|
payRes['resultStatus'] == '9000') { |
|
|
|
queryTenantInfo(); |
|
|
|
queryTenantInfo(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if(payRes['memo'] != "") |
|
|
|
if (payRes['memo'] != "") |
|
|
|
SmartDialog.showToast(payRes['memo'], |
|
|
|
SmartDialog.showToast(payRes['memo'], |
|
|
|
alignment: Alignment.center); |
|
|
|
alignment: Alignment.center); |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
networkStatus =1; |
|
|
|
networkStatus = 1; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
SmartDialog.show( |
|
|
|
SmartDialog.show( |
|
|
|
clickBgDismissTemp: false, |
|
|
|
clickBgDismissTemp: false, |
|
|
@ -345,11 +360,57 @@ class _ServiceSubscriptionPage extends State<ServiceSubscriptionPage> { |
|
|
|
crossAxisAlignment: |
|
|
|
crossAxisAlignment: |
|
|
|
CrossAxisAlignment.start, |
|
|
|
CrossAxisAlignment.start, |
|
|
|
children: [ |
|
|
|
children: [ |
|
|
|
|
|
|
|
Padding( |
|
|
|
|
|
|
|
padding: EdgeInsets.only(bottom: 16.h), |
|
|
|
|
|
|
|
child:Row( |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
Expanded(child:Text( |
|
|
|
|
|
|
|
"你当前的套餐是: ${BusinessInstance.instance.serviceStatus == "正常" ? (widget?.arguments["packageName"] ?? ""):BusinessInstance.instance.serviceStatus}", |
|
|
|
|
|
|
|
maxLines: 1, |
|
|
|
|
|
|
|
overflow:TextOverflow.ellipsis, |
|
|
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
|
|
color: Color(0xFF1A1A1A), |
|
|
|
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
|
|
|
fontWeight: |
|
|
|
|
|
|
|
MyFontWeight.regular, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
)), |
|
|
|
|
|
|
|
GestureDetector( |
|
|
|
|
|
|
|
behavior:HitTestBehavior.opaque, |
|
|
|
|
|
|
|
onTap:(){ |
|
|
|
|
|
|
|
Navigator.of(context).pushNamed( |
|
|
|
|
|
|
|
'/router/service_purchase_record',arguments: { |
|
|
|
|
|
|
|
"storeId":widget.arguments["storeId"], |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
child: Row( |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
Text( |
|
|
|
|
|
|
|
"购买记录", |
|
|
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
|
|
color: Color(0xFF1A1A1A), |
|
|
|
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
|
|
|
fontWeight: |
|
|
|
|
|
|
|
MyFontWeight.regular, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
Padding(padding:EdgeInsets.only(left:4.w,right:12.w), |
|
|
|
|
|
|
|
child: Image.asset( |
|
|
|
|
|
|
|
"assets/image/bs_right.webp", |
|
|
|
|
|
|
|
width:7.w, |
|
|
|
|
|
|
|
height:12.h, |
|
|
|
|
|
|
|
color:Color(0xFF1A1A1A), |
|
|
|
|
|
|
|
)), |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
)), |
|
|
|
Padding( |
|
|
|
Padding( |
|
|
|
padding: |
|
|
|
padding: |
|
|
|
EdgeInsets.only(bottom: 16.h), |
|
|
|
EdgeInsets.only(bottom: 16.h), |
|
|
|
child: Text( |
|
|
|
child: Text( |
|
|
|
"你的到期时间是: ${(tenantPackageCalculateDetails?.expirationTime ?? "").length > 9 ? (tenantPackageCalculateDetails?.expirationTime ?? "").substring(0, 10) : ""}", |
|
|
|
"你的到期时间是: ${(BusinessInstance.instance.expirationTime ?? "").length > 9 ? (BusinessInstance.instance.expirationTime ?? "").substring(0, 10) : ""}", |
|
|
|
style: TextStyle( |
|
|
|
style: TextStyle( |
|
|
|
color: Color(0xFF1A1A1A), |
|
|
|
color: Color(0xFF1A1A1A), |
|
|
|
fontSize: 14.sp, |
|
|
|
fontSize: 14.sp, |
|
|
@ -384,23 +445,36 @@ class _ServiceSubscriptionPage extends State<ServiceSubscriptionPage> { |
|
|
|
color: Color(0xFF0D0D0D), |
|
|
|
color: Color(0xFF0D0D0D), |
|
|
|
fontWeight: MyFontWeight.bold), |
|
|
|
fontWeight: MyFontWeight.bold), |
|
|
|
)), |
|
|
|
)), |
|
|
|
Padding( |
|
|
|
GestureDetector( |
|
|
|
padding: |
|
|
|
behavior: HitTestBehavior.opaque, |
|
|
|
EdgeInsets.only(right: 2.w), |
|
|
|
onTap: () { |
|
|
|
child: Text( |
|
|
|
Navigator.of(context).pushNamed( |
|
|
|
"功能版本介绍", |
|
|
|
'/router/function_version_detail'); |
|
|
|
style: TextStyle( |
|
|
|
}, |
|
|
|
fontSize: 12.sp, |
|
|
|
child: Row( |
|
|
|
color: Color(0xFF1A1A1A), |
|
|
|
children: [ |
|
|
|
fontWeight: |
|
|
|
Padding( |
|
|
|
MyFontWeight.regular), |
|
|
|
padding: EdgeInsets.only( |
|
|
|
)), |
|
|
|
right: 2.w), |
|
|
|
Image.asset( |
|
|
|
child: Text( |
|
|
|
"assets/image/icon_right_z.webp", |
|
|
|
"功能版本介绍", |
|
|
|
width: 14.h, |
|
|
|
style: TextStyle( |
|
|
|
height: 14.h, |
|
|
|
fontSize: 12.sp, |
|
|
|
color: Color(0xFF1A1A1A), |
|
|
|
color: |
|
|
|
), |
|
|
|
Color(0xFF1A1A1A), |
|
|
|
|
|
|
|
fontWeight: |
|
|
|
|
|
|
|
MyFontWeight |
|
|
|
|
|
|
|
.regular), |
|
|
|
|
|
|
|
)), |
|
|
|
|
|
|
|
Image.asset( |
|
|
|
|
|
|
|
"assets/image/icon_right_z.webp", |
|
|
|
|
|
|
|
width: 14.h, |
|
|
|
|
|
|
|
height: 14.h, |
|
|
|
|
|
|
|
color: Color(0xFF1A1A1A), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
) |
|
|
|
], |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
@ -471,6 +545,7 @@ class _ServiceSubscriptionPage extends State<ServiceSubscriptionPage> { |
|
|
|
onTap: () { |
|
|
|
onTap: () { |
|
|
|
setState(() { |
|
|
|
setState(() { |
|
|
|
serviceType = position; |
|
|
|
serviceType = position; |
|
|
|
|
|
|
|
selectIndex = 0; |
|
|
|
queryTenantCalculate(); |
|
|
|
queryTenantCalculate(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
@ -643,7 +718,7 @@ class _ServiceSubscriptionPage extends State<ServiceSubscriptionPage> { |
|
|
|
], |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
if ((tenantPackageSale?.canDiscount ?? false) == true) |
|
|
|
if ((tenantPackageSale?.canDiscount ?? false) == true && ((tenantPackageSale?.packageDiscount?? "")!=100)) |
|
|
|
Container( |
|
|
|
Container( |
|
|
|
decoration: BoxDecoration( |
|
|
|
decoration: BoxDecoration( |
|
|
|
color: Color(0xFFFF8F1F), |
|
|
|
color: Color(0xFFFF8F1F), |
|
|
@ -654,7 +729,7 @@ class _ServiceSubscriptionPage extends State<ServiceSubscriptionPage> { |
|
|
|
), |
|
|
|
), |
|
|
|
padding: EdgeInsets.symmetric(horizontal: 4.w), |
|
|
|
padding: EdgeInsets.symmetric(horizontal: 4.w), |
|
|
|
child: Text( |
|
|
|
child: Text( |
|
|
|
"${(tenantPackageSale?.packageDiscount ?? 0) / 100}折", |
|
|
|
"${AppUtils.calculateDouble((tenantPackageSale?.packageDiscount ?? 0) / 10)}折", |
|
|
|
style: TextStyle( |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 12.sp, |
|
|
|
fontSize: 12.sp, |
|
|
|
color: Colors.white, |
|
|
|
color: Colors.white, |
|
|
@ -918,6 +993,38 @@ class _ServiceSubscriptionPage extends State<ServiceSubscriptionPage> { |
|
|
|
SizedBox( |
|
|
|
SizedBox( |
|
|
|
height: 16.h, |
|
|
|
height: 16.h, |
|
|
|
), |
|
|
|
), |
|
|
|
|
|
|
|
Row( |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
Shimmer.fromColors( |
|
|
|
|
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
child: Container( |
|
|
|
|
|
|
|
margin: EdgeInsets.only(right: 10.w), |
|
|
|
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
width: 112.w, |
|
|
|
|
|
|
|
height: 20.h, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
Shimmer.fromColors( |
|
|
|
|
|
|
|
baseColor: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
highlightColor: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
child: Container( |
|
|
|
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
|
|
|
color: Color(0XFFD8D8D8), |
|
|
|
|
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
width: 85.w, |
|
|
|
|
|
|
|
height: 20.h, |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
SizedBox( |
|
|
|
|
|
|
|
height: 16.h, |
|
|
|
|
|
|
|
), |
|
|
|
Row( |
|
|
|
Row( |
|
|
|
children: [ |
|
|
|
children: [ |
|
|
|
Shimmer.fromColors( |
|
|
|
Shimmer.fromColors( |
|
|
|