@@ -85,39 +85,26 @@ public class MainActivity extends FlutterActivity implements ZhiyingFlutterCommN | |||||
view.addView(launchImageFrame, params); | view.addView(launchImageFrame, params); | ||||
} | } | ||||
Timer timer=new Timer(); | |||||
Timer timer = new Timer(); | |||||
///移除启动页 | ///移除启动页 | ||||
void removeLaunchView() { | void removeLaunchView() { | ||||
//此处延时是为了不显示启动页往上顶 | //此处延时是为了不显示启动页往上顶 | ||||
if(timer!=null){ | |||||
timer.schedule(new TimerTask() { | |||||
@Override | |||||
public void run() { | |||||
MainActivity.this.runOnUiThread(new Runnable() { | |||||
@Override | |||||
public void run() { | |||||
if (view != null && launchImageFrame != null) { | |||||
getWindow().getDecorView().setBackground(new ColorDrawable(Color.parseColor("#000000"))); | |||||
if (view != null && launchImageFrame != null) { | |||||
getWindow().getDecorView().setBackground(new ColorDrawable(Color.parseColor("#000000"))); | |||||
// Animation alphaAnimation = new AlphaAnimation(1, 1); | // Animation alphaAnimation = new AlphaAnimation(1, 1); | ||||
// alphaAnimation.setDuration(100); | // alphaAnimation.setDuration(100); | ||||
// alphaAnimation.setFillAfter(true); | // alphaAnimation.setFillAfter(true); | ||||
// launchImageFrame.startAnimation(alphaAnimation); | // launchImageFrame.startAnimation(alphaAnimation); | ||||
Log.d("----------------", "----------------------清除启动页---------------"); | |||||
view.removeView(launchImageFrame); | |||||
launchImageFrame = null; | |||||
view = null; | |||||
} | |||||
} | |||||
}); | |||||
timer=null; | |||||
} | |||||
},100); | |||||
Log.d("----------------", "----------------------清除启动页---------------"); | |||||
view.removeView(launchImageFrame); | |||||
launchImageFrame = null; | |||||
view = null; | |||||
} | } | ||||
} | } | ||||
@Override | @Override | ||||
protected void onNewIntent(@NonNull Intent intent) { | protected void onNewIntent(@NonNull Intent intent) { | ||||
super.onNewIntent(intent); | super.onNewIntent(intent); | ||||
@@ -167,8 +154,8 @@ public class MainActivity extends FlutterActivity implements ZhiyingFlutterCommN | |||||
@Override | @Override | ||||
public Map getSetting() { | public Map getSetting() { | ||||
Map map = new HashMap(); | Map map = new HashMap(); | ||||
map.put("domain", "http://inapi.izhyin.cn/"); //"http://120.76.175.204:8989"); | |||||
// map.put("domain", "http://api.zhios.cn/");45678910, | |||||
map.put("domain", "http://inapi.izhyin.cn/"); //"http://120.76.175.204:8989"); | |||||
// map.put("domain", "http://api.zhios.cn/");//45678910,api.zhios.cn68703914 | |||||
map.put("master_id", "123456"); | map.put("master_id", "123456"); | ||||
map.put("secret_key", "123456"); | map.put("secret_key", "123456"); | ||||
// map.put("token", "123465"); | // map.put("token", "123465"); | ||||
@@ -119,18 +119,15 @@ class _MyAppState extends State<MyApp> { | |||||
print("change language ${locale.toString()}"); | print("change language ${locale.toString()}"); | ||||
return locale; | return locale; | ||||
}, | }, | ||||
home: GestureDetector( | |||||
onTap: () { | |||||
FocusScopeNode currentFocus = FocusScope.of(context); | |||||
if (!currentFocus.hasPrimaryFocus && currentFocus.focusedChild != null) { | |||||
FocusManager.instance.primaryFocus.unfocus(); | |||||
} | |||||
}, | |||||
child: LaunchPage( | |||||
// builder: (context) => HomePage(), | |||||
), | |||||
home: LaunchPage( | |||||
// builder: (context) => HomePage(), | |||||
), | ), | ||||
), | ), | ||||
); | ); | ||||
} | } | ||||
} | } | ||||
// FocusScopeNode currentFocus = FocusScope.of(context); | |||||
// if (!currentFocus.hasPrimaryFocus && currentFocus.focusedChild != null) { | |||||
// FocusManager.instance.primaryFocus.unfocus(); | |||||
// } |
@@ -27,6 +27,7 @@ import 'package:zhiying_base_widget/widgets/public/custom_button/custom_button_m | |||||
import 'package:zhiying_base_widget/widgets/share/models/share_data_model.dart'; | import 'package:zhiying_base_widget/widgets/share/models/share_data_model.dart'; | ||||
import 'package:zhiying_base_widget/widgets/share/share_alert.dart'; | import 'package:zhiying_base_widget/widgets/share/share_alert.dart'; | ||||
import 'package:zhiying_comm/util/base_bloc.dart'; | import 'package:zhiying_comm/util/base_bloc.dart'; | ||||
import 'package:zhiying_comm/zhiying_comm.dart'; | |||||
class GoodsShareImage extends StatefulWidget { | class GoodsShareImage extends StatefulWidget { | ||||
final Map<String, dynamic> model; | final Map<String, dynamic> model; | ||||
@@ -177,15 +178,15 @@ class _GoodsShareImageContentState extends State<_GoodsShareImageContent> with A | |||||
); | ); | ||||
List<String> moreImageList = List(); | List<String> moreImageList = List(); | ||||
try{ | |||||
try { | |||||
moreImageList = List.from(widget?.params['image_url_list']).map((e) => e.toString()).toList(); | moreImageList = List.from(widget?.params['image_url_list']).map((e) => e.toString()).toList(); | ||||
}catch(e,s){ | |||||
} catch (e, s) { | |||||
print(e); | print(e); | ||||
print(s); | print(s); | ||||
} | } | ||||
_style.customImage.addAll(moreImageList); | _style.customImage.addAll(moreImageList); | ||||
_style.customImage=_style.customImage.reversed.toList(); | |||||
_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]; | ||||
// 分享图片 | // 分享图片 | ||||
@@ -344,17 +345,16 @@ class _GoodsShareImageContentState extends State<_GoodsShareImageContent> with A | |||||
} | } | ||||
List<String> paths = await ImageDownloadUtil.download(images); | List<String> paths = await ImageDownloadUtil.download(images); | ||||
for(var item in paths){ | |||||
for (var item in paths) { | |||||
Uint8List data = File(item).readAsBytesSync(); | 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(); | ||||
} | } | ||||
@@ -363,11 +363,14 @@ class _GoodsShareImageContentState extends State<_GoodsShareImageContent> with A | |||||
BuildContext buildContext = _globalKey.currentContext; | BuildContext buildContext = _globalKey.currentContext; | ||||
if (null != buildContext) { | if (null != buildContext) { | ||||
RenderRepaintBoundary boundary = buildContext.findRenderObject(); | RenderRepaintBoundary boundary = buildContext.findRenderObject(); | ||||
ui.Image image = await boundary.toImage(pixelRatio: 1.5); | |||||
ui.Image image = await boundary.toImage(pixelRatio: 4); | |||||
// 注意:png是压缩后格式,如果需要图片的原始像素数据,请使用rawRgba | // 注意:png是压缩后格式,如果需要图片的原始像素数据,请使用rawRgba | ||||
Loading.show(context); | |||||
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; | |||||
File file = await EncodeUtil.compressImage(context,images: pngBytes, size: 200); | |||||
Loading.dismiss(); | |||||
_shareModel.poster = file.readAsBytesSync(); | |||||
} | } | ||||
} else { | } else { | ||||
_shareModel.poster = null; | _shareModel.poster = null; | ||||
@@ -35,7 +35,7 @@ class HotRankingPageSkeleton extends StatelessWidget { | |||||
_buildBottomListItem() { | _buildBottomListItem() { | ||||
List<Widget> listWidget = List(); | List<Widget> listWidget = List(); | ||||
for (var index = 0; index < 3; index++) { | |||||
for (var index = 0; index < 10; index++) { | |||||
listWidget.add(Container( | listWidget.add(Container( | ||||
margin: EdgeInsets.only(left: 16, top: 10, bottom: 10), | margin: EdgeInsets.only(left: 16, top: 10, bottom: 10), | ||||
child: Row( | child: Row( | ||||
@@ -316,7 +316,7 @@ class _MineDetailContainerState extends State<_MineDetailContainer> { | |||||
if (cropperFile == null) { | if (cropperFile == null) { | ||||
return; | return; | ||||
} | } | ||||
File resultFile = await EncodeUtil.compressImage(cropperFile, 800); | |||||
File resultFile = await EncodeUtil.compressImage(context,file:cropperFile,size: 800); | |||||
Loading.show(context); | Loading.show(context); | ||||
_bloc.uploadAvatar(resultFile); | _bloc.uploadAvatar(resultFile); | ||||
} | } | ||||
@@ -132,6 +132,10 @@ class BaseWidgetRegister { | |||||
Jdsdk.init(appKey: config.keys?.jdAndroid?.appkey ?? '', appSecret: config.keys?.jdAndroid?.secret ?? ''); | Jdsdk.init(appKey: config.keys?.jdAndroid?.appkey ?? '', appSecret: config.keys?.jdAndroid?.secret ?? ''); | ||||
} | } | ||||
SharesdkPlugin.regist(register); | SharesdkPlugin.regist(register); | ||||
///微信支付初始化 | |||||
bool result = await SyFlutterWechat.register(config?.keys?.weixin?.appId); | |||||
print(result); | |||||
}); | }); | ||||
// MOB 秒验 | // MOB 秒验 | ||||
@@ -200,7 +204,6 @@ class BaseWidgetRegister { | |||||
/// 反馈列表页 | /// 反馈列表页 | ||||
PageFactory.regist('pub.flutter.feedback_list', (model) => FeedbackRecordPage(model)); | PageFactory.regist('pub.flutter.feedback_list', (model) => FeedbackRecordPage(model)); | ||||
/// 提现页 | /// 提现页 | ||||
PageFactory.regist('pub.flutter.cash_out', (model) => WithdrawPage(model)); | PageFactory.regist('pub.flutter.cash_out', (model) => WithdrawPage(model)); | ||||
@@ -390,7 +390,9 @@ class __CustomQuickEntryContainerState extends State<_CustomQuickEntryContainer> | |||||
return GestureDetector( | return GestureDetector( | ||||
behavior: HitTestBehavior.opaque, | behavior: HitTestBehavior.opaque, | ||||
onTap: () => _itemIconClick(item), | |||||
onTap: () { | |||||
_itemIconClick(item); | |||||
}, | |||||
child: Container( | child: Container( | ||||
height: itemHeight, | height: itemHeight, | ||||
width: 60, | width: 60, | ||||
@@ -153,6 +153,7 @@ class ListStyle extends SkipModel{ | |||||
String requiredTaobaoAuth; | String requiredTaobaoAuth; | ||||
String skipIdentifier; | String skipIdentifier; | ||||
ListStyle( | ListStyle( | ||||
{this.img, | {this.img, | ||||
this.title, | this.title, | ||||
@@ -173,6 +174,7 @@ class ListStyle extends SkipModel{ | |||||
requiredLogin = json['required_login']; | requiredLogin = json['required_login']; | ||||
requiredTaobaoAuth = json['required_taobao_auth']; | requiredTaobaoAuth = json['required_taobao_auth']; | ||||
skipIdentifier = json['skip_identifier']; | skipIdentifier = json['skip_identifier']; | ||||
} | } | ||||
Map<String, dynamic> toJson() { | Map<String, dynamic> toJson() { | ||||
@@ -185,6 +187,7 @@ class ListStyle extends SkipModel{ | |||||
data['required_login'] = this.requiredLogin; | data['required_login'] = this.requiredLogin; | ||||
data['required_taobao_auth'] = this.requiredTaobaoAuth; | data['required_taobao_auth'] = this.requiredTaobaoAuth; | ||||
data['skip_identifier'] = this.skipIdentifier; | data['skip_identifier'] = this.skipIdentifier; | ||||
return data; | return data; | ||||
} | } | ||||
} | } | ||||
@@ -33,7 +33,7 @@ class HomeGoodsListStyleModel { | |||||
}); | }); | ||||
HomeGoodsListStyleModel.fromJson(Map<String, dynamic> json) { | HomeGoodsListStyleModel.fromJson(Map<String, dynamic> json) { | ||||
hotRankIconList = json['hot_rank_icon_list'].cast<String>(); | |||||
hotRankIconList = json['hot_rank_icon_list']. cast<String>(); | |||||
topMargin = json['top_margin']; | topMargin = json['top_margin']; | ||||
listColumn = json['list_column']; | listColumn = json['list_column']; | ||||
leftRighMargin = json['left_righ_margin']; | leftRighMargin = json['left_righ_margin']; | ||||
@@ -23,6 +23,8 @@ class HotRankingListBloc extends BlocBase { | |||||
bool isLoading = false; | bool isLoading = false; | ||||
bool isFirst=true; | |||||
@override | @override | ||||
void dispose() { | void dispose() { | ||||
_dataController.close(); | _dataController.close(); | ||||
@@ -35,6 +37,11 @@ class HotRankingListBloc extends BlocBase { | |||||
// return; | // return; | ||||
// } | // } | ||||
// isLoading = true; | // isLoading = true; | ||||
if(isFirst){ | |||||
isFirst=false; | |||||
await Future.delayed(Duration(milliseconds: 300)); | |||||
} | |||||
currentTypeId = typeId; | currentTypeId = typeId; | ||||
NetUtil.request('/api/v1/rec?pvd=taobao&category_id=' + typeId + '&page=' + page.toString(), method: NetMethod.GET, onCache: (data) { | NetUtil.request('/api/v1/rec?pvd=taobao&category_id=' + typeId + '&page=' + page.toString(), method: NetMethod.GET, onCache: (data) { | ||||
complete(); | complete(); | ||||
@@ -10,13 +10,13 @@ class HotRankingSkeleton extends StatelessWidget { | |||||
child: Column( | child: Column( | ||||
mainAxisSize: MainAxisSize.min, | mainAxisSize: MainAxisSize.min, | ||||
children: <Widget>[ | children: <Widget>[ | ||||
Container( | |||||
width: double.infinity, | |||||
margin: EdgeInsets.all(16), | |||||
height: 48, | |||||
child: Row( | |||||
children: _buildTopRow(), | |||||
)), | |||||
// Container( | |||||
// width: double.infinity, | |||||
// margin: EdgeInsets.all(16), | |||||
// height: 48, | |||||
// child: Row( | |||||
// children: _buildTopRow(), | |||||
// )), | |||||
Expanded( | Expanded( | ||||
child: Container( | child: Container( | ||||
child: Column( | child: Column( | ||||
@@ -30,7 +30,7 @@ class HotRankingSkeleton extends StatelessWidget { | |||||
_buildBottomListItem() { | _buildBottomListItem() { | ||||
List<Widget> listWidget = List(); | List<Widget> listWidget = List(); | ||||
for (var index = 0; index < 3; index++) { | |||||
for (var index = 0; index < 10; index++) { | |||||
listWidget.add(Container( | listWidget.add(Container( | ||||
margin: EdgeInsets.only(left: 16,top: 10,bottom: 10), | margin: EdgeInsets.only(left: 16,top: 10,bottom: 10), | ||||
child: Row( | child: Row( | ||||
@@ -106,10 +106,11 @@ class _ShareAlertSelectState extends State<ShareAlertSelect> { | |||||
if (null != buildContext) { | if (null != buildContext) { | ||||
RenderRepaintBoundary boundary = buildContext.findRenderObject(); | RenderRepaintBoundary boundary = buildContext.findRenderObject(); | ||||
///pixelRatio是放大倍数 | ///pixelRatio是放大倍数 | ||||
ui.Image image = await boundary.toImage(pixelRatio: 1); | |||||
ui.Image image = await boundary.toImage(pixelRatio: 5); | |||||
// 注意: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; | ||||
} else { | } else { | ||||
_shareModel.poster = null; | _shareModel.poster = null; | ||||
@@ -370,6 +371,27 @@ class _ShareAlertContentState extends State<_ShareAlertContent> { | |||||
), | ), | ||||
), | ), | ||||
onTap: () async { | onTap: () async { | ||||
Loading.show(context); | |||||
await Future.delayed(Duration(seconds: 2)); | |||||
if(_shareDataModel.image!=null){ | |||||
for(var image in _shareDataModel.image){ | |||||
File file = await EncodeUtil.compressImage(context,file: File(image), size: 200); | |||||
image=file.path; | |||||
} | |||||
Loading.dismiss(); | |||||
} | |||||
if(_shareDataModel?.poster!=null){ | |||||
File file = await EncodeUtil.compressImage(context,images: _shareDataModel?.poster, size: 200); | |||||
_shareDataModel.poster=file.readAsBytesSync(); | |||||
Loading.dismiss(); | |||||
} | |||||
//检查是否有存储权限 | //检查是否有存储权限 | ||||
var status = await Permission.storage.status; | var status = await Permission.storage.status; | ||||
if (!status.isGranted) { | if (!status.isGranted) { | ||||
@@ -37,7 +37,6 @@ dependencies: | |||||
# 列表滑动删除 | # 列表滑动删除 | ||||
flutter_slidable: 0.5.7 | flutter_slidable: 0.5.7 | ||||
# image_gallery_saver: ^1.6.0 | # image_gallery_saver: ^1.6.0 | ||||
permission_handler: | permission_handler: | ||||
git: | git: | ||||
ref: 0.0.1 | ref: 0.0.1 | ||||