@@ -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)) { | |||
@@ -131,8 +131,7 @@ class BaseWidgetRegister { | |||
register.setupWechat(config.keys?.weixin?.appId ?? '', config.keys?.weixin?.secret ?? '', config.keys?.weixin?.universalLink ?? ''); | |||
register.setupSinaWeibo( | |||
config.keys?.weibo?.appkey ?? '', config.keys?.weibo?.secret ?? '', config.keys?.weibo?.redirectUrl ?? '', config.keys?.weibo?.universalLink ?? 'templink'); | |||
register.setupSinaWeibo(config.keys?.weibo?.appkey ?? '', config.keys?.weibo?.secret ?? '', config.keys?.weibo?.redirectUrl ?? '', config.keys?.weibo?.universalLink ?? 'templink'); | |||
register.setupQQ(config.keys?.qq?.appId ?? '', config.keys?.qq?.appkey ?? ''); | |||
@@ -4,9 +4,6 @@ import 'package:zhiying_base_widget/widgets/goods_details/recommend/goods_detail | |||
import 'package:zhiying_base_widget/widgets/home/home_goods/home_goods_creater.dart'; | |||
import 'package:zhiying_comm/zhiying_comm.dart'; | |||
import 'category_goods/category_goods_creater.dart'; | |||
import 'category_goods/category_goods_creater2.dart'; | |||
/// | |||
/// 通用模块的商品列表 | |||
/// | |||
@@ -18,8 +15,6 @@ class CustomGoodsCreater extends WidgetCreater { | |||
Map<String, dynamic> json = jsonDecode(model['data']); | |||
// 有Tab头部的商品列表 | |||
if (!EmptyUtil.isEmpty(json['recommend_list'])) { | |||
// creater = CategoryGoodsListCreater2(); | |||
// creater = CategoryGoodsListCreater(); | |||
creater = GoodsListCreater(); | |||
} else { | |||
// 没有Tab头部的商品列表 | |||
@@ -414,7 +414,7 @@ class __CustomQuickEntryContainerState extends State<_CustomQuickEntryContainer> | |||
/// 小角标 | |||
Visibility( | |||
visible: model?.isShowCornerIcon == '1', | |||
child: Align(alignment: Alignment.topRight, child: Transform.translate( offset: Offset(7, -3) ,child: MyNetWorkImage(item?.rightIcon, width: 30)))) | |||
child: Align(alignment: Alignment.topRight, child: Transform.translate( offset: Offset(7, -3) ,child: MyNetWorkImage(item?.rightIcon, width: 34)))) | |||
], | |||
), | |||
@@ -932,7 +932,7 @@ class _CustomQuickCateEntryState extends State<CustomQuickCateEntry> with Ticker | |||
/// 小角标 | |||
Visibility( | |||
visible: model?.isShowCornerIcon == '1', | |||
child: Align(alignment: Alignment.topRight, child: Transform.translate( offset: Offset(7, -3) ,child: MyNetWorkImage(item?.rightIcon, width: 30)))) | |||
child: Align(alignment: Alignment.topRight, child: Transform.translate( offset: Offset(7, -3) ,child: MyNetWorkImage(item?.rightIcon, width: 34)))) | |||
], | |||
), | |||
@@ -389,7 +389,8 @@ class _ShareAlertContentState extends State<_ShareAlertContent> { | |||
try { | |||
// 保存到本地路径 | |||
final tempDir = await getTemporaryDirectory(); | |||
// final tempDir = await getTemporaryDirectory(); | |||
final tempDir = await getApplicationSupportDirectory(); | |||
final file = await File('${tempDir.path}/image.png').create(); | |||
file.writeAsBytesSync(widget.model.poster); | |||