@@ -53,7 +53,8 @@ android { | |||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||||
ndk { | ndk { | ||||
//选择要添加的对应cpu类型的.so库。 | //选择要添加的对应cpu类型的.so库。 | ||||
abiFilters 'armeabi', 'armeabi-v7a', 'x86', 'x86_64', 'mips', 'mips64', 'arm64-v8a' | |||||
abiFilters 'armeabi', 'armeabi-v7a', 'x86', 'x86_64', 'mips', 'mips64', 'arm64-v8a' | |||||
// abiFilters 'armeabi-v7a','x86_64' | |||||
} | } | ||||
} | } | ||||
@@ -107,14 +108,14 @@ android { | |||||
} | } | ||||
// 应用信息配置 | |||||
// // 应用信息配置 | |||||
// productFlavors { | // productFlavors { | ||||
// // 智夜生活 | // // 智夜生活 | ||||
// zhiying { | // zhiying { | ||||
// applicationId "cn.zhios.zhiying" | // applicationId "cn.zhios.zhiying" | ||||
// versionCode 39 | |||||
// versionCode 45 | |||||
// dimension "app" | // dimension "app" | ||||
// versionName '1.2.39' | |||||
// versionName '1.3.3' | |||||
// // 签名信息 | // // 签名信息 | ||||
// signingConfig signingConfigs.zhiying | // signingConfig signingConfigs.zhiying | ||||
// } | // } | ||||
@@ -162,7 +163,7 @@ dependencies { | |||||
androidTestImplementation 'androidx.test:runner:1.1.1' | androidTestImplementation 'androidx.test:runner:1.1.1' | ||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' | ||||
//登陆 | |||||
//登陆 | |||||
implementation 'com.ali.auth.sdk:alibabauth_core:2.0.0.11@aar' | implementation 'com.ali.auth.sdk:alibabauth_core:2.0.0.11@aar' | ||||
implementation 'com.ali.auth.sdk:alibabauth_ui:2.0.0.11@aar' | implementation 'com.ali.auth.sdk:alibabauth_ui:2.0.0.11@aar' | ||||
implementation 'com.ali.auth.sdk:alibabauth_ext:2.0.0.11@aar' | implementation 'com.ali.auth.sdk:alibabauth_ext:2.0.0.11@aar' | ||||
@@ -26,8 +26,8 @@ | |||||
<uses-permission android:name="android.permission.INTERNET" /> | <uses-permission android:name="android.permission.INTERNET" /> | ||||
<!-- Permissions options for the `ignoreBatteryOptimizations` group --> | |||||
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" /> | |||||
<!--<!– <!– Permissions options for the `ignoreBatteryOptimizations` group –>–>--> | |||||
<!-- <uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />--> | |||||
<application | <application | ||||
@@ -19,6 +19,7 @@ import 'package:zhiying_business_college/register.dart'; | |||||
import 'package:zhiying_new_user_free/register.dart'; | import 'package:zhiying_new_user_free/register.dart'; | ||||
import 'package:zhiying_wechat_teacher/register.dart'; | import 'package:zhiying_wechat_teacher/register.dart'; | ||||
import 'package:zhiying_moments/register.dart'; | import 'package:zhiying_moments/register.dart'; | ||||
import 'package:zhiying_member_upgrade/register.dart'; | |||||
void main() { | void main() { | ||||
FlutterError.onError = (FlutterErrorDetails details) { | FlutterError.onError = (FlutterErrorDetails details) { | ||||
@@ -63,6 +64,7 @@ class _MyAppState extends State<MyApp> { | |||||
NewUserFreeRegister.init(); | NewUserFreeRegister.init(); | ||||
WeChatTeachRegister.init(); | WeChatTeachRegister.init(); | ||||
FriendCircleRegister.init(); | FriendCircleRegister.init(); | ||||
MemberUpgradeRegister.init(); | |||||
print('初始化百川'); | print('初始化百川'); | ||||
FlutterAlibc.initAlibc(version: "", appName: "").then((result) { | FlutterAlibc.initAlibc(version: "", appName: "").then((result) { | ||||
print("白川" + '${result.errorCode} ${result.errorMessage}'); | print("白川" + '${result.errorCode} ${result.errorMessage}'); | ||||
@@ -38,8 +38,14 @@ dev_dependencies: | |||||
zhiying_moments: | zhiying_moments: | ||||
#path: ../zhiying_moments | #path: ../zhiying_moments | ||||
git: | git: | ||||
ref: 0.1.1 | |||||
ref: 0.1.5 | |||||
url: http://192.168.0.138:3000/FnuoOS_ZhiYing/zhiying_moments.git | url: http://192.168.0.138:3000/FnuoOS_ZhiYing/zhiying_moments.git | ||||
#会员升级 | |||||
zhiying_member_upgrade: | |||||
#path: ../Zhiying_Member_Upgrade | |||||
git: | |||||
ref: 0.0.1 | |||||
url: http://192.168.0.138:3000/FnuoOS_ZhiYing/Zhiying_Member_Upgrade.git | |||||
# For information on the generic Dart part of this file, see the | # For information on the generic Dart part of this file, see the | ||||
# following page: https://dart.dev/tools/pub/pubspec | # following page: https://dart.dev/tools/pub/pubspec | ||||
@@ -33,8 +33,7 @@ class GoodsShareImage extends StatefulWidget { | |||||
final Map<String, dynamic> params; | final Map<String, dynamic> params; | ||||
final String shareType; | final String shareType; | ||||
const GoodsShareImage(this.model, this.params, this.shareType, {Key key}) | |||||
: super(key: key); | |||||
const GoodsShareImage(this.model, this.params, this.shareType, {Key key}) : super(key: key); | |||||
@override | @override | ||||
_GoodsShareImageState createState() => _GoodsShareImageState(); | _GoodsShareImageState createState() => _GoodsShareImageState(); | ||||
@@ -45,8 +44,7 @@ class _GoodsShareImageState extends State<GoodsShareImage> { | |||||
Widget build(BuildContext context) { | Widget build(BuildContext context) { | ||||
return BlocProvider<GoodsShareContentBloc>( | return BlocProvider<GoodsShareContentBloc>( | ||||
bloc: GoodsShareContentBloc(), | bloc: GoodsShareContentBloc(), | ||||
child: _GoodsShareImageContent( | |||||
widget.model, widget.params, widget.shareType), | |||||
child: _GoodsShareImageContent(widget.model, widget.params, widget.shareType), | |||||
); | ); | ||||
} | } | ||||
} | } | ||||
@@ -56,16 +54,13 @@ class _GoodsShareImageContent extends StatefulWidget { | |||||
final Map<String, dynamic> params; | final Map<String, dynamic> params; | ||||
final String shareType; | final String shareType; | ||||
const _GoodsShareImageContent(this.model, this.params, this.shareType, | |||||
{Key key}) | |||||
: super(key: key); | |||||
const _GoodsShareImageContent(this.model, this.params, this.shareType, {Key key}) : super(key: key); | |||||
@override | @override | ||||
_GoodsShareImageContentState createState() => _GoodsShareImageContentState(); | _GoodsShareImageContentState createState() => _GoodsShareImageContentState(); | ||||
} | } | ||||
class _GoodsShareImageContentState extends State<_GoodsShareImageContent> | |||||
with AutomaticKeepAliveClientMixin { | |||||
class _GoodsShareImageContentState extends State<_GoodsShareImageContent> with AutomaticKeepAliveClientMixin { | |||||
GlobalKey _globalKey = GlobalKey(); | GlobalKey _globalKey = GlobalKey(); | ||||
GoodsShareImageModel _style; | GoodsShareImageModel _style; | ||||
Map<int, String> _images = Map(); | Map<int, String> _images = Map(); | ||||
@@ -123,10 +118,7 @@ class _GoodsShareImageContentState extends State<_GoodsShareImageContent> | |||||
onEditorClick: () { | onEditorClick: () { | ||||
Fluttertoast.showToast(msg: '正在开发中'); | Fluttertoast.showToast(msg: '正在开发中'); | ||||
return; | return; | ||||
Navigator.push( | |||||
context, | |||||
CupertinoPageRoute( | |||||
builder: (context) => GoodsShareEditor(_style))); | |||||
Navigator.push(context, CupertinoPageRoute(builder: (context) => GoodsShareEditor(_style))); | |||||
}, | }, | ||||
onTempChange: (temp) { | onTempChange: (temp) { | ||||
setState(() { | setState(() { | ||||
@@ -183,6 +175,17 @@ class _GoodsShareImageContentState extends State<_GoodsShareImageContent> | |||||
}, | }, | ||||
), | ), | ||||
); | ); | ||||
List<String> moreImageList = List(); | |||||
try{ | |||||
moreImageList = List.from(widget?.params['image_url_list']).map((e) => e.toString()).toList(); | |||||
}catch(e,s){ | |||||
print(e); | |||||
print(s); | |||||
} | |||||
_style.customImage.addAll(moreImageList); | |||||
_style.customImage=_style.customImage.reversed.toList(); | |||||
for (int index = 0; index < _style.customImage.length; index++) { | for (int index = 0; index < _style.customImage.length; index++) { | ||||
String image = _style.customImage[index]; | String image = _style.customImage[index]; | ||||
// 分享图片 | // 分享图片 | ||||
@@ -211,16 +214,9 @@ class _GoodsShareImageContentState extends State<_GoodsShareImageContent> | |||||
child: Container( | child: Container( | ||||
margin: EdgeInsets.only(bottom: 4), | margin: EdgeInsets.only(bottom: 4), | ||||
padding: EdgeInsets.only(top: 10), | padding: EdgeInsets.only(top: 10), | ||||
decoration: BoxDecoration( | |||||
color: Colors.white, | |||||
borderRadius: BorderRadius.only( | |||||
bottomLeft: Radius.circular(8), | |||||
bottomRight: Radius.circular(8))), | |||||
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.only(bottomLeft: Radius.circular(8), bottomRight: Radius.circular(8))), | |||||
child: SingleChildScrollView( | child: SingleChildScrollView( | ||||
child: Column( | |||||
crossAxisAlignment: CrossAxisAlignment.start, | |||||
mainAxisAlignment: MainAxisAlignment.start, | |||||
children: widgets), | |||||
child: Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: widgets), | |||||
), | ), | ||||
), | ), | ||||
), | ), | ||||
@@ -235,12 +231,9 @@ class _GoodsShareImageContentState extends State<_GoodsShareImageContent> | |||||
if (shareImages == null) { | if (shareImages == null) { | ||||
return Container(); | return Container(); | ||||
} | } | ||||
CustomButtonModel btnCopy = CustomButtonModel.fromJson( | |||||
Map<String, dynamic>.from(shareImages['copy_btn'])); | |||||
CustomButtonModel btnSave = CustomButtonModel.fromJson( | |||||
Map<String, dynamic>.from(shareImages['save_btn'])); | |||||
CustomButtonModel btnShare = CustomButtonModel.fromJson( | |||||
Map<String, dynamic>.from(shareImages['share_btn'])); | |||||
CustomButtonModel btnCopy = CustomButtonModel.fromJson(Map<String, dynamic>.from(shareImages['copy_btn'])); | |||||
CustomButtonModel btnSave = CustomButtonModel.fromJson(Map<String, dynamic>.from(shareImages['save_btn'])); | |||||
CustomButtonModel btnShare = CustomButtonModel.fromJson(Map<String, dynamic>.from(shareImages['share_btn'])); | |||||
return SafeArea( | return SafeArea( | ||||
child: Container( | child: Container( | ||||
margin: EdgeInsets.only(left: 12.5, right: 12.5, top: 4, bottom: 4), | margin: EdgeInsets.only(left: 12.5, right: 12.5, top: 4, bottom: 4), | ||||
@@ -317,8 +310,7 @@ class _GoodsShareImageContentState extends State<_GoodsShareImageContent> | |||||
_shareModel.image = null; | _shareModel.image = null; | ||||
} | } | ||||
if ((_shareModel.image == null || _shareModel.image.length == 0) && | |||||
_shareModel.poster == null) { | |||||
if ((_shareModel.image == null || _shareModel.image.length == 0) && _shareModel.poster == null) { | |||||
Fluttertoast.showToast(msg: '请选择要保存的图片'); | Fluttertoast.showToast(msg: '请选择要保存的图片'); | ||||
Loading.dismiss(); | Loading.dismiss(); | ||||
return; | return; | ||||
@@ -352,14 +344,16 @@ class _GoodsShareImageContentState extends State<_GoodsShareImageContent> | |||||
} | } | ||||
List<String> paths = await ImageDownloadUtil.download(images); | List<String> paths = await ImageDownloadUtil.download(images); | ||||
paths.forEach((path) async { | |||||
Uint8List data = File(path).readAsBytesSync(); | |||||
for(var item in paths){ | |||||
Uint8List data = File(item).readAsBytesSync(); | |||||
isSaveSuccess = await SaveImage.save(imageBytes: data); | isSaveSuccess = await SaveImage.save(imageBytes: data); | ||||
}); | |||||
if (isSaveSuccess) | |||||
} | |||||
if (isSaveSuccess) { | |||||
Fluttertoast.showToast(msg: '保存成功'); | Fluttertoast.showToast(msg: '保存成功'); | ||||
else | |||||
} else{ | |||||
Fluttertoast.showToast(msg: '保存失败'); | Fluttertoast.showToast(msg: '保存失败'); | ||||
} | |||||
Loading.dismiss(); | Loading.dismiss(); | ||||
} | } | ||||
@@ -371,8 +365,7 @@ class _GoodsShareImageContentState extends State<_GoodsShareImageContent> | |||||
RenderRepaintBoundary boundary = buildContext.findRenderObject(); | RenderRepaintBoundary boundary = buildContext.findRenderObject(); | ||||
ui.Image image = await boundary.toImage(pixelRatio: 2.0); | ui.Image image = await boundary.toImage(pixelRatio: 2.0); | ||||
// 注意:png是压缩后格式,如果需要图片的原始像素数据,请使用rawRgba | // 注意:png是压缩后格式,如果需要图片的原始像素数据,请使用rawRgba | ||||
ByteData byteData = | |||||
await image.toByteData(format: ui.ImageByteFormat.png); | |||||
ByteData byteData = await image.toByteData(format: ui.ImageByteFormat.png); | |||||
Uint8List pngBytes = byteData.buffer.asUint8List(); | Uint8List pngBytes = byteData.buffer.asUint8List(); | ||||
_shareModel.poster = pngBytes; | _shareModel.poster = pngBytes; | ||||
} | } | ||||
@@ -180,7 +180,7 @@ class _GoodsShareLinkContentState extends State<_GoodsShareLinkContent> | |||||
} | } | ||||
Widget _createBottom() { | Widget _createBottom() { | ||||
Map<String, dynamic> shareImages = _style?.cssList?.shareImage ?? {}; | |||||
Map<String, dynamic> shareImages = _style?.cssList?.shareImage; | |||||
if (shareImages == null) { | if (shareImages == null) { | ||||
return Container(); | return Container(); | ||||
} | } | ||||
@@ -7,11 +7,17 @@ import 'package:zhiying_comm/zhiying_comm.dart'; | |||||
class ImageDownloadUtil { | class ImageDownloadUtil { | ||||
static Future<List<String>> download(List<String> urls) async { | static Future<List<String>> download(List<String> urls) async { | ||||
try { | try { | ||||
var dict = await getPhoneLocalPath(); | |||||
// var dict = await getPhoneLocalPath(); | |||||
// var dict = await getTemporaryDirectory(); | |||||
Directory dict; | |||||
if (Platform.isAndroid) { | |||||
dict = await getTemporaryDirectory(); | |||||
} else { | |||||
dict = await getPhoneLocalPath(); | |||||
} | |||||
Dio dio = Dio(); | Dio dio = Dio(); | ||||
var paths = await Future.wait(urls.map((url) async { | var paths = await Future.wait(urls.map((url) async { | ||||
String path = '${dict.path}/${EncodeUtil.generateMd5(url)}.jpg'; | |||||
String path = '${dict.path}/${EncodeUtil.generateMd5(url)}.png'; | |||||
Logger.debug('图片下载地址 ${path.toString()}'); | Logger.debug('图片下载地址 ${path.toString()}'); | ||||
await dio.download(url, path); | await dio.download(url, path); | ||||
return path; | return path; | ||||
@@ -1,4 +1,3 @@ | |||||
import 'package:zhiying_comm/zhiying_comm.dart'; | import 'package:zhiying_comm/zhiying_comm.dart'; | ||||
class GoodsDetailsFooterModel { | class GoodsDetailsFooterModel { | ||||
@@ -56,9 +55,8 @@ class GoodsDetailsFooterModel { | |||||
topRightRadius: json['top_right_radius'], | topRightRadius: json['top_right_radius'], | ||||
bottomLeftRadius: json['bottom_left_radius'], | bottomLeftRadius: json['bottom_left_radius'], | ||||
bottomRightRadius: json['bottom_right_radius'], | bottomRightRadius: json['bottom_right_radius'], | ||||
bgColor : json['bg_color'], | |||||
listStyle : json['list_style'] != null? new ListStyle.fromJson(json['list_style']): null | |||||
); | |||||
bgColor: json['bg_color'], | |||||
listStyle: json['list_style'] != null ? new ListStyle.fromJson(json['list_style']) : null); | |||||
} | } | ||||
GoodsDetailsFooterModel({ | GoodsDetailsFooterModel({ | ||||
@@ -145,21 +143,22 @@ class FavArgs { | |||||
String marketPrice; | String marketPrice; | ||||
String currentPrice; | String currentPrice; | ||||
String inorderCount; | String inorderCount; | ||||
Null detailData; | |||||
FavArgs({this.provider, | |||||
this.providerName, | |||||
this.goodId, | |||||
this.goodImage, | |||||
this.goodTitle, | |||||
this.shopName, | |||||
this.coupon, | |||||
this.couponUrl, | |||||
this.commission, | |||||
this.marketPrice, | |||||
this.currentPrice, | |||||
this.inorderCount, | |||||
this.detailData}); | |||||
dynamic detailData; | |||||
FavArgs( | |||||
{this.provider, | |||||
this.providerName, | |||||
this.goodId, | |||||
this.goodImage, | |||||
this.goodTitle, | |||||
this.shopName, | |||||
this.coupon, | |||||
this.couponUrl, | |||||
this.commission, | |||||
this.marketPrice, | |||||
this.currentPrice, | |||||
this.inorderCount, | |||||
this.detailData}); | |||||
FavArgs.fromJson(Map<String, dynamic> json) { | FavArgs.fromJson(Map<String, dynamic> json) { | ||||
provider = json['provider']; | provider = json['provider']; | ||||
@@ -205,10 +204,14 @@ class ShareUrlArgs { | |||||
String selfbuyCommission; | String selfbuyCommission; | ||||
String title; | String title; | ||||
String type; | String type; | ||||
List<dynamic> imageUrlList; | |||||
ShareUrlArgs({this.buyUrl, this.coupon, this.couponPrice, this.marketPrice, this.posterImage, this.selfbuyCommission, this.title, this.type}); | |||||
ShareUrlArgs({this.buyUrl, this.coupon, this.couponPrice, this.marketPrice, this.posterImage, this.selfbuyCommission, this.title, this.type,this.imageUrlList}); | |||||
ShareUrlArgs.fromJson(Map<String, dynamic> json) { | ShareUrlArgs.fromJson(Map<String, dynamic> json) { | ||||
if (json['image_url_list'] != null) { | |||||
imageUrlList = List.from(json['image_url_list']).map((e) => e.toString()).toList(); | |||||
} | |||||
buyUrl = json['buy_url']; | buyUrl = json['buy_url']; | ||||
coupon = json['coupon']; | coupon = json['coupon']; | ||||
couponPrice = json['coupon_price']; | couponPrice = json['coupon_price']; | ||||
@@ -216,7 +219,9 @@ class ShareUrlArgs { | |||||
posterImage = json['poster_image']; | posterImage = json['poster_image']; | ||||
selfbuyCommission = json['selfbuy_commission']; | selfbuyCommission = json['selfbuy_commission']; | ||||
title = json['title']; | title = json['title']; | ||||
type = json['type']; | type = json['type']; | ||||
} | } | ||||
Map<String, dynamic> toJson() { | Map<String, dynamic> toJson() { | ||||
@@ -229,6 +234,7 @@ class ShareUrlArgs { | |||||
data['selfbuy_commission'] = this.selfbuyCommission; | data['selfbuy_commission'] = this.selfbuyCommission; | ||||
data['title'] = this.title; | data['title'] = this.title; | ||||
data['type'] = this.type; | data['type'] = this.type; | ||||
data['image_url_list']=this.imageUrlList; | |||||
return data; | return data; | ||||
} | } | ||||
} | } | ||||
@@ -267,7 +273,6 @@ class ConvertArgs { | |||||
} | } | ||||
} | } | ||||
class ListStyle { | class ListStyle { | ||||
LeftIcon1 leftIcon1; | LeftIcon1 leftIcon1; | ||||
LeftIcon1 leftIcon2; | LeftIcon1 leftIcon2; | ||||
@@ -276,32 +281,15 @@ class ListStyle { | |||||
BuyBubbleTip buyBubbleTip; | BuyBubbleTip buyBubbleTip; | ||||
BuyBubbleTip buyShareTip; | BuyBubbleTip buyShareTip; | ||||
ListStyle({this.leftIcon1, | |||||
this.leftIcon2, | |||||
this.rightIcon1, | |||||
this.rightIcon2, | |||||
this.buyBubbleTip, | |||||
this.buyShareTip}); | |||||
ListStyle({this.leftIcon1, this.leftIcon2, this.rightIcon1, this.rightIcon2, this.buyBubbleTip, this.buyShareTip}); | |||||
ListStyle.fromJson(Map<String, dynamic> json) { | ListStyle.fromJson(Map<String, dynamic> json) { | ||||
leftIcon1 = json['left_icon1'] != null | |||||
? new LeftIcon1.fromJson(json['left_icon1']) | |||||
: null; | |||||
leftIcon2 = json['left_icon2'] != null | |||||
? new LeftIcon1.fromJson(json['left_icon2']) | |||||
: null; | |||||
rightIcon1 = json['right_icon1'] != null | |||||
? new RightIcon1.fromJson(json['right_icon1']) | |||||
: null; | |||||
rightIcon2 = json['right_icon2'] != null | |||||
? new RightIcon1.fromJson(json['right_icon2']) | |||||
: null; | |||||
buyBubbleTip = json['buy_bubble_tip'] != null | |||||
? new BuyBubbleTip.fromJson(json['buy_bubble_tip']) | |||||
: null; | |||||
buyShareTip = json['buy_share_tip'] != null | |||||
? new BuyBubbleTip.fromJson(json['buy_share_tip']) | |||||
: null; | |||||
leftIcon1 = json['left_icon1'] != null ? new LeftIcon1.fromJson(json['left_icon1']) : null; | |||||
leftIcon2 = json['left_icon2'] != null ? new LeftIcon1.fromJson(json['left_icon2']) : null; | |||||
rightIcon1 = json['right_icon1'] != null ? new RightIcon1.fromJson(json['right_icon1']) : null; | |||||
rightIcon2 = json['right_icon2'] != null ? new RightIcon1.fromJson(json['right_icon2']) : null; | |||||
buyBubbleTip = json['buy_bubble_tip'] != null ? new BuyBubbleTip.fromJson(json['buy_bubble_tip']) : null; | |||||
buyShareTip = json['buy_share_tip'] != null ? new BuyBubbleTip.fromJson(json['buy_share_tip']) : null; | |||||
} | } | ||||
Map<String, dynamic> toJson() { | Map<String, dynamic> toJson() { | ||||
@@ -328,7 +316,7 @@ class ListStyle { | |||||
} | } | ||||
} | } | ||||
class LeftIcon1 extends SkipModel{ | |||||
class LeftIcon1 extends SkipModel { | |||||
String text; | String text; | ||||
String color; | String color; | ||||
String beforeIcon; | String beforeIcon; | ||||
@@ -339,14 +327,7 @@ class LeftIcon1 extends SkipModel{ | |||||
String isJump; | String isJump; | ||||
String isShow; | String isShow; | ||||
LeftIcon1({this.text, | |||||
this.color, | |||||
this.beforeIcon, | |||||
this.afterIcon, | |||||
this.skipIdentifier, | |||||
this.requiredLogin, | |||||
this.requiredTaobaoAuth, | |||||
this.isJump}); | |||||
LeftIcon1({this.text, this.color, this.beforeIcon, this.afterIcon, this.skipIdentifier, this.requiredLogin, this.requiredTaobaoAuth, this.isJump}); | |||||
LeftIcon1.fromJson(Map<String, dynamic> json) { | LeftIcon1.fromJson(Map<String, dynamic> json) { | ||||
super.fromJson(json); | super.fromJson(json); | ||||
@@ -358,7 +339,7 @@ class LeftIcon1 extends SkipModel{ | |||||
requiredLogin = json['required_login']; | requiredLogin = json['required_login']; | ||||
requiredTaobaoAuth = json['required_taobao_auth']; | requiredTaobaoAuth = json['required_taobao_auth']; | ||||
isJump = json['is_jump']; | isJump = json['is_jump']; | ||||
isShow=json['is_show']; | |||||
isShow = json['is_show']; | |||||
} | } | ||||
Map<String, dynamic> toJson() { | Map<String, dynamic> toJson() { | ||||
@@ -384,12 +365,7 @@ class RightIcon1 { | |||||
List<String> sourceList; | List<String> sourceList; | ||||
String isShow; | String isShow; | ||||
RightIcon1({this.text, | |||||
this.color, | |||||
this.btnStr, | |||||
this.bgImage, | |||||
this.functionType, | |||||
this.sourceList}); | |||||
RightIcon1({this.text, this.color, this.btnStr, this.bgImage, this.functionType, this.sourceList}); | |||||
RightIcon1.fromJson(Map<String, dynamic> json) { | RightIcon1.fromJson(Map<String, dynamic> json) { | ||||
text = json['text']; | text = json['text']; | ||||
@@ -398,7 +374,7 @@ class RightIcon1 { | |||||
bgImage = json['bg_image']; | bgImage = json['bg_image']; | ||||
functionType = json['function_type']; | functionType = json['function_type']; | ||||
sourceList = json['source_list'].cast<String>(); | sourceList = json['source_list'].cast<String>(); | ||||
isShow=json['is_show']; | |||||
isShow = json['is_show']; | |||||
} | } | ||||
Map<String, dynamic> toJson() { | Map<String, dynamic> toJson() { | ||||
@@ -422,13 +398,7 @@ class BuyBubbleTip { | |||||
String isShow; | String isShow; | ||||
List<String> sourceList; | List<String> sourceList; | ||||
BuyBubbleTip({this.textStr, | |||||
this.textColor, | |||||
this.priceIcon, | |||||
this.bgImage, | |||||
this.closeIcon, | |||||
this.isShow, | |||||
this.sourceList}); | |||||
BuyBubbleTip({this.textStr, this.textColor, this.priceIcon, this.bgImage, this.closeIcon, this.isShow, this.sourceList}); | |||||
BuyBubbleTip.fromJson(Map<String, dynamic> json) { | BuyBubbleTip.fromJson(Map<String, dynamic> json) { | ||||
textStr = json['text_str']; | textStr = json['text_str']; | ||||
@@ -42,7 +42,6 @@ class _ShareAlertState extends State<ShareAlert> { | |||||
// }catch(e){ | // }catch(e){ | ||||
// print(e); | // print(e); | ||||
// } | // } | ||||
}, onSuccess: (data) { | }, onSuccess: (data) { | ||||
print(data); | print(data); | ||||
_parseData(data); | _parseData(data); | ||||
@@ -107,6 +106,17 @@ class _ShareAlertContent extends StatefulWidget { | |||||
} | } | ||||
class _ShareAlertContentState extends State<_ShareAlertContent> { | class _ShareAlertContentState extends State<_ShareAlertContent> { | ||||
@override | |||||
void initState() { | |||||
Future.delayed(Duration(milliseconds: 100), () async { | |||||
var status = await Permission.storage.status; | |||||
if (status != PermissionStatus.granted) { | |||||
status = await Permission.storage.request(); | |||||
} | |||||
}); | |||||
super.initState(); | |||||
} | |||||
@override | @override | ||||
Widget build(BuildContext context) { | Widget build(BuildContext context) { | ||||
return GestureDetector( | return GestureDetector( | ||||
@@ -233,11 +243,8 @@ class _ShareAlertContentState extends State<_ShareAlertContent> { | |||||
// mob分享,只能单图分享,多图分享调用系统分享 | // mob分享,只能单图分享,多图分享调用系统分享 | ||||
void _shareByMob(ShareSDKPlatform plateform) async { | void _shareByMob(ShareSDKPlatform plateform) async { | ||||
Loading.show(context); | Loading.show(context); | ||||
Timer(Duration(milliseconds: 2000),(){ | |||||
Timer(Duration(milliseconds: 2000), () { | |||||
Loading.dismiss(); | Loading.dismiss(); | ||||
}); | }); | ||||
@@ -261,25 +268,24 @@ class _ShareAlertContentState extends State<_ShareAlertContent> { | |||||
); | ); | ||||
} | } | ||||
} else { | } else { | ||||
var type = SSDKContentTypes.auto; | |||||
var type=SSDKContentTypes.auto; | |||||
if(widget?.model?.image?.first!=null&&widget.model?.url!=null){ | |||||
type=SSDKContentTypes.webpage; | |||||
}else if(widget?.model?.image?.first!=null){ | |||||
type=SSDKContentTypes.image; | |||||
}else if(widget?.model?.title!=null||widget.model?.content!=null){ | |||||
type=SSDKContentTypes.text; | |||||
if (widget?.model?.image?.first != null && widget.model?.url != null) { | |||||
type = SSDKContentTypes.webpage; | |||||
} else if (widget?.model?.image?.first != null) { | |||||
type = SSDKContentTypes.image; | |||||
} else if (widget?.model?.title != null || widget.model?.content != null) { | |||||
type = SSDKContentTypes.text; | |||||
} | } | ||||
if(plateform==ShareSDKPlatforms.qZone){ | |||||
widget?.model?.title=null; | |||||
type=SSDKContentTypes.message; | |||||
if (plateform == ShareSDKPlatforms.qZone && type == SSDKContentTypes.text) { | |||||
widget?.model?.title = null; | |||||
type = SSDKContentTypes.message; | |||||
} | } | ||||
params = SSDKMap() | params = SSDKMap() | ||||
..setGeneral( | ..setGeneral( | ||||
widget.model?.title ?? '', | widget.model?.title ?? '', | ||||
widget?.model?.content??'', | |||||
widget?.model?.content ?? '', | |||||
Platform.isIOS ? widget.model.image : null, | Platform.isIOS ? widget.model.image : null, | ||||
Platform.isAndroid ? widget?.model?.image?.first : null, | Platform.isAndroid ? widget?.model?.image?.first : null, | ||||
null, | null, | ||||
@@ -336,7 +342,7 @@ class _ShareAlertContentState extends State<_ShareAlertContent> { | |||||
if (status != PermissionStatus.granted) { | if (status != PermissionStatus.granted) { | ||||
status = await Permission.storage.request(); | status = await Permission.storage.request(); | ||||
} | } | ||||
if (status == PermissionStatus.denied) { | |||||
if (status != PermissionStatus.granted) { | |||||
Fluttertoast.showToast(msg: '暂无权限,分享失败'); | Fluttertoast.showToast(msg: '暂无权限,分享失败'); | ||||
return null; | return null; | ||||
} | } | ||||
@@ -368,9 +374,11 @@ class _ShareAlertContentState extends State<_ShareAlertContent> { | |||||
Loading.show(context); | Loading.show(context); | ||||
List<String> downPaths = await ImageDownloadUtil.download(widget.model.image); | List<String> downPaths = await ImageDownloadUtil.download(widget.model.image); | ||||
paths.addAll(downPaths); | paths.addAll(downPaths); | ||||
if(Platform.isAndroid&&type=='wx'){ | |||||
if (Platform.isAndroid && type == 'wx') { | |||||
MorePictureShare.shareWeixinPics(paths); | MorePictureShare.shareWeixinPics(paths); | ||||
}else{ | |||||
} else if (Platform.isAndroid && type == 'pyq') { | |||||
MorePictureShare.shareWeixinPicsCirlc(paths); | |||||
} else { | |||||
ShareExtend.shareMultiple(paths, "image", subject: ""); | ShareExtend.shareMultiple(paths, "image", subject: ""); | ||||
} | } | ||||
Loading.dismiss(); | Loading.dismiss(); | ||||
@@ -3,4 +3,4 @@ library zhiying_base_widget; | |||||
export 'dialog/loading/loading.dart'; | export 'dialog/loading/loading.dart'; | ||||
export 'package:flutter_swiper/flutter_swiper.dart'; | export 'package:flutter_swiper/flutter_swiper.dart'; | ||||
export 'package:zhiying_base_widget/pages/main_page/model/background_model.dart'; | export 'package:zhiying_base_widget/pages/main_page/model/background_model.dart'; | ||||
export 'package:zhiying_base_widget/pages/custom_page/bloc/background_bloc.dart'; | |||||
export 'package:zhiying_base_widget/pages/custom_page/bloc/background_bloc.dart'; |
@@ -15,13 +15,16 @@ dependencies: | |||||
bloc: ^4.0.0 | bloc: ^4.0.0 | ||||
event_bus: ^1.1.1 | event_bus: ^1.1.1 | ||||
pull_to_refresh: | pull_to_refresh: | ||||
path: ../../1.22.0_master/flutter_pulltorefresh | |||||
git: | |||||
url: 'http://192.168.0.138:3000/FnuoOS_ZhiYing/flutter_pulltorefresh.git' | |||||
ref: '0.0.1' | |||||
flutter_cupertino_date_picker: | flutter_cupertino_date_picker: | ||||
path: ../../1.22.0_master/flutter-cupertino-date-picker | |||||
git: | |||||
url: 'http://192.168.0.138:3000/FnuoOS_ZhiYing/flutter-cupertino-date-picker.git' | |||||
ref: '0.0.1' | |||||
image_picker: ^0.6.7+3 | image_picker: ^0.6.7+3 | ||||
tab_indicator_styler: 1.0.0 | tab_indicator_styler: 1.0.0 | ||||
connectivity: ^0.4.9+3 | connectivity: ^0.4.9+3 | ||||
save_image: ^1.0.1 | |||||
image_cropper: | image_cropper: | ||||
git: | git: | ||||
url: 'http://192.168.0.138:3000/FnuoOS_Flutter_Components/Image_Cropper.git' | url: 'http://192.168.0.138:3000/FnuoOS_Flutter_Components/Image_Cropper.git' | ||||