|
|
@@ -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); |
|
|
|
} |
|
|
|
|
|
|
|