@@ -55,6 +55,30 @@ | |||
"packageUri": "lib/", | |||
"languageVersion": "2.0" | |||
}, | |||
{ | |||
"name": "connectivity", | |||
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/connectivity-0.4.9+3", | |||
"packageUri": "lib/", | |||
"languageVersion": "2.1" | |||
}, | |||
{ | |||
"name": "connectivity_for_web", | |||
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/connectivity_for_web-0.3.1+2", | |||
"packageUri": "lib/", | |||
"languageVersion": "2.6" | |||
}, | |||
{ | |||
"name": "connectivity_macos", | |||
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/connectivity_macos-0.1.0+5", | |||
"packageUri": "lib/", | |||
"languageVersion": "2.1" | |||
}, | |||
{ | |||
"name": "connectivity_platform_interface", | |||
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/connectivity_platform_interface-1.0.6", | |||
"packageUri": "lib/", | |||
"languageVersion": "2.1" | |||
}, | |||
{ | |||
"name": "convert", | |||
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/convert-2.1.1", | |||
@@ -554,7 +578,7 @@ | |||
"languageVersion": "2.1" | |||
} | |||
], | |||
"generated": "2020-09-25T12:38:03.249342Z", | |||
"generated": "2020-09-27T08:39:36.051865Z", | |||
"generator": "pub", | |||
"generatorVersion": "2.7.2" | |||
} |
@@ -1,6 +1,7 @@ | |||
# Uncomment this line to define a global platform for your project | |||
# platform :ios, '9.0' | |||
source 'http://repo.baichuan-ios.taobao.com/baichuanSDK/AliBCSpecs.git' | |||
source 'https://github.com/CocoaPods/Specs.git' | |||
# CocoaPods analytics sends network stats synchronously affecting flutter build latency. | |||
ENV['COCOAPODS_DISABLE_STATS'] = 'true' | |||
@@ -4,6 +4,13 @@ PODS: | |||
- AliLinkPartnerSDK (4.0.0.24) | |||
- BCUserTrack (5.2.0.18-appkeys): | |||
- UTDID | |||
- connectivity (0.0.1): | |||
- Flutter | |||
- Reachability | |||
- connectivity_for_web (0.1.0): | |||
- Flutter | |||
- connectivity_macos (0.0.1): | |||
- Flutter | |||
- device_info (0.0.1): | |||
- Flutter | |||
- Flutter (1.0.0) | |||
@@ -44,6 +51,7 @@ PODS: | |||
- Flutter | |||
- path_provider_windows (0.0.1): | |||
- Flutter | |||
- Reachability (3.2) | |||
- securityGuard (5.4.191) | |||
- shared_preferences (0.0.1): | |||
- Flutter | |||
@@ -85,6 +93,9 @@ PODS: | |||
- Flutter | |||
DEPENDENCIES: | |||
- connectivity (from `.symlinks/plugins/connectivity/ios`) | |||
- connectivity_for_web (from `.symlinks/plugins/connectivity_for_web/ios`) | |||
- connectivity_macos (from `.symlinks/plugins/connectivity_macos/ios`) | |||
- device_info (from `.symlinks/plugins/device_info/ios`) | |||
- Flutter (from `Flutter`) | |||
- flutter_alibc (from `.symlinks/plugins/flutter_alibc/ios`) | |||
@@ -124,11 +135,19 @@ SPEC REPOS: | |||
- securityGuard | |||
- UTDID | |||
- WindVane | |||
https://github.com/CocoaPods/Specs.git: | |||
- Reachability | |||
trunk: | |||
- FMDB | |||
- TOCropViewController | |||
EXTERNAL SOURCES: | |||
connectivity: | |||
:path: ".symlinks/plugins/connectivity/ios" | |||
connectivity_for_web: | |||
:path: ".symlinks/plugins/connectivity_for_web/ios" | |||
connectivity_macos: | |||
:path: ".symlinks/plugins/connectivity_macos/ios" | |||
device_info: | |||
:path: ".symlinks/plugins/device_info/ios" | |||
Flutter: | |||
@@ -191,6 +210,9 @@ SPEC CHECKSUMS: | |||
AlibcTradeSDK: 9a3e7af6cd648dd1f85684e82694c213fe48dad2 | |||
AliLinkPartnerSDK: c5778cdfdcee7bfe342238d39a77766184d36a46 | |||
BCUserTrack: 49251c6fb7c65cbbc221a492bbd3f3e142f1fb0f | |||
connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467 | |||
connectivity_for_web: 2b8584556930d4bd490d82b836bcf45067ce345b | |||
connectivity_macos: e2e9731b6b22dda39eb1b128f6969d574460e191 | |||
device_info: d7d233b645a32c40dfdc212de5cf646ca482f175 | |||
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec | |||
flutter_alibc: 0e2a29e7c1de759672d87a260051240d209964b9 | |||
@@ -207,6 +229,7 @@ SPEC CHECKSUMS: | |||
path_provider_linux: 4d630dc393e1f20364f3e3b4a2ff41d9674a84e4 | |||
path_provider_macos: f760a3c5b04357c380e2fddb6f9db6f3015897e0 | |||
path_provider_windows: a2b81600c677ac1959367280991971cb9a1edb3b | |||
Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 | |||
securityGuard: 9c04c44a3b663f36e15064042abfc107fa07133c | |||
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d | |||
shared_preferences_linux: afefbfe8d921e207f01ede8b60373d9e3b566b78 | |||
@@ -226,6 +249,6 @@ SPEC CHECKSUMS: | |||
zhiying_base_widget: 00868c0d2723a3a425c18b27204fbc67e3f7e59d | |||
zhiying_comm: 0daef4a480f4f4dbea3e11b615f3264aafea924b | |||
PODFILE CHECKSUM: 9d32dfabb033b26968c1f3c861e00bd0fcc5665d | |||
PODFILE CHECKSUM: 1a8daf665c989cd04294c52f08548c3a236358d1 | |||
COCOAPODS: 1.9.3 |
@@ -1,5 +1,6 @@ | |||
import 'package:flutter/cupertino.dart'; | |||
import 'package:flutter/material.dart'; | |||
import 'package:flutter_swiper/flutter_swiper.dart'; | |||
import 'package:zhiying_comm/zhiying_comm.dart'; | |||
// 邀请好友 | |||
@@ -17,6 +18,16 @@ class _InvitedFriendsPageState extends State<InvitedFriendsPage> { | |||
Widget build(BuildContext context) { | |||
return Scaffold( | |||
appBar: _createNav(), | |||
backgroundColor: Colors.redAccent, | |||
body: Column( | |||
children: <Widget>[ | |||
Expanded( | |||
child: _createSwiper(), | |||
), | |||
_createTeacher(), | |||
_createBottom(), | |||
], | |||
), | |||
); | |||
} | |||
@@ -29,22 +40,22 @@ class _InvitedFriendsPageState extends State<InvitedFriendsPage> { | |||
style: BorderStyle.none, | |||
), | |||
), | |||
backgroundColor: HexColor.fromHex('#ffffff'), | |||
backgroundColor: Colors.white, | |||
leading: Navigator.canPop(context) | |||
? GestureDetector( | |||
child: Container( | |||
padding: EdgeInsets.zero, | |||
child: Icon( | |||
Icons.arrow_back_ios, | |||
size: 20, | |||
), | |||
), | |||
onTap: () { | |||
if (Navigator.canPop(context)) { | |||
Navigator.pop(context); | |||
} | |||
}, | |||
) | |||
child: Container( | |||
padding: EdgeInsets.zero, | |||
child: Icon( | |||
Icons.arrow_back_ios, | |||
size: 20, | |||
), | |||
), | |||
onTap: () { | |||
if (Navigator.canPop(context)) { | |||
Navigator.pop(context); | |||
} | |||
}, | |||
) | |||
: Container(), | |||
middle: Text( | |||
'邀请好友', | |||
@@ -62,4 +73,117 @@ class _InvitedFriendsPageState extends State<InvitedFriendsPage> { | |||
), | |||
); | |||
} | |||
Widget _createSwiper() { | |||
return Container( | |||
width: double.infinity, | |||
child: Swiper( | |||
itemBuilder: (BuildContext context, int index) { | |||
return new Image.network( | |||
"http://via.placeholder.com/288x188", | |||
fit: BoxFit.fill, | |||
); | |||
}, | |||
itemCount: 10, | |||
viewportFraction: 0.8, | |||
scale: 0.9, | |||
), | |||
); | |||
} | |||
Widget _createTeacher() { | |||
return Container( | |||
width: double.infinity, | |||
margin: EdgeInsets.only(top: 20, left: 30, right: 30), | |||
padding: EdgeInsets.only(left: 13, right: 3), | |||
height: 36, | |||
decoration: BoxDecoration( | |||
color: Color(0x80ffffff), | |||
borderRadius: BorderRadius.circular(18), | |||
), | |||
child: Row( | |||
children: <Widget>[ | |||
Container( | |||
margin: EdgeInsets.only(right: 10), | |||
width: 18, | |||
height: 18, | |||
color: Colors.redAccent, | |||
), | |||
Expanded( | |||
child: Text( | |||
'联系导师教你更多赚钱秘籍', | |||
maxLines: 1, | |||
overflow: TextOverflow.ellipsis, | |||
style: TextStyle( | |||
fontSize: 13, | |||
color: Color(0xff333333), | |||
), | |||
), | |||
), | |||
Container( | |||
width: 88, | |||
height: 30, | |||
decoration: BoxDecoration( | |||
color: Colors.white, borderRadius: BorderRadius.circular(15)), | |||
child: Center( | |||
child: Text( | |||
'联系导师', | |||
style: TextStyle( | |||
fontSize: 13, | |||
color: Color(0xff333333), | |||
), | |||
), | |||
), | |||
), | |||
], | |||
), | |||
); | |||
} | |||
Widget _createBottom() { | |||
return SafeArea( | |||
top: false, | |||
child: Container( | |||
margin: EdgeInsets.all(12.5), | |||
padding: EdgeInsets.all(10), | |||
width: double.infinity, | |||
decoration: BoxDecoration( | |||
color: Colors.white, | |||
borderRadius: BorderRadius.circular(18), | |||
boxShadow: [ | |||
BoxShadow( | |||
offset: Offset(0, 5), //x,y轴 | |||
color: Colors.black12.withOpacity(0.1), //投影颜色 | |||
blurRadius: 10 //,投影距离 | |||
) | |||
], | |||
), | |||
child: Column( | |||
children: <Widget>[ | |||
Row( | |||
children: List.generate(3, (index) { | |||
return Expanded( | |||
child: Container( | |||
margin: EdgeInsets.only(left: 8, right: 8), | |||
height: 28, | |||
decoration: BoxDecoration( | |||
color: Colors.redAccent, | |||
borderRadius: BorderRadius.circular(14), | |||
), | |||
), | |||
); | |||
}), | |||
), | |||
Padding( | |||
padding: EdgeInsets.only(top: 10), | |||
child: Text( | |||
'您的好友下载APP并使用的您的邀请码成功登录之后,Ta将成为您的粉丝,粉丝下单,您也可以获得收益哦!', | |||
style: TextStyle(fontSize: 13, color: Color(0xff999999)), | |||
), | |||
), | |||
], | |||
), | |||
), | |||
); | |||
} | |||
} |
@@ -1,6 +1,8 @@ | |||
import 'package:flutter/material.dart'; | |||
import 'package:zhiying_base_widget/pages/home_page/home_page.dart'; | |||
import 'package:zhiying_comm/util/application.dart'; | |||
import 'package:zhiying_comm/zhiying_comm.dart'; | |||
import 'package:connectivity/connectivity.dart'; | |||
// 启动页,页面初始化等操作~跟原生启动页保持一致,防止白屏问题 | |||
class LaunchPage extends StatefulWidget { | |||
@@ -15,18 +17,34 @@ class LaunchPage extends StatefulWidget { | |||
class _LaunchPageState extends State<LaunchPage> { | |||
@override | |||
void initState() { | |||
Application.init().then((_) { | |||
if (widget.builder != null) { | |||
Navigator.of(context) | |||
.pushReplacement(MaterialPageRoute(builder: widget.builder)); | |||
Connectivity().checkConnectivity().then((connectivityResult) { | |||
if (connectivityResult == ConnectivityResult.mobile || | |||
connectivityResult == ConnectivityResult.wifi) { | |||
// I am connected to a wifi network. | |||
Logger.debug('ConnectivityResult.wifi'); | |||
print('ConnectivityResult.wifi'); | |||
Application.init().then((_) { | |||
if (widget.builder != null) { | |||
Navigator.of(context) | |||
.pushReplacement(MaterialPageRoute(builder: widget.builder)); | |||
} else { | |||
Navigator.of(context).pushReplacement( | |||
MaterialPageRoute(builder: (context) => HomePage())); | |||
} | |||
}).catchError((err) { | |||
Logger.error(err); | |||
}); | |||
} else { | |||
Navigator.of(context).pushReplacement( | |||
MaterialPageRoute(builder: (context) => HomePage())); | |||
Logger.debug('unknow'); | |||
print('unknow'); | |||
} | |||
}); | |||
super.initState(); | |||
} | |||
@override | |||
Widget build(BuildContext context) { | |||
return Scaffold( | |||
@@ -93,25 +93,27 @@ class _MainPageContainerState extends State<_MainPageContainer> { | |||
@override | |||
Widget build(BuildContext context) { | |||
return Scaffold( | |||
backgroundColor: Color(0xfff9f9f9), | |||
floatingActionButton: _floatWidget, | |||
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, | |||
body: MediaQuery.removePadding( | |||
removeTop: true, | |||
context: context, | |||
child: SmartRefresher( | |||
enablePullDown: true, | |||
enablePullUp: false, | |||
header: WaterDropHeader(), | |||
controller: _refreshController, | |||
onLoading: _onLoading, | |||
child: Container( | |||
width: double.infinity, | |||
child: StreamBuilder<List<Map<String, dynamic>>>( | |||
stream: _bloc.outData, | |||
builder: (BuildContext context, AsyncSnapshot snapshot) { | |||
return Stack( | |||
return StreamBuilder<List<Map<String, dynamic>>>( | |||
stream: _bloc.outData, | |||
builder: (BuildContext context, AsyncSnapshot snapshot) { | |||
List widgets = _createContent(context, snapshot.data ?? []); | |||
return Scaffold( | |||
backgroundColor: Color(0xfff9f9f9), | |||
floatingActionButton: _floatWidget, | |||
floatingActionButtonLocation: | |||
FloatingActionButtonLocation.centerDocked, | |||
body: MediaQuery.removePadding( | |||
removeTop: true, | |||
context: context, | |||
child: SmartRefresher( | |||
enablePullDown: true, | |||
enablePullUp: false, | |||
header: WaterDropHeader(), | |||
controller: _refreshController, | |||
onLoading: _onLoading, | |||
child: Container( | |||
width: double.infinity, | |||
child: Stack( | |||
fit: StackFit.passthrough, | |||
children: <Widget>[ | |||
MineHeaderBgWidget( | |||
@@ -119,15 +121,15 @@ class _MainPageContainerState extends State<_MainPageContainer> { | |||
), | |||
CustomScrollView( | |||
controller: _controller, | |||
slivers: _createContent(context, snapshot.data ?? []), | |||
slivers: widgets, | |||
) | |||
], | |||
); | |||
}, | |||
), | |||
), | |||
), | |||
)), | |||
), | |||
); | |||
), | |||
); | |||
}); | |||
} | |||
List<Widget> _createContent( | |||
@@ -1,4 +1,5 @@ | |||
import 'package:zhiying_base_widget/pages/goods_details_page/goods_details_page.dart'; | |||
import 'package:zhiying_base_widget/pages/invited_friends/invited_friends.dart'; | |||
import 'package:zhiying_base_widget/pages/launch_page/launch_page.dart'; | |||
import 'package:zhiying_base_widget/pages/main_page/main_page.dart'; | |||
import 'package:zhiying_base_widget/pages/mine_detail_page/mine_detail_page.dart'; | |||
@@ -11,7 +12,6 @@ import 'package:zhiying_base_widget/pages/setting_page/setting_page.dart'; | |||
import 'package:zhiying_base_widget/pages/sreach_result_page/sreach_result_page.dart'; | |||
import 'package:zhiying_base_widget/pages/wallet_page/wallet_page.dart'; | |||
import 'package:zhiying_base_widget/pages/webview/base_webview.dart'; | |||
import 'package:zhiying_base_widget/pages/invited_friends/invited_friends.dart'; | |||
import 'package:zhiying_base_widget/widgets/goods_details/footer/goods_details_footer_widget.dart'; | |||
import 'package:zhiying_base_widget/widgets/goods_details/price/goods_details_price_widget.dart'; | |||
import 'package:zhiying_base_widget/widgets/goods_details/slide_banner/goods_details_slide_banner_widget.dart'; | |||
@@ -55,8 +55,10 @@ class BaseWidgetRegister { | |||
} | |||
static void registInit() { | |||
Application.addMethod(() { | |||
return BaseSettingModel.init(); | |||
Application.addMethod(() async { | |||
if (await BaseSettingModel.init() == null) { | |||
throw Future.error('BaseSettingModel 初始化失败'); | |||
} | |||
}); | |||
} | |||
@@ -85,16 +87,16 @@ class BaseWidgetRegister { | |||
PageFactory.regist( | |||
'pub.flutter.account_security', (model) => SecurityPage(model)); | |||
PageFactory.regist('pub.flutter.account_security_alipay', | |||
(model) => SecurityBindAlipayPage(model)); | |||
(model) => SecurityBindAlipayPage(model)); | |||
// 登录密码 | |||
PageFactory.regist('pub.flutter.account_security_password', | |||
(model) => SecurityPassword(model)); | |||
(model) => SecurityPassword(model)); | |||
// 修改手机号 | |||
PageFactory.regist('pub.flutter.account_security_mobile', | |||
(model) => SecurityMobile(model)); | |||
(model) => SecurityMobile(model)); | |||
// 邀请好友 | |||
PageFactory.regist('pub.flutter.invite_friends', | |||
(model) => InvitedFriendsPage(model)); | |||
PageFactory.regist( | |||
'pub.flutter.invite_friends', (model) => InvitedFriendsPage(model)); | |||
} | |||
// 注册控件 | |||
@@ -18,6 +18,7 @@ dependencies: | |||
flutter_cupertino_date_picker: ^1.0.26+2 | |||
image_picker: ^0.6.7+3 | |||
tab_indicator_styler: 1.0.0 | |||
connectivity: ^0.4.9+3 | |||
image_cropper: | |||
git: | |||
url: 'http://192.168.0.138:3000/FnuoOS_Flutter_Components/Image_Cropper.git' | |||