@@ -21,7 +21,7 @@ class IntellectCreate { | |||
static bool isRequest = false; | |||
//是否检查粘贴板 | |||
static bool check = false; | |||
static bool check = true; | |||
static setCheck(bool isCheck){ | |||
check=isCheck; | |||
@@ -32,7 +32,7 @@ class IntellectCreate { | |||
if (state == AppLifecycleState.resumed && !isRequest &&check) { | |||
print("读取粘贴版"); | |||
isRequest = true; | |||
Timer(Duration(milliseconds: 2000), () { | |||
@@ -1,13 +1,9 @@ | |||
import 'dart:convert'; | |||
import 'package:cached_network_image/cached_network_image.dart'; | |||
import 'package:flutter/cupertino.dart'; | |||
import 'package:flutter/material.dart'; | |||
import 'package:flutter_bloc/flutter_bloc.dart'; | |||
import 'package:fluttertoast/fluttertoast.dart'; | |||
import 'package:provider/provider.dart'; | |||
import 'package:zhiying_base_widget/pages/goods_share_page/goods_share_page.dart'; | |||
import 'package:zhiying_base_widget/widgets/custom/multi_nav/cached_network_image_util.dart'; | |||
import 'package:zhiying_base_widget/widgets/goods_details/footer/bloc/goods_details_footer_bloc.dart'; | |||
import 'package:zhiying_base_widget/widgets/goods_details/footer/bloc/goods_details_footer_repository.dart'; | |||
import 'package:zhiying_base_widget/widgets/goods_details/footer/goods_details_footer_sk.dart'; | |||
@@ -87,7 +83,7 @@ class _GoodsDetailsFooterContainerState extends State<_GoodsDetailsFooterContain | |||
/// 收藏 | |||
void _collectOnClick(GoodsDetailsFooterModel model) { | |||
///获取用户信息,未登录需要先登录 | |||
var _user = Provider.of<UserInfoNotifier>(context,listen: false).userInfo; | |||
// var _user = Provider.of<UserInfoNotifier>(context,listen: false).userInfo; | |||
if (_user?.token == null || _user?.token?.length == 0) { | |||
RouterUtil.goLogin(context); | |||
return; | |||
@@ -104,6 +100,7 @@ class _GoodsDetailsFooterContainerState extends State<_GoodsDetailsFooterContain | |||
/// 分享 | |||
void _shareOnClick(GoodsDetailsFooterModel model) async { | |||
if (EmptyUtil.isEmpty(model?.share_value)) return; | |||
Map<String, dynamic> result = await TurnChainUtil.getShareTurnChain(context, _user, model?.good_id, model.provider, model.convertArgs.toJson()); | |||
if (!EmptyUtil.isEmpty(result)) { | |||
model.shareUrlArgs.buyUrl = result['open_app_url']; | |||
@@ -113,6 +110,7 @@ class _GoodsDetailsFooterContainerState extends State<_GoodsDetailsFooterContain | |||
/// 自购省 | |||
void _saveMoneyOnClick(GoodsDetailsFooterModel model) async { | |||
if (EmptyUtil.isEmpty(model?.self_buy_value)) return; | |||
await TurnChainUtil.openReceiveCoupon(context, _user, model?.good_id, model?.provider, model?.convertArgs?.toJson(), isFree: widget?.isFree); | |||
} | |||
@@ -11,6 +11,7 @@ import 'package:path_provider/path_provider.dart'; | |||
import 'package:permission_handler/permission_handler.dart'; | |||
import 'package:share_extend/share_extend.dart'; | |||
import 'package:sharesdk_plugin/sharesdk_plugin.dart'; | |||
import 'package:zhiying_base_widget/dialog/global_dialog/intellect_search_goods_dialog/intellect_create.dart'; | |||
import 'package:zhiying_base_widget/dialog/loading/loading.dart'; | |||
import 'package:zhiying_base_widget/utils/image_download_util/image_download_util.dart'; | |||
import 'package:zhiying_base_widget/widgets/share/models/share_alert_model.dart'; | |||
@@ -36,6 +37,9 @@ class _ShareAlertState extends State<ShareAlert> { | |||
@override | |||
void initState() { | |||
Logger.log('设置分享页面不弹'); | |||
/// 设置分享页面不弹 | |||
IntellectCreate.setCheck(false); | |||
NetUtil.request('/api/v1/mod/${widget.skipIdentifier}', method: NetMethod.GET, onCache: (data) { | |||
// try{ | |||
// _parseData(data); | |||
@@ -50,6 +54,14 @@ class _ShareAlertState extends State<ShareAlert> { | |||
super.initState(); | |||
} | |||
@override | |||
void dispose() { | |||
Logger.log('设置智能弹窗可以弹'); | |||
/// 之后可以弹 | |||
IntellectCreate.setCheck(true); | |||
super.dispose(); | |||
} | |||
void _parseData(Map<String, dynamic> data) { | |||
List modList = data['mod_list']; | |||
Map d = modList.first; | |||
@@ -17,6 +17,7 @@ import 'package:path_provider/path_provider.dart'; | |||
import 'package:permission_handler/permission_handler.dart'; | |||
import 'package:share_extend/share_extend.dart'; | |||
import 'package:sharesdk_plugin/sharesdk_plugin.dart'; | |||
import 'package:zhiying_base_widget/dialog/global_dialog/intellect_search_goods_dialog/intellect_create.dart'; | |||
import 'package:zhiying_base_widget/dialog/loading/loading.dart'; | |||
import 'package:zhiying_base_widget/utils/image_download_util/image_download_util.dart'; | |||
import 'package:zhiying_base_widget/widgets/share/models/share_alert_model.dart'; | |||
@@ -50,6 +51,9 @@ class _ShareAlertSelectState extends State<ShareAlertSelect> { | |||
@override | |||
void initState() { | |||
Logger.log('设置分享页面不弹'); | |||
/// 设置分享页面不弹 | |||
IntellectCreate.setCheck(false); | |||
NetUtil.request('/api/v1/mod/${widget.skipIdentifier}', method: NetMethod.GET, onCache: (data) { | |||
// try{ | |||
// _parseData(data); | |||
@@ -70,6 +74,14 @@ class _ShareAlertSelectState extends State<ShareAlertSelect> { | |||
super.initState(); | |||
} | |||
@override | |||
void dispose() { | |||
Logger.log('设置智能弹窗可以弹'); | |||
/// 之后可以弹 | |||
IntellectCreate.setCheck(true); | |||
super.dispose(); | |||
} | |||
void _parseData(Map<String, dynamic> data) { | |||
List modList = data['mod_list']; | |||
Map d = modList.first; | |||