|
|
@@ -16,6 +16,7 @@ import 'package:zhiying_comm/util/pdd_auth/pdd_auth.dart'; |
|
|
|
import 'package:zhiying_comm/util/taobao/taobao_auth.dart'; |
|
|
|
import 'package:zhiying_comm/util/turn_chain/turn_chain_dialog_repository.dart'; |
|
|
|
import 'package:zhiying_comm/util/turn_chain/turn_chain_style_model.dart'; |
|
|
|
import 'package:zhiying_comm/zhiying_comm.dart'; |
|
|
|
|
|
|
|
import '../router_util.dart'; |
|
|
|
import 'turn_chain_dialog.dart'; |
|
|
@@ -56,7 +57,8 @@ class TurnChainUtil { |
|
|
|
/// 微盘: sinavdisk:// |
|
|
|
/// 名片全能王: camcard:// |
|
|
|
/// |
|
|
|
static Future<void> openReceiveCoupon(BuildContext context, UserInfoModel userInfoModel, String goodsId, String provider, Map<String, dynamic> data, {bool isFree = false}) async { |
|
|
|
static Future<void> openReceiveCoupon(BuildContext context, UserInfoModel userInfoModel, String goodsId, String provider, Map<String, dynamic> data, |
|
|
|
{bool isFree = false}) async { |
|
|
|
/// iOS 审核状态 |
|
|
|
// String is_ios_review = await SharedPreferencesUtil.getStringValue(GlobalConfig.IS_IOS_REVIEW, defaultVal: '0'); |
|
|
|
|
|
|
@@ -73,7 +75,7 @@ class TurnChainUtil { |
|
|
|
// TaobaoAuth.auth(context); |
|
|
|
// return; |
|
|
|
// } |
|
|
|
if (provider == GlobalConfig.PROVIDER_TB || provider == GlobalConfig.PROVIDER_TM ) { |
|
|
|
if (provider == GlobalConfig.PROVIDER_TB || provider == GlobalConfig.PROVIDER_TM) { |
|
|
|
bool isAuth = await TaobaoAuth.auth(context); |
|
|
|
if (!isAuth) return; |
|
|
|
} |
|
|
@@ -208,8 +210,10 @@ class TurnChainUtil { |
|
|
|
/// |
|
|
|
static Future<bool> jumpNative(BuildContext context, {String provider = GlobalConfig.PROVIDER_TB, String openAppUrl, String appUrl, String webUrl}) async { |
|
|
|
bool rlt = false; |
|
|
|
|
|
|
|
///iOS 审核状态 |
|
|
|
String isIosReview = await SharedPreferencesUtil.getStringValue(GlobalConfig.IS_IOS_REVIEW, defaultVal: '0'); |
|
|
|
print("渠道" + provider); |
|
|
|
|
|
|
|
/// 4、根据渠道进行不同的跳转 |
|
|
|
switch (provider) { |
|
|
@@ -258,15 +262,15 @@ class TurnChainUtil { |
|
|
|
if (Platform.isIOS) { |
|
|
|
launchable = await launch(appUrl); |
|
|
|
} |
|
|
|
|
|
|
|
if (launchable) { |
|
|
|
if (!Platform.isIOS) { |
|
|
|
if (appUrl.startsWith("suning")) { |
|
|
|
if (provider == GlobalConfig.PROVIDER_SN) { |
|
|
|
RouterUtil.openWebview(webUrl, context); |
|
|
|
rlt = true; |
|
|
|
} else { |
|
|
|
RouterUtil.openWebview(webUrl, context); |
|
|
|
rlt = true; |
|
|
|
}else{ |
|
|
|
await launch(appUrl); |
|
|
|
} |
|
|
|
rlt = true; |
|
|
|
} |
|
|
|
} else if (!EmptyUtil.isEmpty(webUrl)) { |
|
|
|
Logger.log('打开${provider} webUrl, url = ${webUrl}'); |
|
|
@@ -343,13 +347,13 @@ class TurnChainUtil { |
|
|
|
// return null; |
|
|
|
// } |
|
|
|
/// ⚠️ 因业务修改,淘宝或者天猫每次都必须请求网络请求状态 |
|
|
|
if (provider == GlobalConfig.PROVIDER_TB || provider == GlobalConfig.PROVIDER_TM ) { |
|
|
|
if (provider == GlobalConfig.PROVIDER_TB || provider == GlobalConfig.PROVIDER_TM) { |
|
|
|
bool isAuth = await TaobaoAuth.auth(context); |
|
|
|
if (!isAuth) return null; |
|
|
|
} |
|
|
|
|
|
|
|
/// 2.5 如果是拼多多,判断是否需要授权 |
|
|
|
if(provider == GlobalConfig.PROVIDER_PDD) { |
|
|
|
if (provider == GlobalConfig.PROVIDER_PDD) { |
|
|
|
// 如果为true,说明需要进行授权,停止执行。 |
|
|
|
bool result = await PddAuth.auth(context); |
|
|
|
if (result) return null; |
|
|
|