diff --git a/lib/home/activity_list_page.dart b/lib/home/activity_list_page.dart index 6d89ef10..7cb85674 100644 --- a/lib/home/activity_list_page.dart +++ b/lib/home/activity_list_page.dart @@ -10,8 +10,7 @@ import 'package:huixiang/utils/event_type.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:keframe/frame_separate_widget.dart'; -import 'package:keframe/size_cache_widget.dart'; +import 'package:keframe/keframe.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; diff --git a/lib/home/home_view/activity_list.dart b/lib/home/home_view/activity_list.dart index 42132601..87fd8791 100644 --- a/lib/home/home_view/activity_list.dart +++ b/lib/home/home_view/activity_list.dart @@ -12,8 +12,7 @@ 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/my_appbar.dart'; -import 'package:keframe/frame_separate_widget.dart'; -import 'package:keframe/size_cache_widget.dart'; +import 'package:keframe/keframe.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; diff --git a/lib/home/home_view/shortcut_operation.dart b/lib/home/home_view/shortcut_operation.dart index 0b802f2d..7030beb5 100644 --- a/lib/home/home_view/shortcut_operation.dart +++ b/lib/home/home_view/shortcut_operation.dart @@ -151,8 +151,8 @@ class _ShortcutOperation extends State { ), ), Expanded(child: GestureDetector( onTap: (){ - // Navigator.of(context).pushNamed('/router/roll_center_page'); - Navigator.of(context).pushNamed('/router/welfare_page'); + Navigator.of(context).pushNamed('/router/roll_center_page'); + // Navigator.of(context).pushNamed('/router/welfare_page'); }, child:Container( width: double.infinity, diff --git a/lib/home/points_mall_view/points_goods_title.dart b/lib/home/points_mall_view/points_goods_title.dart index 29d74d45..67afb668 100644 --- a/lib/home/points_mall_view/points_goods_title.dart +++ b/lib/home/points_mall_view/points_goods_title.dart @@ -42,10 +42,10 @@ class _PointsGoodsTitle extends State { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - ItemTitle( - text: S.of(context).jifenshangcheng, + // ItemTitle( + // text: S.of(context).jifenshangcheng, // imgPath: "assets/image/icon_points_mall.webp", - ), + // ), // ItemTitle( // text: S.of(context).jifenshangcheng, // imgPath: "assets/image/icon_points_mall.webp", diff --git a/lib/home/welfare_exchange.dart b/lib/home/welfare_exchange.dart new file mode 100644 index 00000000..4099c7f8 --- /dev/null +++ b/lib/home/welfare_exchange.dart @@ -0,0 +1,493 @@ +import 'dart:convert'; +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/home/points_mall_view/points_goods_title.dart'; +import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/data/goods.dart'; +import 'package:huixiang/retrofit/data/goods_category.dart'; +import 'package:huixiang/retrofit/data/page.dart'; +import 'package:huixiang/retrofit/data/user_info.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/utils/flutter_utils.dart'; +import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/view_widget/classic_header.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:huixiang/view_widget/custom_image.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:huixiang/view_widget/my_footer.dart'; +import 'package:huixiang/view_widget/no_data_view.dart'; +import 'package:pull_to_refresh/pull_to_refresh.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +class WelfareExchange extends StatefulWidget { + @override + State createState() { + return _WelfareExchange(); + } +} + +class _WelfareExchange extends State { + ApiService apiService; + final ScrollController scrollController = ScrollController(); + final RefreshController refreshController = RefreshController(); + int pageNum = 1; + //排序类型枚举:1-自然排序,2-销量,3-价格 + int orderType = 1; + //是否降序排列 + bool orderDesc = true; + List goods = []; + List gooods = []; + List gooodsCategorys = []; + UserInfo userInfo; + String categoryId; + + @override + void dispose() { + super.dispose(); + refreshController.dispose(); + } + + @override + void initState() { + super.initState(); + SharedPreferences.getInstance().then((value) => { + apiService = ApiService(Dio(), + context: context, token: value.getString("token")), + creditGoods(), + }); + } + + queryUser() async { + BaseData baseData = + await apiService.queryInfo().catchError((onError) {}); + if (baseData != null && baseData.isSuccess) { + userInfo = baseData.data; + SharedPreferences.getInstance().then((value) => { + value.setString('user', jsonEncode(baseData.data)), + }); + } + } + + creditGoods() async { + EasyLoading.show(status: S.current.zhengzaijiazai); + + final SharedPreferences value = await SharedPreferences.getInstance(); + apiService = ApiService(Dio(), + context: context, token: value.getString('token'), showLoading: false); + + await queryUser(); + + BaseData> goodsData = await apiService.creditGoods({ + "orderDesc": true, + "orderType": 1, + "pageNum": 1, + "pageSize": 10, + "state": 1 + }).catchError((onError) { + refreshController.refreshFailed(); + }); + if (goodsData != null && goodsData.isSuccess) { + gooods.clear(); + gooods.addAll(goodsData.data.list); + } + + BaseData> dataCategory = + await apiService.goodsCategory({ + "current": 1, + "map": {}, + "model": {"pageNum": 1, "pageSize": 20, "searchKey": ""}, + "order": "descending", + "size": 20, + "sort": "sortOrder" + }).catchError((onError) { + refreshController.loadFailed(); + refreshController.refreshFailed(); + }); + + if (dataCategory != null && + dataCategory.isSuccess && + dataCategory.data != null && + dataCategory.data.records != null && + dataCategory.data.records.length > 0) { + gooodsCategorys.clear(); + gooodsCategorys.add(GoodsCategory(name: S.of(context).quanbu)); + gooodsCategorys.addAll(dataCategory.data.records); + } + + var param = { + "categoryId": categoryId ?? "", + "orderDesc": orderDesc, + "orderType": orderType, + "pageNum": pageNum, + "pageSize": 10, + "state": 1 + }; + BaseData> pageGoods = + await apiService.creditGoods(param).catchError((onError) { + refreshController.loadFailed(); + refreshController.refreshFailed(); + }); + EasyLoading.dismiss(); + if (pageGoods != null && pageGoods.isSuccess) { + if (pageNum == 1) { + goods.clear(); + } + goods.addAll(pageGoods.data.list); + refreshController.refreshCompleted(); + refreshController.loadComplete(); + if (pageGoods.data.pageNum == pageGoods.data.pages) { + refreshController.loadNoData(); + } else { + pageNum += 1; + } + } else { + refreshController.loadFailed(); + refreshController.refreshFailed(); + } + } + + _onRefresh() { + creditGoods(); + } + + @override + Widget build(BuildContext context) { + return Container( + color: Color(0xFFF7F7F7), + child: Stack( + children: [ + Container( + // padding: EdgeInsets.only(top: 40.h), + height: 172.h, + decoration: BoxDecoration( + // border: Border.all(color: Colors.white,width: 0.5), + color: Color(0xFF277D4B), + shape: BoxShape.rectangle, + borderRadius: BorderRadius.only( + bottomRight: Radius.circular(40), + bottomLeft: Radius.circular(40), + ), + ), + // child: ClipPath( + // 只裁切底部的方法 + // clipper: BottonClipper(), + // child: Container( + // color: Colors.deepOrange, + // height: 300, + // ), + // ), + ), + Scaffold( + backgroundColor: Colors.transparent, + appBar: MyAppBar( + background: Colors.transparent, + leadingColor: Colors.white, + title: "福利兑换", + titleColor: Colors.white, + titleSize: 18.sp, + brightness: Brightness.dark, + ), + body: SmartRefresher( + controller: refreshController, + enablePullDown: true, + enablePullUp: false, + header: MyHeader(), + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); + }, + ), + onRefresh: () { + setState(() { + _onRefresh(); + }); + }, + physics: BouncingScrollPhysics(), + scrollController: scrollController, + child: Container( + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: FutureBuilder( + future: creditGoods(), + builder: (context, snap) { + return Column( + children: [ + ///积分商城的用户信息 + pointUser(), + + ///积分商品头Tab + PointsGoodsTitle( + gooodsCategorys, + (orderType, orderDesc) { + this.orderType = orderType; + this.orderDesc = orderDesc; + setState(() {}); + }, + (index) { + categoryId = gooodsCategorys[index].id; + pageNum = 1; + setState(() {}); + }, + ), + + ///积分商品列表, + pointList() + ], + ); + }, + ), + ), + ), + ), + ), + ], + ), + ); + } + + Widget pointUser() { + return Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all(Radius.circular(4)), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 1), + blurRadius: 8, + spreadRadius: 0, + ) + ]), + margin: EdgeInsets.all(16), + padding: EdgeInsets.all(16), + child: Row( + children: [ + MImage( + userInfo != null ? userInfo.headimg : "", + width: 50, + height: 50, + isCircle: true, + fit: BoxFit.cover, + errorSrc: "assets/image/default_user.webp", + fadeSrc: "assets/image/default_user.webp", + ), + Expanded( + child: Container( + margin: EdgeInsets.only(left: 12.w), + height: 50.h, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + userInfo == null + ? Text( + S.of(context).denglu, + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF353535), + ), + ) + : Text( + userInfo.nickname, + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF353535), + ), + ), + SizedBox( + height: 2.h, + ), + userInfo == null + ? Text( + S.of(context).weidengluxinxi, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF353535), + ), + ) + : Text( + userInfo == null + ? "" + : AppUtils.phoneEncode(userInfo?.phone ?? ""), + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF353535), + ), + ), + ], + ), + ), + flex: 1, + ), + userInfo == null + ? Icon( + Icons.keyboard_arrow_right, + size: 20, + color: Colors.black, + ) + : Container( + margin: EdgeInsets.only(left: 15.w), + height: 50.h, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text( + S.of(context).yiyoujifen, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF4C4C4C), + ), + ), + SizedBox( + height: 4.h, + ), + Text( + (userInfo != null) ? "${userInfo.points}" : "", + style: TextStyle( + fontSize: 16.sp, + color: Color(0xFF32A060), + fontWeight: FontWeight.bold, + ), + ), + ], + ), + ) + ], + ), + ); + } + + Widget pointList(){ + return Container( + child: (goods == null || goods.length == 0)? NoDataView( + src: "assets/image/xiao_fei.webp", + isShowBtn: false, + text: "当前分类暂无商品", + fontSize: 16.sp, + margin: EdgeInsets.only(top: 120.h,left: 60.w,right: 60.w), + ):GridView.builder( + itemCount:goods == null ? 0 : goods.length, + padding: EdgeInsets.only( + left: 16.w, + right: 16.w, + top: 18.h, + bottom: 16.h, + ), + shrinkWrap: true, + physics: BouncingScrollPhysics(), + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + //一行的Widget数量 + crossAxisCount: 2, + //水平子Widget之间间距 + crossAxisSpacing: 11.w, + //垂直子Widget之间间距 + mainAxisSpacing: 16.w, + //子Widget宽高比例 0.59 + childAspectRatio: + 200 / (261 / 2 + (261 / 2) * AppUtils.textScale(context)), + ), + itemBuilder: (context, index) { + return GestureDetector( + onTap: () { + Navigator.of(context).pushNamed( + '/router/integral_store_page', + arguments: {"goodsId": goods[index].id}, + ); + }, + child: pointItem(goods[index]), + ); + }, + ), + ); + } + + Widget pointItem(Goods goods) { + return Container( + alignment: Alignment.center, + decoration: BoxDecoration( + color: Color(0xFFFFFFFF), + borderRadius: BorderRadius.circular(4), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ) + ], + ), + child: Stack( + alignment: AlignmentDirectional.topEnd, + fit: StackFit.loose, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + MImage( + goods.mainImgPath, + aspectRatio: 1.1, + fit: BoxFit.cover, + radius: BorderRadius.only( + topLeft: Radius.circular(4), + topRight: Radius.circular(4), + ), + errorSrc: "assets/image/default_1.webp", + fadeSrc: "assets/image/default_1.webp", + ), + Expanded( + child: Container( + margin: EdgeInsets.only( + right: 12.w, + top: 10.h, + ),padding: EdgeInsets.only( + bottom: 8, + left: 8 + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + goods.name, + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + color: Color(0xFF0D0D0D), + height: 1.2, + fontWeight: MyFontWeight.regular, + fontSize: 14.sp, + ), + ), + Spacer(), + Text( + (goods?.price == null || goods.price == "0"?"":S.of(context).jifen_(goods.price)) + (goods?.money == null|| goods.money == "0.00" ?"":" + ${goods.money}元"), + style: TextStyle( + color: Color(0xFFE5600D), + fontSize: 16.sp, + fontWeight: MyFontWeight.semi_bold, + ), + ), + ], + ), + ), + flex: 1, + ), + ], + ), + ], + ), + ); + } + +} diff --git a/lib/home/welfare_page.dart b/lib/home/welfare_page.dart index 47ca1b87..c52b512a 100644 --- a/lib/home/welfare_page.dart +++ b/lib/home/welfare_page.dart @@ -1,15 +1,17 @@ import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:huixiang/generated/l10n.dart'; -import 'package:huixiang/retrofit/data/activity.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/data/goods.dart'; import 'package:huixiang/retrofit/data/page.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/utils/flutter_utils.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/classic_header.dart'; -import 'package:huixiang/view_widget/item_title.dart'; +import 'package:huixiang/view_widget/custom_image.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_footer.dart'; @@ -27,10 +29,54 @@ class _WelfarePage extends State { ApiService apiService; final RefreshController refreshController = RefreshController(); final ScrollController scrollController = ScrollController(); + List goods = []; + String categoryId; + bool orderDesc = true; + int orderType = 1; + int pageNum = 1; @override void initState() { super.initState(); + SharedPreferences.getInstance().then((value) => { + apiService = ApiService(Dio(), context: context, token: value.getString("token")), + queryGoods(), + }); + } + + queryGoods() async { + var param = { + "categoryId": categoryId ?? "", + "orderDesc": orderDesc, + "orderType": orderType, + "pageNum": pageNum, + "pageSize": 10, + "state": 1 + }; + BaseData> pageGoods = + await apiService.creditGoods(param).catchError((onError) { + refreshController.loadFailed(); + refreshController.refreshFailed(); + }); + EasyLoading.dismiss(); + if (pageGoods != null && pageGoods.isSuccess) { + setState(() { + if (pageNum == 1) { + goods.clear(); + } + goods.addAll(pageGoods.data.list); + }); + refreshController.refreshCompleted(); + refreshController.loadComplete(); + if (pageGoods.data.pageNum == pageGoods.data.pages) { + refreshController.loadNoData(); + } else { + pageNum += 1; + } + } else { + refreshController.loadFailed(); + refreshController.refreshFailed(); + } } @override @@ -90,7 +136,9 @@ class _WelfarePage extends State { inviteFriends(), - activityTask(), + benefitExchange(), + + // activityTask(), ], ); }, @@ -132,7 +180,7 @@ class _WelfarePage extends State { crossAxisAlignment: CrossAxisAlignment.center, children: [ Text( - "本周劵包 ", + S.of(context).lingquanzhongxin, style: TextStyle( color: Color(0xFF0D0D0D), fontSize: 15.sp, @@ -140,7 +188,7 @@ class _WelfarePage extends State { ), ), Text( - "每周五上新 ", + "每周上新 ", style: TextStyle( color: Color(0xFF4D4D4D), fontSize: 12.sp, @@ -313,7 +361,7 @@ class _WelfarePage extends State { ///邀请好友 Widget inviteFriends() { return Container( - margin: EdgeInsets.only(right:14.w,top:24.h,bottom:20.h), + margin: EdgeInsets.only(top:24.h,bottom:20.h), child:Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, @@ -346,10 +394,171 @@ class _WelfarePage extends State { ); } + ///福利兑换 + Widget benefitExchange() { + return Container( + width: double.infinity, + margin: EdgeInsets.only(top:24.h,bottom:20.h), + child:Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + GestureDetector( + onTap: (){ + Navigator.of(context).pushNamed('/router/welfare_exchange'); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded(child: + Text( + "福利兑换", + style: TextStyle( + fontSize: 15.sp, + fontWeight: MyFontWeight.bold, + color: Color(0xFF0D0D0D), + ), + ),), + Text( + S.of(context).gengduo, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF4D4D4D), + ), + ), + Icon( + Icons.keyboard_arrow_right, + color: Color(0xFF4D4D4D), + size: 20, + ) + ], + ), + ), + SizedBox(height: 12,), + GridView.builder( + itemCount:goods.length>6?6:goods.length, + padding: EdgeInsets.only( + // left: 16.w, + // right: 16.w, + top: 18.h, + bottom: 16.h, + ), + shrinkWrap: true, + physics: BouncingScrollPhysics(), + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + //一行的Widget数量 + crossAxisCount: 2, + //水平子Widget之间间距 + crossAxisSpacing: 11.w, + //垂直子Widget之间间距 + mainAxisSpacing: 16.w, + //子Widget宽高比例 0.59 + childAspectRatio: + 200 / (261 / 2 + (261 / 2) * AppUtils.textScale(context)), + ), + itemBuilder: (context, index) { + return GestureDetector( + onTap: () { + Navigator.of(context).pushNamed( + '/router/integral_store_page', + arguments: {"goodsId": goods[index].id}, + ); + }, + child: exchangeItem(goods[index]), + ); + }, + ) + ], + ), + ); + } + + Widget exchangeItem(Goods goods) { + return Container( + alignment: Alignment.center, + decoration: BoxDecoration( + color: Color(0xFFFFFFFF), + borderRadius: BorderRadius.circular(4), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 2), + blurRadius: 4, + spreadRadius: 0, + ) + ], + ), + child: Stack( + alignment: AlignmentDirectional.topEnd, + fit: StackFit.loose, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + MImage( + goods.mainImgPath, + aspectRatio: 1.1, + fit: BoxFit.cover, + radius: BorderRadius.only( + topLeft: Radius.circular(4), + topRight: Radius.circular(4), + ), + errorSrc: "assets/image/default_1.webp", + fadeSrc: "assets/image/default_1.webp", + ), + Expanded( + child: Container( + margin: EdgeInsets.only( + right: 12.w, + top: 10.h, + ),padding: EdgeInsets.only( + bottom: 8, + left: 8 + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + goods.name, + overflow: TextOverflow.ellipsis, + maxLines: 2, + style: TextStyle( + color: Color(0xFF0D0D0D), + height: 1.2, + fontWeight: MyFontWeight.regular, + fontSize: 14.sp, + ), + ), + Spacer(), + Text( + (goods?.price == null || goods.price == "0"?"":S.of(context).jifen_(goods.price)) + (goods?.money == null|| goods.money == "0.00" ?"":" + ${goods.money}元"), + style: TextStyle( + color: Color(0xFFE5600D), + fontSize: 16.sp, + fontWeight: MyFontWeight.semi_bold, + ), + ), + ], + ), + ), + flex: 1, + ), + ], + ), + ], + ), + ); + } + ///活动任务 Widget activityTask() { return Container( - margin: EdgeInsets.only(right:14.w,bottom:20.h,), + margin: EdgeInsets.only(bottom:20.h,), child:Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, @@ -477,4 +686,5 @@ class _WelfarePage extends State { ); } + } diff --git a/lib/login/new_login_page.dart b/lib/login/new_login_page.dart index b2473a2f..322e9e5a 100644 --- a/lib/login/new_login_page.dart +++ b/lib/login/new_login_page.dart @@ -235,7 +235,8 @@ class _NewLoginPage extends State { EasyLoading.dismiss(); } else { - SmartDialog.showToast(value?.msg, alignment: Alignment.center); + if(value.msg != null) + SmartDialog.showToast(value?.msg, alignment: Alignment.center); } } diff --git a/lib/main.dart b/lib/main.dart index 65ff0bf1..62cf08e0 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -94,6 +94,7 @@ import 'community/report/report_success.dart'; import 'home/guide_page.dart'; import 'home/home_view/activity_list.dart'; import 'home/start_page.dart'; +import 'home/welfare_exchange.dart'; import 'home/welfare_page.dart'; import 'login/new_login_page.dart'; import 'main_page.dart'; @@ -391,4 +392,6 @@ Map routers = { MineShopDetails(arguments:arguments,), '/router/coupon_page': (context, {arguments}) => CouponPage(), + '/router/welfare_exchange': (context, {arguments}) => + WelfareExchange(), }; diff --git a/lib/mine/mine_greenery.dart b/lib/mine/mine_greenery.dart index e9057a39..92df2c57 100644 --- a/lib/mine/mine_greenery.dart +++ b/lib/mine/mine_greenery.dart @@ -347,6 +347,10 @@ class _MineGreenery extends State { goods.mainImgPath, aspectRatio: 1.1, fit: BoxFit.cover, + radius: BorderRadius.only( + topLeft: Radius.circular(4), + topRight: Radius.circular(4), + ), errorSrc: "assets/image/default_1.webp", fadeSrc: "assets/image/default_1.webp", ), diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index 6c6db000..f22f0a70 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -39,7 +39,7 @@ part 'min_api.g.dart'; // const base_url = "http://192.168.10.37:8765/app/"; -const localBaseUrl = "http://192.168.10.78:8765/app/";///本地 +const localBaseUrl = "http://192.168.10.236:8765/app/";///本地 const serviceBaseUrl = "https://pos.api.lotus-wallet.com/app/";///线上 @@ -109,7 +109,7 @@ abstract class MinApiService { } } else if (map["code"] != 0 && response.request.baseUrl == baseUrl) { ///高德地图的poi服务请求不需要toast - SmartDialog.showToast(map["msg"], alignment: Alignment.center); + // SmartDialog.showToast(map["msg"], alignment: Alignment.center); } debugPrint( "======================= Min_响应数据结束 =======================\n"); diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index 74a712a7..4efc5058 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -70,7 +70,7 @@ part 'retrofit_api.g.dart'; // const base_url = "http://192.168.10.132:8766/app/";///詹云久 -const localBaseUrl = "http://192.168.10.78:8766/app/";///本地 +const localBaseUrl = "http://192.168.10.236:8766/app/";///本地 const serviceBaseUrl = "https://pos.platform.lotus-wallet.com/app/";///线上 @RestApi(baseUrl: localBaseUrl) @@ -131,7 +131,7 @@ abstract class ApiService { } } else if (map["code"] != 0 && response.request.baseUrl == baseUrl) { ///高德地图的poi服务请求不需要toast - SmartDialog.showToast(map["msg"], alignment: Alignment.center); + // SmartDialog.showToast(map["msg"], alignment: Alignment.center); } debugPrint("======================= 响应数据结束 =======================\n"); }, onError: (DioError e) { diff --git a/lib/settlement/settlement.dart b/lib/settlement/settlement.dart index eb3d0305..c7088cb1 100644 --- a/lib/settlement/settlement.dart +++ b/lib/settlement/settlement.dart @@ -113,7 +113,7 @@ class _Settlement extends State { tenant: tenant, storeId: storeId, showLoading: true); - if (promotions != null && promotions != "" || tableId <= 0) { + if (promotions != null && promotions != "" && tableId <= 0) { queryOrderInfo( address != null ? address.id : null, selectedBtn, @@ -125,7 +125,7 @@ class _Settlement extends State { actProductSkuId ?? "", count1, payChannel); - } else if (coupons != null && coupons != "" || tableId <= 0) { + } else if (coupons != null && coupons != "" && tableId <= 0) { queryOrderInfo( address != null ? address.id : null, selectedBtn, @@ -818,7 +818,7 @@ class _Settlement extends State { couponBean: couponListBean); }, ); - if (couponBean != null) { + // if (couponBean != null) { this.couponListBean = couponBean; coupons = couponListBean?.promotionName ?? ""; promotions = ""; @@ -834,7 +834,7 @@ class _Settlement extends State { actProductSkuId ?? "", count1, payChannel); - } + // } } ///活动弹窗 @@ -847,7 +847,7 @@ class _Settlement extends State { return SettlementActivity(settleOrderInfo, storeInfo); }, ); - if (pro != null) { + // if (pro != null) { this.promotion = pro; promotions = promotion?.name ?? ""; coupons = ""; @@ -864,5 +864,5 @@ class _Settlement extends State { count1, payChannel); } - } + // } } diff --git a/lib/settlement/settlement_view/coupon.dart b/lib/settlement/settlement_view/coupon.dart index cfa430fd..f8998f46 100644 --- a/lib/settlement/settlement_view/coupon.dart +++ b/lib/settlement/settlement_view/coupon.dart @@ -167,7 +167,7 @@ class _CouponWidget extends State { margin: EdgeInsets.only(right: 23.w), child: GestureDetector( onTap: () { - Navigator.of(context).pop(widget.selected?null:widget.couponList); + Navigator.of(context).pop(widget.couponList); }, child: Image.asset( widget.selected diff --git a/lib/settlement/settlement_view/distribution.dart b/lib/settlement/settlement_view/distribution.dart index ec1a4298..dd5cb8cb 100644 --- a/lib/settlement/settlement_view/distribution.dart +++ b/lib/settlement/settlement_view/distribution.dart @@ -154,13 +154,15 @@ class _DistributionMode extends State { flex: 1, child: GestureDetector( onTap: () { - if (widget.storeInfo.storeName == "一心回乡商城") { - SmartDialog.showToast("该功能暂未开放!", - alignment: Alignment.center); - return; - } - selectedBtn = 1; - widget.queryAddress(selectedBtn); + // if (widget.storeInfo.storeName == "一心回乡商城") { + // SmartDialog.showToast("该功能暂未开放!", + // alignment: Alignment.center); + // return; + // } + // selectedBtn = 1; + // widget.queryAddress(selectedBtn); + SmartDialog.showToast("该功能暂未开放!", + alignment: Alignment.center); }, child: Container( height: 50.h, @@ -180,11 +182,11 @@ class _DistributionMode extends State { flex: 1, child: GestureDetector( onTap: () { - if (widget.storeInfo.storeName == "一心回乡商城") { - selectedBtn = 2; - widget.queryAddress(selectedBtn); - return; - } + // if (widget.storeInfo.storeName == "一心回乡商城") { + // selectedBtn = 2; + // widget.queryAddress(selectedBtn); + // return; + // } SmartDialog.showToast("该功能暂未开放!", alignment: Alignment.center); }, diff --git a/lib/store/store_order.dart b/lib/store/store_order.dart index 6c61d7ee..c14b7f3c 100644 --- a/lib/store/store_order.dart +++ b/lib/store/store_order.dart @@ -294,7 +294,8 @@ class _StoreOrderPage extends State right: 0, ), Positioned( - child: Container( decoration: BoxDecoration( + child: Container( + decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(8.w), ), @@ -339,7 +340,7 @@ class _StoreOrderPage extends State ], ), ), - top:225.h, + top:226.h, bottom: 0, left: 0, right: 0, @@ -363,8 +364,8 @@ class _StoreOrderPage extends State controller: tabcontroller, automaticIndicatorColorAdjustment: true, isScrollable: true, - indicatorWeight: 1, - indicatorColor: Color(0xFFFAFAFA), + indicatorWeight: 3, + indicatorColor: Color(0xFF32A060), labelPadding: EdgeInsets.only( left: 8.w, right: 8.w, @@ -381,7 +382,7 @@ class _StoreOrderPage extends State ), labelColor: Colors.black, tabs: [ - MyTab(text: S.of(context).diancan), + MyTab(text: S.of(context).diandan), // MyTab(text: ""), ], ), @@ -618,7 +619,7 @@ class _StoreOrderPage extends State Widget buildSwiper() { return Container( width: double.infinity, - height: 180.h, + height: 230.h, child: Swiper( pagination: SwiperPagination( alignment: Alignment.bottomCenter, @@ -806,14 +807,14 @@ class _StoreOrderPage extends State if (baseDate.data[0].selectDiscount == 1) { baseDate.data[0].couponList.forEach((element) { if (element.isMaxCoupon) { - cName = element.promotionName; + // cName = element.promotionName; cid = element.id; } }); } else if (baseDate.data[0].selectDiscount == 2) { baseDate.data[0].promotionInfoList.forEach((element) { if (element.isMaxPromotion) { - pName = element.name; + // pName = element.name; pid = element.id; } }); diff --git a/lib/store/store_view/store_info.dart b/lib/store/store_view/store_info.dart index 4eb351c6..3a7dd426 100644 --- a/lib/store/store_view/store_info.dart +++ b/lib/store/store_view/store_info.dart @@ -27,10 +27,10 @@ class _StoreInfoView extends State { margin: EdgeInsets.only( // left: 16.w, // right: 16.w, - top: 5.h, - bottom: 6.h, + // top: 5.h, + // bottom: 6.h, ), - height: MediaQuery.of(context).size.width >= 650 ? 180.h :154.h, + height: MediaQuery.of(context).size.width >= 650 ? 180.h :166.h, padding: EdgeInsets.all(12.w), decoration: BoxDecoration( color: Colors.white, diff --git a/lib/view_widget/mine_vip_view.dart b/lib/view_widget/mine_vip_view.dart index 3d05562e..884b7ad0 100644 --- a/lib/view_widget/mine_vip_view.dart +++ b/lib/view_widget/mine_vip_view.dart @@ -148,6 +148,46 @@ class MineVipView extends StatelessWidget { child: Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ + // Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Container( + // padding: EdgeInsets.fromLTRB(9.w, 4.h, 8.w, 4.h), + // decoration: BoxDecoration( + // color: levelColor, + // borderRadius: BorderRadius.only( + // topLeft: Radius.circular(8), + // bottomRight: Radius.circular(8), + // ), + // ), + // child: Text( + // topLeft, + // style: TextStyle( + // fontSize: 12.sp, + // fontWeight: MyFontWeight.semi_bold, + // color: Colors.white, + // ), + // ), + // ), + // Container( + // padding: EdgeInsets.fromLTRB(9.w, 4.h, 8.w, 4.h), + // margin: EdgeInsets.only(top: 10,right: 10), + // decoration: BoxDecoration( + // color: levelColor, + // borderRadius: BorderRadius.circular(10), + // ), + // child: Text( + // S.of(context).chakanquanyi, + // style: TextStyle( + // fontSize: 12.sp, + // fontWeight: MyFontWeight.semi_bold, + // color: Color(0xFFF5EEE9), + // ), + // ), + // ) + // ], + // ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start, diff --git a/pubspec.lock b/pubspec.lock index c94e502b..8b091912 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -147,7 +147,7 @@ packages: name: ffi url: "https://pub.flutter-io.cn" source: hosted - version: "1.1.2" + version: "1.2.1" file: dependency: transitive description: @@ -307,7 +307,7 @@ packages: name: fluwx url: "https://pub.flutter-io.cn" source: hosted - version: "3.8.4+1" + version: "3.8.5" font_awesome_flutter: dependency: "direct main" description: @@ -377,7 +377,7 @@ packages: name: keframe url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.4" + version: "2.0.6" like_button: dependency: "direct main" description: @@ -468,7 +468,7 @@ packages: name: path_provider_linux url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.5" + version: "2.1.6" path_provider_platform_interface: dependency: transitive description: @@ -482,7 +482,7 @@ packages: name: path_provider_windows url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.5" + version: "2.0.6" permission_handler: dependency: "direct main" description: @@ -566,7 +566,7 @@ packages: name: quiver url: "https://pub.flutter-io.cn" source: hosted - version: "3.0.1+1" + version: "3.1.0" retrofit: dependency: "direct main" description: @@ -629,7 +629,7 @@ packages: name: shared_preferences_web url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.3" + version: "2.0.4" shared_preferences_windows: dependency: transitive description: @@ -802,7 +802,7 @@ packages: name: video_player_web url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.8" + version: "2.0.10" wakelock: dependency: transitive description: