|
|
@@ -1,19 +1,17 @@ |
|
|
|
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:flutter_screenutil/flutter_screenutil.dart'; |
|
|
|
import 'package:provider/provider.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_base_widget/widgets/home/home_quick_entry/cached_network_image_util.dart'; |
|
|
|
import 'package:cached_network_image/cached_network_image.dart'; |
|
|
|
import 'package:zhiying_base_widget/widgets/wallet/wallet_detail/model/wallet_detail_model.dart'; |
|
|
|
import 'package:zhiying_comm/zhiying_comm.dart'; |
|
|
|
import 'package:provider/provider.dart'; |
|
|
|
import 'package:zhiying_comm/zhiying_comm.dart'; |
|
|
|
import 'package:flutter_alibc/flutter_alibc.dart'; |
|
|
|
import 'package:flutter_alibc/alibc_model.dart'; |
|
|
|
import 'package:flutter_alibc/alibc_const_key.dart'; |
|
|
|
|
|
|
|
class IntellectSearchGoodsDialog extends StatefulWidget { |
|
|
|
final IntellectDialogDataModel model; |
|
|
@@ -244,8 +242,8 @@ class _IntellectSearchGoodsDialogState |
|
|
|
), |
|
|
|
Text( |
|
|
|
(num.tryParse(widget?.model?.price ?? "0") - |
|
|
|
num.tryParse( |
|
|
|
widget?.model?.couponPrice ?? "0")).toString() ?? |
|
|
|
num.tryParse(widget?.model?.couponPrice ?? "0")) |
|
|
|
.toString() ?? |
|
|
|
"", |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 32.sp, |
|
|
@@ -286,8 +284,7 @@ class _IntellectSearchGoodsDialogState |
|
|
|
" ¥" + |
|
|
|
((num.tryParse(widget?.model?.couponPrice ?? "0") ?? |
|
|
|
0) + |
|
|
|
num.tryParse( |
|
|
|
widget?.model?.commission ?? '0')) |
|
|
|
num.tryParse(widget?.model?.commission ?? '0')) |
|
|
|
.toString(), |
|
|
|
style: TextStyle( |
|
|
|
color: HexColor.fromHex( |
|
|
@@ -357,10 +354,18 @@ class _IntellectSearchGoodsDialogState |
|
|
|
print("平台" + widget?.model?.provider ?? ""); |
|
|
|
print("链接" + widget?.model?.couponUrl ?? ""); |
|
|
|
if (widget?.model?.provider == 'taobao') { |
|
|
|
TradeResult result = await FlutterAlibc.openByUrl( |
|
|
|
TradeResult result; |
|
|
|
if (Platform.isAndroid) { |
|
|
|
result = await FlutterAlibc.openByUrl( |
|
|
|
url: widget?.model?.couponUrl ?? "", |
|
|
|
openType: AlibcOpenType.AlibcOpenTypeNative, |
|
|
|
backUrl: "alisdk://"); |
|
|
|
} else if (Platform.isIOS) { |
|
|
|
result = await FlutterAlibc.openByUrl( |
|
|
|
url: widget?.model?.couponUrl ?? "", |
|
|
|
openType: AlibcOpenType.AlibcOpenTypeNative, |
|
|
|
backUrl: "alisdk://"); |
|
|
|
); |
|
|
|
} |
|
|
|
Logger.debug('${result.errorCode} ${result.errorMessage} '); |
|
|
|
print("链接" + widget?.model?.couponUrl ?? ""); |
|
|
|
print("错误码" + result.errorCode); |
|
|
|