diff --git a/example/android/app/src/main/java/cn/zhios/zhiying_base_widget_example/MainActivity.java b/example/android/app/src/main/java/cn/zhios/zhiying_base_widget_example/MainActivity.java index 328c0fb..c28b688 100644 --- a/example/android/app/src/main/java/cn/zhios/zhiying_base_widget_example/MainActivity.java +++ b/example/android/app/src/main/java/cn/zhios/zhiying_base_widget_example/MainActivity.java @@ -155,14 +155,14 @@ public class MainActivity extends FlutterActivity implements ZhiyingFlutterCommN public Map getSetting() { Map map = new HashMap(); ///测试 -// map.put("domain", "http://inapi.izhyin.cn/");//"http://120.76.175.204:8989");http://47.114.51.254:80 http://inapi.izhyin.cn/ -// map.put("master_id", "123456"); -// map.put("secret_key", "123456"); + map.put("domain", "http://inapi.izhyin.cn/");//"http://120.76.175.204:8989");http://47.114.51.254:80 http://inapi.izhyin.cn/ + map.put("master_id", "123456"); + map.put("secret_key", "123456"); ///正式 - map.put("domain", "http://api.zhios.cn/");//45678910,api.zhios.cn84198689 - map.put("master_id", "99813608"); - map.put("secret_key", "123456"); +// map.put("domain", "http://api.zhios.cn/");//45678910,api.zhios.cn84198689 +// map.put("master_id", "99813608"); +// map.put("secret_key", "123456"); //客户测试 // map.put("domain", "https://api.douchaoren.com/");//45678910,api.zhios.cn84198689 diff --git a/lib/pages/goods_share_page/goods_share_link/goods_share_link.dart b/lib/pages/goods_share_page/goods_share_link/goods_share_link.dart index 1ec6de5..77d64c6 100644 --- a/lib/pages/goods_share_page/goods_share_link/goods_share_link.dart +++ b/lib/pages/goods_share_page/goods_share_link/goods_share_link.dart @@ -91,11 +91,23 @@ class _GoodsShareLinkContentState extends State<_GoodsShareLinkContent> with Aut _content = data.shareContent; } - _shareModel.image = List(); + try { + if (widget.params['type'] == 'taobao') { + _shareModel.image = List(); + _shareModel.title = data?.appName ?? ""; + _shareModel.content = _content; + } else { + _shareModel.title = data?.title ?? ""; + _shareModel.url = data?.shortUrl??""; + _shareModel.content = data?.content ?? ""; + _shareModel.image = [data?.imgUrl]; + } + } catch (e, s) { + print(e); + print(s); + } - _shareModel.title = data?.appName ?? ""; - _shareModel.content=_content; - // _shareModel.image.add(data?.imgUrl ?? ""); + // _shareModel.image.add(data?.imgUrl ?? ""); widgets.add(GoodsShareItem( imgHeader: _style?.cssList?.headerImage ?? '', @@ -195,6 +207,7 @@ class _GoodsShareLinkContentState extends State<_GoodsShareLinkContent> with Aut child: GestureDetector( onTap: () { Clipboard.setData(ClipboardData(text: _content)); + Fluttertoast.showToast(msg: '文案已复制'); }, child: CustomButton(btnCopy))), btnShare == null diff --git a/lib/pages/goods_share_page/models/goods_share_temp_add_model.dart b/lib/pages/goods_share_page/models/goods_share_temp_add_model.dart index 2f6bae7..9cb4de7 100644 --- a/lib/pages/goods_share_page/models/goods_share_temp_add_model.dart +++ b/lib/pages/goods_share_page/models/goods_share_temp_add_model.dart @@ -20,6 +20,8 @@ class GoodsShareTempDataModel { String page; String imageUrl; + String shortUrl; + GoodsShareTempDataModel({this.shareContent, this.shareTemplate, this.shareTip, this.appUrl, this.miniAppUrl}); GoodsShareTempDataModel.fromJson(Map json) { @@ -46,7 +48,8 @@ class GoodsShareTempDataModel { userName = json['user_name']; miniprogramType = json['miniprogram_type']; page = json['page']; - imageUrl=json['image_url']; + imageUrl = json['image_url']; + shortUrl = json['short_url']; } Map toJson() { @@ -73,6 +76,7 @@ class GoodsShareTempDataModel { data['user_name'] = userName; data['miniprogram_type'] = miniprogramType; data['page'] = page; + data['short_url'] = shortUrl; return data; } } diff --git a/lib/pages/home_page/home_page.dart b/lib/pages/home_page/home_page.dart index de3307d..4b4a3f3 100644 --- a/lib/pages/home_page/home_page.dart +++ b/lib/pages/home_page/home_page.dart @@ -8,10 +8,12 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; import 'package:moblink/moblink.dart'; +import 'package:permission_handler/permission_handler.dart'; import 'package:provider/provider.dart'; import 'package:zhiying_base_widget/dialog/global_dialog/advertising_dialog/advertising_dialog.dart'; import 'package:zhiying_base_widget/dialog/global_dialog/intellect_search_goods_dialog/intellect_create.dart'; import 'package:zhiying_base_widget/dialog/global_dialog/notification_setting_dialog/notification_setting_dialog.dart'; +import 'package:zhiying_base_widget/dialog/tip_dialog/tip_dialog.dart'; import 'package:zhiying_base_widget/models/app_config_model.dart'; import 'package:zhiying_base_widget/pages/custom_page/event/reload_event.dart'; import 'package:zhiying_base_widget/utils/contants.dart'; @@ -27,7 +29,7 @@ import 'package:zhiying_comm/zhiying_comm.dart'; import 'package:zhiying_comm/util/event_util/login_success_event.dart'; import 'package:zhiying_comm/util/event_util/event_util.dart'; import 'package:zhiying_comm/util/event_util/log_out.dart'; - +import 'package:flutter_alibc/flutter_alibc.dart'; import '../../models/app_config_model.dart'; class HomeCenterPage extends StatefulWidget { @@ -364,12 +366,27 @@ class _HomePageState extends LifeState with WidgetsBindingObserver, Ti // 活动弹窗 await AdvertisingDialog.show(context); - await Future.delayed(Duration(milliseconds: 600),() async { - //debug app不更新 app更新插件 - await AppUpdateUtil.initXUpdate(); - // 检查app更新 - await AppUpdateUtil.updateApp(context); + if (!await Permission.storage.isGranted) { + var result = await showDialog( + context: context, + child: TipDialog( + content: "为了节省网络流量,我们需要获取本地存储权限,缓存信息数据。", + )); + if (result != null && result) { + await Permission.storage.request(); + // 初始化百川sdk + FlutterAlibc.initAlibc(version: "", appName: "").then((result) async { + Logger.debug('初始化百川sdk ${result.errorCode} ${result.errorMessage}'); + }); + } + } + + await Future.delayed(Duration(milliseconds: 600), () async { + //debug app不更新 app更新插件 + await AppUpdateUtil.initXUpdate(); + // 检查app更新 + await AppUpdateUtil.updateApp(context); }); diff --git a/lib/pages/invited_friends/invited_friends.dart b/lib/pages/invited_friends/invited_friends.dart index a06e29b..1cbdc8a 100644 --- a/lib/pages/invited_friends/invited_friends.dart +++ b/lib/pages/invited_friends/invited_friends.dart @@ -147,11 +147,17 @@ class _InvitedFriendsContainerState extends State<_InvitedFriendsContainer> { color: HexColor.fromHex(_model?.appBarNameColor ?? '#333333'), ), ), - trailing: Text( - _model?.appBarRightBtnText ?? '规则', - style: TextStyle( - fontSize: 15, - color: HexColor.fromHex(_model?.appBarRightBtnTextColor ?? '#333333'), + trailing: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: (){ + RouterUtil.openWebview(_model?.dataModel?.ruleLink??"", context); + }, + child: Text( + _model?.appBarRightBtnText ?? '规则', + style: TextStyle( + fontSize: 15, + color: HexColor.fromHex(_model?.appBarRightBtnTextColor ?? '#333333'), + ), ), ), ); diff --git a/lib/pages/invited_friends/models/invite_friend_data_model.dart b/lib/pages/invited_friends/models/invite_friend_data_model.dart index 5ad71f3..0fad1a4 100644 --- a/lib/pages/invited_friends/models/invite_friend_data_model.dart +++ b/lib/pages/invited_friends/models/invite_friend_data_model.dart @@ -2,6 +2,7 @@ class InvitedFriendsDataModel { String isBindTeacher; List posterList; String inviteLink; + String ruleLink; InvitedFriendsDataModel( {this.isBindTeacher, this.posterList, this.inviteLink}); @@ -15,6 +16,7 @@ class InvitedFriendsDataModel { }); } inviteLink = json['invite_link']; + ruleLink=json['rule_link']; } Map toJson() { @@ -24,6 +26,7 @@ class InvitedFriendsDataModel { data['poster_list'] = this.posterList.map((v) => v.toJson()).toList(); } data['invite_link'] = this.inviteLink; + data['rule_link']=this.ruleLink; return data; } } diff --git a/lib/widgets/share/share_alert.dart b/lib/widgets/share/share_alert.dart index 327fa31..f9b260c 100644 --- a/lib/widgets/share/share_alert.dart +++ b/lib/widgets/share/share_alert.dart @@ -176,8 +176,8 @@ class _ShareAlertContentState extends State<_ShareAlertContent> { spacing: 10, runSpacing: 10, children: widget.iconModel?.icons?.map((item) { - return _createIcon(item); - })?.toList() ?? + return _createIcon(item); + })?.toList() ?? [], ); } @@ -285,8 +285,10 @@ class _ShareAlertContentState extends State<_ShareAlertContent> { } else if (widget?.model?.title != null || widget.model?.content != null) { type = SSDKContentTypes.text; } - if (plateform == ShareSDKPlatforms.qZone && type == SSDKContentTypes.text) { + if (plateform == ShareSDKPlatforms.qZone && widget?.model?.content != null) { widget?.model?.title = null; + widget?.model?.image=[]; + widget?.model?.url=null; type = SSDKContentTypes.message; } @@ -296,6 +298,30 @@ class _ShareAlertContentState extends State<_ShareAlertContent> { isExistImage = true; } + if (plateform == ShareSDKPlatforms.qq && widget?.model?.url != null) { + SSDKMap params = SSDKMap() + ..setQQ( + widget?.model?.content ?? "", + widget?.model?.title ?? "", + null, + null, + null, + null, + null, + null, + null, + (isExistImage ? widget?.model?.image?.first : null), + null, + widget?.model?.content ?? "", + null, + null, + SSDKContentTypes.image, + ShareSDKPlatforms.qq, + ); + SharesdkPlugin.share(ShareSDKPlatforms.qq, params, (SSDKResponseState state, Map userdata, Map contentEntity, SSDKError error) {}); + return; + } + params = SSDKMap() ..setGeneral( widget.model?.title ?? '',