first commit
This commit is contained in:
1
untitled/lib/views/.pydio
Normal file
1
untitled/lib/views/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
2e1182b3-5819-46c1-8a60-e06c23722b1e
|
||||
96
untitled/lib/views/App.dart
Normal file
96
untitled/lib/views/App.dart
Normal file
@@ -0,0 +1,96 @@
|
||||
import 'package:fancy_bottom_navigation/fancy_bottom_navigation.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:peach/config/_.dart';
|
||||
import 'package:peach/utils/_.dart';
|
||||
|
||||
import 'package:peach/views/Home/Home.dart';
|
||||
import 'package:peach/views/Mechanism/Mechanism.dart';
|
||||
import 'package:peach/views/Model/Model.dart';
|
||||
import 'package:peach/views/Me/Me.dart';
|
||||
|
||||
/*
|
||||
* App的页面框架,底部tabs切换在这实现
|
||||
*/
|
||||
class App extends StatefulWidget {
|
||||
@override
|
||||
State<StatefulWidget> createState() => _App();
|
||||
}
|
||||
|
||||
class _App extends State<App> with AutomaticKeepAliveClientMixin {
|
||||
// 显示第几个页面的下标
|
||||
int currentIndex = 0;
|
||||
// fancy_bottom_navigation 需要的唯一key
|
||||
GlobalKey bottomNavigationKey = GlobalKey();
|
||||
// 存储从 bottomNavigationKey 中获取当前底部导航条的组件
|
||||
FancyBottomNavigationState fState;
|
||||
List<Widget> tabBodies = [ Home(), Mechanism(), Model(), Me() ];
|
||||
|
||||
@override
|
||||
bool get wantKeepAlive => true;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
CheckUpdate().check(context);
|
||||
Config.tabController = PageController(initialPage: currentIndex);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
Config.tabController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
/// 中间内容的组件
|
||||
Widget BodyWidget () {
|
||||
return PageView(
|
||||
controller: Config.tabController,
|
||||
children: tabBodies,
|
||||
// 整个页面滑动的时候,联动切换底部导航
|
||||
onPageChanged: (int index) {
|
||||
setState(() {
|
||||
currentIndex = index;
|
||||
fState = bottomNavigationKey.currentState;
|
||||
fState.setPage(currentIndex);
|
||||
});
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/// 底部导航
|
||||
Widget BottomNavigationWidget() {
|
||||
return FancyBottomNavigation(
|
||||
key: bottomNavigationKey,
|
||||
initialSelection: 0,
|
||||
textColor: ColorConfig.ThemeColor,
|
||||
inactiveIconColor: ColorConfig.ThemeColor,
|
||||
activeIconColor: ColorConfig.WhiteBackColor,
|
||||
circleColor: ColorConfig.ThemeColor,
|
||||
onTabChangedListener: (position) {
|
||||
setState(() {
|
||||
currentIndex = position;
|
||||
/// 带动画的去切换
|
||||
Config.tabController.jumpToPage(currentIndex);
|
||||
});
|
||||
},
|
||||
tabs: [
|
||||
TabData(iconData: IconFont.HomeIcon().icon, title: "首页"),
|
||||
TabData(iconData: IconFont.MechanismIcon().icon, title: "机构"),
|
||||
TabData(iconData: IconFont.ModelIcon().icon, title: "模特"),
|
||||
TabData(iconData: IconFont.MeIcon().icon, title: "我的")
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
super.build(context);
|
||||
return Scaffold(
|
||||
extendBodyBehindAppBar: false,
|
||||
body: BodyWidget(),
|
||||
bottomNavigationBar: BottomNavigationWidget(),
|
||||
);
|
||||
}
|
||||
}
|
||||
1
untitled/lib/views/Details/.pydio
Normal file
1
untitled/lib/views/Details/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
7c2e172d-e970-4e88-8a58-11925c8c6062
|
||||
230
untitled/lib/views/Details/index.dart
Normal file
230
untitled/lib/views/Details/index.dart
Normal file
@@ -0,0 +1,230 @@
|
||||
import 'dart:typed_data';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_modular/flutter_modular.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:image_gallery_saver/image_gallery_saver.dart';
|
||||
import 'package:image_pickers/image_pickers.dart';
|
||||
import 'package:toast/toast.dart';
|
||||
import 'package:peach/config/_.dart';
|
||||
import 'package:peach/entity/_.dart';
|
||||
import 'package:peach/service/_.dart';
|
||||
import 'package:peach/utils/_.dart';
|
||||
import 'package:peach/widget/_.dart';
|
||||
import 'package:share_extend/share_extend.dart';
|
||||
|
||||
class DetailsIndex extends StatefulWidget {
|
||||
final String id;
|
||||
DetailsIndex({Key key, this.id }): super(key: key);
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() => _DetailsIndex();
|
||||
}
|
||||
|
||||
class _DetailsIndex extends State<DetailsIndex> {
|
||||
|
||||
List<String> imagePaths = [];
|
||||
AgentInfo Res;
|
||||
FreeUseEntity freeUseStatus;
|
||||
String title = "";
|
||||
bool LikeStatus = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
checkIdStatus();
|
||||
Core.freeUse(context, () {
|
||||
GetInfoData();
|
||||
});
|
||||
}
|
||||
|
||||
Future<AgentInfo> GetInfoData() async {
|
||||
Res = await HomeService.GetInfoData(params: { 'id': widget.id });
|
||||
setState(() {
|
||||
imagePaths = Res.imgs;
|
||||
title = Res.title;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/// 检查写真是否被收藏
|
||||
Future<bool> checkIdStatus () async {
|
||||
var status = await LikeService.find(int.parse(widget.id));
|
||||
setState(() {
|
||||
LikeStatus = status;
|
||||
});
|
||||
}
|
||||
|
||||
/// 检查是否被收藏,爱心的改变样式
|
||||
Widget LikeStatusWidget () {
|
||||
return
|
||||
LikeStatus
|
||||
? IconButton(icon: Icon(Icons.favorite, color: ColorConfig.WhiteBackColor,),iconSize: 24,)
|
||||
: IconButton(
|
||||
iconSize: 24,
|
||||
icon: LikeStatus ? Icon(Icons.favorite_border) : Icon(Icons.favorite_border),
|
||||
onPressed: () async {
|
||||
if (imagePaths.isNotEmpty) {
|
||||
if (Core.isVip(context)) {
|
||||
var User = LikeEntity(
|
||||
id: int.parse(widget.id),
|
||||
preview: imagePaths[0],
|
||||
source: Res.jigoulist[0].name,
|
||||
title: Res.title,
|
||||
totals: Res.shuliang,
|
||||
user: Res.renwulist[0].name
|
||||
);
|
||||
|
||||
int result = await LikeService.addLike(User);
|
||||
if (result > 0) {
|
||||
Toast.show("写真收藏成功!", context, duration: Toast.LENGTH_LONG, gravity: Toast.BOTTOM);
|
||||
setState(() => LikeStatus = true);
|
||||
} else {
|
||||
Toast.show("写真收藏失败: ${result}", context, duration: Toast.LENGTH_LONG, gravity: Toast.BOTTOM);
|
||||
}
|
||||
} else {
|
||||
Toast.show("您还未开通VIP,无法使用【收藏图片】【收藏写真】【保存到相册】【成人视频】等功能", context, duration: Toast.LENGTH_LONG, gravity: Toast.CENTER);
|
||||
}
|
||||
} else {
|
||||
Toast.show("请稍后收藏,数据正在加载中...", context, duration: Toast.LENGTH_LONG, gravity: Toast.BOTTOM);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/// 长按的弹出框
|
||||
actionDiaLog (String url) async {
|
||||
if (Core.isVip(context)) {
|
||||
await showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return SimpleDialog(
|
||||
titlePadding: EdgeInsets.all(15),
|
||||
contentPadding: EdgeInsets.all(15),
|
||||
title: Container(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(Icons.touch_app,size: 30,color: ColorConfig.ThemeColor,),
|
||||
SizedBox(width: 5,),
|
||||
Text("请选择操作",style: TextStyle(fontSize: 17),)
|
||||
],
|
||||
),
|
||||
),
|
||||
children: <Widget>[
|
||||
FlatButton(
|
||||
child: Text("保存到相册"),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
saveGallery(url);
|
||||
}
|
||||
),
|
||||
FlatButton(
|
||||
child: Text("收藏此图片"),
|
||||
onPressed: () async {
|
||||
Navigator.of(context).pop();
|
||||
singleLike(url);
|
||||
}
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
);
|
||||
} else {
|
||||
Toast.show("您还未开通VIP,无法使用【收藏图片】【收藏写真】【保存到相册】【成人视频】等功能", context, duration: Toast.LENGTH_LONG, gravity: Toast.CENTER);
|
||||
}
|
||||
}
|
||||
|
||||
/// 保存图片到相册
|
||||
saveGallery(String url) async {
|
||||
// var path = await ImagePickers.saveImageToGallery(url);
|
||||
// path.length != 0
|
||||
// ? Toast.show("图片存储在 ${path}", context, duration: Toast.LENGTH_SHORT, gravity: Toast.BOTTOM)
|
||||
// : Toast.show("保存失败", context, duration: Toast.LENGTH_SHORT, gravity: Toast.BOTTOM);
|
||||
|
||||
var response = await DownloadService.downImage(url: url);
|
||||
String fileName = Tool.randomBit();
|
||||
final result = await ImageGallerySaver.saveImage(
|
||||
Uint8List.fromList(response),
|
||||
quality: 100,
|
||||
name: fileName
|
||||
);
|
||||
result['isSuccess']
|
||||
? Toast.show("图片存储在 ${result['filePath']}", context, duration: Toast.LENGTH_SHORT, gravity: Toast.BOTTOM)
|
||||
: Toast.show("保存失败", context, duration: Toast.LENGTH_SHORT, gravity: Toast.BOTTOM);
|
||||
}
|
||||
|
||||
/// 分享给好友
|
||||
shareImg() async {
|
||||
ShareExtend.share(
|
||||
"[有人@你]\n高清模特写真你要不要??\n\n写真集名称:${Res.title}\n\n写真访问地址:${Config.h5IpUrl}info.html?id=${Res.id}\n\n浏览更多高清模特写真请下载应用:【屁桃儿】",
|
||||
"text",
|
||||
sharePanelTitle: "111",
|
||||
);
|
||||
}
|
||||
|
||||
/// 单张图的收藏功能
|
||||
singleLike(String url) async {
|
||||
// false 可以收藏,true 收藏过了
|
||||
bool status = await LikeService.checkIsLike(url);
|
||||
print("status statusstatusstatusstatus : ${status}");
|
||||
if (status) {
|
||||
Toast.show("此图片已经收藏过啦!!", context, duration: Toast.LENGTH_LONG, gravity: Toast.BOTTOM);
|
||||
} else {
|
||||
var add = SingleGraphEntity(
|
||||
id: int.parse(widget.id) + int.parse(Tool.randomBit()),
|
||||
src: url
|
||||
);
|
||||
int result = await LikeService.addImg(add);
|
||||
if (result > 0) {
|
||||
Toast.show("图片收藏成功!", context, duration: Toast.LENGTH_LONG, gravity: Toast.BOTTOM);
|
||||
} else {
|
||||
Toast.show("图片收藏失败!", context, duration: Toast.LENGTH_LONG, gravity: Toast.BOTTOM);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(title),
|
||||
backgroundColor: ColorConfig.ThemeColor,
|
||||
elevation: 0,
|
||||
actions: [
|
||||
LikeStatusWidget(),
|
||||
IconButton(
|
||||
icon: Icon(Icons.share_outlined,color: ColorConfig.WhiteBackColor,),iconSize: 24,
|
||||
onPressed: () {
|
||||
shareImg();
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
body: imagePaths.isEmpty
|
||||
? SpinKitWave(color: ColorConfig.ThemeColor, itemCount: 3, size: 40)
|
||||
: ListView.builder(
|
||||
itemCount: imagePaths.length,
|
||||
cacheExtent: double.maxFinite,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return InkWell(
|
||||
onLongPress: () => actionDiaLog(imagePaths[index]),
|
||||
onTap: () async {
|
||||
ImagePickers.previewImages(imagePaths,index);
|
||||
// Navigator.of(context).push(new MaterialPageRoute(builder: (_) {
|
||||
// return PhotoViewGalleryScreen(
|
||||
// images: imagePaths,
|
||||
// index: index,
|
||||
// title: Res.title,
|
||||
// time: Res.shijian,
|
||||
// heroTag: index.toString(),
|
||||
// );
|
||||
// }));
|
||||
},
|
||||
child: CachedNetworkImg(imagePaths[index]),
|
||||
);
|
||||
},
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
1
untitled/lib/views/Home/.pydio
Normal file
1
untitled/lib/views/Home/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
0c5d82c8-0a08-4f49-94e2-57df03cd7df2
|
||||
83
untitled/lib/views/Home/ClassList.dart
Normal file
83
untitled/lib/views/Home/ClassList.dart
Normal file
@@ -0,0 +1,83 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:peach/config/_.dart';
|
||||
import 'package:peach/entity/_.dart';
|
||||
import 'package:peach/service/_.dart';
|
||||
import 'package:peach/widget/_.dart';
|
||||
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
||||
import 'package:toast/toast.dart';
|
||||
|
||||
/*
|
||||
* 横向菜单除首页外的布局
|
||||
*/
|
||||
class ClassList extends StatefulWidget {
|
||||
int id;
|
||||
int totalPage = 0;
|
||||
List<ItemList> result = [];
|
||||
|
||||
EasyRefreshController _controller; // EasyRefresh控制器
|
||||
|
||||
ClassList({Key key, @required this.id }) : super(key: key);
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() => _ClassList();
|
||||
}
|
||||
|
||||
class _ClassList extends State<ClassList> with AutomaticKeepAliveClientMixin {
|
||||
|
||||
int page = 1;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
widget._controller = EasyRefreshController();
|
||||
new Future.delayed(Duration(milliseconds: 500), () async {
|
||||
getClassListData();
|
||||
});
|
||||
}
|
||||
|
||||
/// 请求数据,类型是根据ajax生成的数据实体类
|
||||
Future<AgentClassListData> getClassListData() async {
|
||||
AgentClassListData res = await HomeService.GetClassListData(params: {
|
||||
'id': widget.id,
|
||||
'page': page
|
||||
});
|
||||
setState(() {
|
||||
widget.result.addAll(res.list);
|
||||
widget.totalPage = int.parse(res.total);
|
||||
page = int.parse(res.page);
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
super.build(context);
|
||||
return EasyRefresh(
|
||||
header: BezierCircleHeader(backgroundColor: ColorConfig.ThemeColor),
|
||||
footer: BezierBounceFooter(backgroundColor: ColorConfig.ThemeColor),
|
||||
onRefresh: () async {
|
||||
// widget.page = 0;
|
||||
// widget.result = [];
|
||||
// await getClassListData();
|
||||
},
|
||||
onLoad: () async {
|
||||
page += 1;
|
||||
if (page > widget.totalPage) {
|
||||
Toast.show("没有数据", context, duration: Toast.LENGTH_SHORT, gravity: Toast.BOTTOM);
|
||||
} else {
|
||||
await getClassListData();
|
||||
widget._controller.finishRefresh();
|
||||
}
|
||||
},
|
||||
child: ItemWidget(
|
||||
data: widget.result,
|
||||
title: '',
|
||||
longPress: () {}
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
bool get wantKeepAlive => true;
|
||||
}
|
||||
66
untitled/lib/views/Home/Default.dart
Normal file
66
untitled/lib/views/Home/Default.dart
Normal file
@@ -0,0 +1,66 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:peach/config/_.dart';
|
||||
import 'package:peach/entity/_.dart';
|
||||
import 'package:peach/utils/_.dart';
|
||||
import 'package:peach/widget/_.dart';
|
||||
import 'package:peach/service/_.dart';
|
||||
|
||||
/*
|
||||
* 首页的布局
|
||||
*/
|
||||
class DefaultLayout extends StatefulWidget {
|
||||
@override
|
||||
State<StatefulWidget> createState() => _Default();
|
||||
|
||||
}
|
||||
|
||||
class _Default extends State<DefaultLayout> with AutomaticKeepAliveClientMixin<DefaultLayout> {
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
/// 请求数据,被异步数据组件 FutureBuilder 调用
|
||||
Future<Result> GetHomeData() async {
|
||||
return await HomeService.GetHomeData(params: {});
|
||||
}
|
||||
|
||||
/// 首页的列表
|
||||
Widget DeaultPageList(Result result) {
|
||||
var Models = Tool.splitList(result.model.res, 4);
|
||||
return SingleChildScrollView(
|
||||
scrollDirection: Axis.vertical,
|
||||
physics: BouncingScrollPhysics(),
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(height: Screen.setHeight(18),),
|
||||
// SwiperWidget(
|
||||
// autoplayDelay: 4000,
|
||||
// autoplay: false,
|
||||
// child: [
|
||||
// ModelWidget(data: Models[0]),
|
||||
// ModelWidget(data: Models[1]),
|
||||
// ]
|
||||
// ),
|
||||
OldItemWidget(icon: Icons.new_releases_sharp, title: '最新收录', data: result.newest.data),
|
||||
OldItemWidget(icon: Icons.thumb_up_alt,title: '推荐写真', data: result.recommended.data,)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
super.build(context);
|
||||
return FutureBuilderWidget<Result>(
|
||||
future: GetHomeData,
|
||||
success: DeaultPageList,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
bool get wantKeepAlive => true;
|
||||
|
||||
}
|
||||
167
untitled/lib/views/Home/Edit.dart
Normal file
167
untitled/lib/views/Home/Edit.dart
Normal file
@@ -0,0 +1,167 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_modular/flutter_modular.dart';
|
||||
import 'package:toast/toast.dart';
|
||||
import 'package:peach/config/_.dart';
|
||||
import 'package:peach/entity/_.dart';
|
||||
import 'package:peach/service/_.dart';
|
||||
import 'package:peach/utils/_.dart';
|
||||
import 'package:peach/event/_.dart';
|
||||
|
||||
/*
|
||||
* 菜单编辑页面
|
||||
*/
|
||||
class Edit extends StatefulWidget {
|
||||
@override
|
||||
State<StatefulWidget> createState() => _Edit();
|
||||
}
|
||||
|
||||
class _Edit extends State<Edit> {
|
||||
|
||||
// 已选菜单
|
||||
List<Principal> principal = [];
|
||||
// 未选菜单
|
||||
List<Principal> additional = [];
|
||||
bool isEdit = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
GetList();
|
||||
}
|
||||
|
||||
void GetList () {
|
||||
new Future.delayed(Duration(milliseconds: 280),() async {
|
||||
var a = await ClassService.findAll("Principal");
|
||||
var b = await ClassService.findAll("Additional");
|
||||
|
||||
setState(() {
|
||||
principal = a.map((e) => Principal.fromJson(e) ).toList();
|
||||
additional = b.map((e)=> Principal.fromJson(e)).toList();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// 已选菜单 被点击的时候
|
||||
principalClick(Principal item) {
|
||||
// 删除原本的数据
|
||||
principal = principal.where((v) => v.id != item.id).toList();
|
||||
|
||||
var isHave = additional.where((v) => v.id == item.id).toList();
|
||||
if (isHave.length == 0) {
|
||||
// 向 未选菜单 添加数据
|
||||
additional.addAll([item]);
|
||||
ClassService.add(tableName: 'Additional', item: item);
|
||||
}
|
||||
|
||||
isEdit = true;
|
||||
setState(() {});
|
||||
ClassService.delete(tableName: 'Principal', item: item);
|
||||
}
|
||||
|
||||
// 未选菜单 被点击的时候
|
||||
additionalClick(Principal item) {
|
||||
// 删除原本的数据
|
||||
additional = additional.where((v) => v.id != item.id).toList();
|
||||
// 向 已选菜单 添加数据
|
||||
principal.addAll([item]);
|
||||
isEdit = true;
|
||||
setState(() {});
|
||||
ClassService.delete(tableName: 'Additional', item: item);
|
||||
ClassService.add(tableName: 'Principal', item: item);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return WillPopScope(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text("分类编辑"),
|
||||
backgroundColor: ColorConfig.ThemeColor,
|
||||
leading: new IconButton(
|
||||
icon: new Icon(Icons.arrow_back),
|
||||
onPressed: () {
|
||||
Config.eventBus.fire(ClassEditEvent(isEdit));
|
||||
Modular.to.pop();
|
||||
},
|
||||
),
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
scrollDirection: Axis.vertical,
|
||||
physics: BouncingScrollPhysics(),
|
||||
padding: EdgeInsets.only(top: 15,right: 15,bottom: 0,left: 15),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(bottom: 20),
|
||||
padding: EdgeInsets.all(8),
|
||||
color: Color(0XFFe1e1e3),
|
||||
width: double.infinity,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text("注意",style: TextStyle(fontSize: 16,fontWeight: FontWeight.w500),),
|
||||
SizedBox(height: Screen.setHeight(10),),
|
||||
Text("1:如果编辑了分类,首页之前的浏览进度将丢失。",style: TextStyle(),),
|
||||
SizedBox(height: Screen.setHeight(5),),
|
||||
Text("2:如果没有编辑分类,那么返回首页,之前的浏览进度都还会在。",style: TextStyle(),),
|
||||
SizedBox(height: Screen.setHeight(5),),
|
||||
Text("3:如果你删除【已选菜单】的所有分类,那么将默认从服务器请求最新菜单",style: TextStyle(),),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(bottom: 20),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text("已选菜单",style: TextStyle(fontSize: Screen.setFontSize(16),fontWeight: FontWeight.w400),),
|
||||
SizedBox(height: Screen.setHeight(5),),
|
||||
Wrap(
|
||||
spacing: Screen.setFontSize(13),
|
||||
children: principal.map((e) => RawChip(
|
||||
label: Text(e.title,style: TextStyle(fontSize: 12,color: ColorConfig.WhiteBackColor)),
|
||||
padding: EdgeInsets.all(1),
|
||||
backgroundColor: ColorConfig.ThemeOtherColor,
|
||||
selectedColor: ColorConfig.ThemeColor,
|
||||
checkmarkColor: Colors.white,
|
||||
onPressed: () {
|
||||
principalClick(e);
|
||||
},
|
||||
)).toList(),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(bottom: Screen.setFontSize(20)),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text("未选菜单",style: TextStyle(fontSize: Screen.setFontSize(16),fontWeight: FontWeight.w400),),
|
||||
SizedBox(height: Screen.setHeight(5),),
|
||||
Wrap(
|
||||
spacing: Screen.setFontSize(18),
|
||||
children: additional.map((e) => RawChip(
|
||||
label: Text(e.title,style: TextStyle(fontSize: Screen.setFontSize(12),color: ColorConfig.WhiteBackColor)),
|
||||
padding: EdgeInsets.all(1),
|
||||
backgroundColor: ColorConfig.ThemeOtherColor,
|
||||
selectedColor: ColorConfig.ThemeColor,
|
||||
checkmarkColor: Colors.white,
|
||||
onPressed: () {
|
||||
additionalClick(e);
|
||||
},
|
||||
)).toList(),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
onWillPop: () async {
|
||||
Config.eventBus.fire(ClassEditEvent(isEdit));
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}
|
||||
189
untitled/lib/views/Home/Home.dart
Normal file
189
untitled/lib/views/Home/Home.dart
Normal file
@@ -0,0 +1,189 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_modular/flutter_modular.dart';
|
||||
import 'package:peach/config/_.dart';
|
||||
import 'package:peach/entity/_.dart';
|
||||
import 'package:peach/utils/_.dart';
|
||||
import 'package:peach/service/_.dart';
|
||||
import 'package:peach/event/_.dart';
|
||||
import 'package:peach/views/Home/Default.dart';
|
||||
import 'package:peach/views/Home/ClassList.dart';
|
||||
import 'package:peach/views/Home/Random.dart';
|
||||
|
||||
/*
|
||||
* 首页
|
||||
*/
|
||||
class Home extends StatefulWidget {
|
||||
@override
|
||||
State<StatefulWidget> createState() => _Home();
|
||||
}
|
||||
|
||||
class _Home extends State<Home> with AutomaticKeepAliveClientMixin<Home> {
|
||||
|
||||
/// 保存横向菜单的数据
|
||||
ClassResult Tabs = ClassResult.fromJson({
|
||||
'principal': [], 'additional': []
|
||||
});
|
||||
|
||||
int _currentIndex = 0;
|
||||
|
||||
@override
|
||||
bool get wantKeepAlive => true;
|
||||
|
||||
TabController _tabController;
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
/// 请求权限
|
||||
AuthorityApplication.init(context);
|
||||
_GetClassData();
|
||||
_EditOnListen();
|
||||
}
|
||||
|
||||
void _EditOnListen () {
|
||||
Config.eventBus.on<ClassEditEvent>().listen((event){
|
||||
print("事件监听 ClassEditEvent ============== :${event.update}");
|
||||
if (event.update) {
|
||||
print("true");
|
||||
_currentIndex = 0;
|
||||
Tabs = ClassResult.fromJson({ 'principal': [], 'additional': [] });
|
||||
_GetClassData();
|
||||
} else {
|
||||
print("false");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void _GetClassData() async {
|
||||
if (Tabs.principal.length == 0) {
|
||||
Tabs = await HomeService.GetClassData(params: {});
|
||||
// 插入首页
|
||||
Tabs.principal.insert(0, Principal.fromJson({ 'id': 0, 'title': '随机展示','page': 0, }));
|
||||
Tabs.principal.insert(0, Principal.fromJson({ 'id': 1, 'title': '首页','page': 0,}));
|
||||
setState(() {});
|
||||
}
|
||||
}
|
||||
|
||||
/// 横向滑动分类菜单边上的右侧编辑按钮
|
||||
Widget RightEdit() {
|
||||
return Container(
|
||||
width: Screen.setWidth(50),
|
||||
child: IconButton(
|
||||
iconSize: Screen.setFontSize(20.0),
|
||||
icon: const Icon(Icons.edit, color: ColorConfig.NoActiveColor,),
|
||||
onPressed: () {
|
||||
Modular.to.pushNamed('/edit');
|
||||
}
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// 横向滑动分类菜单
|
||||
Widget MenuList() {
|
||||
return Expanded(
|
||||
child: TabBar(
|
||||
isScrollable: true,
|
||||
unselectedLabelColor: ColorConfig.NoActiveColor,
|
||||
indicatorColor: ColorConfig.ThemeColor,
|
||||
tabs: Tabs.principal.map((e) => Tab(text: e.title,)).toList(),
|
||||
onTap: (int index) {
|
||||
print("你点击的下标为 ============== :$index");
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// 左侧Logo按钮
|
||||
Widget Leading () {
|
||||
return Builder(
|
||||
builder: (BuildContext context) {
|
||||
return IconButton(
|
||||
icon: IconFont.LogoIcon(),
|
||||
onPressed: () {
|
||||
|
||||
}
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/// 标题的容器
|
||||
Widget TitleWidget() {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
Modular.to.pushNamed("/search");
|
||||
},
|
||||
child: Container(
|
||||
height: Screen.setHeight(30.0),
|
||||
alignment: Alignment.center,
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: ColorConfig.WhiteBackColor,
|
||||
borderRadius: BorderRadius.all(Radius.circular(25.0)),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Icon(Icons.search, color: Color(0XFF999999), size: 14),
|
||||
SizedBox(width: Screen.setWidth(2.0)),
|
||||
Text("198万张图,有你想要的...", style: TextStyle(color: Color(0xFf999999), fontSize: Screen.setFontSize(13)))
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// 返回不同的布局
|
||||
List<Widget> TabView() {
|
||||
return Tabs.principal.map((e) =>
|
||||
e.id == 1
|
||||
? DefaultLayout()
|
||||
: e.id == 0 ? Random() : ClassList(id: e.id,key: GlobalKey(),)
|
||||
).toList();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
super.build(context);
|
||||
return DefaultTabController(
|
||||
key: GlobalKey(),
|
||||
length: Tabs.principal.length != 0 ? Tabs.principal.length : 0,
|
||||
initialIndex: _currentIndex,
|
||||
child: Scaffold(
|
||||
appBar: PreferredSize(
|
||||
preferredSize: Size.fromHeight(90.0),
|
||||
child: AppBar(
|
||||
primary: true,
|
||||
titleSpacing: 0.0,
|
||||
backgroundColor: ColorConfig.ThemeColor,
|
||||
leading: Leading(),
|
||||
title: TitleWidget(),
|
||||
elevation: 0,
|
||||
actions: [
|
||||
IconButton(
|
||||
iconSize: 24,
|
||||
icon: Icon(Icons.supervisor_account),
|
||||
onPressed: () {
|
||||
Config.tabController.jumpToPage(3);
|
||||
},
|
||||
)
|
||||
],
|
||||
bottom: PreferredSize(
|
||||
preferredSize: Size.fromHeight(40.0),
|
||||
child: Row(
|
||||
children: [
|
||||
MenuList(),
|
||||
RightEdit()
|
||||
],
|
||||
)
|
||||
),
|
||||
),
|
||||
),
|
||||
body: TabBarView(
|
||||
children: TabView()
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
74
untitled/lib/views/Home/Random.dart
Normal file
74
untitled/lib/views/Home/Random.dart
Normal file
@@ -0,0 +1,74 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
||||
import 'package:peach/config/_.dart';
|
||||
import 'package:peach/entity/_.dart';
|
||||
import 'package:peach/service/_.dart';
|
||||
import 'package:peach/widget/_.dart';
|
||||
|
||||
|
||||
/*
|
||||
* 随机展示
|
||||
*/
|
||||
class Random extends StatefulWidget {
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() => _Random();
|
||||
}
|
||||
|
||||
class _Random extends State<Random> with AutomaticKeepAliveClientMixin{
|
||||
|
||||
AgentClassListData result;
|
||||
List<ItemList> list = [];
|
||||
EasyRefreshController _controller; // EasyRefresh控制器
|
||||
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
random();
|
||||
}
|
||||
|
||||
Future<AgentClassListData> random() async {
|
||||
result = await HomeService.GetAgentRandom(params: {});
|
||||
setState(() {
|
||||
list.addAll(result.list);
|
||||
});
|
||||
}
|
||||
|
||||
void Refresh() {
|
||||
list = [];
|
||||
setState(() {});
|
||||
random();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
super.build(context);
|
||||
return Scaffold(
|
||||
body: EasyRefresh(
|
||||
header: BezierCircleHeader(backgroundColor: ColorConfig.ThemeColor),
|
||||
footer: BezierBounceFooter(backgroundColor: ColorConfig.ThemeColor),
|
||||
onRefresh: () async {
|
||||
Refresh();
|
||||
},
|
||||
onLoad: () async {
|
||||
random();
|
||||
},
|
||||
child: ItemWidget(
|
||||
data: list,
|
||||
title: '',
|
||||
longPress: () {}
|
||||
),
|
||||
),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
backgroundColor: ColorConfig.ThemeColor,
|
||||
child: Icon(Icons.refresh,color: ColorConfig.WhiteBackColor,),
|
||||
onPressed: () {
|
||||
Refresh();
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
bool get wantKeepAlive => true;
|
||||
}
|
||||
150
untitled/lib/views/Home/Search.dart
Normal file
150
untitled/lib/views/Home/Search.dart
Normal file
@@ -0,0 +1,150 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:toast/toast.dart';
|
||||
import 'package:peach/config/_.dart';
|
||||
import 'package:peach/service/_.dart';
|
||||
import 'package:peach/utils/_.dart';
|
||||
import 'package:peach/entity/_.dart';
|
||||
import 'package:peach/widget/_.dart';
|
||||
|
||||
class Search extends StatefulWidget {
|
||||
@override
|
||||
State<StatefulWidget> createState() => _Search();
|
||||
}
|
||||
|
||||
class _Search extends State<Search> {
|
||||
|
||||
// 搜索框控制器
|
||||
TextEditingController _controller = TextEditingController();
|
||||
FocusNode _userFocusNode = FocusNode();
|
||||
|
||||
// 搜索建议
|
||||
List<String> proposalList = [
|
||||
'JK制服','医生','豹纹','清纯','空姐','大胸','黑丝','美腿','主播','香车','教室','学生装','老师', '风骚','蜜桃社','秀人网'
|
||||
];
|
||||
|
||||
List<ItemList> result = [];
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
_controller.addListener(() {});
|
||||
// 监听输入框是否获得焦点,动态返回页面
|
||||
_userFocusNode.addListener(() {
|
||||
SearchProposal();
|
||||
setState(() => {});
|
||||
});
|
||||
}
|
||||
|
||||
// 顶部搜索输入框
|
||||
Widget SearchItem () {
|
||||
return Container(
|
||||
height: Screen.setHeight(30.0),
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
color: ColorConfig.WhiteBackColor,
|
||||
borderRadius: BorderRadius.all(Radius.circular(25.0)),
|
||||
),
|
||||
child: TextField(
|
||||
controller: _controller,
|
||||
focusNode: _userFocusNode,
|
||||
autofocus: true,
|
||||
showCursor: true,
|
||||
cursorWidth: 2,
|
||||
style: TextStyle(fontSize: 14),
|
||||
cursorRadius: Radius.circular(10),
|
||||
cursorColor: ColorConfig.ThemeColor,
|
||||
textInputAction: TextInputAction.search,
|
||||
onSubmitted: (String val) {
|
||||
GetSearchData();
|
||||
},
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
border: InputBorder.none,
|
||||
contentPadding: EdgeInsets.only(left: 15),
|
||||
hintText: '输入搜索关键字',
|
||||
hintStyle: TextStyle(color: ColorConfig.NoActiveColor,fontSize: 14),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// 顶部右侧的搜索按钮
|
||||
Widget SearchButton() {
|
||||
return IconButton(
|
||||
icon: Icon(Icons.search, color: ColorConfig.WhiteBackColor,),
|
||||
onPressed: () {
|
||||
GetSearchData();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
// 如果输入框获得了焦点,那么返回搜索建议,否则返回搜索列表
|
||||
Widget SearchProposal() {
|
||||
if (_userFocusNode.hasFocus) {
|
||||
return Container(
|
||||
padding: EdgeInsets.all(15),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text("搜索建议",style: TextStyle(fontWeight: FontWeight.w500,fontSize: Screen.setFontSize(15)),),
|
||||
SizedBox(height: Screen.setHeight(10),),
|
||||
Wrap(
|
||||
children: proposalList.map((e) => InkWell(
|
||||
onTap: () {
|
||||
_controller.text = e;
|
||||
GetSearchData();
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(bottom: Screen.setFontSize(5),right: Screen.setFontSize(5)),
|
||||
decoration: BoxDecoration(
|
||||
color: ColorConfig.ThemeColor,
|
||||
borderRadius: BorderRadius.all(Radius.circular(25.0)),
|
||||
),
|
||||
padding: EdgeInsets.only(left: Screen.setFontSize(8),right: Screen.setFontSize(8),bottom: Screen.setFontSize(3),top: Screen.setFontSize(2)),
|
||||
child: Text(e, style: TextStyle(color: ColorConfig.WhiteBackColor,fontSize: Screen.setFontSize(12)),),
|
||||
),
|
||||
)).toList(),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}else{
|
||||
return ItemWidget(
|
||||
data: result,
|
||||
title: '',
|
||||
longPress: () {}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// 如果输入框不为空,那么输入框失去焦点并关闭键盘展示搜索列表页面
|
||||
GetSearchData() async {
|
||||
if (_controller.text.length != 0) {
|
||||
_userFocusNode.unfocus();
|
||||
List<ItemList> res = await HomeService.GetSearchData(params: { "keyword": _controller.text });
|
||||
setState(() => result = res);
|
||||
} else {
|
||||
FocusScope.of(context).requestFocus(_userFocusNode);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
titleSpacing: 0.0,
|
||||
title: SearchItem(),
|
||||
elevation: 0,
|
||||
backgroundColor: ColorConfig.ThemeColor,
|
||||
actions: [ SearchButton() ],
|
||||
),
|
||||
body: SearchProposal(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
dispose() {
|
||||
super.dispose();
|
||||
_controller.dispose();
|
||||
_userFocusNode.dispose();
|
||||
}
|
||||
}
|
||||
1
untitled/lib/views/Me/.pydio
Normal file
1
untitled/lib/views/Me/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
44fb7f85-0472-4263-8b56-e19b0e817612
|
||||
82
untitled/lib/views/Me/About.dart
Normal file
82
untitled/lib/views/Me/About.dart
Normal file
@@ -0,0 +1,82 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:peach/R.dart';
|
||||
import 'package:peach/config/_.dart';
|
||||
import 'package:peach/utils/_.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class About extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text("关于我们"),
|
||||
backgroundColor: ColorConfig.ThemeColor,
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
scrollDirection: Axis.vertical,
|
||||
physics: AlwaysScrollableScrollPhysics(),
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 110),
|
||||
padding: EdgeInsets.all(15),
|
||||
width: double.infinity,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
R.libStaticImgLogoPng,
|
||||
width: Screen.setWidth(70),
|
||||
height: Screen.setWidth(70),
|
||||
),
|
||||
SizedBox(height: 10,),
|
||||
Text(Config.appName, style: TextStyle(fontSize: 17,fontWeight: FontWeight.w400),),
|
||||
SizedBox(height: 6,),
|
||||
Text("十分专业的模特写真App,倾心为您提供国内外共计约198万张的写真图,满足您各种的口味和喜好是我们最初衷的动力!",
|
||||
style: TextStyle(fontSize: 15,color: ColorConfig.TextColor),textAlign: TextAlign.center),
|
||||
|
||||
// Container(
|
||||
// margin: EdgeInsets.only(top: 30),
|
||||
// child: ButtonBar(
|
||||
// alignment: MainAxisAlignment.center,
|
||||
// mainAxisSize: MainAxisSize.max,
|
||||
// children: [
|
||||
// MaterialButton(
|
||||
// color: ColorConfig.ThemeColor,
|
||||
// textColor: Colors.white,
|
||||
// onPressed: () async {
|
||||
// await launch("tel:15155145354");
|
||||
// },
|
||||
// child: Row(
|
||||
// children: [
|
||||
// Icon(Icons.phone_callback,size: 14,),
|
||||
// SizedBox(width: 2,),
|
||||
// Text("电话联系",style: TextStyle(fontSize: 16))
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// SizedBox(width: 10,),
|
||||
// MaterialButton(
|
||||
// color: ColorConfig.ThemeColor,
|
||||
// textColor: Colors.white,
|
||||
// onPressed: () async {
|
||||
// await launch("sms:15155145354");
|
||||
// },
|
||||
// child: Row(
|
||||
// children: [
|
||||
// Icon(Icons.sms_outlined,size: 14,),
|
||||
// SizedBox(width: 2,),
|
||||
// Text("短信联系",style: TextStyle(fontSize: 16))
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// )
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
22
untitled/lib/views/Me/Agent.dart
Normal file
22
untitled/lib/views/Me/Agent.dart
Normal file
@@ -0,0 +1,22 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:peach/config/_.dart';
|
||||
|
||||
class Agent extends StatefulWidget {
|
||||
|
||||
@override
|
||||
State createState() => _Agent();
|
||||
}
|
||||
|
||||
class _Agent extends State<Agent> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: ColorConfig.ThemeColor,
|
||||
title: Text("代理操作教程"),
|
||||
),
|
||||
body: Text("代理操作教程"),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
58
untitled/lib/views/Me/Agreement.dart
Normal file
58
untitled/lib/views/Me/Agreement.dart
Normal file
@@ -0,0 +1,58 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:peach/config/_.dart';
|
||||
|
||||
class Agreement extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text("用户协议"),
|
||||
backgroundColor: ColorConfig.ThemeColor,
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
scrollDirection: Axis.vertical,
|
||||
physics: BouncingScrollPhysics(),
|
||||
child: Container(
|
||||
alignment: Alignment.centerLeft,
|
||||
padding: EdgeInsets.all(15),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text("用户须知",style: TextStyle(fontSize: 17,fontWeight: FontWeight.w700),),
|
||||
SizedBox(height: 15,),
|
||||
Text("1:图片和视频都来源于互联网,如果存在版权问题和纠纷,请通过邮箱(codehelp123456@protonmail.com)联系,我们也会停止相应资源的展示下载等一切行为!",
|
||||
style: TextStyle(fontSize: 15,color: ColorConfig.TextColor),),
|
||||
SizedBox(height: 10,),
|
||||
Text("2:使用过程有任何的问题可以及时给予我们反馈。",
|
||||
style: TextStyle(fontSize: 15,color: ColorConfig.TextColor),),
|
||||
SizedBox(height: 10,),
|
||||
Text("3:本App内部分的内容少儿不宜,如果您未满18岁,请立即停止使用!",
|
||||
style: TextStyle(fontSize: 15,color: ColorConfig.TextColor),),
|
||||
SizedBox(height: 10,),
|
||||
Text("4:如果您想成为代理赚取更多的收益,请加客服微信获取代理码,即可成为代理",
|
||||
style: TextStyle(fontSize: 15,color: ColorConfig.TextColor),),
|
||||
|
||||
SizedBox(height: 15,),
|
||||
Text("产品特点",style: TextStyle(fontSize: 17,fontWeight: FontWeight.w700),),
|
||||
SizedBox(height: 15,),
|
||||
Text("1:海量的超高清图集,图片画质超清晰、全部超大尺寸或原尺寸的图片。目前已经收录35804套图集,共计:197.4394万张高清图片,每周新增约100套+图集!",
|
||||
style: TextStyle(fontSize: 15,color: ColorConfig.TextColor),),
|
||||
SizedBox(height: 10,),
|
||||
Text("2:在线浏览超高品质的图集,超一流的用户体验!一个帐号,电脑、手机、平板任性浏览!还可以收藏自己喜欢的图集,方便下次仔细欣赏。当然您也可以一键下载图集!",
|
||||
style: TextStyle(fontSize: 15,color: ColorConfig.TextColor),),
|
||||
SizedBox(height: 10,),
|
||||
Text("3:全网最专业的图集收集整理网站!中国的、日韩的、欧美的、泰国的,应有尽有。全部都是我们精心整理的,按人物、机构、标签的精准确分类!",
|
||||
style: TextStyle(fontSize: 15,color: ColorConfig.TextColor),),
|
||||
SizedBox(height: 10,),
|
||||
Text("4:特意开发的巧遇功能,随机从我们精心筛选的数千套图集里推送给你直接浏览体验。最贴心、好用、好看的功能!!",
|
||||
style: TextStyle(fontSize: 15,color: ColorConfig.TextColor),),
|
||||
SizedBox(height: 10,),
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
223
untitled/lib/views/Me/Like.dart
Normal file
223
untitled/lib/views/Me/Like.dart
Normal file
@@ -0,0 +1,223 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_modular/flutter_modular.dart';
|
||||
import 'package:peach/config/_.dart';
|
||||
import 'package:peach/entity/_.dart';
|
||||
import 'package:peach/service/_.dart';
|
||||
import 'package:peach/utils/_.dart';
|
||||
import 'package:peach/widget/_.dart';
|
||||
import 'package:flutter_slidable/flutter_slidable.dart';
|
||||
|
||||
class Like extends StatefulWidget {
|
||||
@override
|
||||
State<StatefulWidget> createState() => _Like();
|
||||
}
|
||||
|
||||
class _Like extends State<Like> {
|
||||
|
||||
List<LikeEntity> LikeList = [];
|
||||
String initialValue = "default";
|
||||
final SlidableController slidableController = SlidableController();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
getLikeList();
|
||||
}
|
||||
|
||||
/// TODO 解决思路,再存数据的时候使用 HomeEntityData
|
||||
void getLikeList() async {
|
||||
var likeData = await LikeService.findAll();
|
||||
setState(() => LikeList = likeData);
|
||||
}
|
||||
|
||||
Future<void> deleteAlertDialog(int id) async {
|
||||
await Core.deleteDialog(context, () async {
|
||||
await LikeService.delete(id);
|
||||
getLikeList();
|
||||
});
|
||||
}
|
||||
|
||||
Widget UseLayout() {
|
||||
if (LikeList.isNotEmpty) {
|
||||
switch(initialValue) {
|
||||
case 'default':
|
||||
return OldItemWidget(
|
||||
data: LikeList,
|
||||
longPress: (int id) {
|
||||
deleteAlertDialog(id);
|
||||
},
|
||||
);
|
||||
break;
|
||||
case 'column':
|
||||
return Container(
|
||||
padding: EdgeInsets.only(left: 10,right: 10, top: 5),
|
||||
alignment: Alignment.centerLeft,
|
||||
child: ListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: LikeList.length,
|
||||
physics: BouncingScrollPhysics(),
|
||||
itemBuilder: (BuildContext contenx,int index) {
|
||||
return Slidable(
|
||||
key: Key(index.toString()),
|
||||
controller: slidableController,
|
||||
actionPane: SlidableDrawerActionPane(),
|
||||
actionExtentRatio: 0.25,
|
||||
child: InkWell(
|
||||
onLongPress: () => deleteAlertDialog(LikeList[index].id),
|
||||
onTap: () => Modular.to.pushNamed("/details/${LikeList[index].id}"),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Image.network(
|
||||
LikeList[index].preview,
|
||||
width: Screen.setWidth(120),
|
||||
height: Screen.setHeight(80),
|
||||
),
|
||||
SizedBox(width: 10,),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(height: 5,),
|
||||
Text(LikeList[index].title, style: TextStyle(color: ColorConfig.TitleColor,fontSize: 15),),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 10),
|
||||
child: Wrap(
|
||||
children: [
|
||||
Container(margin: EdgeInsets.only(right: 5),child: Text("模特:${LikeList[index].user}",style: TextStyle(color: ColorConfig.TextColor,fontSize: 13)),),
|
||||
Container(margin: EdgeInsets.only(right: 5),child: Text("来源:${LikeList[index].source}",style: TextStyle(color: ColorConfig.TextColor,fontSize: 13)),),
|
||||
Container(margin: EdgeInsets.only(right: 5),child: Text("图片:${LikeList[index].totals}P",style: TextStyle(color: ColorConfig.TextColor,fontSize: 13)),),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
secondaryActions: [//右侧按钮列表
|
||||
IconSlideAction(
|
||||
caption: '删除',
|
||||
color: ColorConfig.ThemeColor,
|
||||
foregroundColor: ColorConfig.WhiteBackColor,
|
||||
icon: Icons.delete,
|
||||
closeOnTap: false,
|
||||
onTap: () {
|
||||
Slidable.of(context)?.close();
|
||||
deleteAlertDialog(LikeList[index].id);
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
),
|
||||
);
|
||||
break;
|
||||
case 'big':
|
||||
return Container(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: ListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: LikeList.length,
|
||||
physics: BouncingScrollPhysics(),
|
||||
itemBuilder: (BuildContext contenx,int index) {
|
||||
return InkWell(
|
||||
onLongPress: () => deleteAlertDialog(LikeList[index].id),
|
||||
onTap: () => Modular.to.pushNamed("/details/${LikeList[index].id}"),
|
||||
child: Column(
|
||||
children: [
|
||||
Image.network(
|
||||
LikeList[index].preview,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
return Container(
|
||||
height: Screen.setHeight(300),
|
||||
alignment: Alignment.center,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(Icons.error_outline_outlined,size: 50,color: ColorConfig.ThemeColor,),
|
||||
SizedBox(height: 10,),
|
||||
Text("暂无收藏", style: TextStyle(color: ColorConfig.TextColor))
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: ColorConfig.ThemeColor,
|
||||
title: Text("我的收藏"),
|
||||
actions: [
|
||||
Row(
|
||||
children: [
|
||||
Text(initialValue == "default" ? '默认布局' : initialValue == "column" ? "多列布局" : "大图布局"),
|
||||
new PopupMenuButton(
|
||||
initialValue: initialValue,
|
||||
itemBuilder: (BuildContext context) => <PopupMenuItem<String>>[
|
||||
PopupMenuItem(
|
||||
value: 'default',
|
||||
child: new Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
new Icon(Icons.grid_view, color: ColorConfig.ThemeColor),
|
||||
new Text("默认布局"),
|
||||
],
|
||||
)
|
||||
),
|
||||
PopupMenuItem(
|
||||
value: 'column',
|
||||
child: new Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
new Icon(Icons.table_rows_outlined, color: ColorConfig.ThemeColor),
|
||||
new Text("多列布局"),
|
||||
],
|
||||
)
|
||||
),
|
||||
PopupMenuItem(
|
||||
value: 'big',
|
||||
child: new Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: <Widget>[
|
||||
new Icon(Icons.image_outlined, color: ColorConfig.ThemeColor),
|
||||
new Text("大图模式"),
|
||||
],
|
||||
)
|
||||
)
|
||||
],
|
||||
onSelected: (String action) {
|
||||
print("action ===== ${action}");
|
||||
setState(() {
|
||||
initialValue = action;
|
||||
});
|
||||
},
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
scrollDirection: Axis.vertical,
|
||||
physics: BouncingScrollPhysics(),
|
||||
child: UseLayout(),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
324
untitled/lib/views/Me/Me.dart
Normal file
324
untitled/lib/views/Me/Me.dart
Normal file
@@ -0,0 +1,324 @@
|
||||
import 'dart:io';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_modular/flutter_modular.dart';
|
||||
import 'package:peach/R.dart';
|
||||
import 'package:share_extend/share_extend.dart';
|
||||
import 'package:toast/toast.dart';
|
||||
import 'package:peach/config/_.dart';
|
||||
import 'package:peach/utils/_.dart';
|
||||
import 'package:peach/widget/_.dart';
|
||||
|
||||
class Me extends StatefulWidget {
|
||||
@override
|
||||
State<StatefulWidget> createState() => _Me();
|
||||
}
|
||||
|
||||
class _Me extends State<Me> {
|
||||
String cacheSize = "0.00B";
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
ComputeCache();
|
||||
}
|
||||
|
||||
Future<void> ComputeCache() async {
|
||||
String size = await ClearCache.loadCache();
|
||||
setState(() {
|
||||
cacheSize = size;
|
||||
});
|
||||
}
|
||||
|
||||
/// 分享给好友
|
||||
shareText() async {
|
||||
ShareExtend.share(
|
||||
"[有人@你]\n您的朋友给你分享了一个成人写真App。\n点击查看:${Config.shareIpUrl}?objectId=${Tool.userInfo()['objectId']}",
|
||||
"text",
|
||||
sharePanelTitle: "111",
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
toolbarHeight: 0,
|
||||
elevation: 0.0,
|
||||
backgroundColor: ColorConfig.ThemeColor,
|
||||
),
|
||||
body: Stack(
|
||||
alignment: AlignmentDirectional.center,
|
||||
children: [
|
||||
Positioned(
|
||||
width: Screen.width(context),
|
||||
left: 0,
|
||||
top: 0,
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(top: Screen.setHeight(40)),
|
||||
alignment: Alignment.topCenter,
|
||||
height: Screen.setHeight(150),
|
||||
color: ColorConfig.ThemeColor,
|
||||
child: Tool.userInfo()['userType'] == "0"
|
||||
? Text("我 的", style: TextStyle(fontSize: Screen.setFontSize(18),color: ColorConfig.WhiteBackColor),)
|
||||
: Text("欢 迎 代 理", style: TextStyle(fontSize: Screen.setFontSize(18),color: ColorConfig.WhiteBackColor),),
|
||||
),
|
||||
),
|
||||
|
||||
Positioned(
|
||||
width: Screen.width(context) / 1.1,
|
||||
top: Screen.setHeight(80),
|
||||
child: Container(
|
||||
height: Tool.userInfo()['userType'] == "1" ? Screen.setHeight(100) : Screen.setHeight(80),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black12,
|
||||
offset: Offset(1.0, 10.0), //阴影xy轴偏移量
|
||||
blurRadius: 15.0, //阴影模糊程度
|
||||
spreadRadius: 1.0 //阴影扩散程度
|
||||
)
|
||||
]),
|
||||
padding: EdgeInsets.only(left: Screen.setFontSize(15), right: Screen.setFontSize(15),top: Screen.setFontSize(10)),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
ClipOval(
|
||||
child: Image.asset(
|
||||
R.libStaticImgLogoPng,
|
||||
width: Screen.setWidth(60),
|
||||
height: Screen.setWidth(60),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
SizedBox(width: Screen.setWidth(10),),
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(Tool.userInfo()['username'],style: TextStyle(fontSize: Screen.setFontSize(18),color: ColorConfig.TitleColor),),
|
||||
Text("注册时间: ${Tool.userInfo()['createdAt']}",style: TextStyle(fontSize: Screen.setFontSize(12),color: ColorConfig.NoActiveColor),),
|
||||
],
|
||||
)
|
||||
)
|
||||
],
|
||||
),
|
||||
Tool.userInfo()['userType'] == "1"
|
||||
? Column(
|
||||
children: [
|
||||
CellWidget(
|
||||
leftIcon: IconFont.DaLiIcon(),
|
||||
leftText: Text("代理操作教程", style: TextStyle(fontSize: Screen.setFontSize(14),color: ColorConfig.TextColor)),
|
||||
rightText: Text("必看!",style: TextStyle(fontSize: Screen.setFontSize(12),color: Color.fromARGB(87, 0, 0, 0))),
|
||||
onTap: () {
|
||||
Modular.to.pushNamed('/agent');
|
||||
},
|
||||
),
|
||||
],
|
||||
)
|
||||
: Container(),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Positioned(
|
||||
left: 0,
|
||||
right: 0,
|
||||
top: Tool.userInfo()['userType'] == "1" ? Screen.setHeight(180) : Screen.setHeight(160),
|
||||
bottom: 0,
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.vertical,
|
||||
physics: BouncingScrollPhysics(),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
height: 15,
|
||||
),
|
||||
CellWidget(
|
||||
leftIcon: IconFont.VipIcon(),
|
||||
leftText: Text("办理会员", style: TextStyle(fontSize: Screen.setFontSize(14),color: ColorConfig.TextColor)),
|
||||
onTap: () {
|
||||
Modular.to.pushNamed('/vip');
|
||||
},
|
||||
),
|
||||
CellWidget(
|
||||
leftIcon: IconFont.BuyIcon(),
|
||||
leftText: Text("会员状态", style: TextStyle(fontSize: Screen.setFontSize(14),color: ColorConfig.TextColor)),
|
||||
onTap: () {
|
||||
Modular.to.pushNamed('/status');
|
||||
},
|
||||
),
|
||||
Container(
|
||||
height: 10,
|
||||
color: ColorConfig.LineColor,
|
||||
),
|
||||
|
||||
// CellWidget(
|
||||
// leftIcon: IconFont.VideoIcon(),
|
||||
// leftText: Text("成人视频", style: TextStyle(fontSize: Screen.setFontSize(14),color: ColorConfig.TextColor)),
|
||||
// onTap: () {
|
||||
// Modular.to.pushNamed('/video');
|
||||
// },
|
||||
// ),
|
||||
CellWidget(
|
||||
leftIcon: IconFont.VideoIcon(),
|
||||
leftText: Text("快手视频", style: TextStyle(fontSize: Screen.setFontSize(14),color: ColorConfig.TextColor)),
|
||||
onTap: () {
|
||||
Modular.to.pushNamed('/video');
|
||||
},
|
||||
),
|
||||
CellWidget(
|
||||
leftIcon: IconFont.NewsIcon(),
|
||||
leftText: Text("最新写真", style: TextStyle(fontSize: Screen.setFontSize(14),color: ColorConfig.TextColor)),
|
||||
onTap: () {
|
||||
Modular.to.pushNamed('/recently');
|
||||
},
|
||||
),
|
||||
Container(
|
||||
height: 10,
|
||||
color: ColorConfig.LineColor,
|
||||
),
|
||||
|
||||
CellWidget(
|
||||
leftIcon: IconFont.PictureIcon(),
|
||||
leftText: Text("图片收藏", style: TextStyle(fontSize: Screen.setFontSize(14),color: ColorConfig.TextColor)),
|
||||
onTap: () {
|
||||
Modular.to.pushNamed('/singlegraph');
|
||||
},
|
||||
),
|
||||
CellWidget(
|
||||
leftIcon: IconFont.ModelIcon(color: ColorConfig.TextColor,size: Screen.setFontSize(20)),
|
||||
leftText: Text("写真收藏", style: TextStyle(fontSize: Screen.setFontSize(14),color: ColorConfig.TextColor)),
|
||||
onTap: () {
|
||||
Modular.to.pushNamed('/like');
|
||||
},
|
||||
),
|
||||
Container(
|
||||
height: 10,
|
||||
color: ColorConfig.LineColor,
|
||||
),
|
||||
|
||||
CellWidget(
|
||||
leftIcon: IconFont.AboutIcon(),
|
||||
leftText: Text("关于我们", style: TextStyle(fontSize: Screen.setFontSize(14),color: ColorConfig.TextColor)),
|
||||
onTap: () {
|
||||
Modular.to.pushNamed('/about');
|
||||
},
|
||||
),
|
||||
CellWidget(
|
||||
leftIcon: IconFont.XieYiIcon(),
|
||||
leftText: Text("用户协议", style: TextStyle(fontSize: Screen.setFontSize(14),color: ColorConfig.TextColor)),
|
||||
onTap: () {
|
||||
Modular.to.pushNamed('/agreement');
|
||||
},
|
||||
),
|
||||
CellWidget(
|
||||
leftIcon: IconFont.UpdateIcon(),
|
||||
leftText: Text("检测升级", style: TextStyle(fontSize: Screen.setFontSize(14),color: ColorConfig.TextColor)),
|
||||
rightText: Text("v"+Config.packageInfo.version,style: TextStyle(fontSize: Screen.setFontSize(12),color: Color.fromARGB(87, 0, 0, 0))),
|
||||
onTap: () async {
|
||||
bool status = await CheckUpdate().check(context);
|
||||
if (!status) {
|
||||
Toast.show("已是最新版", context, duration: Toast.LENGTH_SHORT, gravity: Toast.BOTTOM);
|
||||
}
|
||||
},
|
||||
),
|
||||
CellWidget(
|
||||
leftIcon: IconFont.ClearIcon(),
|
||||
leftText: Text("清除缓存", style: TextStyle(fontSize: Screen.setFontSize(14),color: ColorConfig.TextColor)),
|
||||
rightText: Text(cacheSize,style: TextStyle(fontSize: Screen.setFontSize(12),color: Color.fromARGB(87, 0, 0, 0))),
|
||||
onTap: () async {
|
||||
await showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (context) => WillPopScope(
|
||||
onWillPop: () async => false,
|
||||
child: AlertDialog(
|
||||
title: Text("清除缓存"),
|
||||
content: Container(
|
||||
height: 110,
|
||||
child: Column(
|
||||
children: [
|
||||
Text("此操作将删除您的【分类菜单】【图片缓存】【收藏记录】等所有内容,请慎重考虑!!"),
|
||||
SizedBox(height: 10,),
|
||||
Text("清除成功后将强制关闭应用,请自行重启",style: TextStyle(color: ColorConfig.NoActiveColor,fontSize: 14))
|
||||
],
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
FlatButton(
|
||||
child: Text('取消', style: TextStyle(color: ColorConfig.ThemeColor),),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
),
|
||||
FlatButton(
|
||||
child: Text("清除", style: TextStyle(color: ColorConfig.NoActiveColor),),
|
||||
onPressed: () async {
|
||||
Navigator.of(context).pop();
|
||||
bool status = await ClearCache.clearCache();
|
||||
await ComputeCache();
|
||||
if (status) {
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
);
|
||||
},
|
||||
),
|
||||
SizedBox(height: 40,),
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
await SPreferences().setBool("isLogin", false);
|
||||
Modular.to.pushReplacementNamed('/login');
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(left: Screen.setFontSize(15),right: Screen.setFontSize(15)),
|
||||
height: Screen.setHeight(35),
|
||||
alignment: Alignment.center,
|
||||
width: Screen.width(context),
|
||||
decoration: BoxDecoration(
|
||||
color: ColorConfig.ThemeColor,
|
||||
borderRadius: BorderRadius.circular(5)
|
||||
),
|
||||
child: Text(
|
||||
"退 出 登 录",
|
||||
style: TextStyle(
|
||||
color: ColorConfig.WhiteBackColor, fontSize: Screen.setFontSize(16)
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: Screen.setHeight(40),),
|
||||
],
|
||||
),
|
||||
)
|
||||
),
|
||||
|
||||
Tool.userInfo()['userType'] == "1" ? Positioned(
|
||||
right: 15,
|
||||
top: 10,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
shareText();
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
Text("分享赚钱", style: TextStyle(color: ColorConfig.WhiteBackColor,fontSize: 15)),
|
||||
],
|
||||
),
|
||||
),
|
||||
) : Container()
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
60
untitled/lib/views/Me/Recently.dart
Normal file
60
untitled/lib/views/Me/Recently.dart
Normal file
@@ -0,0 +1,60 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
||||
import 'package:peach/config/_.dart';
|
||||
import 'package:peach/entity/_.dart';
|
||||
import 'package:peach/service/_.dart';
|
||||
import 'package:peach/widget/_.dart';
|
||||
|
||||
class Recently extends StatefulWidget {
|
||||
@override
|
||||
State<StatefulWidget> createState() => _Recently();
|
||||
}
|
||||
|
||||
class _Recently extends State<Recently> {
|
||||
|
||||
List<ItemList> result = [];
|
||||
int page = 1;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
GetRecentlyData();
|
||||
}
|
||||
|
||||
|
||||
Future<AgentClassListData> GetRecentlyData() async {
|
||||
AgentClassListData res = await HomeService.GetRecently(params: { "page": page });
|
||||
print("========= ${res.total}");
|
||||
setState(() {
|
||||
result.addAll(res.list);
|
||||
page = int.parse(res.page);
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text("最近更新"),
|
||||
backgroundColor: ColorConfig.ThemeColor,
|
||||
),
|
||||
body: EasyRefresh(
|
||||
header: BezierCircleHeader(backgroundColor: ColorConfig.ThemeColor),
|
||||
footer: BezierBounceFooter(backgroundColor: ColorConfig.ThemeColor),
|
||||
onRefresh: () async {
|
||||
print("刷新");
|
||||
},
|
||||
onLoad: () async {
|
||||
setState(() {
|
||||
page+=1;
|
||||
GetRecentlyData();
|
||||
});
|
||||
},
|
||||
child: ItemWidget(
|
||||
data: result,
|
||||
title: '',
|
||||
longPress: () {}
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
87
untitled/lib/views/Me/SingleGraph.dart
Normal file
87
untitled/lib/views/Me/SingleGraph.dart
Normal file
@@ -0,0 +1,87 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:peach/config/_.dart';
|
||||
import 'package:peach/entity/_.dart';
|
||||
import 'package:peach/service/_.dart';
|
||||
import 'package:peach/utils/_.dart';
|
||||
import 'package:peach/widget/_.dart';
|
||||
|
||||
class SingleGraph extends StatefulWidget {
|
||||
@override
|
||||
State<StatefulWidget> createState() => _SingleGraph();
|
||||
}
|
||||
|
||||
class _SingleGraph extends State<SingleGraph> {
|
||||
|
||||
List<SingleGraphEntity> result = [];
|
||||
List<String> imgArr = [];
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
singleImg();
|
||||
}
|
||||
|
||||
Future<List<Map<String, dynamic>>> singleImg () async {
|
||||
List<SingleGraphEntity> res = await LikeService.findAllImg();
|
||||
setState(() {
|
||||
result = res;
|
||||
res.forEach((v) {
|
||||
imgArr.add(v.src);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> deleteAlertDialog(String url) async {
|
||||
await Core.deleteDialog(context, () async {
|
||||
await LikeService.deleteImg(url);
|
||||
singleImg();
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text("单图收藏"),
|
||||
backgroundColor: ColorConfig.ThemeColor,
|
||||
actions: [
|
||||
Container(
|
||||
alignment:Alignment.center,
|
||||
padding: EdgeInsets.only(right: 15),
|
||||
child: Text("共 ${result.length ?? 0} 张"),
|
||||
)
|
||||
],
|
||||
),
|
||||
body: result.isNotEmpty ? ListView.builder(
|
||||
itemCount: result.length ?? 0,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return InkWell(
|
||||
onLongPress: () => deleteAlertDialog(result[index].src),
|
||||
onTap: () async {
|
||||
Navigator.of(context).push(new MaterialPageRoute(builder: (_) {
|
||||
return PhotoViewGalleryScreen(
|
||||
images: imgArr,
|
||||
index: index,
|
||||
title: "",
|
||||
time: "",
|
||||
heroTag: index.toString(),
|
||||
);
|
||||
}));
|
||||
},
|
||||
child: CachedNetworkImg(result[index].src),
|
||||
);
|
||||
},
|
||||
) : Container(
|
||||
height: Screen.setHeight(300),
|
||||
alignment: Alignment.center,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(Icons.error_outline_outlined,size: 50,color: ColorConfig.ThemeColor,),
|
||||
SizedBox(height: 10,),
|
||||
Text("暂无收藏", style: TextStyle(color: ColorConfig.TextColor))
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
1
untitled/lib/views/Me/Video/.pydio
Normal file
1
untitled/lib/views/Me/Video/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
fc0c81c7-b1ce-4324-bfd3-3e74b84b3bc1
|
||||
100
untitled/lib/views/Me/Video/Video.dart
Normal file
100
untitled/lib/views/Me/Video/Video.dart
Normal file
@@ -0,0 +1,100 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:peach/entity/_.dart';
|
||||
import 'package:peach/views/Me/Video/player.dart';
|
||||
import 'package:peach/config/_.dart';
|
||||
import 'package:peach/entity/_.dart';
|
||||
import 'package:peach/utils/_.dart';
|
||||
import 'package:peach/service/_.dart';
|
||||
import 'package:peach/widget/_.dart';
|
||||
|
||||
class Video extends StatefulWidget {
|
||||
@override
|
||||
State<StatefulWidget> createState() => _Video();
|
||||
}
|
||||
|
||||
// 短视频模块
|
||||
class _Video extends State<Video> with AutomaticKeepAliveClientMixin<Video> {
|
||||
PageController pageController;
|
||||
|
||||
String pcursor = "";
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
pageController = PageController(
|
||||
initialPage: Config.currentIndex, //默认在第几个
|
||||
viewportFraction: 1, // 占屏幕多少,1为占满整个屏幕
|
||||
keepPage: true
|
||||
);
|
||||
|
||||
GetAllVideoList();
|
||||
}
|
||||
|
||||
/// 获取视频列表数据
|
||||
Future<VideoListEntity> GetAllVideoList({ String type = "swiper" }) async {
|
||||
print("GetAllVideoList");
|
||||
|
||||
void getData () async {
|
||||
VideoListEntity result = await VideoService.GetVideoList(params: {
|
||||
"pcursor": pcursor
|
||||
});
|
||||
setState(() {
|
||||
Config.feeds.addAll(result.feeds);
|
||||
pcursor = result.pcursor;
|
||||
});
|
||||
|
||||
print("feeds.length ${Config.feeds.length}");
|
||||
}
|
||||
|
||||
if (type == "swiper") {
|
||||
print("swiper");
|
||||
if (Config.feeds.length == 0) {
|
||||
getData();
|
||||
}
|
||||
} else {
|
||||
print("more");
|
||||
getData();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
super.build(context);
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.black,
|
||||
body: PageView(
|
||||
controller: pageController,
|
||||
scrollDirection: Axis.vertical,
|
||||
physics: BouncingScrollPhysics(),
|
||||
pageSnapping: true,
|
||||
onPageChanged: (int index) {
|
||||
setState(() {
|
||||
print("你切换了页面! ============== ${index}");
|
||||
setState(() {
|
||||
Config.currentIndex = index;
|
||||
if (Config.currentIndex >= Config.feeds.length -1) {
|
||||
print("重新请企业数据.....");
|
||||
GetAllVideoList(type: "more");
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
children: Config.feeds.map((e) {
|
||||
// print("e.photo.photoUrl ============ ${e.photo.photoUrl}");
|
||||
return Play(
|
||||
url: e.photo.photoUrl,
|
||||
);
|
||||
}).toList(),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
bool get wantKeepAlive => true;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
pageController.dispose();
|
||||
}
|
||||
}
|
||||
98
untitled/lib/views/Me/Video/player.dart
Normal file
98
untitled/lib/views/Me/Video/player.dart
Normal file
@@ -0,0 +1,98 @@
|
||||
import 'dart:ui';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:video_player/video_player.dart';
|
||||
import 'package:peach/config/_.dart';
|
||||
|
||||
class Play extends StatefulWidget {
|
||||
final String url;
|
||||
|
||||
const Play({
|
||||
this.url
|
||||
});
|
||||
|
||||
@override
|
||||
_Play createState() => _Play();
|
||||
}
|
||||
|
||||
class _Play extends State<Play> {
|
||||
|
||||
VideoPlayerController _controller;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
// print("widget.url:${widget.url}");
|
||||
_controller = VideoPlayerController.network(
|
||||
widget.url,
|
||||
videoPlayerOptions: VideoPlayerOptions(mixWithOthers: true),
|
||||
);
|
||||
_controller.addListener(() {
|
||||
if(_controller.value.position == _controller.value.duration) {
|
||||
|
||||
}
|
||||
});
|
||||
_controller.initialize().then((_) => setState(() {}));
|
||||
_controller.setLooping(true);
|
||||
_controller.play();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
_controller.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
color: Colors.black,
|
||||
alignment: Alignment.center,
|
||||
height: double.infinity,
|
||||
child: _controller.value.isInitialized
|
||||
? GestureDetector(
|
||||
onTap: () {
|
||||
print(_controller.value.aspectRatio);
|
||||
if (_controller.value.isPlaying) {
|
||||
_controller.pause();
|
||||
} else {
|
||||
_controller.play();
|
||||
}
|
||||
setState(() {});
|
||||
},
|
||||
child: Stack(
|
||||
overflow: Overflow.visible,
|
||||
children: [
|
||||
AspectRatio(
|
||||
aspectRatio: _controller.value.aspectRatio,
|
||||
child: Stack(
|
||||
alignment: Alignment.bottomCenter,
|
||||
children: [
|
||||
VideoPlayer( _controller),
|
||||
VideoProgressIndicator(_controller, allowScrubbing: true, colors: VideoProgressColors(playedColor: ColorConfig.ThemeColor),),
|
||||
],
|
||||
),
|
||||
),
|
||||
!_controller.value.isPlaying ? Positioned(
|
||||
top: 0,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
child: InkWell(
|
||||
child: Center(
|
||||
child: Icon(
|
||||
Icons.play_arrow, size: 70, color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
) : Text(""),
|
||||
],
|
||||
),
|
||||
)
|
||||
: Center(
|
||||
child: SpinKitWave(color: ColorConfig.ThemeColor, itemCount: 3, size: 40),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
1
untitled/lib/views/Me/Vip/.pydio
Normal file
1
untitled/lib/views/Me/Vip/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
927290ec-0eef-493f-ba2a-445d720136b1
|
||||
124
untitled/lib/views/Me/Vip/BuyStatus.dart
Normal file
124
untitled/lib/views/Me/Vip/BuyStatus.dart
Normal file
@@ -0,0 +1,124 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_modular/flutter_modular.dart';
|
||||
import 'package:peach/config/_.dart';
|
||||
import 'package:peach/R.dart';
|
||||
import 'package:peach/entity/_.dart';
|
||||
import 'package:peach/service/_.dart';
|
||||
import 'package:peach/utils/_.dart';
|
||||
import 'package:peach/widget/_.dart';
|
||||
import 'package:toast/toast.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class BuyStatus extends StatefulWidget {
|
||||
@override
|
||||
State<StatefulWidget> createState() => _BuyStatus();
|
||||
}
|
||||
|
||||
class _BuyStatus extends State<BuyStatus> {
|
||||
|
||||
List<Arr> orderList = [];
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
getOrderList();
|
||||
}
|
||||
|
||||
Future<orderStatusEntity> getOrderList() async {
|
||||
orderStatusEntity res = await UserService.orderStatus(params: {
|
||||
"objectId": Tool.userInfo()['objectId']
|
||||
});
|
||||
print("============== ${res.code}");
|
||||
setState(() {
|
||||
orderList.addAll(res.arr);
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text("会员状态"),
|
||||
elevation: 0.0,
|
||||
backgroundColor: ColorConfig.ThemeColor,
|
||||
),
|
||||
body: orderList.length == 0 ? Container(
|
||||
child: Text("没有记录"),
|
||||
alignment: Alignment.center,
|
||||
margin: EdgeInsets.only(top: 30),
|
||||
)
|
||||
: Container(
|
||||
alignment: Alignment.center,
|
||||
padding: EdgeInsets.only(top: Screen.setHeight(50)),
|
||||
child: Column(
|
||||
children: [
|
||||
orderList[0].activateStatus == "0" ? Icon(Icons.query_builder, size: 60,color: ColorConfig.ThemeColor,) : Icon(Icons.check, size: 60,color: ColorConfig.ThemeColor,),
|
||||
orderList[0].activateStatus == "0" ? SizedBox(height: 8,) : Container(),
|
||||
Text(orderList[0].activateStatus == "0" ? "等待您转账来激活账户" : "激活成功,可正常使用", style: TextStyle(fontSize: Screen.setFontSize(16)),),
|
||||
SizedBox(height: 5,),
|
||||
orderList[0].activateStatus == "0"
|
||||
? Text("请加微信 ${orderList[0].superiorWeixin} 并转账,转账备注为订单号", style: TextStyle(fontSize: Screen.setFontSize(14),color: ColorConfig.TextColor),)
|
||||
: Text(""),
|
||||
SizedBox(height: 40,),
|
||||
|
||||
CellWidget(
|
||||
leftIcon: IconFont.OrderIcon(size: 22),
|
||||
leftText: Text("订单号", style: TextStyle(fontSize: Screen.setFontSize(14),color: ColorConfig.TextColor)),
|
||||
rightIcon: Text(""),
|
||||
rightText: Text("${orderList[0].orderNumber}(复制订单)",style: TextStyle(fontSize: Screen.setFontSize(13),color: Color.fromARGB(87, 0, 0, 0))),
|
||||
onTap: () {
|
||||
Core.copy(orderList[0].orderNumber);
|
||||
Toast.show("复制成功", context, duration: Toast.LENGTH_LONG, gravity: Toast.BOTTOM);
|
||||
},
|
||||
),
|
||||
CellWidget(
|
||||
leftIcon: IconFont.WeiXinIcon(size: 22),
|
||||
leftText: Text("客服微信", style: TextStyle(fontSize: Screen.setFontSize(14),color: ColorConfig.TextColor)),
|
||||
rightText: Text("${orderList[0].superiorWeixin}(跳转微信)",style: TextStyle(fontSize: Screen.setFontSize(13),color: Color.fromARGB(87, 0, 0, 0))),
|
||||
rightIcon: Text(""),
|
||||
onTap: () {
|
||||
Core.copy(orderList[0].superiorWeixin);
|
||||
Toast.show("复制成功", context, duration: Toast.LENGTH_LONG, gravity: Toast.BOTTOM);
|
||||
launch("weixin://");
|
||||
},
|
||||
),
|
||||
|
||||
Container(
|
||||
height: 10,
|
||||
color: ColorConfig.LineColor,
|
||||
),
|
||||
|
||||
CellWidget(
|
||||
leftIcon: IconFont.VipIcon(),
|
||||
rightIcon: Text(""),
|
||||
leftText: Text("VIP类型", style: TextStyle(fontSize: Screen.setFontSize(14),color: ColorConfig.TextColor)),
|
||||
rightText: Text(Config.vipList[int.parse(orderList[0].vipLevel) - 1]['vipTitle'],style: TextStyle(fontSize: Screen.setFontSize(13),color: Color.fromARGB(87, 0, 0, 0))),
|
||||
onTap: () {},
|
||||
),
|
||||
CellWidget(
|
||||
leftIcon: IconFont.BuyIcon(size: 22),
|
||||
rightIcon: Text(""),
|
||||
leftText: Text("VIP价格", style: TextStyle(fontSize: Screen.setFontSize(14),color: ColorConfig.TextColor)),
|
||||
rightText: Text("¥${Config.vipList[int.parse(orderList[0].vipLevel) - 1]['vipMoney'].toString()}元",style: TextStyle(fontSize: Screen.setFontSize(13),color: ColorConfig.ThemeColor)),
|
||||
onTap: () {},
|
||||
),
|
||||
CellWidget(
|
||||
leftIcon: IconFont.StatusIcon(),
|
||||
rightIcon: Text(""),
|
||||
leftText: Text("VIP状态", style: TextStyle(fontSize: Screen.setFontSize(14),color: ColorConfig.TextColor)),
|
||||
rightText: Container(
|
||||
padding: EdgeInsets.only(left: 6,right: 6,top: 3,bottom: 4),
|
||||
decoration: BoxDecoration(
|
||||
color: ColorConfig.ThemeColor,
|
||||
borderRadius: BorderRadius.circular((10.0))
|
||||
),
|
||||
child: Text(orderList[0].activateStatus == "0" ? '未付款': '已付款',style: TextStyle(fontSize: Screen.setFontSize(12),color: ColorConfig.WhiteBackColor)),
|
||||
),
|
||||
onTap: () {
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
216
untitled/lib/views/Me/Vip/Vip.dart
Normal file
216
untitled/lib/views/Me/Vip/Vip.dart
Normal file
@@ -0,0 +1,216 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_modular/flutter_modular.dart';
|
||||
import 'package:peach/R.dart';
|
||||
import 'package:peach/config/_.dart';
|
||||
import 'package:peach/entity/_.dart';
|
||||
import 'package:peach/service/_.dart';
|
||||
import 'package:peach/utils/_.dart';
|
||||
import 'package:toast/toast.dart';
|
||||
|
||||
class Vip extends StatefulWidget {
|
||||
|
||||
@override
|
||||
State createState() => _Vip();
|
||||
}
|
||||
|
||||
class _Vip extends State<Vip> {
|
||||
|
||||
int currentVipType = 1;
|
||||
List<String> currentExplain;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
setState(() {
|
||||
currentExplain = Config.vipList[currentVipType - 1]["vipExplain"];
|
||||
});
|
||||
}
|
||||
|
||||
choiceVip(Map<String, dynamic> type) {
|
||||
print(type);
|
||||
setState(() {
|
||||
currentVipType = type["id"];
|
||||
currentExplain = type["vipExplain"];
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> placeOrder() async {
|
||||
RegisterEntity res = await UserService.placeOrder(params: {
|
||||
"objectId": Tool.userInfo()['objectId'],
|
||||
"vipLevel": Config.vipList[currentVipType - 1]['id'].toString()
|
||||
});
|
||||
Modular.to.pushNamed('/status');
|
||||
// if (res.code == 200) {
|
||||
// Modular.to.pushNamed('/status');
|
||||
// } else {
|
||||
// Toast.show(res.error, context, duration: Toast.LENGTH_LONG, gravity: Toast.BOTTOM);
|
||||
// }
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: ColorConfig.ThemeColor,
|
||||
title: Text("办理会员"),
|
||||
elevation: 0.0
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
Container(
|
||||
alignment: Alignment.center,
|
||||
height: Screen.setHeight(70),
|
||||
padding: EdgeInsets.only(left: 15, right: 15),
|
||||
color: ColorConfig.ThemeColor,
|
||||
child: Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
R.libStaticImgViplogoPng,
|
||||
width: Screen.setWidth(50),
|
||||
height: Screen.setWidth(50),
|
||||
),
|
||||
SizedBox(width: 10,),
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(Tool.userInfo()['username'], style: TextStyle(color: ColorConfig.WhiteBackColor,fontSize: Screen.setFontSize(18)),),
|
||||
Text("账户安全等级:安全",style: TextStyle(fontSize: Screen.setFontSize(11),color: ColorConfig.NoActiveColor),),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.only(left: 15, right: 15),
|
||||
width: Screen.width(context),
|
||||
height: Screen.setHeight(95),
|
||||
margin: EdgeInsets.only(top: 10),
|
||||
child: Column(
|
||||
children: [
|
||||
SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
physics: BouncingScrollPhysics(),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: Config.vipList.map((e) => InkWell(
|
||||
onTap: () {
|
||||
choiceVip(e);
|
||||
},
|
||||
child: Container(
|
||||
width: currentVipType == e["id"] ? Screen.width(context) / 2: Screen.width(context) / 3.5,
|
||||
margin: EdgeInsets.only(right: 5),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: currentVipType == e["id"] ? ColorConfig.ThemeColor : ColorConfig.IconColor,
|
||||
width: currentVipType == e["id"] ? 1 : 0.5
|
||||
),
|
||||
borderRadius: BorderRadius.circular((7.0))
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.only(topLeft: Radius.circular(5.0),topRight: Radius.circular(5.0)),
|
||||
color: ColorConfig.ThemeColor,
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
padding: EdgeInsets.only(top: 5,bottom: 5),
|
||||
child: Text(e['vipTitle'],style: TextStyle(fontSize: 14,color: ColorConfig.WhiteBackColor),),
|
||||
),
|
||||
Container(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text("¥",style: TextStyle(fontSize: Screen.setFontSize(12),fontWeight: FontWeight.w700,color: ColorConfig.ThemeColor)),
|
||||
Text(e["vipMoney"].toString(),style: TextStyle(fontSize: Screen.setFontSize(24),fontWeight: FontWeight.w700,color: ColorConfig.ThemeColor)),
|
||||
],
|
||||
),
|
||||
height: Screen.setHeight(40),
|
||||
alignment: Alignment.center,
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.only(bottom: 5),
|
||||
child: Text("每天仅${e["vipDay"].toString()}元",style: TextStyle(fontSize: 10,color: ColorConfig.TextColor),),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
)).toList()
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
alignment: Alignment.centerLeft,
|
||||
padding: EdgeInsets.only(left: 15, right: 15),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text("1:会员权益介绍",style: TextStyle(fontSize: Screen.setFontSize(18),fontWeight: FontWeight.w600),),
|
||||
SizedBox(height: 10,),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: currentExplain != null ? currentExplain.map((e) =>
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 15),
|
||||
child: Text(e,style: TextStyle(color: ColorConfig.TextColor),),
|
||||
)
|
||||
).toList() : [],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
alignment: Alignment.centerLeft,
|
||||
margin: EdgeInsets.only(bottom: 50),
|
||||
padding: EdgeInsets.only(left: 15, right: 15,top: 15),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text("2:购买提示",style: TextStyle(fontSize: Screen.setFontSize(18),fontWeight: FontWeight.w600),),
|
||||
SizedBox(height: 10,),
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 15),
|
||||
child: Column(
|
||||
children: [
|
||||
Text("1:当您点击办理按钮后,前往微信添加给出的客服微信号,然后向对方转账并填写转账备注为订单号!",style: TextStyle(color: ColorConfig.TextColor)),
|
||||
SizedBox(height: 5,),
|
||||
Text("2:转账成功后,请等待客服为您办理激活,一分钟左右即可办理成功。",style: TextStyle(color: ColorConfig.TextColor)),
|
||||
SizedBox(height: 5,),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
placeOrder();
|
||||
// Modular.to.pushNamed("/status");
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(left: Screen.setFontSize(15),right: Screen.setFontSize(15)),
|
||||
height: Screen.setHeight(35),
|
||||
alignment: Alignment.center,
|
||||
width: Screen.width(context),
|
||||
decoration: BoxDecoration(
|
||||
color: ColorConfig.ThemeColor,
|
||||
borderRadius: BorderRadius.circular(20)
|
||||
),
|
||||
child: Text(
|
||||
"¥${Config.vipList[currentVipType - 1]['vipMoney']}/${Config.vipList[currentVipType - 1]['vipTitle']} 点击办理",
|
||||
style: TextStyle(
|
||||
color: ColorConfig.WhiteBackColor, fontSize: Screen.setFontSize(16)
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
1
untitled/lib/views/Mechanism/.pydio
Normal file
1
untitled/lib/views/Mechanism/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
eb0076cb-897d-4491-b916-cc08023eedc4
|
||||
81
untitled/lib/views/Mechanism/Mechanism.dart
Normal file
81
untitled/lib/views/Mechanism/Mechanism.dart
Normal file
@@ -0,0 +1,81 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_modular/flutter_modular.dart';
|
||||
import 'package:peach/config/_.dart';
|
||||
import 'package:peach/entity/_.dart';
|
||||
import 'package:peach/utils/_.dart';
|
||||
import 'package:peach/service/_.dart';
|
||||
import 'package:peach/widget/_.dart';
|
||||
|
||||
class Mechanism extends StatefulWidget {
|
||||
@override
|
||||
State<StatefulWidget> createState() => _Mechanism();
|
||||
}
|
||||
|
||||
class _Mechanism extends State<Mechanism> with AutomaticKeepAliveClientMixin<Mechanism> {
|
||||
|
||||
/// 获取机构列表的数据
|
||||
Future<List<MechanismResult>> GetMechanismData() async {
|
||||
return await MechanismService.GetMechanismData(params: {});
|
||||
}
|
||||
|
||||
/// 组件
|
||||
Widget MechanismList(List<MechanismResult> res) {
|
||||
return SingleChildScrollView(
|
||||
scrollDirection: Axis.vertical,
|
||||
physics: BouncingScrollPhysics(),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(Screen.setFontSize(15)),
|
||||
margin: EdgeInsets.only(top: 15),
|
||||
child: Wrap(
|
||||
runAlignment: WrapAlignment.spaceBetween,
|
||||
children: res.map((e) => Container(
|
||||
width: Screen.setWidth(86),
|
||||
margin: EdgeInsets.only(bottom: 20),
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Modular.to.pushNamed("/mechanismList/${e.id}/${e.title}/mechanism");
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
Text(e.title,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
color: ColorConfig.TitleColor,
|
||||
fontSize: Screen.setFontSize(16))),
|
||||
SizedBox(height: 10),
|
||||
Text(
|
||||
e.quantity,
|
||||
style: TextStyle(
|
||||
color: ColorConfig.ThemeColor,
|
||||
fontSize: Screen.setFontSize(12)),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
)).toList()
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
super.build(context);
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: ColorConfig.ThemeColor,
|
||||
automaticallyImplyLeading: false,
|
||||
title: Text("机构"),
|
||||
),
|
||||
body: FutureBuilderWidget<List<MechanismResult>>(
|
||||
future: GetMechanismData,
|
||||
success: MechanismList,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
bool get wantKeepAlive => true;
|
||||
}
|
||||
89
untitled/lib/views/Mechanism/MechanismList.dart
Normal file
89
untitled/lib/views/Mechanism/MechanismList.dart
Normal file
@@ -0,0 +1,89 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
||||
import 'package:toast/toast.dart';
|
||||
import 'package:peach/config/_.dart';
|
||||
import 'package:peach/entity/_.dart';
|
||||
import 'package:peach/service/_.dart';
|
||||
import 'package:peach/widget/_.dart';
|
||||
|
||||
class MechanismList extends StatefulWidget {
|
||||
String id;
|
||||
String title = "";
|
||||
String type;
|
||||
|
||||
int totalPage = 0;
|
||||
|
||||
MechanismList({ this.id, this.title, this.type });
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() => _MechanismList();
|
||||
}
|
||||
|
||||
class _MechanismList extends State<MechanismList> {
|
||||
int page = 1;
|
||||
List<ItemList> Result = [];
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
switch(widget.type) {
|
||||
case 'mechanism':
|
||||
GetmechanismList();
|
||||
break;
|
||||
case 'tags':
|
||||
getClassListData();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/// 机构列表点击进入详情
|
||||
Future<void> GetmechanismList() async {
|
||||
AgentClassListData res = await MechanismService.GetmechanismList(params: { "id": widget.id, "page": page });
|
||||
setState(() {
|
||||
Result.addAll(res.list);
|
||||
widget.totalPage = int.parse(res.total);
|
||||
page = int.parse(res.page);
|
||||
});
|
||||
}
|
||||
|
||||
Future<AgentClassListData> getClassListData() async {
|
||||
AgentClassListData res = await HomeService.GetClassListData(params: { 'id': widget.id, 'page': page });
|
||||
setState(() {
|
||||
Result.addAll(res.list);
|
||||
widget.totalPage = int.parse(res.total);
|
||||
page = int.parse(res.page);
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
elevation: 0,
|
||||
backgroundColor: ColorConfig.ThemeColor,
|
||||
title: Text(widget.title),
|
||||
),
|
||||
body: EasyRefresh(
|
||||
header: BezierCircleHeader(backgroundColor: ColorConfig.ThemeColor),
|
||||
footer: BezierBounceFooter(backgroundColor: ColorConfig.ThemeColor),
|
||||
onRefresh: () async {
|
||||
print("刷新");
|
||||
},
|
||||
onLoad: () async {
|
||||
setState(() {
|
||||
page+=1;
|
||||
if (page > widget.totalPage) {
|
||||
Toast.show("没有数据", context, duration: Toast.LENGTH_SHORT, gravity: Toast.BOTTOM);
|
||||
} else {
|
||||
GetmechanismList();
|
||||
}
|
||||
});
|
||||
},
|
||||
child: ItemWidget(
|
||||
data: Result,
|
||||
title: '',
|
||||
longPress: () {}
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
1
untitled/lib/views/Model/.pydio
Normal file
1
untitled/lib/views/Model/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
8989027d-12a5-4ca8-a827-010051d68874
|
||||
60
untitled/lib/views/Model/Model.dart
Normal file
60
untitled/lib/views/Model/Model.dart
Normal file
@@ -0,0 +1,60 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:peach/config/_.dart';
|
||||
import 'package:peach/utils/_.dart';
|
||||
import 'package:peach/widget/_.dart';
|
||||
import 'package:peach/entity/_.dart';
|
||||
import 'package:peach/service/_.dart';
|
||||
|
||||
class Model extends StatefulWidget {
|
||||
@override
|
||||
State<StatefulWidget> createState() => _Model();
|
||||
|
||||
}
|
||||
|
||||
class _Model extends State<Model> with AutomaticKeepAliveClientMixin<Model>{
|
||||
|
||||
Future<ModelResult> GetModelData() async {
|
||||
return await ModelService.GetModelData(params: {});
|
||||
}
|
||||
|
||||
|
||||
Widget ModelList (ModelResult res) {
|
||||
return SingleChildScrollView(
|
||||
scrollDirection: Axis.vertical,
|
||||
physics: BouncingScrollPhysics(),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.only(top: Screen.setFontSize(15)),
|
||||
child: ModelWidget(data: res.hotModels, height: 25,),
|
||||
),
|
||||
// Container(
|
||||
// padding: EdgeInsets.only(top: Screen.setFontSize(15)),
|
||||
// child: ModelWidget(title: "最新模特", data: res.newest, height: 25,),
|
||||
// )
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
super.build(context);
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: ColorConfig.ThemeColor,
|
||||
automaticallyImplyLeading: false,
|
||||
title: Text("模特"),
|
||||
),
|
||||
body: FutureBuilderWidget<ModelResult>(
|
||||
future: GetModelData,
|
||||
success: ModelList,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
bool get wantKeepAlive => true;
|
||||
|
||||
}
|
||||
118
untitled/lib/views/Model/ModelInfo.dart
Normal file
118
untitled/lib/views/Model/ModelInfo.dart
Normal file
@@ -0,0 +1,118 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:toast/toast.dart';
|
||||
import 'package:peach/config/_.dart';
|
||||
import 'package:peach/entity/_.dart';
|
||||
import 'package:peach/service/_.dart';
|
||||
import 'package:peach/utils/_.dart';
|
||||
import 'package:peach/widget/_.dart';
|
||||
|
||||
class ModelInfo extends StatefulWidget {
|
||||
|
||||
String title;
|
||||
String id;
|
||||
ModelInfo({ this.title, this.id });
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() => _ModelInfo();
|
||||
}
|
||||
|
||||
class _ModelInfo extends State<ModelInfo> {
|
||||
|
||||
|
||||
ModelInfoResult Info = ModelInfoResult.fromJson({
|
||||
"current_page": 0, "total_page": 0, "modelInfo": {}, "data": [], "similar": []
|
||||
});
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
new Future.delayed(Duration(milliseconds: 500),() async {
|
||||
GetModelInfo();
|
||||
});
|
||||
}
|
||||
|
||||
Future<ModelInfoResult> GetModelInfo() async {
|
||||
ModelInfoResult res = await ModelService.GetModelInfo(params: {
|
||||
"page": Info.currentPage,
|
||||
"id": widget.id
|
||||
});
|
||||
setState(() {
|
||||
Info.data.addAll(res.data);
|
||||
Info.similar = res.similar;
|
||||
Info.modelInfo = res.modelInfo;
|
||||
Info.totalPage = res.totalPage;
|
||||
Info.currentPage = res.currentPage;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(widget.title),
|
||||
backgroundColor: ColorConfig.ThemeColor,
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
scrollDirection: Axis.vertical,
|
||||
physics: BouncingScrollPhysics(),
|
||||
child: Info.data.isNotEmpty ? Container(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.all(15),
|
||||
child: Row(
|
||||
children: [
|
||||
ClipOval(
|
||||
child: Image.network(
|
||||
Info.modelInfo.portrait, width: Screen.setWidth(60),
|
||||
height: Screen.setWidth(60), fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 10,),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(Info.modelInfo.name, style: TextStyle(fontWeight: FontWeight.w500,fontSize: 16),),
|
||||
SizedBox(height: 6,),
|
||||
Text(Info.modelInfo.explain, style: TextStyle(fontSize: 12,color: ColorConfig.TextColor),)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 15),
|
||||
child: OldItemWidget(title: "她的作品", data: Info.data,),
|
||||
),
|
||||
Container(
|
||||
alignment: Alignment.center,
|
||||
child: IconButton(
|
||||
onPressed: () async {
|
||||
Info.currentPage += 1;
|
||||
if (Info.currentPage > Info.totalPage || Info.totalPage == 99999) {
|
||||
Toast.show("没有数据", context, duration: Toast.LENGTH_SHORT, gravity: Toast.BOTTOM);
|
||||
} else {
|
||||
GetModelInfo();
|
||||
}
|
||||
},
|
||||
icon: Icon(Icons.keyboard_arrow_down,size: 40,color: ColorConfig.ThemeColor,),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
child: ModelWidget(title: "类似模特", data: Info.similar, height: 25),
|
||||
),
|
||||
],
|
||||
),
|
||||
) : Container(
|
||||
height: Screen.setHeight(250),
|
||||
child: Center(
|
||||
child: SpinKitWave(color: ColorConfig.ThemeColor, itemCount: 3, size: 40),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
1
untitled/lib/views/User/.pydio
Normal file
1
untitled/lib/views/User/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
18b6e362-e187-44a8-87f8-7c98a4f2c28f
|
||||
232
untitled/lib/views/User/AgentRegister.dart
Normal file
232
untitled/lib/views/User/AgentRegister.dart
Normal file
@@ -0,0 +1,232 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_modular/flutter_modular.dart';
|
||||
import 'package:peach/config/_.dart';
|
||||
import 'package:peach/entity/LoginEntity.dart';
|
||||
import 'package:peach/entity/_.dart';
|
||||
import 'package:peach/service/UserService.dart';
|
||||
import 'package:peach/utils/_.dart';
|
||||
import 'package:toast/toast.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
class AgentRegister extends StatefulWidget {
|
||||
|
||||
@override
|
||||
State createState() => _AgentRegister();
|
||||
}
|
||||
|
||||
class _AgentRegister extends State<AgentRegister> {
|
||||
|
||||
// 手机号
|
||||
TextEditingController _phoneController = TextEditingController();
|
||||
// 密码
|
||||
TextEditingController _passwordController = TextEditingController();
|
||||
// 代理码
|
||||
TextEditingController _agentCodeController = TextEditingController();
|
||||
// 代理的微信
|
||||
TextEditingController _weiXinController = TextEditingController();
|
||||
|
||||
bool isShowPassword = true;
|
||||
|
||||
Future<void> agentUserRegisterAction() async {
|
||||
if (!Tool.isPhone(_phoneController.text)) {
|
||||
Toast.show("手机号不正确,请检查", context, duration: Toast.LENGTH_LONG, gravity: Toast.CENTER);
|
||||
return;
|
||||
}
|
||||
|
||||
if (_passwordController.text.length == 0) {
|
||||
Toast.show("密码不能为空", context, duration: Toast.LENGTH_LONG, gravity: Toast.CENTER);
|
||||
return;
|
||||
}
|
||||
|
||||
if (_agentCodeController.text.length == 0) {
|
||||
Toast.show("代理激活码不能为空", context, duration: Toast.LENGTH_LONG, gravity: Toast.CENTER);
|
||||
return;
|
||||
}
|
||||
|
||||
if (_weiXinController.text.length == 0) {
|
||||
Toast.show("代理微信号不能为空", context, duration: Toast.LENGTH_LONG, gravity: Toast.CENTER);
|
||||
return;
|
||||
}
|
||||
|
||||
RegisterEntity user = await UserService.agentUserRegister(params: {
|
||||
'userphone': _phoneController.text,
|
||||
'userpwd': _passwordController.text,
|
||||
'agentcode': _agentCodeController.text,
|
||||
'userweixin': _weiXinController.text
|
||||
});
|
||||
if (user.code == 200) {
|
||||
print("注册成功");
|
||||
Modular.to.pushReplacementNamed('/login');
|
||||
} else {
|
||||
print("注册失败");
|
||||
Toast.show(user.error, context, duration: Toast.LENGTH_LONG, gravity: Toast.CENTER);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
elevation: 0.0,
|
||||
backgroundColor: ColorConfig.ThemeColor,
|
||||
actions: [
|
||||
Container(
|
||||
alignment: Alignment.center,
|
||||
padding: EdgeInsets.only(right: 15),
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Modular.to.pushNamed("/login");
|
||||
},
|
||||
child: Text("登录"),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
physics: BouncingScrollPhysics(),
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(
|
||||
top: Screen.setFontSize(30),
|
||||
left: Screen.setFontSize(30),
|
||||
right: Screen.setFontSize(30)),
|
||||
child: Column(
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"注册为代理",
|
||||
style: TextStyle(fontSize: 30),
|
||||
),
|
||||
SizedBox(height: 20,),
|
||||
Text(
|
||||
"1:请确保手机号的正确,否则功能无法正常使用",
|
||||
style: TextStyle(fontSize: 15),
|
||||
),
|
||||
InkWell(
|
||||
onLongPress: () {
|
||||
Clipboard.setData(ClipboardData(text: 'xy7145'));
|
||||
Toast.show("微信号已复制,请使用微信添加好友", context, duration: Toast.LENGTH_LONG, gravity: Toast.BOTTOM);
|
||||
},
|
||||
child: Text(
|
||||
"2:如果您想成为代理赚取更多的额外收益,那么请加总代理 微信:xy7145(长按复制) 进行申请即可。",
|
||||
style: TextStyle(fontSize: 15),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"3:【代理激活码】请找总代理获取并粘贴至下面输入框中!",
|
||||
style: TextStyle(fontSize: 15),
|
||||
),
|
||||
Text(
|
||||
"4:【收款微信号】请务必填写您真实有效且经常在用的微信号",
|
||||
style: TextStyle(fontSize: 15),
|
||||
),
|
||||
SizedBox(
|
||||
height: Screen.setHeight(20),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(bottom: Screen.setFontSize(80)),
|
||||
child: Column(
|
||||
children: [
|
||||
TextField(
|
||||
controller: _phoneController,
|
||||
keyboardType: TextInputType.number,
|
||||
cursorRadius: Radius.circular(10),
|
||||
cursorColor: ColorConfig.ThemeColor,
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
//选中时下边框颜色
|
||||
borderSide: BorderSide(color: ColorConfig.TextColor),
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
color: ColorConfig.TextColor,
|
||||
),
|
||||
labelText: '请输入手机账户',
|
||||
),
|
||||
),
|
||||
TextField(
|
||||
controller: _passwordController,
|
||||
keyboardType: TextInputType.visiblePassword,
|
||||
cursorRadius: Radius.circular(10),
|
||||
cursorColor: ColorConfig.ThemeColor,
|
||||
obscureText: isShowPassword,
|
||||
decoration: InputDecoration(
|
||||
suffixIcon: IconButton(
|
||||
color: ColorConfig.TextColor,
|
||||
onPressed: () {
|
||||
setState(() => isShowPassword = !isShowPassword);
|
||||
},
|
||||
icon: isShowPassword
|
||||
? Icon(Icons.remove_red_eye_rounded)
|
||||
: Icon(Icons.remove_red_eye_outlined),
|
||||
),
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
//选中时下边框颜色
|
||||
borderSide: BorderSide(color: ColorConfig.TextColor),
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
color: ColorConfig.TextColor,
|
||||
),
|
||||
labelText: '请输入账户密码',
|
||||
),
|
||||
),
|
||||
TextField(
|
||||
controller: _agentCodeController,
|
||||
keyboardType: TextInputType.number,
|
||||
cursorRadius: Radius.circular(10),
|
||||
cursorColor: ColorConfig.ThemeColor,
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
//选中时下边框颜色
|
||||
borderSide: BorderSide(color: ColorConfig.TextColor),
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
color: ColorConfig.TextColor,
|
||||
),
|
||||
labelText: '请输入代理激活码',
|
||||
),
|
||||
),
|
||||
TextField(
|
||||
controller: _weiXinController,
|
||||
keyboardType: TextInputType.number,
|
||||
cursorRadius: Radius.circular(10),
|
||||
cursorColor: ColorConfig.ThemeColor,
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
//选中时下边框颜色
|
||||
borderSide: BorderSide(color: ColorConfig.TextColor),
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
color: ColorConfig.TextColor,
|
||||
),
|
||||
labelText: '请输入收款微信号',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
await agentUserRegisterAction();
|
||||
},
|
||||
child: Container(
|
||||
height: Screen.setHeight(35),
|
||||
alignment: Alignment.center,
|
||||
width: Screen.width(context),
|
||||
decoration: BoxDecoration(
|
||||
color: ColorConfig.ThemeColor,
|
||||
borderRadius: BorderRadius.circular(30)
|
||||
),
|
||||
child: Text("注 册 为 代 理", style: TextStyle(color: ColorConfig.WhiteBackColor,fontSize: 18),)
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
202
untitled/lib/views/User/Login.dart
Normal file
202
untitled/lib/views/User/Login.dart
Normal file
@@ -0,0 +1,202 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_modular/flutter_modular.dart';
|
||||
import 'package:peach/config/_.dart';
|
||||
import 'package:peach/entity/_.dart';
|
||||
import 'package:peach/service/_.dart';
|
||||
import 'package:peach/utils/_.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:toast/toast.dart';
|
||||
|
||||
class Login extends StatefulWidget {
|
||||
@override
|
||||
State createState() => _Login();
|
||||
}
|
||||
|
||||
class _Login extends State<Login> {
|
||||
// 手机号
|
||||
TextEditingController _phoneController = TextEditingController();
|
||||
|
||||
// 密码
|
||||
TextEditingController _passwordController = TextEditingController();
|
||||
|
||||
bool isShowPassword = true;
|
||||
|
||||
Future<void> userLoginAction() async {
|
||||
if (!Tool.isPhone(_phoneController.text)) {
|
||||
Toast.show("手机号不正确,请检查", context, duration: Toast.LENGTH_LONG, gravity: Toast.CENTER);
|
||||
return;
|
||||
}
|
||||
|
||||
if (_passwordController.text.length == 0) {
|
||||
Toast.show("密码不能为空", context, duration: Toast.LENGTH_LONG, gravity: Toast.CENTER);
|
||||
return;
|
||||
}
|
||||
|
||||
LoginEntity user = await UserService.userLogin(params: {
|
||||
'username': _phoneController.text,
|
||||
'userpwd': _passwordController.text
|
||||
});
|
||||
if (user.code == 200) {
|
||||
print("账户密码正确");
|
||||
print("userType ===== ${user.userType}");
|
||||
print("userWeiXin ===== ${user.userWeiXin}");
|
||||
await SPreferences().setBool("isLogin", true);
|
||||
await SPreferences().setString("username", user.username);
|
||||
await SPreferences().setString("objectId", user.objectId);
|
||||
await SPreferences().setString("createdAt", user.createdAt);
|
||||
await SPreferences().setString("userType", user.userType);
|
||||
await SPreferences().setString("userWeiXin", user.userWeiXin);
|
||||
Modular.to.pushReplacementNamed('/init');
|
||||
} else {
|
||||
print("账户密码错误");
|
||||
Toast.show(user.error, context, duration: Toast.LENGTH_LONG, gravity: Toast.CENTER);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
elevation: 0.0,
|
||||
backgroundColor: ColorConfig.ThemeColor,
|
||||
actions: [
|
||||
Container(
|
||||
alignment: Alignment.center,
|
||||
padding: EdgeInsets.only(right: 15),
|
||||
child: Row(
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Modular.to.pushNamed("/reg");
|
||||
},
|
||||
child: Text("用户注册"),
|
||||
),
|
||||
SizedBox(width: 15,),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Modular.to.pushNamed("/agentReg");
|
||||
},
|
||||
child: Text("代理注册"),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
physics: BouncingScrollPhysics(),
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(
|
||||
top: Screen.setFontSize(30),
|
||||
left: Screen.setFontSize(30),
|
||||
right: Screen.setFontSize(30)),
|
||||
child: Column(
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"登录",
|
||||
style: TextStyle(fontSize: 30),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Text(
|
||||
"欢迎来到屁桃儿,请使用手机号登录",
|
||||
style: TextStyle(fontSize: 15),
|
||||
),
|
||||
Text(
|
||||
"请确保手机号的正确性,否则部分功能无法正常使用",
|
||||
style:
|
||||
TextStyle(fontSize: 12, color: ColorConfig.TextColor),
|
||||
),
|
||||
SizedBox(
|
||||
height: Screen.setHeight(30),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(bottom: Screen.setFontSize(80)),
|
||||
child: Column(
|
||||
children: [
|
||||
TextField(
|
||||
controller: _phoneController,
|
||||
keyboardType: TextInputType.number,
|
||||
cursorRadius: Radius.circular(10),
|
||||
cursorColor: ColorConfig.ThemeColor,
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
//选中时下边框颜色
|
||||
borderSide:
|
||||
BorderSide(color: ColorConfig.TextColor),
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
color: ColorConfig.TextColor,
|
||||
),
|
||||
labelText: '请输入手机账户',
|
||||
),
|
||||
),
|
||||
TextField(
|
||||
controller: _passwordController,
|
||||
keyboardType: TextInputType.visiblePassword,
|
||||
cursorRadius: Radius.circular(10),
|
||||
cursorColor: ColorConfig.ThemeColor,
|
||||
obscureText: isShowPassword,
|
||||
decoration: InputDecoration(
|
||||
suffixIcon: IconButton(
|
||||
color: ColorConfig.TextColor,
|
||||
onPressed: () {
|
||||
setState(
|
||||
() => isShowPassword = !isShowPassword);
|
||||
},
|
||||
icon: isShowPassword
|
||||
? Icon(Icons.remove_red_eye_rounded)
|
||||
: Icon(Icons.remove_red_eye_outlined),
|
||||
),
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
//选中时下边框颜色
|
||||
borderSide:
|
||||
BorderSide(color: ColorConfig.TextColor),
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
color: ColorConfig.TextColor,
|
||||
),
|
||||
labelText: '请输入账户密码',
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
userLoginAction();
|
||||
},
|
||||
child: Container(
|
||||
height: Screen.setHeight(35),
|
||||
alignment: Alignment.center,
|
||||
width: Screen.width(context),
|
||||
decoration: BoxDecoration(
|
||||
color: ColorConfig.ThemeColor,
|
||||
borderRadius: BorderRadius.circular(30)
|
||||
),
|
||||
child: Text(
|
||||
"登 录",
|
||||
style: TextStyle(
|
||||
color: ColorConfig.WhiteBackColor, fontSize: 18
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 15),
|
||||
alignment: Alignment.center,
|
||||
child: Text("忘记密码"),
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
168
untitled/lib/views/User/Register.dart
Normal file
168
untitled/lib/views/User/Register.dart
Normal file
@@ -0,0 +1,168 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_modular/flutter_modular.dart';
|
||||
import 'package:peach/config/_.dart';
|
||||
import 'package:peach/entity/LoginEntity.dart';
|
||||
import 'package:peach/entity/_.dart';
|
||||
import 'package:peach/service/UserService.dart';
|
||||
import 'package:peach/utils/_.dart';
|
||||
import 'package:toast/toast.dart';
|
||||
|
||||
class Register extends StatefulWidget {
|
||||
|
||||
@override
|
||||
State createState() => _Register();
|
||||
}
|
||||
|
||||
class _Register extends State<Register> {
|
||||
// 手机号
|
||||
TextEditingController _phoneController = TextEditingController();
|
||||
|
||||
// 密码
|
||||
TextEditingController _passwordController = TextEditingController();
|
||||
|
||||
bool isShowPassword = true;
|
||||
|
||||
Future<void> userRegisterAction() async {
|
||||
if (!Tool.isPhone(_phoneController.text)) {
|
||||
Toast.show("手机号不正确,请检查", context, duration: Toast.LENGTH_LONG, gravity: Toast.CENTER);
|
||||
return;
|
||||
}
|
||||
|
||||
if (_passwordController.text.length == 0) {
|
||||
Toast.show("密码不能为空", context, duration: Toast.LENGTH_LONG, gravity: Toast.CENTER);
|
||||
return;
|
||||
}
|
||||
|
||||
RegisterEntity user = await UserService.userRegister(params: {
|
||||
'userphone': _phoneController.text,
|
||||
'userpwd': _passwordController.text
|
||||
});
|
||||
if (user.code == 200) {
|
||||
print("注册成功");
|
||||
Modular.to.pushReplacementNamed('/login');
|
||||
} else {
|
||||
print("注册失败");
|
||||
Toast.show(user.error, context, duration: Toast.LENGTH_LONG, gravity: Toast.CENTER);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
elevation: 0.0,
|
||||
backgroundColor: ColorConfig.ThemeColor,
|
||||
actions: [
|
||||
Container(
|
||||
alignment: Alignment.center,
|
||||
padding: EdgeInsets.only(right: 15),
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Modular.to.pushNamed("/login");
|
||||
},
|
||||
child: Text("登录"),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
physics: BouncingScrollPhysics(),
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(
|
||||
top: Screen.setFontSize(30),
|
||||
left: Screen.setFontSize(30),
|
||||
right: Screen.setFontSize(30)),
|
||||
child: Column(
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"注册",
|
||||
style: TextStyle(fontSize: 30),
|
||||
),
|
||||
SizedBox(height: 20,),
|
||||
Text(
|
||||
"欢迎注册屁桃儿,请使用手机号注册",
|
||||
style: TextStyle(fontSize: 15),
|
||||
),
|
||||
Text(
|
||||
"请确保手机号的正确性,否则部分功能无法正常使用",
|
||||
style: TextStyle(fontSize: 12,color: ColorConfig.TextColor),
|
||||
),
|
||||
SizedBox(
|
||||
height: Screen.setHeight(30),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(bottom: Screen.setFontSize(80)),
|
||||
child: Column(
|
||||
children: [
|
||||
TextField(
|
||||
controller: _phoneController,
|
||||
keyboardType: TextInputType.number,
|
||||
cursorRadius: Radius.circular(10),
|
||||
cursorColor: ColorConfig.ThemeColor,
|
||||
decoration: InputDecoration(
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
//选中时下边框颜色
|
||||
borderSide: BorderSide(color: ColorConfig.TextColor),
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
color: ColorConfig.TextColor,
|
||||
),
|
||||
labelText: '请输入手机账户',
|
||||
),
|
||||
),
|
||||
TextField(
|
||||
controller: _passwordController,
|
||||
keyboardType: TextInputType.visiblePassword,
|
||||
cursorRadius: Radius.circular(10),
|
||||
cursorColor: ColorConfig.ThemeColor,
|
||||
obscureText: isShowPassword,
|
||||
decoration: InputDecoration(
|
||||
suffixIcon: IconButton(
|
||||
color: ColorConfig.TextColor,
|
||||
onPressed: () {
|
||||
setState(() => isShowPassword = !isShowPassword);
|
||||
},
|
||||
icon: isShowPassword
|
||||
? Icon(Icons.remove_red_eye_rounded)
|
||||
: Icon(Icons.remove_red_eye_outlined),
|
||||
),
|
||||
focusedBorder: UnderlineInputBorder(
|
||||
//选中时下边框颜色
|
||||
borderSide: BorderSide(color: ColorConfig.TextColor),
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
color: ColorConfig.TextColor,
|
||||
),
|
||||
labelText: '请输入账户密码',
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () async {
|
||||
await userRegisterAction();
|
||||
},
|
||||
child: Container(
|
||||
height: Screen.setHeight(35),
|
||||
alignment: Alignment.center,
|
||||
width: Screen.width(context),
|
||||
decoration: BoxDecoration(
|
||||
color: ColorConfig.ThemeColor,
|
||||
borderRadius: BorderRadius.circular(30)
|
||||
),
|
||||
child: Text("注 册", style: TextStyle(color: ColorConfig.WhiteBackColor,fontSize: 18),)
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
39
untitled/lib/views/Welcome.dart
Normal file
39
untitled/lib/views/Welcome.dart
Normal file
@@ -0,0 +1,39 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_modular/flutter_modular.dart';
|
||||
import 'package:intro_views_flutter/intro_views_flutter.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
import 'package:peach/config/_.dart';
|
||||
import 'package:peach/utils/_.dart';
|
||||
import 'package:peach/views/App.dart';
|
||||
|
||||
/*
|
||||
* 启动欢迎页面
|
||||
*/
|
||||
class Welcome extends StatefulWidget {
|
||||
@override
|
||||
State<StatefulWidget> createState() => _Welcome();
|
||||
|
||||
Welcome({Key key}) : super(key: key);
|
||||
}
|
||||
|
||||
class _Welcome extends State<Welcome> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Builder(
|
||||
builder: (context) => IntroViewsFlutter(
|
||||
Config.pages,
|
||||
onTapDoneButton: () {
|
||||
Config.isLogin ? Modular.to.pushReplacementNamed('/login') : Modular.to.pushReplacementNamed('/init');
|
||||
},
|
||||
skipText: Text("跳过"),
|
||||
doneText: Text("进入"),
|
||||
pageButtonTextStyles: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: Screen.setFontSize(15.0),
|
||||
),
|
||||
), //IntroViewsFlutter
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user