diff --git a/lib/community/community_course.dart b/lib/community/community_course.dart index 59c8f3a7..4cb77888 100644 --- a/lib/community/community_course.dart +++ b/lib/community/community_course.dart @@ -10,18 +10,15 @@ import 'package:huixiang/retrofit/data/brand.dart'; import 'package:huixiang/retrofit/data/brand_data.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_details.dart'; import 'package:huixiang/retrofit/data/course_list.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/login_tips_dialog.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 'community_view/class_list_view.dart'; import 'community_view/class_title_tab.dart'; import 'community_view/course_banner.dart'; @@ -40,9 +37,8 @@ class _CommunityCourse extends State final RefreshController refreshController = RefreshController(); ApiService apiService; - List brands = []; - BrandData brandData; List globaKeys = []; + List brands = []; List bannerData = []; List classSelectList = []; List classList = []; @@ -68,15 +64,31 @@ class _CommunityCourse extends State ///banner queryCourseBanner() async { - BaseData> banner = await apiService.queryBanner({ + if (apiService == null) { + SharedPreferences value = await SharedPreferences.getInstance(); + apiService = ApiService( + Dio(), + context: context, + token: value.getString("token"), + ); + } + BaseData> baseData = + await apiService.queryBanner({ "model": {"type": "COURSE_BANNER"}, - }).catchError((error) { + }).catchError((onError) { refreshController.refreshFailed(); }); - bannerData.clear(); - bannerData.addAll(banner.data.records); + if (baseData != null && baseData.isSuccess) { + bannerData.clear(); + bannerData.addAll(baseData.data.records); + refreshController.refreshCompleted(); + } else { + refreshController.refreshFailed(); + } + EasyLoading.dismiss(); } + ///课程分类列表 classListAsync() async { if (apiService == null) { @@ -242,7 +254,7 @@ class _CommunityCourse extends State List classChildItem() { var widgets = [ ///课程banner - CourseBanner(bannerData), + CourseBanner(bannerData,), SizedBox(height: 28), diff --git a/lib/community/community_details.dart b/lib/community/community_details.dart index 81e3151e..59ddd16b 100644 --- a/lib/community/community_details.dart +++ b/lib/community/community_details.dart @@ -138,10 +138,14 @@ class _CommunityDetails extends State with WidgetsBindingObser commentKey, comunity?.likes ?? comunity?.likes.toString() ?? 0, comunity.id, + 1, isKeyBoardShow, _reply, _delCommentTips, 12.sp, + requestApiFinish: (total){setState(() { + commentTotal = total; + });}, ), if (memberList == null || memberList.length == 0) Container( @@ -186,7 +190,7 @@ class _CommunityDetails extends State with WidgetsBindingObser ///给文章/活动点赞 _queryInformationLikes() async { - BaseData baseData = await apiService.informationLikes(comunity.id); + BaseData baseData = await apiService.informationLikes(comunity.id).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { commentKey.currentState.setState(() {}); setState(() { diff --git a/lib/community/community_view/class_details.dart b/lib/community/community_view/class_details.dart index 9ed9a92e..d72a542d 100644 --- a/lib/community/community_view/class_details.dart +++ b/lib/community/community_view/class_details.dart @@ -313,6 +313,7 @@ class _ClassDetails extends State with WidgetsBindingObserver{ commentKey, course?.likes ?? course?.likes?? 0, widget.arguments["id"], + 3, isKeyBoardShow, _reply, _delCommentTips, @@ -528,7 +529,7 @@ class _ClassDetails extends State with WidgetsBindingObserver{ ///给文章/活动点赞 _queryInformationLikes() async { - BaseData baseData = await apiService.informationLikes(widget.arguments["id"]); + BaseData baseData = await apiService.informationLikes(widget.arguments["id"]).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { commentKey.currentState.setState(() {}); setState(() { @@ -549,13 +550,14 @@ class _ClassDetails extends State with WidgetsBindingObserver{ "content": content, "parentId": parenId, "relationalId":widget.arguments["id"], - "relationalType": 1 + "relationalType": 3 }).catchError((error) {}); if (baseData != null && baseData.isSuccess) { CommentListState state = commentKey.currentState; state.queryMemberCommentList(); commentTextController.text = ""; FocusScope.of(context).unfocus(); + // _toComment(); } } diff --git a/lib/community/community_view/course_banner.dart b/lib/community/community_view/course_banner.dart index d1ca2c79..bf0241b9 100644 --- a/lib/community/community_view/course_banner.dart +++ b/lib/community/community_view/course_banner.dart @@ -71,7 +71,7 @@ class _CourseBanner extends State { ); } - /// contentType 跳转类型(0:不跳转,1:积分商品,2:活动,3:文章) + /// contentType 跳转类型(0:不跳转,1:积分商品,2:活动,3:文章,4:页面跳转,5:课程) bannerClick(BannerData bannerData) async { switch (bannerData.contentType) { case 1: @@ -101,14 +101,18 @@ class _CourseBanner extends State { Navigator.of(context).pushNamed(router); } break; + case 5: + Navigator.of(context) + .pushNamed('/router/class_details', arguments: { + "id": bannerData.content, + }); + break; + } } } -} - - diff --git a/lib/home/home_view/home_banner.dart b/lib/home/home_view/home_banner.dart index a72834a8..a677bc8d 100644 --- a/lib/home/home_view/home_banner.dart +++ b/lib/home/home_view/home_banner.dart @@ -69,26 +69,24 @@ class _HomeBanner extends State { ); } - /// contentType 跳转类型(0:不跳转,1:积分商品,2:活动,3:文章) + /// contentType 跳转类型(0:不跳转,1:积分商品,2:活动,3:文章,4:页面跳转,5:课程) bannerClick(BannerData bannerData) async { switch (bannerData.contentType) { case 1: - Navigator.of(context).pushNamed( - '/router/integral_store_page', - arguments: {"goodsId": bannerData.content}, - ); + 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}, - ); + 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}, - ); + Navigator.of(context) + .pushNamed('/router/web_page', arguments: { + "articleId": bannerData.content, + }); break; case 4: String router = bannerData.content; @@ -101,6 +99,12 @@ class _HomeBanner extends State { Navigator.of(context).pushNamed(router); } break; + case 5: + Navigator.of(context) + .pushNamed('/router/class_details', arguments: { + "id": bannerData.content, + }); + break; } } } diff --git a/lib/home/home_view/shortcut_operation.dart b/lib/home/home_view/shortcut_operation.dart index 46401733..4a23a3c2 100644 --- a/lib/home/home_view/shortcut_operation.dart +++ b/lib/home/home_view/shortcut_operation.dart @@ -80,7 +80,7 @@ class _ShortcutOperation extends State { ), GestureDetector( onTap: (){ - + Navigator.of(context).pushNamed('/router/recharge_page'); }, child: Container( width: 106, diff --git a/lib/home/huixiang_view/huixiang_banner.dart b/lib/home/huixiang_view/huixiang_banner.dart index de2aebd2..6aa42a5f 100644 --- a/lib/home/huixiang_view/huixiang_banner.dart +++ b/lib/home/huixiang_view/huixiang_banner.dart @@ -62,7 +62,7 @@ class _HuiXiangBanner extends State { ); } - /// contentType 跳转类型(0:不跳转,1:积分商品,2:活动,3:文章) + /// contentType 跳转类型(0:不跳转,1:积分商品,2:活动,3:文章,4:页面跳转,5:课程) bannerClick(BannerData bannerData) async { switch (bannerData.contentType) { case 1: @@ -92,6 +92,12 @@ class _HuiXiangBanner extends State { Navigator.of(context).pushNamed(router); } break; + case 5: + Navigator.of(context) + .pushNamed('/router/class_details', arguments: { + "id": bannerData.content, + }); + break; } } diff --git a/lib/home/points_mall_view/points_goods_view.dart b/lib/home/points_mall_view/points_goods_view.dart index 4e434a37..aaabe68d 100644 --- a/lib/home/points_mall_view/points_goods_view.dart +++ b/lib/home/points_mall_view/points_goods_view.dart @@ -100,6 +100,7 @@ class _PointGoods extends State { Text( goods.name, overflow: TextOverflow.ellipsis, + maxLines: 2, style: TextStyle( color: Color(0xff353535), fontWeight: MyFontWeight.medium, @@ -109,17 +110,12 @@ class _PointGoods extends State { SizedBox( height: 5.h, ), - Container( - height: 35.h * AppUtils.textScale(context), - child: Text( - goods.description, - maxLines: 2, - overflow: TextOverflow.ellipsis, - style: TextStyle( - color: Color(0xFF727272), - fontWeight: MyFontWeight.regular, - fontSize: 12.sp, - ), + Text( + S.of(context).jifen_(goods.price), + style: TextStyle( + color: Color(0xFF32A060), + fontSize: 14.sp, + fontWeight: MyFontWeight.semi_bold, ), ), SizedBox( @@ -143,11 +139,12 @@ class _PointGoods extends State { flex: 1, ), Text( - S.of(context).jifen_(goods.price), + "库存:${goods?.stock ?? goods?.stock ??""}份", style: TextStyle( - color: Color(0xFF32A060), - fontSize: 14.sp, - fontWeight: MyFontWeight.semi_bold, + color: Color(0xFF585858), + decorationColor: Color(0xFF353535), + fontWeight: MyFontWeight.medium, + fontSize: 12.sp, ), ), ], diff --git a/lib/home/points_mall_view/points_mall_banner.dart b/lib/home/points_mall_view/points_mall_banner.dart index a2f3d06a..3e9e6814 100644 --- a/lib/home/points_mall_view/points_mall_banner.dart +++ b/lib/home/points_mall_view/points_mall_banner.dart @@ -69,7 +69,7 @@ class _PointMallBanner extends State { ); } - /// contentType 跳转类型(0:不跳转,1:积分商品,2:活动,3:文章) + /// contentType 跳转类型(0:不跳转,1:积分商品,2:活动,3:文章,4:页面跳转,5:课程) bannerClick(BannerData bannerData) async { switch (bannerData.contentType) { case 1: @@ -99,10 +99,15 @@ class _PointMallBanner extends State { Navigator.of(context).pushNamed(router); } break; + case 5: + Navigator.of(context) + .pushNamed('/router/class_details', arguments: { + "id": bannerData.content, + }); + break; } } - } diff --git a/lib/integral/integral_page.dart b/lib/integral/integral_page.dart index 8effca3c..e4f037e1 100644 --- a/lib/integral/integral_page.dart +++ b/lib/integral/integral_page.dart @@ -152,7 +152,7 @@ class _IntegralPage extends State { return; } EasyLoading.show(status: S.of(context).zhengzaijiazai); - BaseData baseData = await apiService.signIn(); + BaseData baseData = await apiService.signIn().catchError((onError) {}); if (baseData != null && baseData.isSuccess) { setState(() {}); SmartDialog.show( diff --git a/lib/integral_store/integral_store_details_page.dart b/lib/integral_store/integral_store_details_page.dart index fcb008ca..e08f3d4e 100644 --- a/lib/integral_store/integral_store_details_page.dart +++ b/lib/integral_store/integral_store_details_page.dart @@ -52,7 +52,7 @@ class _IntegralStoreDetailsPage extends State { queryGoodsById() async { BaseData baseData = - await apiService.creditGoodsById(arguments["goodsId"]); + await apiService.creditGoodsById(arguments["goodsId"]).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { setState(() { goods = baseData.data; @@ -63,13 +63,13 @@ class _IntegralStoreDetailsPage extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: MyAppBar( - background: Color(0xFFFFFFFF), - leadingColor: Colors.black, - title: S.of(context).shangpinxiangqing, - titleColor: Colors.black, - titleSize: 16.sp, - ), + // appBar: MyAppBar( + // background: Color(0xFFFFFFFF), + // leadingColor: Colors.black, + // title: S.of(context).shangpinxiangqing, + // titleColor: Colors.black, + // titleSize: 16.sp, + // ), body: Container( child: Column( children: [ @@ -213,7 +213,7 @@ class _IntegralStoreDetailsPage extends State { width: 10.w, ), Expanded(child: Text( - S.of(context).yuan_(goods.worth), + S.of(context).yuan_(goods?.worth??goods?.worth??""), style: TextStyle( color: Color(0xFF585858), decoration: TextDecoration.lineThrough, @@ -223,7 +223,7 @@ class _IntegralStoreDetailsPage extends State { ), ),), Text( - "库存:${goods.stock}份", + "库存:${goods?.stock ?? goods?.stock ??""}份", style: TextStyle( color: Color(0xFF585858), decorationColor: Color(0xFF353535), @@ -268,28 +268,47 @@ class _IntegralStoreDetailsPage extends State { return Container( child: AspectRatio( aspectRatio: 1.3698, - child: Swiper( - pagination: SwiperPagination( - alignment: Alignment.bottomCenter, - builder: DotSwiperPaginationBuilder( - size: 8, - activeSize: 8, - space: 5, - activeColor: Colors.black, - color: Colors.black.withAlpha(76), + child: Stack( + children: [ + Swiper( + pagination: SwiperPagination( + alignment: Alignment.bottomCenter, + builder: DotSwiperPaginationBuilder( + size: 8, + activeSize: 8, + space: 5, + activeColor: Colors.black, + color: Colors.black.withAlpha(76), + ), + ), + itemBuilder: (context, position) { + return goods == null + ? Container() + : Image.network( + goods.viceImgPaths.elementAt(position), + fit: BoxFit.cover, + ); + }, + itemCount: (goods == null || goods.viceImgPaths == null) + ? 1 + : goods.viceImgPaths.length, ), - ), - itemBuilder: (context, position) { - return goods == null - ? Container() - : Image.network( - goods.viceImgPaths.elementAt(position), - fit: BoxFit.cover, - ); - }, - itemCount: (goods == null || goods.viceImgPaths == null) - ? 1 - : goods.viceImgPaths.length, + GestureDetector( + onTap: (){ + Navigator.of(context).pop(); + }, + child: Container( + margin: EdgeInsets.only(left: 16,top: 52), + padding:EdgeInsets.all(5), + child:Image.asset( + "assets/image/integral_return.png", + // alignment: Alignment.center, + width: 24, + height: 24, + ), + ), + ), + ], ), ), ); diff --git a/lib/mine/coupons_page.dart b/lib/mine/coupons_page.dart index 8f275736..4d4bd1c2 100644 --- a/lib/mine/coupons_page.dart +++ b/lib/mine/coupons_page.dart @@ -211,7 +211,7 @@ class _CouponsPage extends State { } receiveCoupon(couponId) async { - BaseData baseData = await apiService.receiveCoupon(couponId); + BaseData baseData = await apiService.receiveCoupon(couponId).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { _onRefresh(); showAlertDialog(); diff --git a/lib/mine/mine_wallet_page.dart b/lib/mine/mine_wallet_page.dart index c68fd63a..1a3eb244 100644 --- a/lib/mine/mine_wallet_page.dart +++ b/lib/mine/mine_wallet_page.dart @@ -57,7 +57,7 @@ class _MineWalletPage extends State { } queryUserBalance() async { - BaseData baseData = await apiService.queryInfo(); + BaseData baseData = await apiService.queryInfo().catchError((onError) {}); if (baseData != null && baseData.isSuccess) { userInfo = baseData.data; mBalance = double.tryParse(userInfo.money); diff --git a/lib/mine/user_info_page.dart b/lib/mine/user_info_page.dart index 0c09c074..55a8234e 100644 --- a/lib/mine/user_info_page.dart +++ b/lib/mine/user_info_page.dart @@ -344,7 +344,7 @@ class _UserInfoPage extends State { ///调用修改用户信息接口 modifyInfos() async { - var info = await apiService.editInfo(modifyInfo); + var info = await apiService.editInfo(modifyInfo).catchError((onError) {}); if (info.isSuccess) { setState(() { SmartDialog.showToast("用户信息修改成功", alignment: Alignment.center); @@ -355,7 +355,7 @@ class _UserInfoPage extends State { ///文件上传 fileUpload() async { if (filePath != null && filePath != "" && await File(filePath).exists()) { - BaseData baseData = await apiService.upload(File(filePath), 123123123); + BaseData baseData = await apiService.upload(File(filePath), 123123123).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { UploadResult uploadResult = baseData.data; modifyInfo["headimg"] = uploadResult.url; diff --git a/lib/order/exchange_order_page.dart b/lib/order/exchange_order_page.dart index a53cf3f9..b14c326b 100644 --- a/lib/order/exchange_order_page.dart +++ b/lib/order/exchange_order_page.dart @@ -13,6 +13,7 @@ import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/min.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; +import 'package:huixiang/view_widget/round_button.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -226,6 +227,85 @@ class _ExchangeOrderPage extends State { ], ), ), + Container( + margin: + EdgeInsets.only(left: 16, right: 16, top: 26, bottom: 8), + padding: EdgeInsets.all(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( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Image.asset( + "assets/image/icon_order_exchange_info.png", + width: 24, + height: 24, + ), + SizedBox(width: 4), + Text( + S.of(context).duihuanxinxi, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + color: Color(0xFF353535)), + ), + ], + ), + SizedBox( + height: 18.h, + ), + 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( + height: 12.h, + ), + Text( + "非实物商品兑换后领取到卡包即可使用!", + style: TextStyle( + fontSize: 14.sp, + color: Color(0xFF32A060), + fontWeight: MyFontWeight.medium + ), + ), + ], + ), + ), Container( margin: EdgeInsets.only(left: 16, right: 16, top: 8, bottom: 16), @@ -318,38 +398,62 @@ class _ExchangeOrderPage extends State { SizedBox( height: 12.h, ), - // Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // crossAxisAlignment: CrossAxisAlignment.center, - // children: [ - // Text( - // "商品积分", - // style: - // TextStyle(fontSize: 14, color: Color(0xFF353535)), - // ), - // SizedBox( - // width: 12, - // ), - // Text( - // S.of(context).jifen_(widget.arguments["price"]), - // style: TextStyle( - // fontSize: 12, - // color: Colors.black, - // ), - // ), - // ], - // ), - // SizedBox( - // height: 12, - // ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ Text( - "实付积分", + "应付数额", + style: + TextStyle(fontSize: 14, color: Color(0xFF353535),fontWeight: MyFontWeight.regular), + ), + SizedBox( + width: 12, + ), + Text( + S.of(context).jifen_(widget.arguments["price"]), + style: TextStyle( + fontSize: 12, + color: Colors.black, + ), + ), + ], + ), + SizedBox( + height: 12, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "现金抵扣积分", + style: + TextStyle(fontSize: 14, color: Color(0xFF353535),fontWeight: MyFontWeight.regular), + ), + SizedBox( + width: 12, + ), + Text( + S.of(context).jifen_(widget.arguments["price"]), + style: TextStyle( + fontSize: 12, + color: Colors.black, + ), + ), + ], + ), + SizedBox( + height: 12, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + "合计", style: TextStyle( - fontSize: 14.sp, color: Color(0xFF353535)), + fontSize: 14.sp, color: Color(0xFF353535),fontWeight: MyFontWeight.regular), ), SizedBox( width: 12.w, @@ -432,7 +536,7 @@ class _ExchangeOrderPage extends State { left: 16.w, right: 16.w, top: 12.h, - bottom:5.h, + bottom:20.h, ), padding: EdgeInsets.only( left: 16.w, @@ -577,28 +681,123 @@ class _ExchangeOrderPage extends State { ], ), ), - GestureDetector( - onTap: () { - if (!storeIsSelected) return; - creditOrder(); - }, - child: Container( - padding: EdgeInsets.only(top: 16, bottom: 16), - decoration: BoxDecoration( - color: MaterialStateColor.resolveWith((states) => - storeIsSelected ? Color(0xFF32A060) : Color(0xFFD8D8D8)), - borderRadius: BorderRadius.only( - topLeft: Radius.circular(4), - topRight: Radius.circular(4))), - alignment: Alignment.center, - child: Text( - S.of(context).querenduihuan, - style: TextStyle( + // GestureDetector( + // onTap: () { + // if (!storeIsSelected) return; + // creditOrder(); + // }, + // child: Container( + // padding: EdgeInsets.only(top: 16, bottom: 16), + // decoration: BoxDecoration( + // color: MaterialStateColor.resolveWith((states) => + // storeIsSelected ? Color(0xFF32A060) : Color(0xFFD8D8D8)), + // borderRadius: BorderRadius.only( + // topLeft: Radius.circular(4), + // topRight: Radius.circular(4))), + // alignment: Alignment.center, + // child: Text( + // S.of(context).querenduihuan, + // style: TextStyle( + // fontSize: 16.sp, + // color: MaterialStateColor.resolveWith((states) => + // storeIsSelected ? Colors.white : Color(0xFFA0A0A0)), + // fontWeight: FontWeight.bold), + // ), + // ), + // ), + Container( + height: 54.h, + color: Colors.white, + child: Row( + children: [ + Spacer(), + Padding(padding: EdgeInsets.only(top: 7,right: 16), + child:Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + S.of(context).heji, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Colors.black, + ), + ), + Text( + "¥0.0", + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF32A060), + ), + ), + ], + )), + GestureDetector( + onTap: () { + + }, + child: RoundButton( + width: 103.w, + height: 54.h, + text: S.current.jiesuan, + textColor: Colors.white, + fontWeight: MyFontWeight.regular, + backgroup: Color(0xFF32A060), + radius: 0, + fontSize: 16.sp, + padding: EdgeInsets.symmetric(vertical: 5.h), + ), + ), + ], + ), + ), + Container( + height: 54.h, + color: Colors.white, + child: Row( + children: [ + Spacer(), + Padding(padding: EdgeInsets.only(top: 7,right: 16), + child:Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + S.of(context).heji, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Colors.black, + ), + ), + Text( + S.of(context).jifen_(widget.arguments["price"]), + style: TextStyle( + fontSize: 16.sp, + fontWeight: MyFontWeight.medium, + color: Color(0xFF32A060), + ), + ), + ], + )), + GestureDetector( + onTap: () { + if (!storeIsSelected) return; + creditOrder(); + }, + child: RoundButton( + width: 103.w, + height: 54.h, + text: S.current.duihuan, + textColor: Colors.white, + fontWeight: MyFontWeight.regular, + backgroup: Color(0xFF32A060), + radius: 0, fontSize: 16.sp, - color: MaterialStateColor.resolveWith((states) => - storeIsSelected ? Colors.white : Color(0xFFA0A0A0)), - fontWeight: FontWeight.bold), - ), + padding: EdgeInsets.symmetric(vertical: 5.h), + ), + ), + ], ), ), ], diff --git a/lib/web/web_page.dart b/lib/web/web_page.dart index 70df4568..5b0463ba 100644 --- a/lib/web/web_page.dart +++ b/lib/web/web_page.dart @@ -190,7 +190,7 @@ class _WebPage extends State with WidgetsBindingObserver { //给文章/活动点赞 _queryInformationLikes() async { BaseData baseData = await apiService.informationLikes( - widget.arguments["activityId"] ?? widget.arguments["articleId"]); + widget.arguments["activityId"] ?? widget.arguments["articleId"]).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { if (article != null) { if (article.liked) { @@ -273,10 +273,14 @@ class _WebPage extends State with WidgetsBindingObserver { commentKey, article?.likes ?? activity?.likes ?? 0, widget.arguments["activityId"] ?? widget.arguments["articleId"], + 1, isKeyBoardShow, _reply, _delCommentTips, 12.sp, + requestApiFinish: (total){setState(() { + commentTotal = total; + });}, ), ], ), diff --git a/lib/web/web_view/comment_list.dart b/lib/web/web_view/comment_list.dart index e2b463f8..156776d5 100644 --- a/lib/web/web_view/comment_list.dart +++ b/lib/web/web_view/comment_list.dart @@ -22,10 +22,11 @@ class CommentList extends StatefulWidget { final Function delCommentTips; final double fontSize; final String relationalId; + final int relationalType; final int like; final Function requestApiFinish; - CommentList(Key key, this.like, this.relationalId, + CommentList(Key key, this.like, this.relationalId,this.relationalType, this.isKeyBoardShow, this.reply, this.delCommentTips, this.fontSize,{this.requestApiFinish}) : super(key: key); @@ -213,10 +214,11 @@ class CommentListState extends State { "pageNum": 1, "pageSize": 100, "relationalId": widget.relationalId, - "relationalType": 1, + "relationalType": widget.relationalType, }).catchError((error) {}); if (baseData != null && baseData.isSuccess) { setState(() { + memberList.clear(); commentTotal = baseData.data.size; widget.requestApiFinish(commentTotal); memberList.addAll(baseData.data.list);