Browse Source

文章合集增加;

积分商城创建订单接口字段增加;
会员权益详情点击更改;
成就弹窗实体类更改,增加奖励列表;
会员中心样式更改;
ff_new
w-R 3 years ago
parent
commit
2afde85a5a
  1. 5
      lib/address/edit_address_page.dart
  2. 107
      lib/article/hot_article_item.dart
  3. 4
      lib/community/community_page.dart
  4. 1
      lib/community/community_view/class_details.dart
  5. 1
      lib/community/community_view/home_class.dart
  6. 176
      lib/community/headlines/article_list.dart
  7. 239
      lib/community/headlines/article_page.dart
  8. 119
      lib/community/headlines/headlines_banner.dart
  9. 166
      lib/community/headlines/headlines_collection.dart
  10. 344
      lib/community/headlines/headlines_column_details.dart
  11. 4
      lib/main.dart
  12. 6
      lib/mine/mine_page.dart
  13. 558
      lib/mine/mine_vip/legal_right_details.dart
  14. 49
      lib/mine/mine_vip/mine_attainment_page.dart
  15. 850
      lib/mine/mine_vip/mine_vip_core.dart
  16. 2
      lib/mine/mine_vip_level_page.dart
  17. 7
      lib/mine/recharge_page.dart
  18. 173
      lib/order/exchange_order_page.dart
  19. 77
      lib/order/order_view/order_commodity.dart
  20. 203
      lib/retrofit/data/achievement_detail_list.dart
  21. 99
      lib/retrofit/data/headlines_list.dart
  22. 99
      lib/retrofit/data/headlines_list_details.dart
  23. 5
      lib/retrofit/data/order_info.dart
  24. 8
      lib/retrofit/data/settleOrderInfo.dart
  25. 264
      lib/retrofit/data/shoppingCart.dart
  26. 19
      lib/retrofit/retrofit_api.dart
  27. 69
      lib/retrofit/retrofit_api.g.dart
  28. 3
      lib/settlement/settlement.dart
  29. 20
      lib/store/store_order.dart
  30. 2
      lib/view_widget/item_input_widget.dart
  31. 16
      lib/view_widget/mine_vip_view.dart
  32. 131
      lib/view_widget/receiving_method_dialog.dart
  33. 4
      lib/view_widget/vip_dialog.dart

5
lib/address/edit_address_page.dart

@ -82,7 +82,7 @@ class _EditAddressPage extends State<EditAddressPage> {
bottomRight: Radius.circular(8),
),
),
child: Column(
child: Expanded(child:Column(
children: [
editItem(
S.of(context).xingming,
@ -114,7 +114,8 @@ class _EditAddressPage extends State<EditAddressPage> {
houseNumberController,
false),
],
),
),),
),
InkWell(
onTap: () {

107
lib/article/hot_article_item.dart

@ -1,26 +1,31 @@
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/article.dart';
import 'package:huixiang/retrofit/data/banner.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/page.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/hot_item.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class HotArticlePage extends StatefulWidget {
class TouTiao extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _HotArticlePage();
return _TouTiao();
}
}
class _HotArticlePage extends State<HotArticlePage> {
class _TouTiao extends State<TouTiao> {
ApiService apiService;
List<BannerData> bannerData = [];
@override
void dispose() {
@ -33,9 +38,9 @@ class _HotArticlePage extends State<HotArticlePage> {
super.initState();
SharedPreferences.getInstance().then((value) => {
apiService = ApiService(Dio(), context: context, token: value.getString("token")),
queryArticle(),
});
apiService = ApiService(Dio(), context: context, token: value.getString("token")),
queryArticle(),
});
}
int pageNum = 1;
@ -78,6 +83,33 @@ class _HotArticlePage extends State<HotArticlePage> {
}
}
///banner
queryCourseBanner() async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
}
BaseData<PageInfo<BannerData>> baseData =
await apiService.queryBanner({
"model": {"type": "COURSE_BANNER"},
}).catchError((onError) {
refreshController.refreshFailed();
});
if (baseData != null && baseData.isSuccess) {
bannerData.clear();
bannerData.addAll(baseData.data.records);
refreshController.refreshCompleted();
} else {
refreshController.refreshFailed();
// SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
EasyLoading.dismiss();
}
@override
Widget build(BuildContext context) {
return Scaffold(
@ -89,35 +121,40 @@ class _HotArticlePage extends State<HotArticlePage> {
// titleSize: 18.sp,
// ),
body: Container(
child: SmartRefresher(
controller: refreshController,
enablePullDown: true,
enablePullUp: true,
physics: BouncingScrollPhysics(),
header: MyHeader(),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
onRefresh: _onRefresh,
onLoading: queryArticle,
child: ListView.builder(
itemCount: articles.length,
physics: NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical,
itemBuilder: (context, position) {
return AspectRatio(
aspectRatio: position == 0 ? 1.38 : 2.56,
child: Container(
height: position == 0 ? 247.h : 96.h,
margin: EdgeInsets.symmetric(vertical:6.h, horizontal: 16.w),
child:
HotArticleItem(article: articles[position], isHot: position == 0),
),
);
},
),
child: Column(
children: [
SmartRefresher(
controller: refreshController,
enablePullDown: true,
enablePullUp: true,
physics: BouncingScrollPhysics(),
header: MyHeader(),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
onRefresh: _onRefresh,
onLoading: queryArticle,
child: ListView.builder(
itemCount: articles.length,
physics: NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical,
itemBuilder: (context, position) {
return AspectRatio(
aspectRatio: position == 0 ? 1.38 : 2.56,
child: Container(
height: position == 0 ? 247.h : 96.h,
margin: EdgeInsets.symmetric(vertical:6.h, horizontal: 16.w),
child:
HotArticleItem(article: articles[position], isHot: position == 0),
),
);
},
),
),
],
),
),
);

4
lib/community/community_page.dart

@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:huixiang/article/hot_article_item.dart';
import 'package:huixiang/community/community_child_page.dart';
import 'package:huixiang/home/huixiang_brand_page.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
@ -8,6 +7,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/my_tab.dart';
import 'community_course.dart';
import 'headlines/article_page.dart';
class CommunityPage extends StatefulWidget {
@override
@ -97,7 +97,7 @@ class _CommunityPage extends State<CommunityPage>
if (e == "关于我们") {
return BrandPage();
}else if(e == "头条"){
return HotArticlePage();
return ArticlePage();
}else if(e == "课程"){
return CommunityCourse();
}

1
lib/community/community_view/class_details.dart

@ -335,7 +335,6 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
),
flex: 1,
),
///
InputComment(
inputKey,

1
lib/community/community_view/home_class.dart

@ -225,7 +225,6 @@ class _HomeClass extends State<HomeClass> {
),
),
],),
],
),
Expanded(child:

176
lib/community/headlines/article_list.dart

@ -0,0 +1,176 @@
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/article.dart';
import 'package:huixiang/retrofit/data/banner.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/page.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/hot_item.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/my_footer.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class ArticleList extends StatefulWidget {
final List<Article> articles;
ArticleList(this.articles,);
@override
State<StatefulWidget> createState() {
return _ArticleList();
}
}
class _ArticleList extends State<ArticleList> {
ApiService apiService;
@override
void initState() {
super.initState();
SharedPreferences.getInstance().then((value) => {
apiService = ApiService(Dio(),
context: context, token: value.getString("token")),
});
}
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.only(top:20,left:16,right: 16),
child:Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Padding(padding:EdgeInsets.only(bottom: 12),
child:Text(
"最新文章",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.medium,
color: Colors.black,
),
)),
ListView.builder(
padding: EdgeInsets.zero,
itemCount: widget.articles.length,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
Navigator.of(context).pushNamed(
'/router/web_page',
arguments: {"articleId": widget.articles[position].id});
widget.articles[position].viewers = (widget.articles[position].viewers + 1);
setState(() {});
},
child: articleItem(widget.articles[position],position),
);
},
),
],
));
}
Widget articleItem(Article articles,position) {
return Container(
width: double.infinity,
padding: EdgeInsets.all(16),
margin: EdgeInsets.only(bottom: 12),
color: Colors.white,
child:Row(
children: [
Expanded(child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Text(
widget?.articles[position]?.mainTitle ?? "",
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
color: Colors.black,
),
),
SizedBox(height:5),
Text(
widget?.articles[position]?.viceTitle ?? "",
// overflow: TextOverflow.ellipsis,
// maxLines: 1,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF353535),
),
),
SizedBox(height: 10),
Row(
children: [
Text(
(widget.articles[position] != null &&
widget.articles[position].author != null)
? widget.articles[position].author.name
: "",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF8E8E8E),
),
),
SizedBox(width:8),
Image.asset(
"assets/image/browse.png",
width: 14,
height: 14,
color: Color(0xFF808080),
),
Expanded(child: Text(
"${widget?.articles[position]?.viewers}"
?? "",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF8D8D8D),
),
)),
Text(
widget?.articles[position]?.createTime?.split(" ")[0]
?? "",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF8D8D8D),
),
),
],
),
],
),),
SizedBox(width:12),
MImage(
widget?.articles[position]?.coverImg ?? "",
fit: BoxFit.cover,
radius: BorderRadius.all(Radius.circular(2)),
width:96,
height:96,
),
],
),
);
}
}

239
lib/community/headlines/article_page.dart

@ -0,0 +1,239 @@
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:huixiang/community/headlines/headlines_banner.dart';
import 'package:huixiang/community/headlines/headlines_collection.dart';
import 'package:huixiang/main.dart';
import 'package:huixiang/retrofit/data/article.dart';
import 'package:huixiang/retrofit/data/banner.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/brand.dart';
import 'package:huixiang/retrofit/data/category_select_list.dart';
import 'package:huixiang/retrofit/data/collect_class_list.dart';
import 'package:huixiang/retrofit/data/course_list.dart';
import 'package:huixiang/retrofit/data/headlines_list.dart';
import 'package:huixiang/retrofit/data/headlines_list_details.dart';
import 'package:huixiang/retrofit/data/page.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/event_type.dart';
import 'package:huixiang/view_widget/classic_header.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/store_title_tab.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'article_list.dart';
class ArticlePage extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _ArticlePage();
}
}
class _ArticlePage extends State<ArticlePage>
with SingleTickerProviderStateMixin, AutomaticKeepAliveClientMixin {
final ScrollController scrollController = ScrollController();
final RefreshController refreshController = RefreshController();
ApiService apiService;
List<GlobalKey> globaKeys = [];
List<Brand> brands = [];
List<BannerData> bannerData = [];
List<Article> articles = [];
List<HeadlinesList> headlines = [];
int pageNum = 1;
@override
void initState() {
super.initState();
eventBus.on<EventType>().listen((event) {
print("object: ArticlePage");
if (event.type < 3) {
setState(() {});
}
});
queryArticleList();
queryHeadlinesBanner();
queryHeadlinesList();
}
@override
void dispose() {
super.dispose();
refreshController.dispose();
}
///banner
queryHeadlinesBanner() async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
}
BaseData<PageInfo<BannerData>> baseData =
await apiService.queryBanner({
"model": {"type": "INFORMATION"},
}).catchError((onError) {
refreshController.refreshFailed();
});
if (baseData != null && baseData.isSuccess) {
bannerData.clear();
bannerData.addAll(baseData.data.records);
refreshController.refreshCompleted();
} else {
refreshController.refreshFailed();
// SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
EasyLoading.dismiss();
}
///
queryArticleList() async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
}
BaseData<PageInfo<Article>> baseData = await apiService.queryArticle({
"pageNum": pageNum,
"pageSize": 10,
"searchKey": "",
"state": 1,
"type": 2
}).catchError((onError){
refreshController.refreshFailed();
refreshController.loadFailed();
});
if (baseData != null && baseData.isSuccess) {
refreshController.refreshCompleted();
refreshController.loadComplete();
if(pageNum == 1) {
articles.clear();
}
articles.addAll(baseData.data.list);
if (baseData.data.pageNum == baseData.data.pages) {
refreshController.loadNoData();
} else {
pageNum += 1;
}
setState(() {});
} else {
refreshController.refreshFailed();
refreshController.loadFailed();
}
}
///
queryHeadlinesList() async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
}
BaseData<List<HeadlinesList>> baseData = await apiService.headlinesList().catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
setState(() {
headlines.clear();
headlines.addAll(baseData.data);
headlines.forEach((element) {
// collectCourse(element.id);
});
});
}
EasyLoading.dismiss();
}
_onRefresh(){
queryHeadlinesBanner();
queryHeadlinesList();//
}
@override
Widget build(BuildContext context) {
super.build(context);
return
Stack(
children: [
Positioned(
child: Container(
child: SmartRefresher(
controller: refreshController,
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
physics: ClampingScrollPhysics(),
onRefresh: _onRefresh,
scrollController: scrollController,
child: Container(
child: SingleChildScrollView(
physics: NeverScrollableScrollPhysics(),
child: Container(
color: Color(0xFFF7F7F7),
margin: EdgeInsets.only(top: 16.h),
child: Column(
children: classChildItem(),
),
),
),
),
),
),
bottom:0,
top: 0,
left: 0,
right: 0,
),
if (brands != null && brands.length > 0)
Positioned(
child: Container(
color: Colors.white,
child: StoreTitleTab(
brands,
globaKeys,
scrollController,
isScroll: true,
),
),
top: 0,
left: 0,
right: 0,
),
],
);
}
List<Widget> classChildItem() {
var widgets = <Widget>[
///banner
HeadlinesBanner(bannerData,),
SizedBox(height: 28),
///
HeadlinesCollection(headlines,articles),
///
ArticleList(articles),
];
return widgets;
}
@override
bool get wantKeepAlive => true;
}

119
lib/community/headlines/headlines_banner.dart

@ -0,0 +1,119 @@
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:huixiang/retrofit/data/banner.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/page.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
class HeadlinesBanner extends StatefulWidget {
final List<BannerData> bannerData;
HeadlinesBanner(this.bannerData);
@override
State<StatefulWidget> createState() {
return _HeadlinesBanner();
}
}
class _HeadlinesBanner extends State<HeadlinesBanner> {
ApiService apiService;
final RefreshController refreshController = RefreshController();
List<BannerData> bannerData = [];
@override
Widget build(BuildContext context) {
return Container(
child: AspectRatio(
aspectRatio: 2.08,
child: Swiper(
viewportFraction: 0.88,
scale: 0.93,
pagination: SwiperPagination(
alignment: Alignment.bottomCenter,
builder: DotSwiperPaginationBuilder(
size: 8,
activeSize: 8,
space: 5,
activeColor: Colors.black,
color: Colors.black.withAlpha(76),
),
),
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return InkWell(
onTap: () {
bannerClick(widget.bannerData[position]);
},
child: MImage(
(widget.bannerData != null && position < widget.bannerData.length)
? widget.bannerData[position].imgUrl
: "",
fit: BoxFit.cover,
radius: BorderRadius.circular(8),
errorSrc: "assets/image/default_2_1.png",
fadeSrc: "assets/image/default_2_1.png",
),
);
},
itemCount: (widget.bannerData != null && widget.bannerData.length > 0)
? widget.bannerData.length
: 1),
),
);
}
/// contentType 0123,4:,5:
bannerClick(BannerData bannerData) async {
switch (bannerData.contentType) {
case 1:
Navigator.of(context).pushNamed('/router/integral_store_page',
arguments: {"goodsId": bannerData.content});
break;
case 2:
Navigator.of(context)
.pushNamed('/router/web_page', arguments: {
"activityId": bannerData.content,
});
break;
case 3:
Navigator.of(context)
.pushNamed('/router/web_page', arguments: {
"articleId": bannerData.content,
});
break;
case 4:
String router = bannerData.content;
if (router.contains("?")) {
String params = router.substring(router.indexOf("?"));
params = params.replaceAll("?", "");
Map map = jsonDecode(params);
Navigator.of(context).pushNamed(router, arguments: map);
} else {
Navigator.of(context).pushNamed(router);
}
break;
case 5:
Navigator.of(context)
.pushNamed('/router/class_details', arguments: {
"id": bannerData.content,
});
break;
}
}
}

166
lib/community/headlines/headlines_collection.dart

@ -0,0 +1,166 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart';
import 'package:huixiang/retrofit/data/article.dart';
import 'package:huixiang/retrofit/data/collect_class_list.dart';
import 'package:huixiang/retrofit/data/course_list.dart';
import 'package:huixiang/retrofit/data/headlines_list.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class HeadlinesCollection extends StatefulWidget {
final List<HeadlinesList> headlines;
final List<Article> articles;
HeadlinesCollection(this.headlines,this.articles);
@override
State<StatefulWidget> createState() {
return _HeadlinesCollection();
}
}
class _HeadlinesCollection extends State<HeadlinesCollection> {
ApiService apiService;
BMFCoordinate latLng;
final TextEditingController editingController = TextEditingController();
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return Container(
height: 100,
margin: EdgeInsets.only(top:10),
child: ListView.builder(
scrollDirection: Axis.horizontal,
physics: BouncingScrollPhysics(),
padding: EdgeInsets.symmetric(horizontal: 10),
itemCount:widget.headlines == null ? 0 : widget.headlines.length,
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
Navigator.of(context).pushNamed(
'/router/headlines_column_details',
arguments: {"id":widget.headlines[position].id,
"articles":widget.articles});
},
child: headlinesCollectionItem(widget.headlines[position]),
);
},
),
);
}
Widget headlinesCollectionItem(HeadlinesList headlines) {
return Container(
width: 225.w,
height:110.h,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(10),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
color: Colors.black,
),
margin: EdgeInsets.symmetric(
horizontal:6,
),
child: Stack(
children: [
ClipRRect(
child: Opacity(
opacity: 0.8,
child: MImage(
headlines?.coverImg ?? "",
width: 225.w,
height: 110.h,
fit: BoxFit.fill,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
),
),
borderRadius: BorderRadius.vertical(
top: Radius.circular(4),
),
),
Container(
padding: EdgeInsets.all(12),
child: Column(children: [
Expanded(child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Container(
margin: EdgeInsets.only(right:4),
padding:EdgeInsets.only(left:2,right:2),
height: 16.h,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(2),
color: Color(0xFF32A060),
),
child: Text(
"专栏",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),
),
Expanded(child:Text(
headlines?.name ?? "",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
color: Colors.white,
),
),),
],)),
Row(
children: [
Expanded(child:Text(
"更新3篇",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
)),
Text(
"查看专栏",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Colors.white,
),
),
SizedBox(width: 2),
Image.asset(
"assets/image/t_right.png",
width: 14,
height: 14,
),
],),
],),
),
],
),
);
}
}

344
lib/community/headlines/headlines_column_details.dart

@ -0,0 +1,344 @@
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:huixiang/retrofit/data/article.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/headlines_list.dart';
import 'package:huixiang/retrofit/data/headlines_list_details.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:shared_preferences/shared_preferences.dart';
class HeadlinesColumnDetails extends StatefulWidget {
final Map<String, dynamic> arguments;
HeadlinesColumnDetails({this.arguments});
@override
State<StatefulWidget> createState() {
return _HeadlinesColumnDetails();
}
}
class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
with WidgetsBindingObserver {
ApiService apiService;
List<Article> articles;
HeadlinesListDetails headlinesListDetails;
List<HeadlinesList> headlines = [];
@override
void initState() {
super.initState();
articles = widget.arguments["articles"];
WidgetsBinding.instance.addObserver(this);
queryHeadlinesDetails(widget.arguments["id"]);
queryHeadlinesList(widget.arguments["id"]);
}
///
queryHeadlinesDetails(id) async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
}
BaseData<HeadlinesListDetails> baseData =
await apiService.headlinesDetails(id).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
setState(() {
headlinesListDetails = baseData.data;
});
}
}
///
queryHeadlinesList(id) async {
if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
);
}
BaseData<List<HeadlinesList>> baseData = await apiService.headlinesList().catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
setState(() {
headlines.clear();
headlines.addAll(baseData.data);
headlines.forEach((element) {
// collectCourse(element.id);
});
});
}
EasyLoading.dismiss();
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
child: Column(
children: [
Expanded(
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
children: [
Stack(
alignment: Alignment.bottomCenter,
children: [
Stack(
children: [
Positioned(child:
MImage(
headlinesListDetails?.coverImg ?? "",
width:double.infinity,
height: 260.h,
fit: BoxFit.cover,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
),
),
Container(
margin: EdgeInsets.only(
top: 50.h, left: 16.w, right: 16.w),
decoration: BoxDecoration(
color: Colors.transparent,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
GestureDetector(
child: Image.asset(
"assets/image/integral_return.png",
width: 24,
height: 24,
),
onTap: () {
Navigator.of(context).pop();
},
),
],
),
),
],
),
Container(
child: Column(
children: [
Padding(padding:EdgeInsets.only(left: 16),
child:Row(
children: [
Container(
margin: EdgeInsets.only(right:4),
padding:EdgeInsets.only(left:2,right:2),
height:20.h,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(2),
color: Color(0xFF32A060),
),
child: Text(
"专栏",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),
),
SizedBox(
width: 6.w,
),
Expanded(
child: Text(
headlinesListDetails?.name ?? "",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 18.sp,
fontWeight: MyFontWeight.semi_bold,
color: Colors.white,
),
),
flex: 1,
)
],
),),
Container(
width: double.infinity,
decoration: BoxDecoration(
border: Border.all(
width: 0,
color: Colors.white,
),
color: Colors.white,
borderRadius: new BorderRadius.only(
topLeft: Radius.circular(8.0),
topRight: Radius.circular(8.0),
),
),
margin: EdgeInsets.only(top: 16),
// padding: EdgeInsets.all(16),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(padding:EdgeInsets.all(16),
child: Text(
"简介:${headlinesListDetails?.introduce ?? ""}",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.medium ,
color: Colors.black,
),
)),
],
),
),
],
),
),
],
),
ListView.builder(
padding: EdgeInsets.zero,
itemCount:headlines == null ? 0 : headlines.length,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
Navigator.of(context).pushNamed(
'/router/web_page',
arguments: {"articleId": articles[position].id});
articles[position].viewers = (articles[position].viewers + 1);
setState(() {}
);
},
child: articleColumnItem(articles[position]),
);
},
),
],
),
),
flex: 1,
),
],
),
),
);
}
Widget articleColumnItem(Article articles) {
return Container(
width: double.infinity,
// padding: EdgeInsets.all(16),
color: Colors.white,
child:Column(
children: [
Container(
// margin: EdgeInsets.only(top: 16,bottom: 16),
width: double.infinity,
height: 0.5.h,
color: Color(0xFFF5F5F5),
),
Padding(padding: EdgeInsets.all(16),
child:Row(
children: [
Expanded(child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Text(
articles?.mainTitle ?? "",
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
color: Colors.black,
),
),
SizedBox(height:5),
Text(
articles?.viceTitle ?? "",
// overflow: TextOverflow.ellipsis,
// maxLines: 1,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF353535),
),
),
SizedBox(height: 10),
Row(
children: [
Text(
(articles != null &&
articles.author != null)
? articles.author.name
: "",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF8E8E8E),
),
),
SizedBox(width:8),
Image.asset(
"assets/image/browse.png",
width: 14,
height: 14,
color: Color(0xFF808080),
),
Expanded(child: Text(
"${articles?.viewers}"
?? "",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF8D8D8D),
),
)),
Text(
articles?.createTime ?? "",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF8D8D8D),
),
),
],
),
],
),),
SizedBox(width:12),
MImage(
articles?.coverImg ?? "",
fit: BoxFit.cover,
radius: BorderRadius.all(Radius.circular(2)),
width:96,
height:96,
),
],
)),
],
),
);
}
}

4
lib/main.dart

@ -71,6 +71,7 @@ import 'package:tpns_flutter_plugin/tpns_flutter_plugin.dart';
import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart';
import 'community/community_view/class_details.dart';
import 'community/headlines/headlines_column_details.dart';
import 'home/guide_page.dart';
import 'home/home_view/activity_list.dart';
import 'main_page.dart';
@ -298,7 +299,7 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
'/router/founder_story_page': (context, {arguments}) => FounderStoryPage(),
'/router/system_msg_page': (context, {arguments}) => SystemMessagePage(),
'/router/edit_remarks_page': (context, {arguments}) => EditRemarksPage(),
'/router/hot_article_page': (context, {arguments}) => HotArticlePage(),
// '/router/hot_article_page': (context, {arguments}) => HotArticlePage(),
'/router/address_map_page': (context, {arguments}) => AddressMapPage(),
'/router/roll_center_page': (context, {arguments}) => RollCenterPage(),
'/router/release_dynamic': (context, {arguments}) => ReleaseDynamic(),
@ -324,4 +325,5 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
'/router/activity_list': (context, {arguments}) => ActivityList(),
'/router/class_details': (context, {arguments}) => ClassDetails(arguments: arguments),
'/router/mine_attainment_page': (context, {arguments}) => MineAttainmentPage(arguments: arguments),
'/router/headlines_column_details': (context, {arguments}) => HeadlinesColumnDetails(arguments: arguments),
};

6
lib/mine/mine_page.dart

@ -196,10 +196,8 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
tag: "vip",
ranks: ranks,
userInfo: userInfo,
rank: (userInfo != null)
? int.tryParse(userInfo.expendAmount)
: 0,
rankMax: userInfo?.memberRankVo?.rankOrigin??0,
rank: double.tryParse(userInfo?.expendAmount??"0").toInt(),
rankMax: userInfo?.memberRankVo?.nextOrigin??0,
createTime: userInfo?.createTime??"",
),
],

558
lib/mine/mine_vip/legal_right_details.dart

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -37,6 +39,7 @@ class _LegalRightDetails extends State<LegalRightDetails> {
int checkIndex = 0;
ScrollController _scrollController = ScrollController();
List<SecondCardList> secondCardList = [];
bool offsetOnEnd = false;
@override
void initState() {
@ -45,7 +48,7 @@ class _LegalRightDetails extends State<LegalRightDetails> {
apiService =
ApiService(Dio(), context: context, token: value.getString("token"));
});
vipBenefitList = widget.arguments["vipBenefitList"];
vipBenefitList.addAll(widget.arguments["vipBenefitList"]);
querySecondCardList();
}
@ -59,12 +62,13 @@ class _LegalRightDetails extends State<LegalRightDetails> {
token: value.getString("token"),
);
}
BaseData<List<SecondCardList>> baseData = await apiService.secondCardList().catchError((onError) {});
BaseData<List<SecondCardList>> baseData =
await apiService.secondCardList().catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
setState(() {
secondCardList.clear();
secondCardList.addAll(baseData.data);
if(secondCardList.length < 5){
if (secondCardList.length < 5) {
var isSecondCard = SecondCardList();
isSecondCard.isAdd = true;
secondCardList.add(isSecondCard);
@ -74,7 +78,6 @@ class _LegalRightDetails extends State<LegalRightDetails> {
EasyLoading.dismiss();
}
///
queryUnbindSecondCard(phone) async {
if (apiService == null) {
@ -110,18 +113,18 @@ class _LegalRightDetails extends State<LegalRightDetails> {
Container(
height: 130,
padding: EdgeInsets.only(top: 24),
margin: EdgeInsets.only(
left: (MediaQuery.of(context).size.width / 2 -
48 -
checkIndex * 85) <
0
? 0
: (MediaQuery.of(context).size.width / 2 -
48 -
checkIndex * 85)),
// margin: EdgeInsets.only(
// left: (MediaQuery.of(context).size.width / 2 -
// 48 -
// checkIndex * 85) <
// 0
// ? 0
// : (MediaQuery.of(context).size.width / 2 -
// 48 -
// checkIndex * 85)),
child: ListView.builder(
scrollDirection: Axis.horizontal,
physics: BouncingScrollPhysics(),
physics: NeverScrollableScrollPhysics(),
controller: _scrollController,
shrinkWrap: true,
padding: EdgeInsets.symmetric(horizontal: 10),
@ -130,9 +133,30 @@ class _LegalRightDetails extends State<LegalRightDetails> {
return GestureDetector(
onTap: () {
setState(() {
checkIndex = position;
// _scrollController.animateTo((MediaQuery.of(context).size.width/2-48-checkIndex*85)
// >0?0:checkIndex*85, duration: new Duration(seconds: 1), curve: Curves.ease);
if (checkIndex == position) return;
offsetOnEnd = position - checkIndex < 0 && position != 0;
int jumpIndex = (position - checkIndex).abs();
int maxCountInWidth =
MediaQuery.of(context).size.width ~/ 80;
int tempPosition = checkIndex;
for (var i = 0; i < jumpIndex; i++) {
if (position - checkIndex < 0)
tempPosition -= 1;
else
tempPosition += 1;
checkIndex = tempPosition;
if (tempPosition <=
vipBenefitList.length - maxCountInWidth) {
if (tempPosition != 0)
_scrollController.jumpTo((_scrollController.offset +
(offsetOnEnd ? -85 : 85))
.toDouble());
} else {
_scrollController.jumpTo(
((vipBenefitList.length - maxCountInWidth) * 85)
.toDouble());
}
}
});
},
child: legalRightItem(vipBenefitList[position], position),
@ -140,28 +164,8 @@ class _LegalRightDetails extends State<LegalRightDetails> {
},
),
),
Container(
alignment: Alignment.center,
width: 33,
height: 16,
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: 0,
color: Color(0xFFFFF6E9),
),
),
),
child: Image.asset(
"assets/image/jian_j.png",
width: 33,
height: 16,
color: Color(0xFFFFF6E9),
fit: BoxFit.fill,
),
),
Expanded(child: Container(
padding: EdgeInsets.only(left: 16, right: 49),
Expanded(
child: Container(
decoration: BoxDecoration(
border: Border.all(
width: 0,
@ -244,82 +248,48 @@ class _LegalRightDetails extends State<LegalRightDetails> {
),
],
),
Text(
S.of(context).quanyijishao,
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 14.sp,
color: Color(0xFF674119),
),
),
SizedBox(
height: 8.h,
),
if (vipBenefitList[checkIndex]?.introduce != null &&
vipBenefitList[checkIndex].introduce != "")
Container(
color: Color(0xFFFFF6E9),
child: Html(
data: vipBenefitList[checkIndex]?.describes ?? "",
style: {
"html": Style(
color: Color(0xFF674119),
),
},
customImageRenders: {
networkSourceMatcher(): networkImageRender(
loadingWidget: () {
return Container();
},
),
},
),
),
SizedBox(
height: 20,
),
Text(
S.of(context).quanyishuoming,
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 14.sp,
color: Color(0xFF674119),
),
),
SizedBox(
height: 8,
),
if (vipBenefitList[checkIndex]?.describes != null &&
vipBenefitList[checkIndex].describes != "")
Container(
color: Color(0xFFFFF6E9),
child: Html(
data: vipBenefitList[checkIndex]?.describes ?? "",
style: {
"html": Style(
color: Color(0xFF674119),
),
},
customImageRenders: {
networkSourceMatcher(): networkImageRender(
loadingWidget: () {
return Container();
},
),
},
),
),
SizedBox(
height: 20,
),
if(vipBenefitList[checkIndex].name == "副卡" && vipBenefitList[checkIndex].actived && vipBenefitList[checkIndex].have)
Container(
padding: EdgeInsets.only(left: 16, right: 49),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"${S.of(context).yibangfuka}(${secondCardList.length - (secondCardList.length >= 5 && !(secondCardList.last.isAdd ?? false) ? 0 :1 )}/5)",
S.of(context).quanyijishao,
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 14.sp,
color: Color(0xFF674119),
),
),
SizedBox(
height: 8.h,
),
if (vipBenefitList[checkIndex]?.introduce != null &&
vipBenefitList[checkIndex].introduce != "")
Container(
color: Color(0xFFFFF6E9),
child: Html(
data: vipBenefitList[checkIndex]?.describes ?? "",
style: {
"html": Style(
color: Color(0xFF674119),
),
},
customImageRenders: {
networkSourceMatcher(): networkImageRender(
loadingWidget: () {
return Container();
},
),
},
),
),
SizedBox(
height: 20,
),
Text(
S.of(context).quanyishuoming,
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 14.sp,
@ -329,7 +299,52 @@ class _LegalRightDetails extends State<LegalRightDetails> {
SizedBox(
height: 8,
),
assistant(),
if (vipBenefitList[checkIndex]?.describes != null &&
vipBenefitList[checkIndex].describes != "")
Container(
color: Color(0xFFFFF6E9),
child: Html(
data: vipBenefitList[checkIndex]?.describes ?? "",
style: {
"html": Style(
color: Color(0xFF674119),
),
},
customImageRenders: {
networkSourceMatcher(): networkImageRender(
loadingWidget: () {
return Container();
},
),
},
),
),
SizedBox(
height: 20,
),
if (vipBenefitList[checkIndex].name == "副卡" &&
vipBenefitList[checkIndex].actived &&
vipBenefitList[checkIndex].have)
Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
"${S.of(context).yibangfuka}(${secondCardList.length - (secondCardList.length >= 5 && !(secondCardList.last.isAdd ?? false) ? 0 : 1)}/5)",
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 14.sp,
color: Color(0xFF674119),
),
),
SizedBox(
height: 8,
),
assistant(),
],
),
),
],
),
),
@ -432,100 +447,124 @@ class _LegalRightDetails extends State<LegalRightDetails> {
///
Widget legalRightItem(VipBenefitList vipBenefitList, index) {
return Opacity(
opacity: index == checkIndex ? 1 : 0.6,
child: Container(
width: 80,
alignment: Alignment.center,
child: Column(
children: [
Stack(
alignment: Alignment.bottomCenter,
return Column(
children: [
Expanded(
child: Opacity(
opacity: index == checkIndex ? 1 : 0.6,
child: Container(
width: 80,
alignment: Alignment.center,
child: Column(
children: [
MImage(
vipBenefitList?.icon ?? "",
width: 50,
height: 50,
// fit: BoxFit.cover,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
),
if(!vipBenefitList.actived)
Container(
decoration: new BoxDecoration(
color: Color(0xFFA29E9E),
borderRadius: BorderRadius.circular(7.0),
Stack(
alignment: Alignment.bottomCenter,
children: [
MImage(
vipBenefitList?.icon ?? "",
width: 50,
height: 50,
// fit: BoxFit.cover,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
),
width: 52.w,
height: 15.h,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.lock,
color: Color(0xFFFFDCA1),
size: 10,
if (!vipBenefitList.actived)
Container(
decoration: new BoxDecoration(
color: Color(0xFFA29E9E),
borderRadius: BorderRadius.circular(7.0),
),
Text(
"暂未开放",
style: TextStyle(
color: Color(0xFFFFDCA1),
fontWeight: MyFontWeight.regular,
fontSize: 9.sp,
),
width: 52.w,
height: 15.h,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.lock,
color: Color(0xFFFFDCA1),
size: 10,
),
Text(
"暂未开放",
style: TextStyle(
color: Color(0xFFFFDCA1),
fontWeight: MyFontWeight.regular,
fontSize: 9.sp,
),
),
],
),
],
),
),
if(!vipBenefitList.actived && !vipBenefitList.have)
Container(
decoration: new BoxDecoration(
color: Color(0xFFA29E9E),
borderRadius: BorderRadius.circular(7.0),
),
width: 52.w,
height: 15.h,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.lock,
color: Color(0xFFFFDCA1),
size: 10,
),
if (!vipBenefitList.actived && !vipBenefitList.have)
Container(
decoration: new BoxDecoration(
color: Color(0xFFA29E9E),
borderRadius: BorderRadius.circular(7.0),
),
Text(
"暂未解锁",
style: TextStyle(
color: Color(0xFFFFDCA1),
fontWeight: MyFontWeight.regular,
fontSize: 9.sp,
),
width: 52.w,
height: 15.h,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.lock,
color: Color(0xFFFFDCA1),
size: 10,
),
Text(
"暂未解锁",
style: TextStyle(
color: Color(0xFFFFDCA1),
fontWeight: MyFontWeight.regular,
fontSize: 9.sp,
),
),
],
),
],
),
),
],
),
SizedBox(
height: 8.h,
),
Text(
vipBenefitList.name,
maxLines: 2,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
),
),
],
),
SizedBox(
height: 8.h,
),
Text(
vipBenefitList.name,
maxLines: 2,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
),
)),
if (index == checkIndex)
Container(
width: 33,
height: 16,
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: 0,
color: Color(0xFFFFF6E9),
),
),
),
],
),
),
child: Image.asset(
"assets/image/jian_j.png",
width: 33,
height: 16,
color: Color(0xFFFFF6E9),
fit: BoxFit.fill,
),
),
],
);
}
@ -534,7 +573,7 @@ class _LegalRightDetails extends State<LegalRightDetails> {
return Column(
children: [
GridView.builder(
itemCount:secondCardList == null ? 0 : secondCardList.length,
itemCount: secondCardList == null ? 0 : secondCardList.length,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
@ -561,73 +600,74 @@ class _LegalRightDetails extends State<LegalRightDetails> {
Widget assistantItem(SecondCardList secondCardList) {
return Container(
alignment: Alignment.center,
child: !(secondCardList.isAdd ?? false) ? Column(
children: [
Stack(
alignment: Alignment.bottomRight,
children: [
MImage(
secondCardList?.headimg ?? "",
width: 50,
height: 50,
isCircle: true,
fit: BoxFit.cover,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
),
GestureDetector(
onTap: () {
setState(() {
unbindShowDeleteDialog(secondCardList.phone);
});
},
child: Image.asset(
"assets/image/fuka_j.png",
width: 24,
height: 24,
fit: BoxFit.cover,
child: !(secondCardList.isAdd ?? false)
? Column(
children: [
Stack(
alignment: Alignment.bottomRight,
children: [
MImage(
secondCardList?.headimg ?? "",
width: 50,
height: 50,
isCircle: true,
fit: BoxFit.cover,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
),
GestureDetector(
onTap: () {
setState(() {
unbindShowDeleteDialog(secondCardList.phone);
});
},
child: Image.asset(
"assets/image/fuka_j.png",
width: 24,
height: 24,
fit: BoxFit.cover,
),
),
],
),
),
],
),
SizedBox(
height: 5.h,
),
Text(
AppUtils.phoneEncode(secondCardList?.phone ?? ""),
style: TextStyle(
color: Color(0xFF79572D),
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
),
),
],
):
GestureDetector(
onTap: (){
Navigator.of(context).pushNamed('/router/binding_assistant_card').then((value) =>{
querySecondCardList()
});
},
child:Column(
children: [
Image.asset(
"assets/image/fuka_zj.png",
width:50,
height:50,
fit: BoxFit.cover,
),
Text(
"添加新副卡",
style: TextStyle(
color: Color(0xFF79572D),
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
SizedBox(
height: 5.h,
),
Text(
AppUtils.phoneEncode(secondCardList?.phone ?? ""),
style: TextStyle(
color: Color(0xFF79572D),
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
),
),
],
)
: GestureDetector(
onTap: () {
Navigator.of(context)
.pushNamed('/router/binding_assistant_card')
.then((value) => {querySecondCardList()});
},
child: Column(
children: [
Image.asset(
"assets/image/fuka_zj.png",
width: 50,
height: 50,
fit: BoxFit.cover,
),
Text(
"添加新副卡",
style: TextStyle(
color: Color(0xFF79572D),
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
),
),
],
),
),
],
),
),
);
}
}

49
lib/mine/mine_vip/mine_attainment_page.dart

@ -38,6 +38,7 @@ class _MineAttainmentPage extends State<MineAttainmentPage> {
int checkPosition = 0;
SocialInfo infoNumber;
@override
void dispose() {
super.dispose();
@ -132,7 +133,7 @@ class _MineAttainmentPage extends State<MineAttainmentPage> {
child: Scaffold(
backgroundColor: Colors.transparent,
appBar: MyAppBar(
title: "我的成就",
title:S.of(context).wodechengjiu,
titleColor: Colors.black,
titleSize: 18.sp,
background: Colors.transparent,
@ -299,7 +300,7 @@ class _MineAttainmentPage extends State<MineAttainmentPage> {
return AlertDialog(
content: Container(
width: MediaQuery.of(context).size.width - 84,
height: 410.h,
height: 430.h,
child: Column(
children: [
GestureDetector(
@ -318,7 +319,8 @@ class _MineAttainmentPage extends State<MineAttainmentPage> {
),
),
MImage(
this.vipBadgesList[index].icon,
// this.vipBadgesList[index].icon,
achievementDetail[checkPosition].icon,
width: 150,
height: 150,
fit: BoxFit.cover,
@ -360,27 +362,28 @@ class _MineAttainmentPage extends State<MineAttainmentPage> {
color: Color(0xFF515151)),
),
SizedBox(width: 8),
Image.asset(
"assets/image/icon_gold_coin.png",
width: 14,
height: 14,
fit: BoxFit.cover,
),
SizedBox(width: 4),
Text(
vipBadgesList[index].eachReward.toString(),
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
color: Color(0xFF515151)),
Column(
crossAxisAlignment:CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children:
achievementDetail[checkPosition].rewardList != null
? achievementDetail[checkPosition].rewardList.map((e) {
return Text(
rewardStr(e),
style: TextStyle(
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
color: Color(0xFF515151)),
);
}).toList()
: [],
),
],
),
SizedBox(height: 5),
Expanded(
child: Container(
height: double.maxFinite,
margin: EdgeInsets.only(top: 24),
margin: EdgeInsets.only(top:14),
child: ListView.builder(
shrinkWrap: true,
scrollDirection: Axis.horizontal,
@ -411,6 +414,16 @@ class _MineAttainmentPage extends State<MineAttainmentPage> {
);
}
String rewardStr(RewardList rewardList){
if(rewardList.rewardType == 1)
return "积分:${rewardList.refId}";
else if(rewardList.rewardType == 2)
return "平台余额:${rewardList.refId}";
else if(rewardList.rewardType == 3)
return "平台兑换券:${rewardList.couponName}";
return "";
}
///
Widget badgeGradeItem(
AchievementDetailList achievementDetail, var position, var size) {

850
lib/mine/mine_vip/mine_vip_core.dart

@ -47,13 +47,16 @@ class _MineVipCore extends State<MineVipCore> {
super.initState();
SharedPreferences.getInstance().then((value) {
if(widget.arguments["rankLevel"] == 1 && !(value.getBool("FirstYinKa")??false)){
if (widget.arguments["rankLevel"] == 1 &&
!(value.getBool("FirstYinKa") ?? false)) {
showAlertDialog("银卡会员");
value.setBool("FirstYinKa", true);
}else if(widget.arguments["rankLevel"] == 2 && !(value.getBool("FirstJinKa")??false)){
} else if (widget.arguments["rankLevel"] == 2 &&
!(value.getBool("FirstJinKa") ?? false)) {
showAlertDialog("金卡会员");
value.setBool("FirstJinKa", true);
}else if(widget.arguments["rankLevel"] == 3 && !(value.getBool("FirstGongC")??false)){
} else if (widget.arguments["rankLevel"] == 3 &&
!(value.getBool("FirstGongC") ?? false)) {
showAlertDialog("共创会员");
value.setBool("FirstGongC", true);
}
@ -80,12 +83,13 @@ class _MineVipCore extends State<MineVipCore> {
///
queryBenefitList() async {
BaseData<List<VipBenefitList>> baseData = await apiService.benefitList().catchError((onError) {});
BaseData<List<VipBenefitList>> baseData =
await apiService.benefitList().catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
setState(() {
vipBenefitList.clear();
vipBenefitList.addAll(baseData.data);
vipBenefitList.sort((a,b)=>(a.sort).compareTo(b.sort));
vipBenefitList.sort((a, b) => (a.sort).compareTo(b.sort));
});
}
EasyLoading.dismiss();
@ -94,7 +98,7 @@ class _MineVipCore extends State<MineVipCore> {
//////
queryRuleDetails() async {
BaseData<VipRuleDetails> baseData =
await apiService.vipBenefit().catchError((onError) {});
await apiService.vipBenefit().catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
setState(() {
vipRuleDetails = baseData.data;
@ -105,7 +109,6 @@ class _MineVipCore extends State<MineVipCore> {
///
buyRank() async {
// if (!(await Min.isInitialize())) {
// app的充值支付使用同一个WXPayEntryActivity回调
// getPackage空指针
@ -113,8 +116,8 @@ class _MineVipCore extends State<MineVipCore> {
// await Min.initialize();
// }
BaseData<dynamic> baseData =
await apiService.rankBuy({"buyType": 2, "rankId":ranks[checkIndex].id});
BaseData<dynamic> baseData = await apiService
.rankBuy({"buyType": 2, "rankId": ranks[checkIndex].id});
if (baseData != null && baseData.isSuccess) {
WxPay wxPay = WxPay.fromJson(baseData.data);
await registerWxApi(
@ -133,380 +136,433 @@ class _MineVipCore extends State<MineVipCore> {
);
weChatResponseEventHandler.listen((event) async {
print("payCallback: ${event.errCode}");
if(event.errCode == 0){
if (event.errCode == 0) {
widget.arguments["rankLevel"] = ranks[checkIndex].level;
queryVipLevel();
showAlertDialog(ranks[checkIndex].rankName);
}
else{
} else {
SmartDialog.showToast("支付失败", alignment: Alignment.center);
return;
}
});
}
else{
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: MyAppBar(
title: S.of(context).huiyuanzhongxin,
titleColor: Colors.black,
titleSize: 18.sp,
background: Colors.transparent,
leadingColor: Colors.black,
action:widget?.arguments["userInfo"] != null ? Container(
alignment: Alignment.center,
margin: EdgeInsets.only(right: 16.w),
child: GestureDetector(
onTap: () {
Navigator.of(context).pushNamed('/router/integral_detailed_page');
},
child: Text(
"${S.of(context).dangqianzhukadengji} : ${widget?.arguments["userInfo"]??""}",
style: TextStyle(
color: Colors.black,
fontSize: 16.sp,
fontWeight: MyFontWeight.bold,
),
return Stack(
children: [
Container(
// padding: EdgeInsets.only(top: 40.h),
height:260.h,
decoration: BoxDecoration(
gradient: new LinearGradient(
begin: Alignment.bottomCenter,
end: Alignment.topCenter,
colors: [
Color(0xFF000000),
Color(0xFF585858),
]),
// border: Border.all(color: Colors.white,width: 0.5),
shape: BoxShape.rectangle,
borderRadius: BorderRadius.only(
bottomRight: Radius.circular(35),
bottomLeft: Radius.circular(35),
),
),
) : SizedBox(),
),
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
children: [
///
Container(
height: (MediaQuery.of(context).size.width) /
1.78 *
AppUtils.textScale(context),
child: Swiper(
viewportFraction: 0.95,
loop: false,
physics: BouncingScrollPhysics(),
controller: controller,
onIndexChanged: (index){
setState(() {
checkIndex = index;
});
},
itemBuilder: (context, position) {
return MineVipView(
vipLevel: !(ranks != null && ranks.isNotEmpty)
? widget.arguments["rankLevel"]
: position + 1,
curLevel: widget.arguments["rankLevel"],
tag: (widget.arguments["rankLevel"] == (position + 1) ||
!(ranks != null && ranks.isNotEmpty))
? "vip"
: "",
padding: 6.w,
rank: !(ranks != null && ranks.isNotEmpty)
? 0
: widget.arguments["expendAmount"],
rankMax: !(ranks != null && ranks.isNotEmpty)
? 0
: (position < (ranks.length - 1))
? ranks[position + 1].rankOrigin
: ranks[position].rankOrigin,
createTime: widget.arguments["createTime"],
);
},
itemCount:
(ranks != null && ranks.isNotEmpty) ? ranks.length : 1,
),
),
),
Column(
children: [
SizedBox(height: 40),
///
Container(
margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0),
padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8),
topRight: Radius.circular(8),
),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
Container(
child:Row(
children: [
Container(
width: 4,
height: 18,
decoration: BoxDecoration(
gradient: new LinearGradient(
begin: Alignment.bottomCenter,
end: Alignment.topCenter,
colors: [
Color(0xFF000000),
Color(0xFF585858),
]),
),
),
SizedBox(
width: 4.w,
),
Text(
S.of(context).huiyuanquanyi,
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 16.sp,
color: Colors.black,
),
Expanded(
child: GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
child: Padding(
padding: EdgeInsets.only(left: 16.h, bottom: 10.h),
child: Row(
children: [
Icon(
Icons.arrow_back_ios,
size: 24,
color: Colors.white,
),
Text(
S.of(context).huiyuanzhongxin,
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 18.sp,
color: Colors.white,
),
),
],
),
)),
),
if(widget?.arguments["userInfo"] != null)
Container(
alignment: Alignment.center,
margin: EdgeInsets.only(right: 16.w),
child: GestureDetector(
onTap: () {
// Navigator.of(context).pushNamed('/router/integral_detailed_page');
},
child: Text(
"${S.of(context).dangqianzhukadengji} : ${widget?.arguments["userInfo"]??""}",
style: TextStyle(
color: Colors.white,
fontSize: 16.sp,
fontWeight: MyFontWeight.medium,
),
),
),
)
],
),
SizedBox(
height: 12.h,
),
vipLegalRight(),
],
),
),
///
Container(
margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0),
padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8),
topRight: Radius.circular(8),
),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
Expanded(child:
SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Column(
children: [
///
Container(
width: 4,
height: 18,
decoration: BoxDecoration(
gradient: new LinearGradient(
begin: Alignment.bottomCenter,
end: Alignment.topCenter,
colors: [
Color(0xFF000000),
Color(0xFF585858),
]),
height: (MediaQuery.of(context).size.width) /
1.78 *
AppUtils.textScale(context),
child: Swiper(
viewportFraction: 0.95,
loop: false,
physics: BouncingScrollPhysics(),
controller: controller,
onIndexChanged: (index) {
setState(() {
checkIndex = index;
});
},
itemBuilder: (context, position) {
return MineVipView(
vipLevel: !(ranks != null && ranks.isNotEmpty)
? widget.arguments["rankLevel"]
: position + 1,
curLevel: widget.arguments["rankLevel"],
tag: (widget.arguments["rankLevel"] == (position + 1) ||
!(ranks != null && ranks.isNotEmpty))
? "vip"
: "",
padding: 6.w,
rank: !(ranks != null && ranks.isNotEmpty)
? 0
: widget.arguments["expendAmount"] ?? 0,
rankMax: !(ranks != null && ranks.isNotEmpty)
? 0
: (position < (ranks.length - 1))
? ranks[position + 1].rankOrigin
: ranks[position].rankOrigin,
createTime: widget.arguments["createTime"],
);
},
itemCount:
(ranks != null && ranks.isNotEmpty) ? ranks.length : 1,
),
),
SizedBox(
width: 4.w,
),
Text(
S.of(context).huiyuanguize,
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 16.sp,
color: Colors.black,
),
),
],
),
SizedBox(
height: 12.h,
),
if (vipRuleDetails?.qa != null &&
vipRuleDetails.qa != "")
Container(
color: Colors.white,
padding: EdgeInsets.only(left: 8),
child: Html(
data: vipRuleDetails?.qa??"",
customImageRenders: {
networkSourceMatcher(): networkImageRender(
loadingWidget: () {
return Container();
},
///
Container(
margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0),
padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8),
topRight: Radius.circular(8),
),
},
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Container(
width: 4,
height: 18,
decoration: BoxDecoration(
gradient: new LinearGradient(
begin: Alignment.bottomCenter,
end: Alignment.topCenter,
colors: [
Color(0xFF000000),
Color(0xFF585858),
]),
),
),
SizedBox(
width: 4.w,
),
Text(
S.of(context).huiyuanquanyi,
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 16.sp,
color: Colors.black,
),
),
],
),
SizedBox(
height: 12.h,
),
vipLegalRight(),
],
),
),
),
],
),
),
///
Container(
margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0),
padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8),
topRight: Radius.circular(8),
),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
///
Container(
width: 4,
height: 18,
margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0),
padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h),
decoration: BoxDecoration(
gradient: new LinearGradient(
begin: Alignment.bottomCenter,
end: Alignment.topCenter,
colors: [
Color(0xFF000000),
Color(0xFF585858),
]),
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8),
topRight: Radius.circular(8),
),
),
),
SizedBox(
width: 4.w,
),
Text(
S.of(context).huiyuanjibieduizhao,
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 16.sp,
color: Colors.black,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Container(
width: 4,
height: 18,
decoration: BoxDecoration(
gradient: new LinearGradient(
begin: Alignment.bottomCenter,
end: Alignment.topCenter,
colors: [
Color(0xFF000000),
Color(0xFF585858),
]),
),
),
SizedBox(
width: 4.w,
),
Text(
S.of(context).huiyuanguize,
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 16.sp,
color: Colors.black,
),
),
],
),
SizedBox(
height: 12.h,
),
if (vipRuleDetails?.qa != null && vipRuleDetails.qa != "")
Container(
color: Colors.white,
padding: EdgeInsets.only(left: 8),
child: Html(
data: vipRuleDetails?.qa ?? "",
customImageRenders: {
networkSourceMatcher(): networkImageRender(
loadingWidget: () {
return Container();
},
),
},
),
),
],
),
),
],
),
SizedBox(
height: 12.h,
),
MImage(
vipRuleDetails?.contrast ?? "",
width: double.infinity,
height: 281,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
),
SizedBox(
height: 16.h,
),
],
),
),
///
Container(
margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8),
topRight: Radius.circular(8),
),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
///
Container(
margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0),
padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8),
topRight: Radius.circular(8),
),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 4,
height: 18,
decoration: BoxDecoration(
gradient: new LinearGradient(
begin: Alignment.bottomCenter,
end: Alignment.topCenter,
colors: [
Color(0xFF000000),
Color(0xFF585858),
]),
),
Row(
children: [
Container(
width: 4,
height: 18,
decoration: BoxDecoration(
gradient: new LinearGradient(
begin: Alignment.bottomCenter,
end: Alignment.topCenter,
colors: [
Color(0xFF000000),
Color(0xFF585858),
]),
),
),
SizedBox(
width: 4.w,
),
Text(
S.of(context).huiyuanjibieduizhao,
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 16.sp,
color: Colors.black,
),
),
],
),
SizedBox(
width: 4.w,
height: 12.h,
),
Text(
S.of(context).huiyuanhuodejifen,
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 16.sp,
color: Colors.black,
),
MImage(
vipRuleDetails?.contrast ?? "",
width: double.infinity,
height: 281,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
),
SizedBox(
height: 16.h,
),
],
),
SizedBox(
height: 12.h,
),
if (vipRuleDetails?.rule != null &&
vipRuleDetails.rule != "")
Container(
),
///
Container(
margin: EdgeInsets.fromLTRB(0, 16.h, 0, 0),
decoration: BoxDecoration(
color: Colors.white,
child: Html(
data: vipRuleDetails?.rule??"",
customImageRenders: {
networkSourceMatcher(): networkImageRender(
loadingWidget: () {
return Container();
},
),
},
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8),
topRight: Radius.circular(8),
),
),
],
),
),
if(
ranks.length > checkIndex && widget.arguments["rankLevel"] < ranks[checkIndex].level && ranks[checkIndex].price != "0.00")
InkWell(
onTap: () {
setState(() {
buyRank();
});
},
child: Container(
decoration: BoxDecoration(
gradient: new LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: [
Color(0xFFFFDCA1),
Color(0xFFFAE4C0),
]),
),
width: MediaQuery.of(context).size.width,
padding: EdgeInsets.all(16),
height: 54,
alignment: Alignment.center,
child: Text(
"${S.of(context).lijikaitong}${ranks.length>checkIndex?ranks[checkIndex].price:""}/永久",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 16.sp,
color: Color(0xFF4A4748),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Container(
width: 4,
height: 18,
decoration: BoxDecoration(
gradient: new LinearGradient(
begin: Alignment.bottomCenter,
end: Alignment.topCenter,
colors: [
Color(0xFF000000),
Color(0xFF585858),
]),
),
),
SizedBox(
width: 4.w,
),
Text(
S.of(context).huiyuanhuodejifen,
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 16.sp,
color: Colors.black,
),
),
],
),
SizedBox(
height: 12.h,
),
if (vipRuleDetails?.rule != null &&
vipRuleDetails.rule != "")
Container(
color: Colors.white,
child: Html(
data: vipRuleDetails?.rule ?? "",
customImageRenders: {
networkSourceMatcher(): networkImageRender(
loadingWidget: () {
return Container();
},
),
},
),
),
],
),
),
if (ranks.length > checkIndex &&
widget.arguments["rankLevel"] < ranks[checkIndex].level &&
ranks[checkIndex].price != "0.00")
InkWell(
onTap: () {
setState(() {
buyRank();
});
},
child: Container(
decoration: BoxDecoration(
gradient: new LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: [
Color(0xFFFFDCA1),
Color(0xFFFAE4C0),
]),
),
width: MediaQuery.of(context).size.width,
padding: EdgeInsets.all(16),
height: 54,
alignment: Alignment.center,
child: Text(
"${S.of(context).lijikaitong}${ranks.length > checkIndex ? ranks[checkIndex].price : ""}/永久",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 16.sp,
color: Color(0xFF4A4748),
),
),
),
),
],
),
),
),
],
),
],
),
)),
],
),
],
),
),
],
);
}
///vip
@ -549,7 +605,7 @@ class _MineVipCore extends State<MineVipCore> {
///
Widget vipLegalRight() {
return GridView.builder(
itemCount:vipBenefitList == null ? 0 : vipBenefitList.length,
itemCount: vipBenefitList == null ? 0 : vipBenefitList.length,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
@ -568,7 +624,9 @@ class _MineVipCore extends State<MineVipCore> {
return GestureDetector(
onTap: () {
Navigator.of(context)
.pushNamed('/router/legal_right_details', arguments: {"vipBenefitList": vipBenefitList,});
.pushNamed('/router/legal_right_details', arguments: {
"vipBenefitList": vipBenefitList,
});
},
child: vipLegalRightItem(vipBenefitList[index]),
);
@ -585,75 +643,76 @@ class _MineVipCore extends State<MineVipCore> {
alignment: Alignment.bottomCenter,
children: [
MImage(
vipBenefitList?.icon ?? "",
width: 36,
height: 36,
// fit: BoxFit.cover,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
),
if(!vipBenefitList.actived)
Container(
decoration: new BoxDecoration(
color: Color(0xFFA29E9E),
borderRadius: BorderRadius.circular(7.0),
),
width: 52.w,
height: 15.h,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.lock,
color: Color(0xFFFFDCA1),
size: 10,
),
Text(
"暂未开放",
style: TextStyle(
vipBenefitList?.icon ?? "",
width: 36,
height: 36,
// fit: BoxFit.cover,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
),
if (!vipBenefitList.actived)
Container(
decoration: new BoxDecoration(
color: Color(0xFFA29E9E),
borderRadius: BorderRadius.circular(7.0),
),
width: 52.w,
height: 15.h,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.lock,
color: Color(0xFFFFDCA1),
fontWeight: MyFontWeight.regular,
fontSize: 9.sp,
size: 10,
),
),
],
),
),
if(!vipBenefitList.actived && !vipBenefitList.have)
Container(
decoration: new BoxDecoration(
color: Color(0xFFA29E9E),
borderRadius: BorderRadius.circular(7.0),
Text(
"暂未开放",
style: TextStyle(
color: Color(0xFFFFDCA1),
fontWeight: MyFontWeight.regular,
fontSize: 9.sp,
),
),
],
),
),
width: 52.w,
height: 15.h,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.lock,
color: Color(0xFFFFDCA1),
size: 10,
),
Text(
"暂未解锁",
style: TextStyle(
if (!vipBenefitList.actived && !vipBenefitList.have)
Container(
decoration: new BoxDecoration(
color: Color(0xFFA29E9E),
borderRadius: BorderRadius.circular(7.0),
),
width: 52.w,
height: 15.h,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.lock,
color: Color(0xFFFFDCA1),
fontWeight: MyFontWeight.regular,
fontSize: 9.sp,
size: 10,
),
),
],
Text(
"暂未解锁",
style: TextStyle(
color: Color(0xFFFFDCA1),
fontWeight: MyFontWeight.regular,
fontSize: 9.sp,
),
),
],
),
),
),
],
),
SizedBox(
height: 5.h,
),
Expanded(child: Text(
Expanded(
child: Text(
vipBenefitList?.name ?? "",
maxLines: 2,
overflow: TextOverflow.ellipsis,
@ -663,8 +722,7 @@ class _MineVipCore extends State<MineVipCore> {
fontWeight: MyFontWeight.regular,
fontSize: 12.sp,
),
))
,
)),
],
),
);

2
lib/mine/mine_vip_level_page.dart

@ -81,7 +81,7 @@ class _MineVipLevelPage extends State<MineVipLevelPage> {
curLevel: widget.arguments["rankLevel"],
tag: (widget.arguments["rankLevel"] == (position + 1) || !(ranks != null && ranks.isNotEmpty)) ? "vip" : "",
padding: 6.w,
rank: !(ranks != null && ranks.isNotEmpty) ? 0 : widget.arguments["points"],
rank: !(ranks != null && ranks.isNotEmpty) ? 0 : widget.arguments["points"]??0,
rankMax: !(ranks != null && ranks.isNotEmpty) ? 0 : (position < (ranks.length - 1))
? ranks[position + 1].rankOrigin
: ranks[position].rankOrigin,

7
lib/mine/recharge_page.dart

@ -164,13 +164,6 @@ class _RechargePage extends State<RechargePage> {
bottom: 20.h,
),
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Color(0x000000).withAlpha(25),
offset: Offset(0, 1),
blurRadius: 12.0,
),
],
color: Colors.white,
// borderRadius: BorderRadius.circular(4),
),

173
lib/order/exchange_order_page.dart

@ -12,6 +12,7 @@ import 'package:huixiang/retrofit/data/wx_pay.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/receiving_method_dialog.dart';
import 'package:huixiang/view_widget/round_button.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -39,6 +40,16 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
void initState() {
super.initState();
SharedPreferences.getInstance().then((value) {
if(value.getString("minMember") == null){
return;
}
Map<String, dynamic> memberInfo =
jsonDecode(value.getString("minMember"));
balance = memberInfo["balance"];
money = memberInfo["money"];
setState(() {});
});
SharedPreferences.getInstance().then((value) => {
apiService = ApiService(Dio(),
context: context, token: value.getString("token")),
@ -103,7 +114,12 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
SizedBox(
height: 18.h,
),
Row(
GestureDetector(onTap: (){
setState(() {
showAlertDialog();
});
},
child: Row(
children: [
Text(
S.of(context).lingqufangshi,
@ -115,7 +131,7 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
SizedBox(
width: 12.w,
),
Text(
Expanded(child:Text(
widget.arguments["useTyped"] == 1
? S.of(context).ziti
: widget.arguments["useTyped"] == 2
@ -125,9 +141,14 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
fontSize: 14.sp,
color: Color(0xFF353535),
),
)),
Icon(
Icons.keyboard_arrow_right,
size: 16,
color: Color(0xFF32A060),
),
],
),
),),
Visibility(
child: SizedBox(
height: 13.h,
@ -344,31 +365,41 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
SizedBox(
height: 18.h,
),
Row(
children: [
Text(
S.of(context).lingqufangshi,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF353535),
GestureDetector(onTap: (){
setState(() {
showAlertDialog();
});
},
child: Row(
children: [
Text(
S.of(context).lingqufangshi,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF353535),
),
),
),
SizedBox(
width: 12.w,
),
Text(
widget.arguments["useTyped"] == 1
? S.of(context).ziti
: widget.arguments["useTyped"] == 2
? S.of(context).peisong
: S.of(context).xianshangfafang,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF353535),
SizedBox(
width: 12.w,
),
),
],
),
Expanded(child:Text(
widget.arguments["useTyped"] == 1
? S.of(context).ziti
: widget.arguments["useTyped"] == 2
? S.of(context).peisong
: S.of(context).xianshangfafang,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF353535),
),
)),
Icon(
Icons.keyboard_arrow_right,
size: 16,
color: Color(0xFF32A060),
),
],
),),
Visibility(
child: SizedBox(
height: 13.h,
@ -770,43 +801,43 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
SizedBox(
height: 10,
),
GestureDetector(
onTap: () {
setState(() {
checkIndex = 2;
});
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
checkPayView(2),
Expanded(
child: Container(),
flex: 1,
),
Text(
"¥$balance",
style: TextStyle(
fontSize: 14.sp,
color: Color(0xff353535),
fontWeight: MyFontWeight.semi_bold,
),
),
SizedBox(
width: 10,
),
Text(
S.of(context).dianpuyue,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xff353535),
fontWeight: MyFontWeight.semi_bold,
),
),
],
),
),
// GestureDetector(
// onTap: () {
// setState(() {
// checkIndex = 2;
// });
// },
// child: Row(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// checkPayView(2),
// Expanded(
// child: Container(),
// flex: 1,
// ),
// Text(
// "¥$balance",
// style: TextStyle(
// fontSize: 14.sp,
// color: Color(0xff353535),
// fontWeight: MyFontWeight.semi_bold,
// ),
// ),
// SizedBox(
// width: 10,
// ),
// Text(
// S.of(context).dianpuyue,
// style: TextStyle(
// fontSize: 14.sp,
// color: Color(0xff353535),
// fontWeight: MyFontWeight.semi_bold,
// ),
// ),
// ],
// ),
// ),
SizedBox(
height: 10,
),
@ -898,6 +929,21 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
);
}
///
showAlertDialog() {
//
showDialog(
context: context,
builder: (BuildContext context) {
return ReceivingMethodDialog(widget.arguments["useTyped"],(value){
setState(() {
widget.arguments["useTyped"] = value;
});
});
},
);
}
String handleNeedPay(){
return widget.arguments["payType"] == 1 ?
"${double.parse(widget.arguments["onePrice"])*buyNum}积分".toString() : (widget.arguments["payType"] == 2
@ -959,6 +1005,7 @@ class _ExchangeOrderPage extends State<ExchangeOrderPage> {
BaseData baseDate = await apiService.creditOrder({
"goodsId": widget.arguments["goodsId"],
"isOneSell":widget.arguments["payType"] != 2,
"isPoints":!handleNeedPay().contains(""),
"number": buyNum,
"useTyped": widget.arguments["useTyped"],
"payChannel":handleNeedPay().contains("") ? (checkIndex == 3?"1":"4") : "0",

77
lib/order/order_view/order_commodity.dart

@ -87,9 +87,21 @@ class _OrderCommodity extends State<OrderCommodity> {
);
}
if (widget.orderInfo.benefitDiscountAmount != "0.00") {
//
widgets.add(
vipItem(
Color(0xFFFF7A1A),
"会员优惠金额",
widget?.orderInfo?.benefitDiscountAmount ?? "0.00",
),
);
}
if (widget.orderInfo.orderDetail != null &&
widget.orderInfo.orderDetail.couponDTO != null) {
//
//
widgets.add(
discountItem(
Color(0xFFFF7A1A),
@ -99,10 +111,11 @@ class _OrderCommodity extends State<OrderCommodity> {
),
);
}
if (widget.orderInfo.orderDetail != null &&
widget.orderInfo.orderDetail.activityPrice != null &&
double.tryParse(widget.orderInfo.orderDetail.activityPrice ?? "0") > 0) {
//
//
widgets.add(
discountItem(
Color(0xFFFF7A1A),
@ -136,6 +149,7 @@ class _OrderCommodity extends State<OrderCommodity> {
return widgets;
}
Widget commodityItem(OrderProductVOList productList) {
return Container(
margin: EdgeInsets.only(top: 8.h, bottom: 8.h),
@ -265,6 +279,45 @@ class _OrderCommodity extends State<OrderCommodity> {
);
}
Widget vipItem(Color color, textName,amount) {
return Container(
margin: EdgeInsets.only(top: 9.h, bottom: 9.h),
child: Row(
children: [
Container(
padding: EdgeInsets.fromLTRB(4.w, 2.h, 4.w, 2.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(2)),
border: Border.all(
width: 1,
color: color,
style: BorderStyle.solid,
),
),
child: Text(
textName,
style: TextStyle(
fontSize: 10.sp,
color: color,
),
),
),
SizedBox(
width: 27.w,
),
Spacer(),
Text(
S.of(context).yuan_("$amount"),
style: TextStyle(
fontSize: 12.sp,
color: color,
),
),
],
),
);
}
Widget buildQrCode() {
return Container(
margin: EdgeInsets.only(right: 16.w),
@ -357,16 +410,16 @@ class _OrderCommodity extends State<OrderCommodity> {
),
flex: 1,
),
Container(
child: Text(
"已优惠:¥${widget.orderInfo.orderDetail.activityPrice}",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF7B7B7B),
fontWeight: MyFontWeight.medium,
),
),
),
// Container(
// child: Text(
// "已优惠:¥${widget.orderInfo.orderDetail.activityPrice}",
// style: TextStyle(
// fontSize: 12.sp,
// color: Color(0xFF7B7B7B),
// fontWeight: MyFontWeight.medium,
// ),
// ),
// ),
SizedBox(
width: 15.w,
),

203
lib/retrofit/data/achievement_detail_list.dart

@ -1,19 +1,20 @@
/// id : "1460450874352310812"
/// id : "1460450874352317701"
/// createTime : "2021-11-12 11:42:08"
/// createUser : "123"
/// updateTime : "2021-11-17 17:49:17"
/// updateTime : "2021-11-19 13:59:36"
/// updateUser : "1"
/// categoryId : "1460164746211753984"
/// categoryId : "1460904379451179008"
/// name : "青铜"
/// level : 0
/// icon : "https://pos.upload.gznl.top/admin/2021/11/a83f895b-8159-455e-a54d-ac67068b28b7.jpg"
/// score : 10
/// icon : "https://pos.upload.gznl.top/MDAwMA==/2021/11/dd1bd6f1-6079-46ab-8d0f-6a946048db9d.png"
/// score : 1
/// actived : true
/// sort : 0
/// isDelete : 0
/// lessScore : 0
/// get : true
/// lessScore : "1"
/// rewardList : [{"id":"1464064141143572480","createTime":"2021-11-26 10:51:07","createUser":"1","updateTime":"2021-11-26 10:51:07","updateUser":"1","categoryId":"1460904379451179008","achievementId":"1460450874352317701","rewardType":2,"refId":"10","isDelete":0,"achievementCategoryName":null,"achievementName":null,"couponName":null},{"id":"1464064181471805440","createTime":"2021-11-26 10:51:17","createUser":"1","updateTime":"2021-11-26 10:51:17","updateUser":"1","categoryId":"1460904379451179008","achievementId":"1460450874352317701","rewardType":2,"refId":"20","isDelete":0,"achievementCategoryName":null,"achievementName":null,"couponName":null},{"id":"1464136057103581184","createTime":"2021-11-26 15:36:53","createUser":"1","updateTime":"2021-11-26 15:36:53","updateUser":"1","categoryId":"1460904379451179008","achievementId":"1460450874352317701","rewardType":1,"refId":"888","isDelete":0,"achievementCategoryName":null,"achievementName":null,"couponName":null}]
/// max : false
/// get : false
class AchievementDetailList {
AchievementDetailList({
@ -30,9 +31,10 @@ class AchievementDetailList {
bool actived,
int sort,
int isDelete,
int lessScore,
bool get,
bool max,}){
String lessScore,
List<RewardList> rewardList,
bool max,
bool get,}){
_id = id;
_createTime = createTime;
_createUser = createUser;
@ -47,8 +49,9 @@ class AchievementDetailList {
_sort = sort;
_isDelete = isDelete;
_lessScore = lessScore;
_get = get;
_rewardList = rewardList;
_max = max;
_get = get;
}
AchievementDetailList.fromJson(dynamic json) {
@ -66,8 +69,14 @@ class AchievementDetailList {
_sort = json['sort'];
_isDelete = json['isDelete'];
_lessScore = json['lessScore'];
_get = json['get'];
if (json['rewardList'] != null) {
_rewardList = [];
json['rewardList'].forEach((v) {
_rewardList.add(RewardList.fromJson(v));
});
}
_max = json['max'];
_get = json['get'];
}
String _id;
String _createTime;
@ -82,9 +91,10 @@ class AchievementDetailList {
bool _actived;
int _sort;
int _isDelete;
int _lessScore;
bool _get;
String _lessScore;
List<RewardList> _rewardList;
bool _max;
bool _get;
String get id => _id;
String get createTime => _createTime;
@ -99,14 +109,10 @@ class AchievementDetailList {
bool get actived => _actived;
int get sort => _sort;
int get isDelete => _isDelete;
int get lessScore => _lessScore;
bool get get => _get;
String get lessScore => _lessScore;
List<RewardList> get rewardList => _rewardList;
bool get max => _max;
set id(String value) {
_id = value;
}
bool get get => _get;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
@ -124,68 +130,119 @@ class AchievementDetailList {
map['sort'] = _sort;
map['isDelete'] = _isDelete;
map['lessScore'] = _lessScore;
map['get'] = _get;
if (_rewardList != null) {
map['rewardList'] = _rewardList.map((v) => v.toJson()).toList();
}
map['max'] = _max;
map['get'] = _get;
return map;
}
set createTime(String value) {
_createTime = value;
}
set createUser(String value) {
_createUser = value;
}
set updateTime(String value) {
_updateTime = value;
}
set updateUser(String value) {
_updateUser = value;
}
set categoryId(String value) {
_categoryId = value;
}
set name(String value) {
_name = value;
}
set level(int value) {
_level = value;
}
set icon(String value) {
_icon = value;
}
set score(int value) {
_score = value;
}
}
set actived(bool value) {
_actived = value;
}
/// id : "1464064141143572480"
/// createTime : "2021-11-26 10:51:07"
/// createUser : "1"
/// updateTime : "2021-11-26 10:51:07"
/// updateUser : "1"
/// categoryId : "1460904379451179008"
/// achievementId : "1460450874352317701"
/// rewardType : 2
/// refId : "10"
/// isDelete : 0
/// achievementCategoryName : null
/// achievementName : null
/// couponName : null
set sort(int value) {
_sort = value;
}
class RewardList {
RewardList({
String id,
String createTime,
String createUser,
String updateTime,
String updateUser,
String categoryId,
String achievementId,
int rewardType,
String refId,
int isDelete,
dynamic achievementCategoryName,
dynamic achievementName,
dynamic couponName,}){
_id = id;
_createTime = createTime;
_createUser = createUser;
_updateTime = updateTime;
_updateUser = updateUser;
_categoryId = categoryId;
_achievementId = achievementId;
_rewardType = rewardType;
_refId = refId;
_isDelete = isDelete;
_achievementCategoryName = achievementCategoryName;
_achievementName = achievementName;
_couponName = couponName;
}
set isDelete(int value) {
_isDelete = value;
RewardList.fromJson(dynamic json) {
_id = json['id'];
_createTime = json['createTime'];
_createUser = json['createUser'];
_updateTime = json['updateTime'];
_updateUser = json['updateUser'];
_categoryId = json['categoryId'];
_achievementId = json['achievementId'];
_rewardType = json['rewardType'];
_refId = json['refId'];
_isDelete = json['isDelete'];
_achievementCategoryName = json['achievementCategoryName'];
_achievementName = json['achievementName'];
_couponName = json['couponName'];
}
String _id;
String _createTime;
String _createUser;
String _updateTime;
String _updateUser;
String _categoryId;
String _achievementId;
int _rewardType;
String _refId;
int _isDelete;
dynamic _achievementCategoryName;
dynamic _achievementName;
dynamic _couponName;
set lessScore(int value) {
_lessScore = value;
}
String get id => _id;
String get createTime => _createTime;
String get createUser => _createUser;
String get updateTime => _updateTime;
String get updateUser => _updateUser;
String get categoryId => _categoryId;
String get achievementId => _achievementId;
int get rewardType => _rewardType;
String get refId => _refId;
int get isDelete => _isDelete;
dynamic get achievementCategoryName => _achievementCategoryName;
dynamic get achievementName => _achievementName;
dynamic get couponName => _couponName;
set get(bool value) {
_get = value;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = _id;
map['createTime'] = _createTime;
map['createUser'] = _createUser;
map['updateTime'] = _updateTime;
map['updateUser'] = _updateUser;
map['categoryId'] = _categoryId;
map['achievementId'] = _achievementId;
map['rewardType'] = _rewardType;
map['refId'] = _refId;
map['isDelete'] = _isDelete;
map['achievementCategoryName'] = _achievementCategoryName;
map['achievementName'] = _achievementName;
map['couponName'] = _couponName;
return map;
}
set max(bool value) {
_max = value;
}
}

99
lib/retrofit/data/headlines_list.dart

@ -0,0 +1,99 @@
/// id : "1463790611994771456"
/// createTime : "2021-11-25 16:44:12"
/// createUser : "1"
/// updateTime : "2021-11-25 16:45:55"
/// updateUser : "1"
/// name : "一心回乡"
/// introduce : "22"
/// coverImg : "https://pos.upload.gznl.top/0000/2021/11/899b578b-f594-42f7-91e1-cebc5dbc39da.png"
/// bannerImg : "https://pos.upload.gznl.top/0000/2021/11/7a41ebe2-d3b1-44ea-9cda-2e952b58d54c.png"
/// sort : 0
/// isDelete : 0
/// tenantCode : "admin"
class HeadlinesList {
HeadlinesList({
String id,
String createTime,
String createUser,
String updateTime,
String updateUser,
String name,
String introduce,
String coverImg,
String bannerImg,
int sort,
int isDelete,
String tenantCode,}){
_id = id;
_createTime = createTime;
_createUser = createUser;
_updateTime = updateTime;
_updateUser = updateUser;
_name = name;
_introduce = introduce;
_coverImg = coverImg;
_bannerImg = bannerImg;
_sort = sort;
_isDelete = isDelete;
_tenantCode = tenantCode;
}
HeadlinesList.fromJson(dynamic json) {
_id = json['id'];
_createTime = json['createTime'];
_createUser = json['createUser'];
_updateTime = json['updateTime'];
_updateUser = json['updateUser'];
_name = json['name'];
_introduce = json['introduce'];
_coverImg = json['coverImg'];
_bannerImg = json['bannerImg'];
_sort = json['sort'];
_isDelete = json['isDelete'];
_tenantCode = json['tenantCode'];
}
String _id;
String _createTime;
String _createUser;
String _updateTime;
String _updateUser;
String _name;
String _introduce;
String _coverImg;
String _bannerImg;
int _sort;
int _isDelete;
String _tenantCode;
String get id => _id;
String get createTime => _createTime;
String get createUser => _createUser;
String get updateTime => _updateTime;
String get updateUser => _updateUser;
String get name => _name;
String get introduce => _introduce;
String get coverImg => _coverImg;
String get bannerImg => _bannerImg;
int get sort => _sort;
int get isDelete => _isDelete;
String get tenantCode => _tenantCode;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = _id;
map['createTime'] = _createTime;
map['createUser'] = _createUser;
map['updateTime'] = _updateTime;
map['updateUser'] = _updateUser;
map['name'] = _name;
map['introduce'] = _introduce;
map['coverImg'] = _coverImg;
map['bannerImg'] = _bannerImg;
map['sort'] = _sort;
map['isDelete'] = _isDelete;
map['tenantCode'] = _tenantCode;
return map;
}
}

99
lib/retrofit/data/headlines_list_details.dart

@ -0,0 +1,99 @@
/// id : "1463790611994771456"
/// createTime : "2021-11-25 16:44:12"
/// createUser : "1"
/// updateTime : "2021-11-25 16:45:55"
/// updateUser : "1"
/// name : "一心回乡"
/// introduce : "22"
/// coverImg : "https://pos.upload.gznl.top/0000/2021/11/899b578b-f594-42f7-91e1-cebc5dbc39da.png"
/// bannerImg : "https://pos.upload.gznl.top/0000/2021/11/7a41ebe2-d3b1-44ea-9cda-2e952b58d54c.png"
/// sort : 0
/// isDelete : 0
/// tenantCode : "admin"
class HeadlinesListDetails {
HeadlinesListDetails({
String id,
String createTime,
String createUser,
String updateTime,
String updateUser,
String name,
String introduce,
String coverImg,
String bannerImg,
int sort,
int isDelete,
String tenantCode,}){
_id = id;
_createTime = createTime;
_createUser = createUser;
_updateTime = updateTime;
_updateUser = updateUser;
_name = name;
_introduce = introduce;
_coverImg = coverImg;
_bannerImg = bannerImg;
_sort = sort;
_isDelete = isDelete;
_tenantCode = tenantCode;
}
HeadlinesListDetails.fromJson(dynamic json) {
_id = json['id'];
_createTime = json['createTime'];
_createUser = json['createUser'];
_updateTime = json['updateTime'];
_updateUser = json['updateUser'];
_name = json['name'];
_introduce = json['introduce'];
_coverImg = json['coverImg'];
_bannerImg = json['bannerImg'];
_sort = json['sort'];
_isDelete = json['isDelete'];
_tenantCode = json['tenantCode'];
}
String _id;
String _createTime;
String _createUser;
String _updateTime;
String _updateUser;
String _name;
String _introduce;
String _coverImg;
String _bannerImg;
int _sort;
int _isDelete;
String _tenantCode;
String get id => _id;
String get createTime => _createTime;
String get createUser => _createUser;
String get updateTime => _updateTime;
String get updateUser => _updateUser;
String get name => _name;
String get introduce => _introduce;
String get coverImg => _coverImg;
String get bannerImg => _bannerImg;
int get sort => _sort;
int get isDelete => _isDelete;
String get tenantCode => _tenantCode;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = _id;
map['createTime'] = _createTime;
map['createUser'] = _createUser;
map['updateTime'] = _updateTime;
map['updateUser'] = _updateUser;
map['name'] = _name;
map['introduce'] = _introduce;
map['coverImg'] = _coverImg;
map['bannerImg'] = _bannerImg;
map['sort'] = _sort;
map['isDelete'] = _isDelete;
map['tenantCode'] = _tenantCode;
return map;
}
}

5
lib/retrofit/data/order_info.dart

@ -110,6 +110,7 @@ class OrderInfo {
String payNum;
String promotionId;
String couponId;
String benefitDiscountAmount;
int isDelete;
int isTakeOut;
int batch;
@ -172,6 +173,7 @@ class OrderInfo {
String payNum,
String promotionId,
String couponId,
String benefitDiscountAmount,
int isDelete,
int isTakeOut,
int batch,
@ -232,6 +234,7 @@ class OrderInfo {
this.payNum = payNum;
this.promotionId = promotionId;
this.couponId = couponId;
this.benefitDiscountAmount =benefitDiscountAmount;
this.isDelete = isDelete;
this.isTakeOut = isTakeOut;
this.batch = batch;
@ -297,6 +300,7 @@ class OrderInfo {
this.payNum = json["payNum"];
this.promotionId = json["promotionId"];
this.couponId = json["couponId"];
this.benefitDiscountAmount = json["benefitDiscountAmount"];
this.isDelete = json["isDelete"];
this.isTakeOut = json["isTakeOut"];
this.batch = json["batch"];
@ -371,6 +375,7 @@ class OrderInfo {
map["payNum"] = this.payNum;
map["promotionId"] = this.promotionId;
map["couponId"] = this.couponId;
map["benefitDiscountAmount"] = this.benefitDiscountAmount;
map["isDelete"] = this.isDelete;
map["isTakeOut"] = this.isTakeOut;
map["batch"] = this.batch;

8
lib/retrofit/data/settleOrderInfo.dart

@ -205,6 +205,7 @@ class SettleOrderInfo {
/// promotionName : "<EFBFBD><EFBFBD>10-8"
/// usable : true
/// allProduct : true
/// isMaxCoupon:true
/// productList : null
class CouponListBean {
@ -231,6 +232,7 @@ class CouponListBean {
String promotionName;
bool usable;
bool allProduct;
bool isMaxCoupon;
dynamic productList;
bool isEx;
@ -261,6 +263,7 @@ class CouponListBean {
couponListBean.promotionName = map['promotionName'];
couponListBean.usable = map['usable'];
couponListBean.allProduct = map['allProduct'];
couponListBean.isMaxCoupon = map['isMaxCoupon'];
couponListBean.productList = map['productList'];
return couponListBean;
}
@ -289,6 +292,7 @@ class CouponListBean {
"promotionName": promotionName,
"usable": usable,
"allProduct": allProduct,
"isMaxCoupon": isMaxCoupon,
"productList": productList,
};
@ -321,6 +325,7 @@ class CouponListBean {
/// isDelete : 0
/// tenantCode : "1175"
/// canPartake : true
/// isMaxPromotion : true
/// promotionProuctList : null
class PromotionInfoListBean {
@ -351,6 +356,7 @@ class PromotionInfoListBean {
int isDelete;
String tenantCode;
bool canPartake;
bool isMaxPromotion;
dynamic promotionProuctList;
static PromotionInfoListBean fromJson(Map<String, dynamic> map) {
@ -387,6 +393,7 @@ class PromotionInfoListBean {
promotionInfoListBean.isDelete = map['isDelete'];
promotionInfoListBean.tenantCode = map['tenantCode'];
promotionInfoListBean.canPartake = map['canPartake'];
promotionInfoListBean.isMaxPromotion = map['isMaxPromotion'];
promotionInfoListBean.promotionProuctList = map['promotionProuctList'];
return promotionInfoListBean;
}
@ -419,6 +426,7 @@ class PromotionInfoListBean {
"isDelete": isDelete,
"tenantCode": tenantCode,
"canPartake": canPartake,
"isMaxPromotion": isMaxPromotion,
"promotionProuctList": promotionProuctList,
};
}

264
lib/retrofit/data/shoppingCart.dart

@ -1,4 +1,7 @@
import 'package:huixiang/retrofit/data/settleOrderInfo.dart';
/// cartSum : 0
/// selectDiscount:2
/// numberOfPeople : 0
/// selected : 0
/// shoppingCartSkuItemList : [{"buyNum":0,"createTime":"","groupId":0,"id":0,"platterList":[{"deleted":true,"id":0,"productId":0,"required":true,"skuId":0}],"productId":0,"productName":"","selected":0,"skuImg":"","skuName":"","skuPrice":0,"skuStock":0,"storeId":0,"tableId":0}]
@ -12,8 +15,11 @@ class ShoppingCart {
int selected;
List<ShoppingCartSkuItemListBean> shoppingCartSkuItemList;
String storeId;
int selectDiscount;
String storeName;
String tableId;
List<PromotionInfoListBean> promotionInfoList;
List<CouponListBean> couponList;
static ShoppingCart fromJson(Map<String, dynamic> map) {
if (map == null) return null;
@ -26,7 +32,14 @@ class ShoppingCart {
);
shoppingCartBean.storeId = map['storeId'];
shoppingCartBean.storeName = map['storeName'];
shoppingCartBean.selectDiscount = map['selectDiscount'];
shoppingCartBean.tableId = map['tableId'];
shoppingCartBean.promotionInfoList = List()..addAll(
(map['promotionInfoList'] as List ?? []).map((o) => PromotionInfoListBean.fromJson(o))
);
shoppingCartBean.couponList = List()..addAll(
(map['couponList'] as List ?? []).map((o) => CouponListBean.fromJson(o))
);
return shoppingCartBean;
}
@ -37,7 +50,9 @@ class ShoppingCart {
"shoppingCartSkuItemList": shoppingCartSkuItemList == null ? null : shoppingCartSkuItemList.map((e) => e.toJson()).toList(),
"storeId": storeId,
"storeName": storeName,
"selectDiscount" : selectDiscount,
"tableId": tableId,
"promotionInfoList": promotionInfoList,
};
}
@ -147,3 +162,252 @@ class PlatterListBean {
"skuId": skuId,
};
}
/// id : "1437254523520286720"
/// createTime : "2021-09-13 11:19:16"
/// createUser : "1333246101196636160"
/// updateTime : "2021-09-13 17:30:00"
/// updateUser : "0"
/// storeId : "1433719074906439680"
/// name : "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD>"
/// image : "https://pos.upload.gznl.top/1175/2021/09/44d60dab-0ae3-4d07-b624-50b8ab99d0fc.jpg"
/// description : "1"
/// status : 4
/// applyStartTime : "2021-09-13 11:19:16"
/// applyEndTime : "2021-09-13 11:19:16"
/// activityStartTime : "2021-09-01 00:00:00"
/// activityEndTime : "2021-10-30 00:00:00"
/// doStartTime : null
/// doEndTime : null
/// isNeedSecurityDeposit : 0
/// securityDeposit : "0"
/// tag : "11"
/// promotionType : 1
/// promotionPlan : 0
/// promotionDetail : [{"limitTime":"0","discountRate":"0","discountAmount":"0","fullAmount":"0","collageNumber":"0","fullNumber":"1"}]
/// channels : ["MINI","POS"]
/// isVip : false
/// isDelete : 0
/// tenantCode : "1175"
/// canPartake : true
/// isMaxPromotion : true
/// promotionProuctList : null
class PromotionInfoListBean {
String id;
String createTime;
String createUser;
String updateTime;
String updateUser;
String storeId;
String name;
String image;
String description;
int status;
String applyStartTime;
String applyEndTime;
String activityStartTime;
String activityEndTime;
dynamic doStartTime;
dynamic doEndTime;
int isNeedSecurityDeposit;
String securityDeposit;
String tag;
int promotionType;
int promotionPlan;
List<PromotionDetailBean> promotionDetail;
List<String> channels;
bool isVip;
int isDelete;
String tenantCode;
bool canPartake;
bool isMaxPromotion;
dynamic promotionProuctList;
static PromotionInfoListBean fromJson(Map<String, dynamic> map) {
if (map == null) return null;
PromotionInfoListBean promotionInfoListBean = PromotionInfoListBean();
promotionInfoListBean.id = map['id'];
promotionInfoListBean.createTime = map['createTime'];
promotionInfoListBean.createUser = map['createUser'];
promotionInfoListBean.updateTime = map['updateTime'];
promotionInfoListBean.updateUser = map['updateUser'];
promotionInfoListBean.storeId = map['storeId'];
promotionInfoListBean.name = map['name'];
promotionInfoListBean.image = map['image'];
promotionInfoListBean.description = map['description'];
promotionInfoListBean.status = map['status'];
promotionInfoListBean.applyStartTime = map['applyStartTime'];
promotionInfoListBean.applyEndTime = map['applyEndTime'];
promotionInfoListBean.activityStartTime = map['activityStartTime'];
promotionInfoListBean.activityEndTime = map['activityEndTime'];
promotionInfoListBean.doStartTime = map['doStartTime'];
promotionInfoListBean.doEndTime = map['doEndTime'];
promotionInfoListBean.isNeedSecurityDeposit = map['isNeedSecurityDeposit'];
promotionInfoListBean.securityDeposit = map['securityDeposit'];
promotionInfoListBean.tag = map['tag'];
promotionInfoListBean.promotionType = map['promotionType'];
promotionInfoListBean.promotionPlan = map['promotionPlan'];
promotionInfoListBean.promotionDetail = List()..addAll(
(map['promotionDetail'] as List ?? []).map((o) => PromotionDetailBean.fromJson(o))
);
promotionInfoListBean.channels = List()..addAll(
(map['channels'] as List ?? []).map((o) => o.toString())
);
promotionInfoListBean.isVip = map['isVip'];
promotionInfoListBean.isDelete = map['isDelete'];
promotionInfoListBean.tenantCode = map['tenantCode'];
promotionInfoListBean.canPartake = map['canPartake'];
promotionInfoListBean.isMaxPromotion = map['isMaxPromotion'];
promotionInfoListBean.promotionProuctList = map['promotionProuctList'];
return promotionInfoListBean;
}
Map toJson() => {
"id": id,
"createTime": createTime,
"createUser": createUser,
"updateTime": updateTime,
"updateUser": updateUser,
"storeId": storeId,
"name": name,
"image": image,
"description": description,
"status": status,
"applyStartTime": applyStartTime,
"applyEndTime": applyEndTime,
"activityStartTime": activityStartTime,
"activityEndTime": activityEndTime,
"doStartTime": doStartTime,
"doEndTime": doEndTime,
"isNeedSecurityDeposit": isNeedSecurityDeposit,
"securityDeposit": securityDeposit,
"tag": tag,
"promotionType": promotionType,
"promotionPlan": promotionPlan,
"promotionDetail": promotionDetail,
"channels": channels,
"isVip": isVip,
"isDelete": isDelete,
"tenantCode": tenantCode,
"canPartake": canPartake,
"isMaxPromotion": isMaxPromotion,
"promotionProuctList": promotionProuctList,
};
}
/// id : "1448907890034212864"
/// storeId : "1333246101343436800"
/// bizType : 1
/// fullAmount : "10.00"
/// discountAmount : "8.00"
/// fullNumber : 1
/// discountPercent : 100
/// bizId : ""
/// publishStartTime : "2021-10-01"
/// publishEndTime : "2021-10-29"
/// useStartTime : "2021-10-02"
/// useEndTime : "2021-10-31"
/// promotionId : "0"
/// mid : "1438443365845696512"
/// couponId : "1448902034085380096"
/// receiveTime : "2021-10-15"
/// useTime : null
/// status : 1
/// tenantCode : "1175"
/// type : 1
/// promotionName : "<EFBFBD><EFBFBD>10-8"
/// usable : true
/// allProduct : true
/// isMaxCoupon:true
/// productList : null
class CouponListBean {
String id;
String storeId;
int bizType;
String fullAmount;
String discountAmount;
int fullNumber;
int discountPercent;
String bizId;
String publishStartTime;
String publishEndTime;
String useStartTime;
String useEndTime;
String promotionId;
String mid;
String couponId;
String receiveTime;
dynamic useTime;
int status;
String tenantCode;
int type;
String promotionName;
bool usable;
bool allProduct;
bool isMaxCoupon;
dynamic productList;
bool isEx;
static CouponListBean fromJson(Map<String, dynamic> map) {
if (map == null) return null;
CouponListBean couponListBean = CouponListBean();
couponListBean.id = map['id'];
couponListBean.storeId = map['storeId'];
couponListBean.bizType = map['bizType'];
couponListBean.fullAmount = map['fullAmount'];
couponListBean.discountAmount = map['discountAmount'];
couponListBean.fullNumber = map['fullNumber'];
couponListBean.discountPercent = map['discountPercent'];
couponListBean.bizId = map['bizId'];
couponListBean.publishStartTime = map['publishStartTime'];
couponListBean.publishEndTime = map['publishEndTime'];
couponListBean.useStartTime = map['useStartTime'];
couponListBean.useEndTime = map['useEndTime'];
couponListBean.promotionId = map['promotionId'];
couponListBean.mid = map['mid'];
couponListBean.couponId = map['couponId'];
couponListBean.receiveTime = map['receiveTime'];
couponListBean.useTime = map['useTime'];
couponListBean.status = map['status'];
couponListBean.tenantCode = map['tenantCode'];
couponListBean.type = map['type'];
couponListBean.promotionName = map['promotionName'];
couponListBean.usable = map['usable'];
couponListBean.allProduct = map['allProduct'];
couponListBean.isMaxCoupon = map['isMaxCoupon'];
couponListBean.productList = map['productList'];
return couponListBean;
}
Map toJson() => {
"id": id,
"storeId": storeId,
"bizType": bizType,
"fullAmount": fullAmount,
"discountAmount": discountAmount,
"fullNumber": fullNumber,
"discountPercent": discountPercent,
"bizId": bizId,
"publishStartTime": publishStartTime,
"publishEndTime": publishEndTime,
"useStartTime": useStartTime,
"useEndTime": useEndTime,
"promotionId": promotionId,
"mid": mid,
"couponId": couponId,
"receiveTime": receiveTime,
"useTime": useTime,
"status": status,
"tenantCode": tenantCode,
"type": type,
"promotionName": promotionName,
"usable": usable,
"allProduct": allProduct,
"isMaxCoupon": isMaxCoupon,
"productList": productList,
};
}

19
lib/retrofit/retrofit_api.dart

@ -30,6 +30,8 @@ import 'data/exchange_order.dart';
import 'data/follow_list.dart';
import 'data/goods.dart';
import 'data/goods_category.dart';
import 'data/headlines_list.dart';
import 'data/headlines_list_details.dart';
import 'data/logistics.dart';
import 'data/member_comment_list.dart';
import 'data/message.dart';
@ -53,15 +55,15 @@ part 'retrofit_api.g.dart';
// const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///
// const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///
const base_url = "http://192.168.10.236:8766/app/"; ///
const baseUrl = "http://192.168.10.236:8766/app/"; ///
// const base_url = "http://192.168.10.236:8766/app/"; ///
// const baseUrl = "http://192.168.10.236:8766/app/"; ///
// const base_url = "http://192.168.10.37:8766/app/";
// const baseUrl = "http://192.168.10.37:8766/app/";
// const base_url = "http://192.168.10.130:8766/app/";///
// const baseUrl = "http://192.168.10.130:8766/app/";///
const base_url = "http://192.168.10.130:8766/app/";///
const baseUrl = "http://192.168.10.130:8766/app/";///
@RestApi(baseUrl: baseUrl)
abstract class ApiService {
@ -467,4 +469,13 @@ abstract class ApiService {
@POST("/member/rankBuy")
Future<BaseData<dynamic>> rankBuy(@Body() Map<String, dynamic> param);
///
@GET("/information/categoryList")
Future<BaseData<List<HeadlinesList>>> headlinesList();
///
@GET("/information/category/{id}")
Future<BaseData<HeadlinesListDetails>> headlinesDetails(@Path("id") String id);
}

69
lib/retrofit/retrofit_api.g.dart

@ -9,7 +9,7 @@ part of 'retrofit_api.dart';
class _ApiService implements ApiService {
_ApiService(this._dio, {this.baseUrl}) {
ArgumentError.checkNotNull(_dio, '_dio');
baseUrl ??= 'http://192.168.10.236:8766/app/';
baseUrl ??= 'http://192.168.10.130:8766/app/';
}
final Dio _dio;
@ -1393,29 +1393,6 @@ class _ApiService implements ApiService {
return value;
}
//
// @override
// Future<BaseData<dynamic>> catalogList(courseId) async {
// ArgumentError.checkNotNull(courseId, 'courseId');
// const _extra = <String, dynamic>{};
// final queryParameters = <String, dynamic>{};
// final _data = <String, dynamic>{};
// final _result = await _dio.request<Map<String, dynamic>>(
// '/course/catalogList/$courseId',
// queryParameters: queryParameters,
// options: RequestOptions(
// method: 'GET',
// headers: <String, dynamic>{},
// extra: _extra,
// baseUrl: baseUrl),
// data: _data);
// final value = BaseData<dynamic>.fromJson(
// _result.data,
// (json) => json as dynamic,
// );
// return value;
// }
@override
Future<BaseData<PageInfo<CourseList>>> courseList(map) async {
ArgumentError.checkNotNull(map, 'map');
@ -1730,4 +1707,48 @@ class _ApiService implements ApiService {
return value;
}
@override
Future<BaseData<List<HeadlinesList>>> headlinesList() async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/information/categoryList',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<List<HeadlinesList>>.fromJson(
_result.data,
(json) => (json as List<dynamic>)
.map<HeadlinesList>((i) => HeadlinesList.fromJson(i as Map<String, dynamic>))
.toList());
return value;
}
@override
Future<BaseData<HeadlinesListDetails>> headlinesDetails(id) async {
ArgumentError.checkNotNull(id, 'id');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
final _result = await _dio.request<Map<String, dynamic>>(
'/information/category/$id',
queryParameters: queryParameters,
options: RequestOptions(
method: 'GET',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<HeadlinesListDetails>.fromJson(
_result.data,
(json) => HeadlinesListDetails.fromJson(json),
);
return value;
}
}

3
lib/settlement/settlement.dart

@ -72,7 +72,8 @@ class _Settlement extends State<Settlement> {
parentId = widget.arguments["parentId"] ?? "";
storeInfo = widget.arguments["storeInfo"];
numberOfPeople = widget.arguments["numberOfPeople"] ?? 0;
promotions=widget.arguments["pid"]??"";
coupons=widget.arguments["cid"]??"";
if (tableId == 0) {
placeOrder = true;
}

20
lib/store/store_order.dart

@ -62,6 +62,8 @@ class _StoreOrderPage extends State<StoreOrderPage>
int numberOfPeople = 0;
///token
String minToken;
String pid;
String cid;
@override
void initState() {
@ -545,7 +547,6 @@ class _StoreOrderPage extends State<StoreOrderPage>
return;
}
}
await Navigator.of(context).pushNamed(
'/router/settlement',
arguments: {
@ -553,6 +554,8 @@ class _StoreOrderPage extends State<StoreOrderPage>
"tableId": tableId,
"parentCode": parentCode,
"parentId": parentId,
"pid":pid,
"cid":cid,
"shoppingCart": shopCarGoods,
"numberOfPeople": numberOfPeople,
},
@ -730,12 +733,27 @@ class _StoreOrderPage extends State<StoreOrderPage>
///
Future<ShoppingCart> queryShopCar() async {
pid="";
cid="";
BaseData<List<ShoppingCart>> baseDate =
await minService.getShoppingCart(tableId);
if (baseDate != null &&
baseDate.isSuccess &&
baseDate.data != null &&
baseDate.data.length > 0) {
if( baseDate.data[0].selectDiscount ==1){
baseDate.data[0].couponList.forEach((element) {
if(element.isMaxCoupon){
cid = element.promotionName;
}
});
}else if(baseDate.data[0].selectDiscount==2){
baseDate.data[0].promotionInfoList.forEach((element) {
if(element.isMaxPromotion){
pid=element.name;
}
});
}
return baseDate.data[0];
} else {
return null;

2
lib/view_widget/item_input_widget.dart

@ -102,9 +102,9 @@ class ItemInputWidget extends StatelessWidget {
),
Container(
margin: EdgeInsets.only(left: 5),
width: 85,
height: 20.h,
alignment: Alignment.center,
padding: EdgeInsets.only(left:3,right:4),
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(9),

16
lib/view_widget/mine_vip_view.dart

@ -217,9 +217,9 @@ class MineVipView extends StatelessWidget {
// rank > rankMax
// ? S.of(context).dangqiandengji
// : "${S.of(context).jifen_(rankMax - rank)} ${S.of(context).daoxiayidengji}",
rank > rankMax
(vipLevel < curLevel)?"":(((rank ?? 0) > rankMax || curLevel == 3)
? S.of(context).dangqiandengji
: "消费¥${rankMax - rank}${S.of(context).daoxiayidengji}",
: "消费¥${rankMax - (rank ?? 0)}${S.of(context).daoxiayidengji}"),
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: textColor,
@ -233,14 +233,14 @@ class MineVipView extends StatelessWidget {
TextSpan(
children: [
TextSpan(
text: "$rank",
text: (vipLevel < curLevel)?rankMax.toString():rank.toString(),
style: TextStyle(
fontSize: 26.sp,
fontWeight: MyFontWeight.semi_bold,
color: textColor,
),
),
if (rank <= rankMax)
if ((rank ?? 0) <= rankMax)
TextSpan(
text: rankMax > 0 ? "/$rankMax" : "/0",
style: TextStyle(
@ -259,7 +259,7 @@ class MineVipView extends StatelessWidget {
child: ClipRRect(
borderRadius: BorderRadius.circular(6.5),
child: LinearProgressIndicator(
value: rankMax > 0 ? rank / rankMax : 0,
value: rankMax > (rank ?? 0) ? ((vipLevel < curLevel) ? rankMax/rankMax:(rank ?? 0) / rankMax) : 0,
backgroundColor: Colors.white,
color: levelColor,
),
@ -274,7 +274,9 @@ class MineVipView extends StatelessWidget {
S.of(context).kaitongriqi(
(createTime != null && createTime != "")
? createTime.split(" ")[0]
: "$createTime"),
: "$createTime"
// createTime ?? ""
),
style: TextStyle(
color: textColor,
fontWeight: MyFontWeight.regular,
@ -317,7 +319,7 @@ class MineVipView extends StatelessWidget {
"rankLevel": curLevel,
"userInfo":userInfo.masterCardRankName,
"createTime": (userInfo != null) ? "${userInfo.createTime}" : "",
"expendAmount": (userInfo != null) ? int.tryParse(userInfo.expendAmount) : 0,
"expendAmount": double.tryParse(userInfo?.expendAmount??"0").toInt(),
});
});
}

131
lib/view_widget/receiving_method_dialog.dart

@ -0,0 +1,131 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/utils/flutter_utils.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/round_button.dart';
import 'custom_image.dart';
import 'my_appbar.dart';
class ReceivingMethodDialog extends StatefulWidget {
final int takeType;
final Function changeTakeType;
ReceivingMethodDialog(this.takeType,this.changeTakeType);
@override
State<StatefulWidget> createState() {
return _ReceivingMethodDialog();
}
}
class _ReceivingMethodDialog extends State<ReceivingMethodDialog> {
Widget build(BuildContext context) {
return Container(
alignment:Alignment.bottomCenter,
child: Column(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.end,
children: [
Container(
margin:
EdgeInsets.only(top: 26, bottom: 8),
// alignment: Alignment.center,
padding: EdgeInsets.only(top: 20,bottom:20),
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
borderRadius: BorderRadius.all(Radius.circular(8)),
),
child: Column(
children: [
Text(
"请选择商品的领取方式",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFFA29E9E),
),
),
Container(
margin: EdgeInsets.only(top:20,bottom: 20),
height:1,
color:Color(0xFFF4F4F4),
),
GestureDetector(
onTap:(){
widget.changeTakeType(1);
Navigator.of(context).pop();
},
child: Text(
S.of(context).ziti,
style: TextStyle(
fontSize: 16.sp,
fontWeight: widget.takeType == 1 ? MyFontWeight.semi_bold : MyFontWeight.medium,
color: widget.takeType == 1 ? Color(0xFF32A060):Color(0xFFA29E9E),
),
),
),
Container(
margin: EdgeInsets.only(top: 20,bottom: 20),
height:1,
color:Color(0xFFF4F4F4),
),
GestureDetector(
onTap:(){
widget.changeTakeType(2);
Navigator.of(context).pop();
},
child:Text(
"物流配送",
style: TextStyle(
fontSize: 16.sp,
fontWeight: widget.takeType == 2 ? MyFontWeight.semi_bold : MyFontWeight.medium,
color: widget.takeType == 2 ? Color(0xFF32A060):Color(0xFFA29E9E),
),
),
),
],
),
),
GestureDetector(
onTap: (){
Navigator.of(context).pop();
},
child:Container(
margin: EdgeInsets.only(top:16),
height:68.h,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(18),
color: Color(0xFF32A060),
),
child:
Text(
S.of(context).quxiao,
style: TextStyle(
fontSize: 18.sp,
fontWeight: MyFontWeight.semi_bold,
color: Colors.white,
),
)
),
),
],
),
);
}
}

4
lib/view_widget/vip_dialog.dart

@ -65,7 +65,7 @@ class _VipDialog extends State<VipDialog> {
alignment: Alignment.topCenter,
children: [
Container(
margin: EdgeInsets.only(top: 40.h),
margin: EdgeInsets.only(top:50.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
@ -76,7 +76,7 @@ class _VipDialog extends State<VipDialog> {
alignment: Alignment.center,
width: double.infinity,
height: 92,
padding: EdgeInsets.only(top: 50.h, bottom: 19.h),
padding: EdgeInsets.only(top: 40.h, bottom: 19.h),
decoration: BoxDecoration(
color: Colors.black,
borderRadius: BorderRadius.only(

Loading…
Cancel
Save