优化支付后流程
This commit is contained in:
parent
2e7e85fb27
commit
db247d253b
@ -63,6 +63,10 @@ class KROrderStatusView extends GetView<KROrderStatusController> {
|
|||||||
SizedBox(height: 16.h),
|
SizedBox(height: 16.h),
|
||||||
// 描述文本
|
// 描述文本
|
||||||
_buildDescriptionText(),
|
_buildDescriptionText(),
|
||||||
|
SizedBox(height: 32.h),
|
||||||
|
// 操作按钮(支付成功时显示)
|
||||||
|
if (controller.kr_isPaymentSuccess.value)
|
||||||
|
_buildSuccessButtons(),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -112,4 +116,73 @@ class KROrderStatusView extends GetView<KROrderStatusController> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// 构建支付成功后的操作按钮
|
||||||
|
Widget _buildSuccessButtons() {
|
||||||
|
return Padding(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 24.w),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
// 返回首页按钮
|
||||||
|
SizedBox(
|
||||||
|
width: double.infinity,
|
||||||
|
height: 48.h,
|
||||||
|
child: ElevatedButton(
|
||||||
|
onPressed: () {
|
||||||
|
// 返回到首页(清空导航栈)
|
||||||
|
Get.offAllNamed('/');
|
||||||
|
},
|
||||||
|
style: ElevatedButton.styleFrom(
|
||||||
|
backgroundColor: Theme.of(Get.context!).primaryColor,
|
||||||
|
foregroundColor: Colors.white,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(12.r),
|
||||||
|
),
|
||||||
|
elevation: 0,
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
AppTranslations.kr_orderStatus.backToHome ?? '返回首页',
|
||||||
|
style: KrAppTextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 12.h),
|
||||||
|
// 查看订阅按钮
|
||||||
|
SizedBox(
|
||||||
|
width: double.infinity,
|
||||||
|
height: 48.h,
|
||||||
|
child: OutlinedButton(
|
||||||
|
onPressed: () {
|
||||||
|
// 返回到首页并切换到订阅页面
|
||||||
|
Get.offAllNamed('/');
|
||||||
|
// 可以通过事件总线发送消息切换tab
|
||||||
|
},
|
||||||
|
style: OutlinedButton.styleFrom(
|
||||||
|
foregroundColor: Theme.of(Get.context!).primaryColor,
|
||||||
|
side: BorderSide(
|
||||||
|
color: Theme.of(Get.context!).primaryColor,
|
||||||
|
width: 1.5,
|
||||||
|
),
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(12.r),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
AppTranslations.kr_orderStatus.viewSubscription ?? '查看订阅',
|
||||||
|
style: KrAppTextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: Theme.of(Get.context!).primaryColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user