first commit
This commit is contained in:
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)
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user