|
|
@@ -1,12 +1,9 @@ |
|
|
|
import 'dart:convert'; |
|
|
|
import 'dart:io'; |
|
|
|
|
|
|
|
import 'package:cached_network_image/cached_network_image.dart'; |
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
import 'package:flutter/services.dart'; |
|
|
|
import 'package:flutter_alibc/alibc_const_key.dart'; |
|
|
|
import 'package:flutter_alibc/alibc_model.dart'; |
|
|
|
import 'package:flutter_alibc/flutter_alibc.dart'; |
|
|
|
import 'package:zhiying_comm/util/turn_chain/turn_chain_util.dart'; |
|
|
|
import 'package:zhiying_base_widget/dialog/global_dialog/intellect_search_goods_dialog/model/has_goods_dialog_style_model.dart'; |
|
|
|
import 'package:zhiying_base_widget/dialog/global_dialog/intellect_search_goods_dialog/model/intellect_dialog_data_model.dart'; |
|
|
|
import 'package:zhiying_comm/zhiying_comm.dart'; |
|
|
@@ -376,26 +373,35 @@ class _IntellectSearchGoodsDialogState |
|
|
|
} |
|
|
|
widget?.model?.couponUrl=widget?.model?.couponUrl.replaceAll("\\", ""); |
|
|
|
print("链接" + widget?.model?.couponUrl ?? ""); |
|
|
|
if (widget?.model?.provider == 'taobao') { |
|
|
|
TradeResult result; |
|
|
|
if (Platform.isAndroid) { |
|
|
|
result = await FlutterAlibc.openByUrl( |
|
|
|
url: widget?.model?.couponUrl ?? "", |
|
|
|
backUrl: "alisdk://"); |
|
|
|
} else if (Platform.isIOS) { |
|
|
|
result = await FlutterAlibc.openByUrl( |
|
|
|
url: widget?.model?.couponUrl ?? "" |
|
|
|
); |
|
|
|
} |
|
|
|
Logger.debug('${result.errorCode} ${result.errorMessage} '); |
|
|
|
print("链接" + widget?.model?.couponUrl ?? ""); |
|
|
|
print("错误码" + result.errorCode); |
|
|
|
print("原因" + result.errorMessage); |
|
|
|
} else { |
|
|
|
await FlutterAlibc.openByUrl( |
|
|
|
url: widget?.model?.couponUrl, |
|
|
|
openType: AlibcOpenType.AlibcOpenTypeNative); |
|
|
|
} |
|
|
|
// if (widget?.model?.provider == GlobalConfig.PROVIDER_TB || widget?.model?.provider == GlobalConfig.PROVIDER_TM) { |
|
|
|
// TradeResult result; |
|
|
|
// if (Platform.isAndroid) { |
|
|
|
// result = await FlutterAlibc.openByUrl(url: widget?.model?.couponUrl ?? "", backUrl: "alisdk://"); |
|
|
|
// } else if (Platform.isIOS) { |
|
|
|
// result = await FlutterAlibc.openByUrl(url: widget?.model?.couponUrl ?? ""); |
|
|
|
// } |
|
|
|
// Logger.debug('${result.errorCode} ${result.errorMessage} '); |
|
|
|
// print("链接" + widget?.model?.couponUrl ?? ""); |
|
|
|
// print("错误码" + result.errorCode); |
|
|
|
// print("原因" + result.errorMessage); |
|
|
|
// } else if (widget?.model?.provider == GlobalConfig.PROVIDER_JD) { |
|
|
|
// /// 京东 |
|
|
|
// // Jdsdk.openUrl(url: openAppUrl); |
|
|
|
// Logger.log('走了京东打开'); |
|
|
|
// } else { |
|
|
|
// /// 其它 |
|
|
|
// Logger.log('走了其它打开方式'); |
|
|
|
// // await FlutterAlibc.openByUrl(url: widget?.model?.couponUrl, openType: AlibcOpenType.AlibcOpenTypeNative); |
|
|
|
// } |
|
|
|
Logger.log('智能弹窗有商品情况跳转数据 = ${widget?.model?.toJson()}'); |
|
|
|
/// 改成统一跳转 |
|
|
|
await TurnChainUtil.jumpNative( |
|
|
|
context, |
|
|
|
provider: widget?.model?.provider ?? 'taobao', |
|
|
|
openAppUrl: widget?.model?.couponUrl, |
|
|
|
appUrl: widget?.model?.couponUrl, |
|
|
|
webUrl: widget?.model?.couponUrl, |
|
|
|
); |
|
|
|
|
|
|
|
///关闭弹窗 |
|
|
|
if (Navigator.canPop(context)) { |
|
|
|