From 6807699c2c7f2ab09c3763c7112556e0bb35101b Mon Sep 17 00:00:00 2001 From: PH2 <1293456824@qq.com> Date: Thu, 15 Apr 2021 19:07:29 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E6=99=BA=E8=83=BD=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E6=B8=A0=E9=81=93=E8=B7=B3=E8=BD=AC=E6=8C=87=E5=AE=9A=E5=8E=9F?= =?UTF-8?q?=E7=94=9F=E5=BA=94=E7=94=A8=202=E3=80=81=E5=8F=B3=E4=B8=8A?= =?UTF-8?q?=E8=A7=92=E5=B0=8F=E5=9B=BE=E6=A0=87=E5=A4=A7=E5=B0=8F=E8=B0=83?= =?UTF-8?q?=E6=95=B4=203=E3=80=81=E5=BE=AE=E4=BF=A1=E5=88=86=E4=BA=AB?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../intellect_search_goods_dialog.dart | 54 ++++++++++--------- lib/register.dart | 3 +- .../custom/goods/custom_goods_creater.dart | 5 -- .../custom/multi_nav/custom_quick_entry.dart | 4 +- lib/widgets/share/share_alert.dart | 3 +- 5 files changed, 35 insertions(+), 34 deletions(-) diff --git a/lib/dialog/global_dialog/intellect_search_goods_dialog/intellect_search_goods_dialog.dart b/lib/dialog/global_dialog/intellect_search_goods_dialog/intellect_search_goods_dialog.dart index a716664..8470a00 100644 --- a/lib/dialog/global_dialog/intellect_search_goods_dialog/intellect_search_goods_dialog.dart +++ b/lib/dialog/global_dialog/intellect_search_goods_dialog/intellect_search_goods_dialog.dart @@ -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)) { diff --git a/lib/register.dart b/lib/register.dart index f5a0040..96a70dc 100644 --- a/lib/register.dart +++ b/lib/register.dart @@ -131,8 +131,7 @@ class BaseWidgetRegister { register.setupWechat(config.keys?.weixin?.appId ?? '', config.keys?.weixin?.secret ?? '', config.keys?.weixin?.universalLink ?? ''); //================ Weibo - 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'); // ================ QQ register.setupQQ(config.keys?.qq?.appId ?? '', config.keys?.qq?.appkey ?? ''); diff --git a/lib/widgets/custom/goods/custom_goods_creater.dart b/lib/widgets/custom/goods/custom_goods_creater.dart index a07d511..16a9040 100644 --- a/lib/widgets/custom/goods/custom_goods_creater.dart +++ b/lib/widgets/custom/goods/custom_goods_creater.dart @@ -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 json = jsonDecode(model['data']); // 有Tab头部的商品列表 if (!EmptyUtil.isEmpty(json['recommend_list'])) { - // creater = CategoryGoodsListCreater2(); - // creater = CategoryGoodsListCreater(); creater = GoodsListCreater(); } else { // 没有Tab头部的商品列表 diff --git a/lib/widgets/custom/multi_nav/custom_quick_entry.dart b/lib/widgets/custom/multi_nav/custom_quick_entry.dart index c97c9d2..f05c1a1 100644 --- a/lib/widgets/custom/multi_nav/custom_quick_entry.dart +++ b/lib/widgets/custom/multi_nav/custom_quick_entry.dart @@ -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 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)))) ], ), diff --git a/lib/widgets/share/share_alert.dart b/lib/widgets/share/share_alert.dart index f9b260c..fd27da4 100644 --- a/lib/widgets/share/share_alert.dart +++ b/lib/widgets/share/share_alert.dart @@ -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);