|
|
@@ -11,6 +11,7 @@ import 'package:injectable/injectable.dart';
|
|
|
import 'package:location/base/base_controller.dart';
|
|
|
import 'package:location/data/bean/goods_bean.dart';
|
|
|
import 'package:location/data/bean/pay_item_bean.dart';
|
|
|
+import 'package:location/data/consts/channel_id.dart';
|
|
|
import 'package:location/data/repositories/account_repository.dart';
|
|
|
import 'package:location/data/repositories/member_repository.dart';
|
|
|
import 'package:location/dialog/alipay_qr_code_dialog.dart';
|
|
|
@@ -29,6 +30,7 @@ import '../../data/consts/error_code.dart';
|
|
|
import '../../data/consts/payment_type.dart';
|
|
|
import '../../data/consts/web_url.dart';
|
|
|
import '../../data/repositories/phone_event_repository.dart';
|
|
|
+import '../../device/atmob_platform_info.dart';
|
|
|
import '../../dialog/common_confirm_dialog_impl.dart';
|
|
|
import '../../dialog/loading_dialog.dart';
|
|
|
import '../../dialog/member_retain_dialog.dart';
|
|
|
@@ -153,24 +155,20 @@ class MemberController extends BaseController implements PaymentStatusCallback {
|
|
|
_toolBarOpacity.value = opacity;
|
|
|
});
|
|
|
refreshMemberData();
|
|
|
-
|
|
|
}
|
|
|
|
|
|
///是否弹窗提示
|
|
|
void _isTherePopUpPrompt() {
|
|
|
- MemberPageType pageType = Get.arguments ?? MemberPageType.universalAccessEnter;
|
|
|
+ MemberPageType pageType =
|
|
|
+ Get.arguments ?? MemberPageType.universalAccessEnter;
|
|
|
if (pageType == MemberPageType.afeterTrialMemberEnter) {
|
|
|
- MemberFirstWeekDiscountDialog.show(
|
|
|
- confirmOnTap: () {
|
|
|
- onBuyClick();
|
|
|
- },
|
|
|
- onPrivacyPolicyClick: () {
|
|
|
- onPrivacyPolicyClick();
|
|
|
- },
|
|
|
- onTermOfServiceClick: () {
|
|
|
- onTermOfServiceClick();
|
|
|
- }
|
|
|
- );
|
|
|
+ MemberFirstWeekDiscountDialog.show(confirmOnTap: () {
|
|
|
+ onBuyClick();
|
|
|
+ }, onPrivacyPolicyClick: () {
|
|
|
+ onPrivacyPolicyClick();
|
|
|
+ }, onTermOfServiceClick: () {
|
|
|
+ onTermOfServiceClick();
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -200,7 +198,10 @@ class MemberController extends BaseController implements PaymentStatusCallback {
|
|
|
children: [
|
|
|
RichText(
|
|
|
text: TextSpan(
|
|
|
- style: TextStyle(fontSize: 11.sp, color: Colors.white,fontWeight: FontWeight.w400),
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 11.sp,
|
|
|
+ color: Colors.white,
|
|
|
+ fontWeight: FontWeight.w400),
|
|
|
children: [
|
|
|
TextSpan(text: userIdStr),
|
|
|
TextSpan(text: '用户 '),
|
|
|
@@ -304,7 +305,8 @@ class MemberController extends BaseController implements PaymentStatusCallback {
|
|
|
_isPopBackInProgress = true; // 锁定状态
|
|
|
//_keMemberPageShowKey
|
|
|
String? memberPageKeyStr = KVUtil.getString(_keMemberPageShowKey, '');
|
|
|
- if ((memberPageKeyStr ?? '').isEmpty && (accountRepository.memberStatusInfo.value?.trialed == false)) {
|
|
|
+ if ((memberPageKeyStr ?? '').isEmpty &&
|
|
|
+ (accountRepository.memberStatusInfo.value?.trialed == false)) {
|
|
|
///永久化存储
|
|
|
KVUtil.putString(_keMemberPageShowKey, _keMemberPageShowKey);
|
|
|
MemberUserCancelPayDialog.show(payClick: () {
|
|
|
@@ -337,7 +339,7 @@ class MemberController extends BaseController implements PaymentStatusCallback {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- void onBuyClick() {
|
|
|
+ void onBuyClick() async {
|
|
|
if (selectedGoods == null) {
|
|
|
ToastUtil.show(StringName.memberPleaseChoiceGoods);
|
|
|
return;
|
|
|
@@ -346,6 +348,16 @@ class MemberController extends BaseController implements PaymentStatusCallback {
|
|
|
ToastUtil.show(StringName.memberPleaseChoicePayment);
|
|
|
return;
|
|
|
}
|
|
|
+ //增加渠道登录判断
|
|
|
+ if (atmobPlatformInfo.tgPlatform == ChannelId.sd) {
|
|
|
+ if (!accountRepository.isLogin.value) {
|
|
|
+ ToastUtil.show(StringName.accountNoLogin);
|
|
|
+ final isLogin = await LoginPage.start();
|
|
|
+ if (!isLogin) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
final buyGoods = selectedGoods!;
|
|
|
final buyPayWay = selectedPayWay!;
|
|
|
|
|
|
@@ -400,10 +412,12 @@ class MemberController extends BaseController implements PaymentStatusCallback {
|
|
|
}
|
|
|
|
|
|
///发起购买请求
|
|
|
- Future<void> _onApplePay(String outTradeNo,
|
|
|
- String appAccountToken,
|
|
|
- PayItemBean payWayInfo,
|
|
|
- GoodsBean goodsInfo,) async {
|
|
|
+ Future<void> _onApplePay(
|
|
|
+ String outTradeNo,
|
|
|
+ String appAccountToken,
|
|
|
+ PayItemBean payWayInfo,
|
|
|
+ GoodsBean goodsInfo,
|
|
|
+ ) async {
|
|
|
final result = await ApplePay().purchase(
|
|
|
productId: goodsInfo.appleGoodsId ?? "",
|
|
|
appAccountToken: appAccountToken,
|
|
|
@@ -617,6 +631,7 @@ class MemberController extends BaseController implements PaymentStatusCallback {
|
|
|
String orderNo, PayItemBean paymentWay, GoodsBean storeItemBean) {
|
|
|
///购买成功消失
|
|
|
LoadingDialog.hide();
|
|
|
+
|
|
|
///购买成功之后弹出
|
|
|
afterTheFirstPurchasePromptSharingBoxPops();
|
|
|
}
|
|
|
@@ -632,50 +647,63 @@ class MemberController extends BaseController implements PaymentStatusCallback {
|
|
|
paymentStatusManager.onOrderFirstCheck().then((checkReponse) {
|
|
|
//是否展示邀请弹框
|
|
|
if (checkReponse.showInvite || checkReponse.showEvaluate) {
|
|
|
- MemberPageType pageType = Get.arguments ?? MemberPageType.universalAccessEnter;
|
|
|
+ MemberPageType pageType =
|
|
|
+ Get.arguments ?? MemberPageType.universalAccessEnter;
|
|
|
//去分享
|
|
|
- if (checkReponse.showInvite && pageType == MemberPageType.addFriendToEnter) {
|
|
|
+ if (checkReponse.showInvite &&
|
|
|
+ pageType == MemberPageType.addFriendToEnter) {
|
|
|
MemberPaymentCompletedDialog.show(confirmOnTap: () {
|
|
|
WechatShareUtil.shareWebPage().catchError((error) {
|
|
|
ToastUtil.show(error);
|
|
|
});
|
|
|
if (checkReponse.showEvaluate) {
|
|
|
///是否展示好评领会员弹框
|
|
|
- MemberEvaluationPopUpDialog.show(confirmOnTap: () {
|
|
|
- AppReviewService.requestAppReview(Get.context!);
|
|
|
- onPaySucessShow();
|
|
|
- },cancelOnTap: () {
|
|
|
- onPaySucessShow();
|
|
|
- },days: 1);
|
|
|
+ MemberEvaluationPopUpDialog.show(
|
|
|
+ confirmOnTap: () {
|
|
|
+ AppReviewService.requestAppReview(Get.context!);
|
|
|
+ onPaySucessShow();
|
|
|
+ },
|
|
|
+ cancelOnTap: () {
|
|
|
+ onPaySucessShow();
|
|
|
+ },
|
|
|
+ days: 1);
|
|
|
} else {
|
|
|
onPaySucessShow();
|
|
|
}
|
|
|
- },cancelOnTap: () {
|
|
|
+ }, cancelOnTap: () {
|
|
|
if (checkReponse.showEvaluate) {
|
|
|
///是否展示好评领会员弹框
|
|
|
- MemberEvaluationPopUpDialog.show(confirmOnTap: () {
|
|
|
- AppReviewService.requestAppReview(Get.context!);
|
|
|
- ///领取会员后请求
|
|
|
- memberRepository.memberEvaluate().then((_){
|
|
|
- }).catchError((error) {
|
|
|
- });;//memberEvaluate
|
|
|
- onPaySucessShow();
|
|
|
- },cancelOnTap: () {
|
|
|
- onPaySucessShow();
|
|
|
- },days: 1);
|
|
|
+ MemberEvaluationPopUpDialog.show(
|
|
|
+ confirmOnTap: () {
|
|
|
+ AppReviewService.requestAppReview(Get.context!);
|
|
|
+
|
|
|
+ ///领取会员后请求
|
|
|
+ memberRepository
|
|
|
+ .memberEvaluate()
|
|
|
+ .then((_) {})
|
|
|
+ .catchError((error) {});
|
|
|
+ ; //memberEvaluate
|
|
|
+ onPaySucessShow();
|
|
|
+ },
|
|
|
+ cancelOnTap: () {
|
|
|
+ onPaySucessShow();
|
|
|
+ },
|
|
|
+ days: 1);
|
|
|
} else {
|
|
|
onPaySucessShow();
|
|
|
}
|
|
|
});
|
|
|
- }
|
|
|
- else if (checkReponse.showEvaluate) {
|
|
|
+ } else if (checkReponse.showEvaluate) {
|
|
|
///是否展示好评领会员弹框
|
|
|
- MemberEvaluationPopUpDialog.show(confirmOnTap: () {
|
|
|
- AppReviewService.requestAppReview(Get.context!);
|
|
|
- onPaySucessShow();
|
|
|
- },cancelOnTap: () {
|
|
|
- onPaySucessShow();
|
|
|
- },days: 1);
|
|
|
+ MemberEvaluationPopUpDialog.show(
|
|
|
+ confirmOnTap: () {
|
|
|
+ AppReviewService.requestAppReview(Get.context!);
|
|
|
+ onPaySucessShow();
|
|
|
+ },
|
|
|
+ cancelOnTap: () {
|
|
|
+ onPaySucessShow();
|
|
|
+ },
|
|
|
+ days: 1);
|
|
|
}
|
|
|
} else {
|
|
|
onPaySucessShow();
|