@@ -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 | |||
@@ -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 | |||
@@ -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<String, dynamic> 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<String, dynamic> toJson() { | |||
@@ -73,6 +76,7 @@ class GoodsShareTempDataModel { | |||
data['user_name'] = userName; | |||
data['miniprogram_type'] = miniprogramType; | |||
data['page'] = page; | |||
data['short_url'] = shortUrl; | |||
return data; | |||
} | |||
} | |||
@@ -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<HomePage> 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); | |||
}); | |||
@@ -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'), | |||
), | |||
), | |||
), | |||
); | |||
@@ -2,6 +2,7 @@ class InvitedFriendsDataModel { | |||
String isBindTeacher; | |||
List<InvitedFriendsPosterDataModel> 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<String, dynamic> 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; | |||
} | |||
} | |||
@@ -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 ?? '', | |||