@@ -85,39 +85,26 @@ public class MainActivity extends FlutterActivity implements ZhiyingFlutterCommN | |||
view.addView(launchImageFrame, params); | |||
} | |||
Timer timer=new Timer(); | |||
Timer timer = new Timer(); | |||
///移除启动页 | |||
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); | |||
// alphaAnimation.setDuration(100); | |||
// alphaAnimation.setFillAfter(true); | |||
// 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 | |||
protected void onNewIntent(@NonNull Intent intent) { | |||
super.onNewIntent(intent); | |||
@@ -167,8 +154,8 @@ public class MainActivity extends FlutterActivity implements ZhiyingFlutterCommN | |||
@Override | |||
public Map getSetting() { | |||
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("secret_key", "123456"); | |||
// map.put("token", "123465"); | |||
@@ -119,18 +119,15 @@ class _MyAppState extends State<MyApp> { | |||
print("change language ${locale.toString()}"); | |||
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/share_alert.dart'; | |||
import 'package:zhiying_comm/util/base_bloc.dart'; | |||
import 'package:zhiying_comm/zhiying_comm.dart'; | |||
class GoodsShareImage extends StatefulWidget { | |||
final Map<String, dynamic> model; | |||
@@ -177,15 +178,15 @@ class _GoodsShareImageContentState extends State<_GoodsShareImageContent> with A | |||
); | |||
List<String> moreImageList = List(); | |||
try{ | |||
try { | |||
moreImageList = List.from(widget?.params['image_url_list']).map((e) => e.toString()).toList(); | |||
}catch(e,s){ | |||
} catch (e, s) { | |||
print(e); | |||
print(s); | |||
} | |||
_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++) { | |||
String image = _style.customImage[index]; | |||
// 分享图片 | |||
@@ -344,17 +345,16 @@ class _GoodsShareImageContentState extends State<_GoodsShareImageContent> with A | |||
} | |||
List<String> paths = await ImageDownloadUtil.download(images); | |||
for(var item in paths){ | |||
for (var item in paths) { | |||
Uint8List data = File(item).readAsBytesSync(); | |||
isSaveSuccess = await SaveImage.save(imageBytes: data); | |||
} | |||
if (isSaveSuccess) { | |||
Fluttertoast.showToast(msg: '保存成功'); | |||
} else{ | |||
} else { | |||
Fluttertoast.showToast(msg: '保存失败'); | |||
} | |||
Loading.dismiss(); | |||
} | |||
@@ -363,11 +363,14 @@ class _GoodsShareImageContentState extends State<_GoodsShareImageContent> with A | |||
BuildContext buildContext = _globalKey.currentContext; | |||
if (null != buildContext) { | |||
RenderRepaintBoundary boundary = buildContext.findRenderObject(); | |||
ui.Image image = await boundary.toImage(pixelRatio: 1.5); | |||
ui.Image image = await boundary.toImage(pixelRatio: 4); | |||
// 注意:png是压缩后格式,如果需要图片的原始像素数据,请使用rawRgba | |||
Loading.show(context); | |||
ByteData byteData = await image.toByteData(format: ui.ImageByteFormat.png); | |||
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 { | |||
_shareModel.poster = null; | |||
@@ -35,7 +35,7 @@ class HotRankingPageSkeleton extends StatelessWidget { | |||
_buildBottomListItem() { | |||
List<Widget> listWidget = List(); | |||
for (var index = 0; index < 3; index++) { | |||
for (var index = 0; index < 10; index++) { | |||
listWidget.add(Container( | |||
margin: EdgeInsets.only(left: 16, top: 10, bottom: 10), | |||
child: Row( | |||
@@ -316,7 +316,7 @@ class _MineDetailContainerState extends State<_MineDetailContainer> { | |||
if (cropperFile == null) { | |||
return; | |||
} | |||
File resultFile = await EncodeUtil.compressImage(cropperFile, 800); | |||
File resultFile = await EncodeUtil.compressImage(context,file:cropperFile,size: 800); | |||
Loading.show(context); | |||
_bloc.uploadAvatar(resultFile); | |||
} | |||
@@ -132,6 +132,10 @@ class BaseWidgetRegister { | |||
Jdsdk.init(appKey: config.keys?.jdAndroid?.appkey ?? '', appSecret: config.keys?.jdAndroid?.secret ?? ''); | |||
} | |||
SharesdkPlugin.regist(register); | |||
///微信支付初始化 | |||
bool result = await SyFlutterWechat.register(config?.keys?.weixin?.appId); | |||
print(result); | |||
}); | |||
// MOB 秒验 | |||
@@ -200,7 +204,6 @@ class BaseWidgetRegister { | |||
/// 反馈列表页 | |||
PageFactory.regist('pub.flutter.feedback_list', (model) => FeedbackRecordPage(model)); | |||
/// 提现页 | |||
PageFactory.regist('pub.flutter.cash_out', (model) => WithdrawPage(model)); | |||
@@ -390,7 +390,9 @@ class __CustomQuickEntryContainerState extends State<_CustomQuickEntryContainer> | |||
return GestureDetector( | |||
behavior: HitTestBehavior.opaque, | |||
onTap: () => _itemIconClick(item), | |||
onTap: () { | |||
_itemIconClick(item); | |||
}, | |||
child: Container( | |||
height: itemHeight, | |||
width: 60, | |||
@@ -153,6 +153,7 @@ class ListStyle extends SkipModel{ | |||
String requiredTaobaoAuth; | |||
String skipIdentifier; | |||
ListStyle( | |||
{this.img, | |||
this.title, | |||
@@ -173,6 +174,7 @@ class ListStyle extends SkipModel{ | |||
requiredLogin = json['required_login']; | |||
requiredTaobaoAuth = json['required_taobao_auth']; | |||
skipIdentifier = json['skip_identifier']; | |||
} | |||
Map<String, dynamic> toJson() { | |||
@@ -185,6 +187,7 @@ class ListStyle extends SkipModel{ | |||
data['required_login'] = this.requiredLogin; | |||
data['required_taobao_auth'] = this.requiredTaobaoAuth; | |||
data['skip_identifier'] = this.skipIdentifier; | |||
return data; | |||
} | |||
} | |||
@@ -33,7 +33,7 @@ class HomeGoodsListStyleModel { | |||
}); | |||
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']; | |||
listColumn = json['list_column']; | |||
leftRighMargin = json['left_righ_margin']; | |||
@@ -23,6 +23,8 @@ class HotRankingListBloc extends BlocBase { | |||
bool isLoading = false; | |||
bool isFirst=true; | |||
@override | |||
void dispose() { | |||
_dataController.close(); | |||
@@ -35,6 +37,11 @@ class HotRankingListBloc extends BlocBase { | |||
// return; | |||
// } | |||
// isLoading = true; | |||
if(isFirst){ | |||
isFirst=false; | |||
await Future.delayed(Duration(milliseconds: 300)); | |||
} | |||
currentTypeId = typeId; | |||
NetUtil.request('/api/v1/rec?pvd=taobao&category_id=' + typeId + '&page=' + page.toString(), method: NetMethod.GET, onCache: (data) { | |||
complete(); | |||
@@ -10,13 +10,13 @@ class HotRankingSkeleton extends StatelessWidget { | |||
child: Column( | |||
mainAxisSize: MainAxisSize.min, | |||
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( | |||
child: Container( | |||
child: Column( | |||
@@ -30,7 +30,7 @@ class HotRankingSkeleton extends StatelessWidget { | |||
_buildBottomListItem() { | |||
List<Widget> listWidget = List(); | |||
for (var index = 0; index < 3; index++) { | |||
for (var index = 0; index < 10; index++) { | |||
listWidget.add(Container( | |||
margin: EdgeInsets.only(left: 16,top: 10,bottom: 10), | |||
child: Row( | |||
@@ -106,10 +106,11 @@ class _ShareAlertSelectState extends State<ShareAlertSelect> { | |||
if (null != buildContext) { | |||
RenderRepaintBoundary boundary = buildContext.findRenderObject(); | |||
///pixelRatio是放大倍数 | |||
ui.Image image = await boundary.toImage(pixelRatio: 1); | |||
ui.Image image = await boundary.toImage(pixelRatio: 5); | |||
// 注意:png是压缩后格式,如果需要图片的原始像素数据,请使用rawRgba | |||
ByteData byteData = await image.toByteData(format: ui.ImageByteFormat.png); | |||
Uint8List pngBytes = byteData.buffer.asUint8List(); | |||
_shareModel.poster = pngBytes; | |||
} else { | |||
_shareModel.poster = null; | |||
@@ -370,6 +371,27 @@ class _ShareAlertContentState extends State<_ShareAlertContent> { | |||
), | |||
), | |||
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; | |||
if (!status.isGranted) { | |||
@@ -37,7 +37,6 @@ dependencies: | |||
# 列表滑动删除 | |||
flutter_slidable: 0.5.7 | |||
# image_gallery_saver: ^1.6.0 | |||
permission_handler: | |||
git: | |||
ref: 0.0.1 | |||