@@ -620,7 +620,7 @@ | |||
"languageVersion": "2.8" | |||
} | |||
], | |||
"generated": "2020-10-16T06:45:33.016683Z", | |||
"generated": "2020-10-17T09:07:26.676256Z", | |||
"generator": "pub", | |||
"generatorVersion": "2.8.2" | |||
} |
@@ -1,6 +1,7 @@ | |||
#import "AppDelegate.h" | |||
#import "GeneratedPluginRegistrant.h" | |||
#import <zhiying_comm/ZhiyingCommNative.h> | |||
#import <AlibcTradeSDK/AlibcTradeSDK.h> | |||
@implementation AppDelegate | |||
@@ -32,4 +33,31 @@ | |||
}; | |||
} | |||
#pragma mark -- 第三方应用跳转 | |||
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation{ | |||
// 如果百川处理过会返回YES | |||
if (![[AlibcTradeSDK sharedInstance] application:application openURL:url sourceApplication:sourceApplication annotation:annotation]) { | |||
return YES; | |||
} | |||
return NO; | |||
} | |||
//IOS9.0 系统新的处理openURL 的API | |||
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<NSString *,id> *)options { | |||
if (@available(iOS 9.0, *)) { | |||
__unused BOOL isHandledByALBBSDK=[[AlibcTradeSDK sharedInstance] application:application openURL:url options:options]; | |||
return isHandledByALBBSDK; | |||
} else { | |||
// Fallback on earlier versions | |||
}//处理其他app跳转到自己的app,如果百川处理过会返回YES | |||
return NO; | |||
} | |||
@end |
@@ -0,0 +1,343 @@ | |||
import 'dart:io'; | |||
import 'package:flutter/cupertino.dart'; | |||
import 'package:flutter/material.dart'; | |||
import 'package:fluttertoast/fluttertoast.dart'; | |||
import 'package:image_picker/image_picker.dart'; | |||
import 'package:permission_handler/permission_handler.dart'; | |||
import 'package:zhiying_base_widget/pages/feedback_page/feedback_record_page.dart'; | |||
import 'package:zhiying_base_widget/pages/feedback_page/widgets/feedback_image.dart'; | |||
import 'package:zhiying_base_widget/pages/feedback_page/widgets/feedback_tab_widget.dart'; | |||
import 'package:zhiying_base_widget/widgets/others/action_selected_alert/action_selected_alert.dart'; | |||
import 'package:zhiying_comm/util/log/let_log.dart'; | |||
class FeedbackPage extends StatefulWidget { | |||
@override | |||
_FeedbackPageState createState() => _FeedbackPageState(); | |||
} | |||
class _FeedbackPageState extends State<FeedbackPage> { | |||
List<File> _images = List(); | |||
bool _submitable = false; | |||
TextEditingController _feedback = TextEditingController(); | |||
@override | |||
void dispose() { | |||
_feedback.dispose(); | |||
super.dispose(); | |||
} | |||
@override | |||
Widget build(BuildContext context) { | |||
return Scaffold( | |||
resizeToAvoidBottomInset: false, | |||
appBar: _createNav(), | |||
body: GestureDetector( | |||
onTap: () { | |||
FocusScope.of(context).requestFocus(FocusNode()); | |||
}, | |||
child: SafeArea( | |||
child: Column( | |||
children: <Widget>[ | |||
Expanded( | |||
child: SingleChildScrollView( | |||
child: Column( | |||
children: <Widget>[ | |||
Container( | |||
width: double.infinity, | |||
margin: EdgeInsets.only( | |||
top: 10, bottom: 10, left: 12.5, right: 12.5), | |||
padding: EdgeInsets.all(12.5), | |||
decoration: BoxDecoration( | |||
color: Colors.white, | |||
borderRadius: BorderRadius.circular(7.5)), | |||
child: Column( | |||
crossAxisAlignment: CrossAxisAlignment.start, | |||
mainAxisAlignment: MainAxisAlignment.start, | |||
children: <Widget>[ | |||
_createTitle(), | |||
_createUpload(), | |||
_createSubmit(), | |||
], | |||
), | |||
) | |||
], | |||
), | |||
), | |||
), | |||
Center( | |||
child: GestureDetector( | |||
behavior: HitTestBehavior.opaque, | |||
onTap: () { | |||
Navigator.push( | |||
context, | |||
CupertinoPageRoute( | |||
builder: (_) => FeedbackRecordPage(), | |||
), | |||
); | |||
}, | |||
child: Container( | |||
width: 120, | |||
height: 30, | |||
margin: EdgeInsets.all(10), | |||
decoration: BoxDecoration( | |||
color: Colors.white, | |||
borderRadius: BorderRadius.circular(15)), | |||
child: Row( | |||
mainAxisAlignment: MainAxisAlignment.center, | |||
crossAxisAlignment: CrossAxisAlignment.center, | |||
children: <Widget>[ | |||
Padding( | |||
padding: EdgeInsets.only(right: 6), | |||
child: Icon( | |||
Icons.list, | |||
size: 12, | |||
), | |||
), | |||
Text( | |||
'反馈记录', | |||
style: | |||
TextStyle(fontSize: 13, color: Color(0xff333333)), | |||
) | |||
], | |||
), | |||
), | |||
), | |||
), | |||
], | |||
), | |||
), | |||
), | |||
); | |||
} | |||
// 导航栏 | |||
Widget _createNav() { | |||
return CupertinoNavigationBar( | |||
border: Border( | |||
bottom: BorderSide( | |||
width: 0.0, // One physical pixel. | |||
style: BorderStyle.none, | |||
), | |||
), | |||
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); | |||
} | |||
}, | |||
) | |||
: Container(), | |||
middle: Text( | |||
'意见反馈', | |||
style: TextStyle( | |||
fontSize: 15, | |||
color: Color(0xff333333), | |||
), | |||
), | |||
); | |||
} | |||
Widget _createTitle() { | |||
return Column( | |||
crossAxisAlignment: CrossAxisAlignment.start, | |||
mainAxisAlignment: MainAxisAlignment.start, | |||
children: <Widget>[ | |||
Text( | |||
'反馈描述', | |||
style: TextStyle( | |||
fontSize: 14, | |||
color: Color(0xff333333), | |||
fontWeight: FontWeight.bold, | |||
), | |||
), | |||
Padding( | |||
padding: EdgeInsets.only(top: 4, bottom: 4), | |||
child: Row( | |||
children: List.generate( | |||
3, | |||
(index) => Expanded( | |||
child: Container( | |||
margin: EdgeInsets.only(left: 2, right: 2), | |||
height: 28, | |||
child: FeedbackTabWidget('功能异常')), | |||
)), | |||
), | |||
), | |||
Container( | |||
height: 118, | |||
margin: EdgeInsets.only(left: 2, right: 2, top: 4, bottom: 4), | |||
child: CupertinoTextField( | |||
controller: _feedback, | |||
textAlignVertical: TextAlignVertical.top, | |||
style: TextStyle(fontSize: 12, color: Color(0xff333333)), | |||
maxLines: null, | |||
placeholder: '请输入您的意见(最多100个字)', | |||
placeholderStyle: TextStyle( | |||
fontSize: 12, | |||
color: Color(0xff999999), | |||
), | |||
decoration: BoxDecoration( | |||
color: Color(0xfff9f9f9), | |||
borderRadius: BorderRadius.circular(7.5)), | |||
onChanged: (value) { | |||
if (value == null || value == '') { | |||
_submitable = false; | |||
} else { | |||
_submitable = true; | |||
} | |||
setState(() {}); | |||
}, | |||
), | |||
), | |||
], | |||
); | |||
} | |||
Widget _createUpload() { | |||
List<Widget> images = List(); | |||
_images.forEach((file) { | |||
images.add(Container( | |||
margin: EdgeInsets.only(top: 4, bottom: 4, right: 8), | |||
width: 80, | |||
height: 80, | |||
child: FeedbackImageWidget( | |||
file: file, | |||
onDelete: () { | |||
_images.remove(file); | |||
setState(() {}); | |||
}, | |||
), | |||
)); | |||
}); | |||
if (images.length < 4) { | |||
images.add(GestureDetector( | |||
child: Container( | |||
margin: EdgeInsets.only(top: 4, bottom: 4), | |||
decoration: BoxDecoration( | |||
borderRadius: BorderRadius.circular(7.5), | |||
color: Color(0xfff9f9f9)), | |||
height: 80, | |||
width: 80, | |||
child: Icon( | |||
Icons.add, | |||
size: 60, | |||
color: Color(0xffd8d8d8), | |||
), | |||
), | |||
onTap: _onAddImage, | |||
)); | |||
} | |||
return Column( | |||
children: <Widget>[ | |||
Row( | |||
children: <Widget>[ | |||
Padding( | |||
padding: EdgeInsets.only(right: 10, top: 4, bottom: 4), | |||
child: Text( | |||
'上传图片', | |||
style: TextStyle( | |||
fontSize: 14, | |||
color: Color(0xff333333), | |||
fontWeight: FontWeight.bold, | |||
), | |||
), | |||
), | |||
Text( | |||
'最多上传4张,大小不超过1M/张', | |||
style: TextStyle( | |||
fontSize: 12, | |||
color: Color(0xff999999), | |||
), | |||
), | |||
], | |||
), | |||
Row( | |||
children: images, | |||
) | |||
], | |||
); | |||
} | |||
Widget _createSubmit() { | |||
return GestureDetector( | |||
onTap: () { | |||
if (!_submitable) { | |||
return; | |||
} | |||
Logger.debug('提交:${_feedback.text.toString()}'); | |||
}, | |||
child: Container( | |||
margin: EdgeInsets.only(top: 24, bottom: 4), | |||
height: 45, | |||
decoration: BoxDecoration( | |||
color: _submitable ? Colors.redAccent : Color(0xffffe1e1), | |||
borderRadius: BorderRadius.circular(7.5), | |||
), | |||
child: Center( | |||
child: Text( | |||
'提交意见', | |||
style: TextStyle( | |||
fontSize: 14, | |||
color: Colors.white, | |||
), | |||
), | |||
), | |||
), | |||
); | |||
} | |||
void _onAddImage() async { | |||
if (_images.length >= 4) { | |||
Fluttertoast.showToast(msg: '最多上传4张图片'); | |||
return; | |||
} | |||
var status = await Permission.photos.status; | |||
if (status != PermissionStatus.granted) { | |||
status = await Permission.photos.request(); | |||
} | |||
if (status == PermissionStatus.denied) { | |||
Fluttertoast.showToast(msg: '暂无权限,图片选择失败'); | |||
return null; | |||
} | |||
final picker = ImagePicker(); | |||
PickedFile file; | |||
int index = await showModalBottomSheet( | |||
context: context, | |||
builder: (context) { | |||
return ActionSelectedAlert( | |||
// title: '拍照/选择图片', | |||
actions: ['拍照', '从相册选择图片'], | |||
); | |||
}, | |||
isScrollControlled: false, | |||
backgroundColor: Colors.transparent); | |||
if (index != null) { | |||
if (index == 0) { | |||
file = await picker.getImage(source: ImageSource.camera); | |||
} else { | |||
file = await picker.getImage(source: ImageSource.gallery); | |||
} | |||
if (file == null) return; | |||
setState(() { | |||
_images.add(File(file.path)); | |||
}); | |||
// File resultFile = await EncodeUtil.compressImage(file, 800); | |||
} | |||
} | |||
} |
@@ -0,0 +1,65 @@ | |||
import 'package:flutter/cupertino.dart'; | |||
import 'package:flutter/material.dart'; | |||
import 'package:zhiying_base_widget/pages/feedback_page/widgets/feedback_record_item.dart'; | |||
class FeedbackRecordPage extends StatefulWidget { | |||
@override | |||
_FeedbackRecordPageState createState() => _FeedbackRecordPageState(); | |||
} | |||
class _FeedbackRecordPageState extends State<FeedbackRecordPage> { | |||
@override | |||
Widget build(BuildContext context) { | |||
return Scaffold( | |||
appBar: _createNav(), | |||
body: GestureDetector( | |||
onTap: () { | |||
FocusScope.of(context).requestFocus(FocusNode()); | |||
}, | |||
child: SafeArea( | |||
child: ListView.builder( | |||
itemCount: 10, | |||
itemBuilder: (context, index) { | |||
return FeedbackRecordItem(); | |||
}), | |||
), | |||
), | |||
); | |||
} | |||
// 导航栏 | |||
Widget _createNav() { | |||
return CupertinoNavigationBar( | |||
border: Border( | |||
bottom: BorderSide( | |||
width: 0.0, // One physical pixel. | |||
style: BorderStyle.none, | |||
), | |||
), | |||
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); | |||
} | |||
}, | |||
) | |||
: Container(), | |||
middle: Text( | |||
'反馈列表', | |||
style: TextStyle( | |||
fontSize: 15, | |||
color: Color(0xff333333), | |||
), | |||
), | |||
); | |||
} | |||
} |
@@ -0,0 +1,46 @@ | |||
import 'dart:io'; | |||
import 'package:flutter/material.dart'; | |||
class FeedbackImageWidget extends StatelessWidget { | |||
final File file; | |||
final VoidCallback onDelete; | |||
const FeedbackImageWidget({Key key, this.file, this.onDelete}) | |||
: super(key: key); | |||
@override | |||
Widget build(BuildContext context) { | |||
return Stack( | |||
alignment: Alignment.topRight, | |||
children: <Widget>[ | |||
Container( | |||
width: double.infinity, | |||
height: double.infinity, | |||
child: Image.file( | |||
file, | |||
fit: BoxFit.cover, | |||
), | |||
), | |||
GestureDetector( | |||
onTap: onDelete, | |||
child: Transform.translate( | |||
offset: Offset(4, -4), | |||
child: Container( | |||
width: 16, | |||
height: 16, | |||
decoration: BoxDecoration( | |||
color: Colors.redAccent, | |||
borderRadius: BorderRadius.circular(8)), | |||
child: Icon( | |||
Icons.remove, | |||
color: Colors.white, | |||
size: 10, | |||
), | |||
), | |||
), | |||
) | |||
], | |||
); | |||
} | |||
} |
@@ -0,0 +1,108 @@ | |||
import 'package:flutter/material.dart'; | |||
class FeedbackRecordItem extends StatelessWidget { | |||
@override | |||
Widget build(BuildContext context) { | |||
return Container( | |||
margin: EdgeInsets.only(left: 12.5, right: 12.5, top: 4, bottom: 4), | |||
padding: EdgeInsets.all(15), | |||
width: double.infinity, | |||
decoration: BoxDecoration( | |||
color: Colors.white, | |||
borderRadius: BorderRadius.circular(7.5), | |||
), | |||
child: Row( | |||
mainAxisAlignment: MainAxisAlignment.start, | |||
crossAxisAlignment: CrossAxisAlignment.start, | |||
children: <Widget>[ | |||
Expanded( | |||
child: Column( | |||
mainAxisAlignment: MainAxisAlignment.start, | |||
crossAxisAlignment: CrossAxisAlignment.start, | |||
children: <Widget>[ | |||
_createTitle(), | |||
_createDesc(), | |||
_createImage(), | |||
_createTime(), | |||
], | |||
), | |||
), | |||
Container( | |||
width: 60, | |||
height: 60, | |||
decoration: BoxDecoration( | |||
color: Colors.green, | |||
borderRadius: BorderRadius.circular(30), | |||
), | |||
) | |||
], | |||
), | |||
); | |||
} | |||
Widget _createTitle() { | |||
List<InlineSpan> list = List(); | |||
list.add(WidgetSpan( | |||
child: Container( | |||
padding: EdgeInsets.only(left: 2, right: 2, top: 3, bottom: 3), | |||
margin: EdgeInsets.only(right: 4), | |||
child: Text( | |||
'功能异常', | |||
style: TextStyle( | |||
fontSize: 9, | |||
height: 1, | |||
// color: HexColor.fromHex(style.providerNameColor), | |||
color: Colors.white, | |||
), | |||
), | |||
decoration: BoxDecoration( | |||
color: Colors.redAccent, borderRadius: BorderRadius.circular(2.5)), | |||
), | |||
)); | |||
list.add(TextSpan( | |||
text: '关于关闭提现功能的反馈', | |||
style: TextStyle( | |||
fontSize: 14, color: Color(0xff333333), fontWeight: FontWeight.bold), | |||
)); | |||
return RichText( | |||
maxLines: 2, | |||
overflow: TextOverflow.ellipsis, | |||
text: TextSpan(children: list), | |||
); | |||
} | |||
Widget _createDesc() { | |||
return Container( | |||
child: Text( | |||
'我今天想使用我的提现功能的时候,发现官方已经把这个功能给暂时关闭了,所以我很伤心,不开心不开心不开心,所以我很伤心,不开心不开心不开心', | |||
style: TextStyle(fontSize: 11, color: Color(0xff999999)), | |||
), | |||
); | |||
} | |||
Widget _createImage() { | |||
return Container( | |||
margin: EdgeInsets.only(top: 4, bottom: 4), | |||
child: Wrap( | |||
children: <Widget>[ | |||
Container( | |||
width: 60, | |||
height: 60, | |||
color: Colors.redAccent, | |||
), | |||
], | |||
), | |||
); | |||
} | |||
Widget _createTime() { | |||
return Container( | |||
child: Text( | |||
'2020-06-23 01:00:06', | |||
style: TextStyle(fontSize: 11, color: Color(0xffd8d8d8)), | |||
), | |||
); | |||
} | |||
} |
@@ -0,0 +1,31 @@ | |||
import 'package:flutter/material.dart'; | |||
class FeedbackTabWidget extends StatelessWidget { | |||
final bool isSelected; | |||
final String title; | |||
const FeedbackTabWidget(this.title, {Key key, this.isSelected = false}) | |||
: super(key: key); | |||
@override | |||
Widget build(BuildContext context) { | |||
return Container( | |||
decoration: BoxDecoration( | |||
borderRadius: BorderRadius.circular(2.5), | |||
border: Border.all( | |||
color: isSelected ? Colors.redAccent : Color(0xffe7e7e7), | |||
width: 1, | |||
), | |||
), | |||
child: Center( | |||
child: Text( | |||
title ?? '', | |||
style: TextStyle( | |||
fontSize: 12, | |||
color: isSelected ? Colors.redAccent : Color(0xff999999), | |||
), | |||
), | |||
), | |||
); | |||
} | |||
} |
@@ -7,6 +7,7 @@ import 'package:fluttertoast/fluttertoast.dart'; | |||
import 'package:image_cropper/image_cropper.dart'; | |||
import 'package:image_picker/image_picker.dart'; | |||
import 'package:intl/intl.dart'; | |||
import 'package:permission_handler/permission_handler.dart'; | |||
import 'package:zhiying_base_widget/dialog/loading/loading.dart'; | |||
import 'package:zhiying_base_widget/pages/mine_detail_page/mine_detail_bloc.dart'; | |||
import 'package:zhiying_base_widget/pages/mine_detail_page/models/mine_detail_model.dart'; | |||
@@ -277,6 +278,15 @@ class _MineDetailContainerState extends State<_MineDetailContainer> { | |||
} | |||
void _selectImage() async { | |||
var status = await Permission.photos.status; | |||
if (status != PermissionStatus.granted) { | |||
status = await Permission.photos.request(); | |||
} | |||
if (status == PermissionStatus.denied) { | |||
Fluttertoast.showToast(msg: '暂无权限,图片选择失败'); | |||
return null; | |||
} | |||
final picker = ImagePicker(); | |||
PickedFile file; | |||
int index = await showModalBottomSheet( | |||
@@ -61,9 +61,10 @@ class _SettingContainerState extends State<_SettingContainer> { | |||
return _createSection(list); | |||
})?.toList() ?? | |||
[]); | |||
widgets.add(Provider.of<UserInfoNotifier>(context).userInfo == null | |||
? Container() | |||
: _createLogout()); | |||
UserInfoModel user = Provider.of<UserInfoNotifier>(context).userInfo; | |||
if (user != null && (user.token != null && user.token != '')) { | |||
widgets.add(_createLogout()); | |||
} | |||
return Scaffold( | |||
backgroundColor: Color(0xfff9f9f9), | |||
@@ -1,77 +0,0 @@ | |||
import 'package:flutter/material.dart'; | |||
import 'package:zhiying_base_widget/widgets/home/home_goods/home_goods_item_single.dart'; | |||
import 'package:zhiying_base_widget/widgets/home/home_goods/models/home_goods_model.dart'; | |||
import 'package:zhiying_base_widget/widgets/home/home_goods/models/home_goods_style_model.dart'; | |||
import 'package:zhiying_comm/util/net_util.dart'; | |||
class TestPage extends StatefulWidget { | |||
@override | |||
_TestPageState createState() => _TestPageState(); | |||
} | |||
class _TestPageState extends State<TestPage> { | |||
List<HomeGoodsModel> _goods; | |||
HomeGoodsStyleModel _styleModel; | |||
@override | |||
void initState() { | |||
// NetUtil.request('/api/v1/rec/featured?page=3', method: NetMethod.GET, | |||
// onSuccess: (data) { | |||
// List goods = data['good']; | |||
// _styleModel = HomeGoodsStyleModel( | |||
// listColumn: '1', | |||
// // recommendList, | |||
// providerNameColor: '#ffffff', | |||
// providerNameBackgroundColor: '#ff4242', | |||
// shopNameColor: '#ffffff', | |||
// shopIcon: '', | |||
// couponFontColor: '#ffffff', | |||
// couponBgColor: '#ff4242', | |||
// commissionFontColor: '#ffffff', | |||
// commissionBgColor: '#ff4242', | |||
// marketPriceColor: '#ffffff', | |||
// currentPriceColor: '#ff4242', | |||
// ); | |||
// _goods = goods.map((e) { | |||
// return HomeGoodsModel.fromJson(Map<String, dynamic>.from(e)); | |||
// }).toList(); | |||
// setState(() {}); | |||
// }); | |||
super.initState(); | |||
} | |||
@override | |||
Widget build(BuildContext context) { | |||
return Scaffold( | |||
appBar: AppBar( | |||
title: Text('测试'), | |||
), | |||
body: Container(), | |||
// body: CustomScrollView( | |||
// slivers: <Widget>[ | |||
// SliverFixedExtentList( | |||
// itemExtent: 200.0, | |||
// delegate: new SliverChildBuilderDelegate( | |||
// (BuildContext context, int index) { | |||
// //创建列表项 | |||
// return HomeGoodsItemSingle( | |||
// _goods[index % _goods.length], _styleModel); | |||
// }, | |||
// childCount: (_goods?.length ?? 0) * 2000, //50个列表项 | |||
// ), | |||
// ), | |||
// // SliverToBoxAdapter( | |||
// // child: ListView.builder( | |||
// // shrinkWrap: true, | |||
// // physics: NeverScrollableScrollPhysics(), | |||
// // itemCount: (_goods?.length ?? 0) * 20, | |||
// // itemBuilder: (context, index) { | |||
// // return HomeGoodsItemSingle( | |||
// // _goods[index % _goods.length], _styleModel); | |||
// // }), | |||
// // ) | |||
// ], | |||
// )); | |||
); | |||
} | |||
} |
@@ -0,0 +1,168 @@ | |||
import 'package:flutter/cupertino.dart'; | |||
import 'package:flutter/material.dart'; | |||
import 'package:zhiying_base_widget/pages/wechat_teacher_page/widgets/wechat_teacher_item.dart'; | |||
// 微信导师 | |||
class WechatTeacherPage extends StatefulWidget { | |||
@override | |||
_WechatTeacherPageState createState() => _WechatTeacherPageState(); | |||
} | |||
class _WechatTeacherPageState extends State<WechatTeacherPage> { | |||
@override | |||
Widget build(BuildContext context) { | |||
return Scaffold( | |||
appBar: _createNav(), | |||
body: SafeArea( | |||
child: SingleChildScrollView( | |||
child: Column( | |||
children: <Widget>[ | |||
_createHeader(), | |||
_createWechat(), | |||
], | |||
), | |||
), | |||
), | |||
); | |||
} | |||
// 导航栏 | |||
Widget _createNav() { | |||
return CupertinoNavigationBar( | |||
border: Border( | |||
bottom: BorderSide( | |||
width: 0.0, // One physical pixel. | |||
style: BorderStyle.none, | |||
), | |||
), | |||
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); | |||
} | |||
}, | |||
) | |||
: Container(), | |||
middle: Text( | |||
'微信导师', | |||
style: TextStyle( | |||
fontSize: 15, | |||
color: Color(0xff333333), | |||
), | |||
), | |||
); | |||
} | |||
Widget _createHeader() { | |||
return Container( | |||
width: double.infinity, | |||
height: 283, | |||
child: Stack( | |||
children: <Widget>[ | |||
Container( | |||
width: double.infinity, | |||
height: 185, | |||
color: Colors.redAccent, | |||
), | |||
Align( | |||
alignment: Alignment.bottomCenter, | |||
child: Container( | |||
width: double.infinity, | |||
height: 138, | |||
margin: EdgeInsets.only(left: 10, right: 10), | |||
padding: EdgeInsets.all(12), | |||
decoration: BoxDecoration( | |||
color: Colors.white, | |||
borderRadius: BorderRadius.circular(10), | |||
), | |||
child: Column( | |||
mainAxisAlignment: MainAxisAlignment.start, | |||
crossAxisAlignment: CrossAxisAlignment.start, | |||
children: <Widget>[ | |||
Text( | |||
'我的导师', | |||
style: TextStyle( | |||
fontWeight: FontWeight.bold, | |||
fontSize: 15, | |||
color: Color(0xff333333), | |||
), | |||
), | |||
Container( | |||
margin: EdgeInsets.only(top: 8, bottom: 2), | |||
child: CupertinoTextField( | |||
placeholder: '请填写邀请人邀请码/手机号码', | |||
placeholderStyle: TextStyle(fontSize: 14), | |||
decoration: BoxDecoration(), | |||
), | |||
), | |||
Container( | |||
height: 0.5, | |||
color: Color(0xffd5d5d5), | |||
), | |||
Center( | |||
child: Container( | |||
margin: EdgeInsets.only(top: 10), | |||
width: 130, | |||
height: 30, | |||
decoration: BoxDecoration( | |||
color: Colors.redAccent, | |||
borderRadius: BorderRadius.circular(15)), | |||
child: Center( | |||
child: Text( | |||
'绑定邀请人', | |||
style: TextStyle(color: Colors.white, fontSize: 14), | |||
), | |||
), | |||
), | |||
) | |||
], | |||
), | |||
), | |||
), | |||
], | |||
), | |||
); | |||
} | |||
Widget _createWechat() { | |||
return Container( | |||
width: double.infinity, | |||
margin: EdgeInsets.only(left: 10, right: 10, top: 15), | |||
padding: EdgeInsets.all(12), | |||
decoration: BoxDecoration( | |||
color: Colors.white, | |||
borderRadius: BorderRadius.circular(10), | |||
), | |||
child: Column( | |||
mainAxisAlignment: MainAxisAlignment.start, | |||
crossAxisAlignment: CrossAxisAlignment.start, | |||
children: <Widget>[ | |||
Text( | |||
'官方微信', | |||
style: TextStyle( | |||
fontSize: 15, | |||
fontWeight: FontWeight.bold, | |||
), | |||
), | |||
WechatTeachetItem(), | |||
Container( | |||
margin: EdgeInsets.only(top: 4, bottom: 4), | |||
width: double.infinity, | |||
height: 0.5, | |||
color: Color(0xffebebeb), | |||
), | |||
WechatTeachetItem(), | |||
], | |||
), | |||
); | |||
} | |||
} |
@@ -0,0 +1,67 @@ | |||
import 'package:flutter/material.dart'; | |||
class WechatTeachetItem extends StatelessWidget { | |||
@override | |||
Widget build(BuildContext context) { | |||
return Container( | |||
margin: EdgeInsets.only(top: 8, bottom: 8), | |||
child: Row( | |||
children: <Widget>[ | |||
Expanded( | |||
child: Column( | |||
crossAxisAlignment: CrossAxisAlignment.start, | |||
children: <Widget>[ | |||
Text( | |||
'微信公众号 智莺生活公众号', | |||
style: TextStyle( | |||
fontSize: 14, | |||
color: Color(0xff3c3c3c), | |||
fontWeight: FontWeight.bold, | |||
), | |||
), | |||
Padding( | |||
padding: const EdgeInsets.only(top: 8.0, bottom: 8), | |||
child: Text( | |||
'微信号:5645434', | |||
style: TextStyle( | |||
fontSize: 13, | |||
color: Color(0xffff5050), | |||
fontWeight: FontWeight.bold), | |||
), | |||
), | |||
UnconstrainedBox( | |||
child: Container( | |||
decoration: BoxDecoration( | |||
color: Color(0xffffdada), | |||
borderRadius: BorderRadius.circular(20), | |||
), | |||
padding: | |||
EdgeInsets.only(left: 9, right: 9, top: 4, bottom: 4), | |||
child: Text( | |||
'长按保存二维码', | |||
style: TextStyle(fontSize: 13, color: Color(0xffff0000)), | |||
), | |||
), | |||
), | |||
], | |||
), | |||
), | |||
Column( | |||
children: <Widget>[ | |||
Container( | |||
margin: EdgeInsets.only(bottom: 4), | |||
width: 55, | |||
height: 55, | |||
color: Colors.redAccent, | |||
), | |||
Text( | |||
'长按保存二维码', | |||
style: TextStyle(fontSize: 12, color: Color(0xff999999)), | |||
), | |||
], | |||
) | |||
], | |||
), | |||
); | |||
} | |||
} |
@@ -18,9 +18,32 @@ class WithdrawBloc extends BlocBase { | |||
_dataController = null; | |||
} | |||
void refresh() { | |||
NetUtil.request('/api/v1/config.json', onSuccess: (data) { | |||
_dataController.add(model); | |||
void loadData(String skipIdentifier) async { | |||
NetUtil.request('/api/v1/mod/${skipIdentifier.toString()}', | |||
method: NetMethod.GET, onCache: (data) { | |||
_loadData(data); | |||
}, onSuccess: (data) { | |||
_loadData(data); | |||
}); | |||
} | |||
void _loadData(dynamic data) { | |||
try { | |||
Map<String, dynamic> json = Map<String, dynamic>.from(data); | |||
if (json == null || json.length == 0) { | |||
return; | |||
} | |||
// List mods = json['mod_list']; | |||
// if (mods.first != null) { | |||
// json = Map<String, dynamic>.from(mods.first); | |||
// String d = json['data']; | |||
// Map<String, dynamic> da = | |||
// Map<String, dynamic>.from(convert.jsonDecode(d)); | |||
// _model = SecurityBindAlipayModel.fromJson(da); | |||
// _dataController.add(_model); | |||
// } | |||
} catch (err) { | |||
Logger.error(err); | |||
} | |||
} | |||
} |
@@ -1,8 +1,14 @@ | |||
import 'package:flutter/cupertino.dart'; | |||
import 'package:flutter/material.dart'; | |||
import 'package:zhiying_base_widget/pages/withdraw_page/bloc/withdraw_bloc.dart'; | |||
import 'package:zhiying_comm/util/base_bloc.dart'; | |||
/*提现页面*/ | |||
class WithdrawPage extends StatefulWidget { | |||
final Map<String, dynamic> data; | |||
const WithdrawPage(this.data, {Key key}) : super(key: key); | |||
@override | |||
_WithdrawPageState createState() => _WithdrawPageState(); | |||
} | |||
@@ -13,7 +19,10 @@ class _WithdrawPageState extends State<WithdrawPage> { | |||
return Scaffold( | |||
appBar: _createNav(), | |||
body: SafeArea( | |||
child: _WithdrawContainer(), | |||
child: BlocProvider<WithdrawBloc>( | |||
bloc: WithdrawBloc(), | |||
child: _WithdrawContainer(widget.data), | |||
), | |||
), | |||
); | |||
} | |||
@@ -56,11 +65,26 @@ class _WithdrawPageState extends State<WithdrawPage> { | |||
} | |||
class _WithdrawContainer extends StatefulWidget { | |||
final Map<String, dynamic> data; | |||
const _WithdrawContainer(this.data, {Key key}) : super(key: key); | |||
@override | |||
_WithdrawContainerState createState() => _WithdrawContainerState(); | |||
} | |||
class _WithdrawContainerState extends State<_WithdrawContainer> { | |||
WithdrawBloc _bloc; | |||
@override | |||
void initState() { | |||
_bloc = BlocProvider.of<WithdrawBloc>(context); | |||
if (widget.data.containsKey('skip_identifier')) { | |||
_bloc.loadData(widget.data['skip_identifier']); | |||
} | |||
super.initState(); | |||
} | |||
@override | |||
Widget build(BuildContext context) { | |||
return SingleChildScrollView( | |||
@@ -1,6 +1,7 @@ | |||
import 'package:sharesdk_plugin/sharesdk_interface.dart'; | |||
import 'package:sharesdk_plugin/sharesdk_register.dart'; | |||
import 'package:zhiying_base_widget/pages/favorite_page/favorite_page.dart'; | |||
import 'package:zhiying_base_widget/pages/feedback_page/feedback_page.dart'; | |||
import 'package:zhiying_base_widget/pages/goods_details_page/goods_details_page.dart'; | |||
import 'package:zhiying_base_widget/pages/home_page/home_page.dart'; | |||
import 'package:zhiying_base_widget/pages/hot_ranking_page/hot_ranking_page.dart'; | |||
@@ -18,8 +19,9 @@ import 'package:zhiying_base_widget/pages/security_page/security_page.dart'; | |||
import 'package:zhiying_base_widget/pages/security_page/security_password/security_password.dart'; | |||
import 'package:zhiying_base_widget/pages/setting_page/setting_page.dart'; | |||
import 'package:zhiying_base_widget/pages/team_page/team_page.dart'; | |||
import 'package:zhiying_base_widget/pages/test_page/test_page.dart'; | |||
import 'package:zhiying_base_widget/pages/webview/base_webview.dart'; | |||
import 'package:zhiying_base_widget/pages/wechat_teacher_page/wechat_teacher_page.dart'; | |||
import 'package:zhiying_base_widget/pages/withdraw_page/withdraw_page.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'; | |||
@@ -64,7 +66,6 @@ import 'widgets/search/hot_tag/search_hot_tag_widget.dart'; | |||
import 'widgets/search/input/search_input_widget.dart'; | |||
import 'widgets/search/tabbar/search_tab_creater.dart'; | |||
import 'widgets/search_result/goods_list/search_result_goods_list_creater.dart'; | |||
import 'widgets/search_result/goods_list/search_result_goods_list_widget.dart'; | |||
import 'widgets/search_result/search_input/search_result_input.dart'; | |||
class BaseWidgetRegister { | |||
@@ -114,12 +115,10 @@ class BaseWidgetRegister { | |||
'pub.flutter.search_index', (model) => SearchResultPage(model)); | |||
PageFactory.regist( | |||
'search_result_item', (model) => SearchResultItemPage(model)); | |||
PageFactory.regist('pub.flutter.feedback', (model) => TestPage()); | |||
// PageFactory.regist('search_think_page', (model) => SearchThinkPage(model)); | |||
// PageFactory.regist('login', (model) => LoginPage(model)); | |||
// PageFactory.regist('login_quick', (model) => LoginQuickPage(model)); | |||
// PageFactory.regist('login_account', (model) => LoginAccountPage(model)); | |||
// PageFactory.regist('login_invite', (model) => LoginInvitePage()); | |||
PageFactory.regist('pub.flutter.feedback', (model) => FeedbackPage()); | |||
PageFactory.regist( | |||
'pub.flutter.wechat_teacher', (model) => WechatTeacherPage()); | |||
PageFactory.regist('pub.flutter.cash_out', (model) => WithdrawPage(model)); | |||
// webview | |||
PageFactory.regist('pub.flutter.url', (model) => BaseWebview(model)); | |||
@@ -205,43 +204,43 @@ class BaseWidgetRegister { | |||
WidgetFactory.regist('search_result_taobao_sort', | |||
DefaultWidgetCreater((model) => SearchResultSortWidget(model))); | |||
// 搜索结果的商品列表 淘宝 | |||
WidgetFactory.regist('search_result_taobao_item', | |||
SearchResultGoodsListCreater()); | |||
WidgetFactory.regist( | |||
'search_result_taobao_item', SearchResultGoodsListCreater()); | |||
// 搜索结果页筛选widget 京东 | |||
WidgetFactory.regist('search_result_jd_sort', | |||
DefaultWidgetCreater((model) => SearchResultSortWidget(model))); | |||
// 搜索结果的商品列表 京东 | |||
WidgetFactory.regist('search_result_jd_item', | |||
SearchResultGoodsListCreater()); | |||
WidgetFactory.regist( | |||
'search_result_jd_item', SearchResultGoodsListCreater()); | |||
// 搜索结果页筛选widget 苏宁 | |||
WidgetFactory.regist('search_result_suning_sort', | |||
DefaultWidgetCreater((model) => SearchResultSortWidget(model))); | |||
// 搜索结果的商品列表 苏宁 | |||
WidgetFactory.regist('search_result_suning_item', | |||
SearchResultGoodsListCreater()); | |||
WidgetFactory.regist( | |||
'search_result_suning_item', SearchResultGoodsListCreater()); | |||
// 搜索结果页筛选widget 拼多多 | |||
WidgetFactory.regist('search_result_pdd_sort', | |||
DefaultWidgetCreater((model) => SearchResultSortWidget(model))); | |||
// 搜索结果的商品列表 拼多多 | |||
WidgetFactory.regist('search_result_pdd_item', | |||
SearchResultGoodsListCreater()); | |||
WidgetFactory.regist( | |||
'search_result_pdd_item', SearchResultGoodsListCreater()); | |||
// 搜索结果页筛选widget 唯品会 | |||
WidgetFactory.regist('search_result_vip_sort', | |||
DefaultWidgetCreater((model) => SearchResultSortWidget(model))); | |||
// 搜索结果的商品列表 唯品会 | |||
WidgetFactory.regist('search_result_vip_item', | |||
SearchResultGoodsListCreater()); | |||
WidgetFactory.regist( | |||
'search_result_vip_item', SearchResultGoodsListCreater()); | |||
// 搜索结果页筛选widget 考拉 | |||
WidgetFactory.regist('search_result_kaola_sort', | |||
DefaultWidgetCreater((model) => SearchResultSortWidget(model))); | |||
// 搜索结果的商品列表 考拉 | |||
WidgetFactory.regist('search_result_kaola_item', | |||
SearchResultGoodsListCreater()); | |||
WidgetFactory.regist( | |||
'search_result_kaola_item', SearchResultGoodsListCreater()); | |||
/// ==================== 商品详情 ==================== /// | |||
// 商品详情轮播图 | |||
@@ -311,10 +310,12 @@ class BaseWidgetRegister { | |||
//======================= 账单明细 | |||
//======================== 热榜 | |||
WidgetFactory.regist('hot_rank_appbar', DefaultWidgetCreater((model)=>HotRankingAppBar(model))); | |||
WidgetFactory.regist('hot_rank_tabs', DefaultWidgetCreater((model)=>HotRankTableBar(model))); | |||
WidgetFactory.regist('hot_rank_tab_view', DefaultWidgetCreater((model)=>HotRankingList(model))); | |||
WidgetFactory.regist('hot_rank_appbar', | |||
DefaultWidgetCreater((model) => HotRankingAppBar(model))); | |||
WidgetFactory.regist('hot_rank_tabs', | |||
DefaultWidgetCreater((model) => HotRankTableBar(model))); | |||
WidgetFactory.regist('hot_rank_tab_view', | |||
DefaultWidgetCreater((model) => HotRankingList(model))); | |||
} | |||
} |
@@ -63,9 +63,9 @@ class _HomeGoodsContainerState extends State<_HomeGoodsContainer> { | |||
_style = HomeGoodsStyleModel.fromJson(Map<String, dynamic>.from(json)); | |||
widget.eventBus.on<HomeGoodsHeaderEvent>().listen((data) { | |||
Loading.show(context); | |||
_provider = data.provider; | |||
_bloc.loadMore(_provider); | |||
Loading.show(context); | |||
}); | |||
super.initState(); | |||
@@ -23,10 +23,7 @@ class _MineDataState extends State<MineData> { | |||
@override | |||
Widget build(BuildContext context) { | |||
UserInfoModel user = Provider.of<UserInfoNotifier>(context).userInfo; | |||
if (user == null) { | |||
String value = '123'; | |||
int result = int.tryParse(value); | |||
if (user == null || user.token == null || user.token == '') { | |||
// 未登录 | |||
String d = widget.data['data']; | |||
Map json = convert.jsonDecode(d); | |||
@@ -1,6 +1,7 @@ | |||
import 'dart:convert' as convert; | |||
import 'package:cached_network_image/cached_network_image.dart'; | |||
import 'package:flutter/cupertino.dart'; | |||
import 'package:flutter/material.dart'; | |||
import 'package:zhiying_base_widget/widgets/mine/mine_data/model/mine_data_model.dart'; | |||
import 'package:zhiying_base_widget/widgets/mine/mine_header/model/mine_profile_model.dart'; | |||
@@ -12,10 +13,11 @@ class MineDataWidget extends StatelessWidget { | |||
Map<String, dynamic> _json; | |||
MineDataModel _style; | |||
MineDataWidget(this.profile, | |||
this.data, { | |||
Key key, | |||
}) : super(key: key) { | |||
MineDataWidget( | |||
this.profile, | |||
this.data, { | |||
Key key, | |||
}) : super(key: key) { | |||
String d = data['data']; | |||
_json = convert.jsonDecode(d); | |||
_style = MineDataModel.fromJson(Map<String, dynamic>.from(_json)); | |||
@@ -121,7 +123,12 @@ class MineDataWidget extends StatelessWidget { | |||
), | |||
), | |||
onTap: () { | |||
// RouterUtil.route(_json, context); | |||
SkipModel skipModel = SkipModel( | |||
skipIdentifier: 'pub.flutter.cash_out', | |||
requiredLogin: '1', | |||
requiredTaobaoAuth: '0', | |||
); | |||
RouterUtil.route(skipModel, skipModel.toJson(), context); | |||
}, | |||
) | |||
], | |||
@@ -24,7 +24,7 @@ class _MineHeaderState extends State<MineHeader> { | |||
// } | |||
UserInfoModel user = Provider.of<UserInfoNotifier>(context).userInfo; | |||
if (user == null) { | |||
if (user == null || user.token == null || user.token == '') { | |||
// 未登录 | |||
return MineStaticContainer(widget.data); | |||
} | |||
@@ -23,6 +23,9 @@ class MineHeaderBloc extends BlocBase { | |||
method: NetMethod.GET, onCache: (data) {}, onSuccess: (data) { | |||
_profile = MineProfileModel.fromJson(Map<String, dynamic>.from(data)); | |||
_profileController.add(_profile); | |||
}, onError: (err) { | |||
_profile = MineProfileModel(); | |||
_profileController.add(_profile); | |||
}); | |||
} | |||
} |