diff --git a/ios/Podfile.lock b/ios/Podfile.lock index aaf89031..022bd440 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -228,8 +228,8 @@ SPEC CHECKSUMS: tpns_flutter_plugin: a366649c8ad71f19dfb864d3c994ed0480b69daa url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef video_player: 9cc823b1d9da7e8427ee591e8438bfbcde500e6e - wakelock: bfc7955c418d0db797614075aabbc58a39ab5107 - webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96 + wakelock: d0fc7c864128eac40eba1617cb5264d9c940b46f + webview_flutter: 3603125dfd3bcbc9d8d418c3f80aeecf331c068b WechatOpenSDK_Fuck: aa8f4b0af902837e887a1d40c62f06c060c1dc98 ZLPhotoBrowser-objc: c7657d3bc85ae231884e058d0e3638f619164736 diff --git a/lib/community/community_child_page.dart b/lib/community/community_child_page.dart index 00152673..6b0a075e 100644 --- a/lib/community/community_child_page.dart +++ b/lib/community/community_child_page.dart @@ -51,7 +51,7 @@ class _CommunityChildPage extends State { } pageNum += 1; BaseData> baseData = await apiService.trendList({ - "onlyFollow": widget.typeStr == "关注" ? true:false, + "onlyFollow": widget.typeStr == "关注" ? true : false, "onlyMe": false, "pageNum": pageNum, "pageSize": 10, @@ -82,39 +82,44 @@ class _CommunityChildPage extends State { future: queryCommunity(), builder: (context, position) { return SmartRefresher( - controller: refreshController, - enablePullDown: true, - enablePullUp: true, - physics: BouncingScrollPhysics(), - header: MyHeader(), - footer: CustomFooter( - builder: (context, mode) { - return MyFooter(mode); - }, - ), - onRefresh: _onRefresh, - onLoading: () { - setState(() {}); + controller: refreshController, + enablePullDown: true, + enablePullUp: true, + physics: BouncingScrollPhysics(), + header: MyHeader(), + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); }, - child: ListView.builder( - physics: NeverScrollableScrollPhysics(), - itemBuilder: (context, position) { - return InkWell( - child: CommunityDynamic(comments[position],0,exitFull: (){setState(() { - - });},), - onTap: () { - Navigator.of(context).pushNamed( - '/router/community_details', - arguments: { - "comment": comments[position], - }, - ); + ), + onRefresh: _onRefresh, + onLoading: () { + setState(() {}); + }, + child: ListView.builder( + physics: NeverScrollableScrollPhysics(), + itemBuilder: (context, position) { + return InkWell( + child: CommunityDynamic( + comments[position], + 0, + exitFull: () { + setState(() {}); }, - ); - }, - itemCount: comments.length, - )); + ), + onTap: () { + Navigator.of(context).pushNamed( + '/router/community_details', + arguments: { + "comment": comments[position], + }, + ); + }, + ); + }, + itemCount: comments.length, + ), + ); }, ); } diff --git a/lib/community/community_details.dart b/lib/community/community_details.dart index d657e54b..45830a86 100644 --- a/lib/community/community_details.dart +++ b/lib/community/community_details.dart @@ -15,6 +15,7 @@ import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/view_widget/comment_menu.dart'; import 'package:huixiang/view_widget/login_tips_dialog.dart'; +import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/tips_dialog.dart'; import 'package:huixiang/web/web_view/input_comment.dart'; import 'package:shared_preferences/shared_preferences.dart'; @@ -48,7 +49,6 @@ class _CommunityDetails extends State int commentTotal = 0; Article article; - @override void didChangeMetrics() { WidgetsBinding.instance.addPostFrameCallback((_) { @@ -56,15 +56,17 @@ class _CommunityDetails extends State if (MediaQuery.of(context).viewInsets.bottom == 0) { if (isKeyBoardShow) { FocusScope.of(context).requestFocus(FocusNode()); - setState(() { - hintText = S.current.liuxianinjingcaidepinglunba; - isKeyBoardShow = false; - }); + if (mounted) + setState(() { + hintText = S.current.liuxianinjingcaidepinglunba; + isKeyBoardShow = false; + }); } } else { - setState(() { - isKeyBoardShow = true; - }); + if (mounted) + setState(() { + isKeyBoardShow = true; + }); } }); } @@ -83,186 +85,140 @@ class _CommunityDetails extends State queryDetails() async { SharedPreferences value = await SharedPreferences.getInstance(); if (apiService == null) - apiService = - ApiService(Dio(), context: context, token: value.getString("token")); - BaseData
baseData = await apiService - .informationInfo(comunity.id) - .catchError((onError) {}); - if (baseData != null && baseData.isSuccess) { - } + apiService = ApiService( + Dio(), + context: context, + token: value.getString("token"), + ); + BaseData
baseData = + await apiService.informationInfo(comunity.id).catchError((onError) {}); + if (baseData != null && baseData.isSuccess) {} } @override Widget build(BuildContext context) { return Scaffold( - body: Container( - child: Column( - children: [ - Expanded( - child: NestedScrollView( - headerSliverBuilder: (context, position) { - return [ - SliverOverlapAbsorber( - handle: - NestedScrollView.sliverOverlapAbsorberHandleFor(context), - sliver: SliverAppBar( - expandedHeight: (height == 0) ? 614 : height, - pinned: true, - backgroundColor: Colors.white, - title: Text( - "动态详情", - style: TextStyle( - color: Colors.black, - fontSize: 18.sp, - fontWeight: MyFontWeight.semi_bold, - ), - ), - elevation: 0, - leading: GestureDetector( - onTap: () { - Navigator.of(context).pop(); + appBar: MyAppBar( + title: "动态详情", + titleColor: Colors.black, + titleSize: 18.sp, + background: Colors.white, + leading: true, + leadingColor: Colors.black, + ), + body: Container( + child: Column( + children: [ + Expanded( + child: SingleChildScrollView( + child: Column( + children: [ + CommunityDynamic( + comunity, + 0, + exitFull: () { + setState(() {}); + }, + itemCount: 3, + isDetails: true, + heightFun: (height) { + this.height = height + + MediaQuery.of(context).padding.top + + kToolbarHeight + + 24; + if (mounted) setState(() {}); }, - child: Container( - alignment: Alignment.centerRight, - margin: EdgeInsets.only(left: 10), - padding: EdgeInsets.all(6), - child: Icon( - Icons.arrow_back_ios, - color: Colors.black, - size: 24, - ), - ), - ), - flexibleSpace: FlexibleSpaceBar( - //Colors.white, - background: Container( - padding: EdgeInsets.only( - top: MediaQuery.of(context).padding.top + - kToolbarHeight, - ), - color: Colors.white, - child: CommunityDynamic( - comunity,0,exitFull: (){setState(() { - - });}, - itemCount: 3, - isDetails: true, - heightFun: (height) { - this.height = height + - MediaQuery.of(context).padding.top + - kToolbarHeight + - 24; - setState(() {}); - }, - ), - ), - collapseMode: CollapseMode.pin, ), - bottom: PreferredSize( - preferredSize: Size( - MediaQuery.of(context).size.width, - 46, - ), - child: Container( - padding: EdgeInsets.all(16), - margin: EdgeInsets.only(top: 16.h), - color: Colors.white, - child: Row( - children: [ - Text( - S.of(context).pinglun_(commentTotal.toString()), - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.bold, - color: Color(0xff1A1A1A), - ), - ), - SizedBox( - width: 16.w, + Container( + padding: EdgeInsets.all(16), + color: Colors.white, + child: Row( + children: [ + Text( + S.of(context).pinglun_(commentTotal.toString()), + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.bold, + color: Color(0xff1A1A1A), ), - Text( - S.of(context).xihuan_( - "${comunity?.likes ?? comunity?.likes ?? "0"}"), - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.bold, - color: Color(0xff1A1A1A), - ), + ), + SizedBox( + width: 16.w, + ), + Text( + S.of(context).xihuan_( + "${comunity?.likes ?? comunity?.likes ?? "0"}"), + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.bold, + color: Color(0xff1A1A1A), ), - ], - ), + ), + ], ), ), - ), - ), - ]; - }, - body: Container( - height: MediaQuery.of(context).size.height - - MediaQuery.of(context).padding.top + - kToolbarHeight - 68, - margin: EdgeInsets.only(top: 50 + kToolbarHeight), - child: Column( - children: [ - if (memberList != null && memberList.length > 0) - Expanded(child: ListView.builder( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - itemCount: memberList != null ? memberList.length : 0, - scrollDirection: Axis.vertical, - itemBuilder: (context, position) { - return Material( - color: Colors.white, - child: InkWell( - onTap: () { - showPressMenu(memberList[position].createUser, - memberList[position]); - }, - child: CommunityComment( - memberList[position], - _queryCommentLike, - (memberList.length-1 == position)?1:0 + if (memberList != null && memberList.length > 0) + ListView.builder( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + itemCount: memberList != null ? memberList.length : 0, + scrollDirection: Axis.vertical, + itemBuilder: (context, position) { + return Material( + color: Colors.white, + child: InkWell( + onTap: () { + showPressMenu( + memberList[position].createUser, + memberList[position], + ); + }, + child: CommunityComment( + memberList[position], + _queryCommentLike, + (memberList.length - 1 == position) ? 1 : 0, + ), ), + ); + }, + ), + if (memberList == null || memberList.length == 0) + Container( + width: double.infinity, + alignment: Alignment.topCenter, + margin: EdgeInsets.only(top: 40), + padding: EdgeInsets.all(22.h), + child: Text( + S.of(context).zanwupinglun, + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.bold, + color: Color(0xFFA0A0A0), ), - ); - }, - )), - if (memberList == null || memberList.length == 0) - Container( - width: double.infinity, - alignment: Alignment.topCenter, - margin: EdgeInsets.only(top:40), - padding: EdgeInsets.all(22.h), - child: Text( - S.of(context).zanwupinglun, - style: TextStyle( - fontSize: 12, - fontWeight: FontWeight.bold, - color: Color(0xFFA0A0A0), ), ), - ), - ], + ], + ), ), + flex: 1, ), - ), - flex: 1, - ), - /// 富文本评论的输入框 - InputComment( - inputKey, - hintText, - isKeyBoardShow, - commentFocus, - commentTextController, - _toComment, - _queryMemberComment, - _queryInformationLikes, - isLike: comunity.selfLike, + /// 富文本评论的输入框 + InputComment( + inputKey, + hintText, + isKeyBoardShow, + commentFocus, + commentTextController, + _toComment, + _queryMemberComment, + _queryInformationLikes, + isLike: comunity.selfLike, + ), + ], ), - ], - ))); + ), + ); } ///给文章/活动点赞 @@ -271,10 +227,11 @@ class _CommunityDetails extends State if (baseData != null && baseData.isSuccess) { // commentKey.currentState.setState(() {}); setState(() { - if(comunity.selfLike??false) + if (comunity.selfLike ?? false) comunity.likes -= 1; - else comunity.likes += 1; - comunity.selfLike = !comunity.selfLike??false; + else + comunity.likes += 1; + comunity.selfLike = !comunity.selfLike ?? false; }); } else { SmartDialog.showToast(baseData.msg, alignment: Alignment.center); @@ -303,11 +260,12 @@ class _CommunityDetails extends State RenderBox firstRenderBox = commentKey.currentContext.findRenderObject(); Offset first = firstRenderBox.localToGlobal(Offset.zero); scrollController.animateTo( - first.dy + - scrollController.offset - - (kToolbarHeight + MediaQuery.of(context).padding.top), - duration: Duration(milliseconds: 300), - curve: Curves.easeIn); + first.dy + + scrollController.offset - + (kToolbarHeight + MediaQuery.of(context).padding.top), + duration: Duration(milliseconds: 300), + curve: Curves.easeIn, + ); } final GlobalKey inputKey = GlobalKey(); @@ -415,7 +373,7 @@ class _CommunityDetails extends State commentTotal = baseData.data.size; memberList = baseData.data.list; contentHeight(); - setState(() {}); + if (mounted) setState(() {}); } } } diff --git a/lib/community/community_view/community_dynamic.dart b/lib/community/community_view/community_dynamic.dart index bfca430e..7b57be89 100644 --- a/lib/community/community_view/community_dynamic.dart +++ b/lib/community/community_view/community_dynamic.dart @@ -1,3 +1,5 @@ +import 'dart:ui'; + import 'package:chewie/chewie.dart'; import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; @@ -32,8 +34,8 @@ class CommunityDynamic extends StatefulWidget { this.itemCount = 9, this.heightFun, this.isDetails = false, - this.removalDynamic, - this.exitFull + this.removalDynamic, + this.exitFull, }) : super(key: key); @override @@ -47,13 +49,50 @@ class _CommunityDynamic extends State { double height = 0; ApiService apiService; + VideoPlayerController videoPlayerController; + ChewieController chewieAudioController; + Chewie chewies; + @override void initState() { super.initState(); - SharedPreferences.getInstance().then((value) => { - apiService = ApiService(Dio(), - context: context, token: value.getString('token')), + SharedPreferences.getInstance().then( + (value) => { + apiService = ApiService( + Dio(), + context: context, + token: value.getString('token'), + ), + }, + ); + + if (widget.comment.subjectInfo.type == "video" && + widget.comment.subjectInfo.video.isNotEmpty) { + videoPlayerController = VideoPlayerController.network( + widget.comment.subjectInfo.video, + )..initialize().then((value) { + chewieAudioController = ChewieController( + videoPlayerController: videoPlayerController, + aspectRatio: videoPlayerController.value.aspectRatio, + //宽高比 + autoPlay: false, + //自动播放 + looping: false, + //循环播放 + allowFullScreen: true, + // 拖动条样式颜色 + materialProgressColors: chewie.ChewieProgressColors( + playedColor: Colors.white, + handleColor: Colors.white, + backgroundColor: Colors.grey, + bufferedColor: Colors.transparent, + ), + autoInitialize: true, + ); + chewieAudioController.addListener(_fullScreenListener); + if (mounted) setState(() {}); }); + } } ///关注/取关会员 @@ -71,7 +110,6 @@ class _CommunityDynamic extends State { BaseData baseData = await apiService.deleteTrend(id); if (baseData != null && baseData.isSuccess) { SmartDialog.showToast("删除成功", alignment: Alignment.center); - } else { SmartDialog.showToast(baseData.msg, alignment: Alignment.center); } @@ -111,7 +149,7 @@ class _CommunityDynamic extends State { child: Row( children: [ MImage( - widget?.comment?.memberInfo?.avatar??"", + widget?.comment?.memberInfo?.avatar ?? "", width: 44, height: 44, isCircle: true, @@ -127,7 +165,7 @@ class _CommunityDynamic extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - widget?.comment?.memberInfo?.nickname??"", + widget?.comment?.memberInfo?.nickname ?? "", style: TextStyle( fontSize: 14.sp, fontWeight: MyFontWeight.medium, @@ -135,7 +173,7 @@ class _CommunityDynamic extends State { ), ), Text( - widget?.comment?.createTime??"", + widget?.comment?.createTime ?? "", style: TextStyle( fontSize: 12.sp, fontWeight: MyFontWeight.regular, @@ -244,7 +282,7 @@ class _CommunityDynamic extends State { Container( height: 16, color: Color(0xFFF7F7F7), - ) + ), ], ); } @@ -262,7 +300,7 @@ class _CommunityDynamic extends State { subjectInfo.images[0], fit: BoxFit.cover, width: MediaQuery.of(context).size.width / 2, - height: MediaQuery.of(context).size.width /1, + height: MediaQuery.of(context).size.width / 2, errorSrc: "assets/image/default_2_1.png", fadeSrc: "assets/image/default_2_1.png", ), @@ -295,11 +333,13 @@ class _CommunityDynamic extends State { itemCount: subjectInfo.images.length, ); } - } else if (subjectInfo.type == "video" && - subjectInfo.video.isNotEmpty) { + } else if (subjectInfo.type == "video" && subjectInfo.video.isNotEmpty) { widget = videoWidget( MediaQuery.of(context).size.width - 32, - MediaQuery.of(context).size.width /2, + videoPlayerController != null + ? (MediaQuery.of(context).size.width - 32) / + videoPlayerController.value.aspectRatio + : MediaQuery.of(context).size.width / 2, subjectInfo.video); } @@ -316,58 +356,44 @@ class _CommunityDynamic extends State { ); } - VideoPlayerController videoPlayerController; - ChewieController chewieAudioController; - Chewie chewies; + @override + void dispose() { + super.dispose(); - Widget videoWidget(double width, double height, src) { - print("src : $src"); - chewieAudioController = ChewieController( - videoPlayerController: videoPlayerController = - VideoPlayerController.network( - src, - ), - aspectRatio: width / height, - //宽高比 - autoPlay: false, - //自动播放 - looping: false, - //循环播放 - allowFullScreen: true, - // systemOverlaysAfterFullScreen: [], - // systemOverlaysOnEnterFullScreen: [], - // deviceOrientationsAfterFullScreen: [], - // deviceOrientationsOnEnterFullScreen: [], - // 拖动条样式颜色 - materialProgressColors: chewie.ChewieProgressColors( - playedColor: Colors.white, - handleColor: Colors.white, - backgroundColor: Colors.grey, - bufferedColor: Colors.transparent, - ), - autoInitialize: true, - ); + if (chewieAudioController != null) { + chewieAudioController.pause(); + chewieAudioController.dispose(); + chewieAudioController = null; + } - chewieAudioController.addListener(_fullScreenListener); + if (videoPlayerController != null) { + videoPlayerController.pause(); + videoPlayerController.dispose(); + } + } + Widget videoWidget(double width, double height, src) { + print("src : $src"); return MediaQuery( data: MediaQuery.of(context).copyWith( textScaleFactor: 0.9, ), - child: Container( - width: MediaQuery.of(context).size.width - 17, - height: (MediaQuery.of(context).size.width) / (width / height), - child: chewies = Chewie( - controller: chewieAudioController, - ), - ), + child: chewieAudioController != null + ? Container( + width: width, + height: height, + child: chewies = Chewie( + controller: chewieAudioController, + ), + ) + : Container( + width: width, + height: height, + ), ); } Future _fullScreenListener() async { - print("object: isPlaying: ${videoPlayerController.value.isPlaying}"); - print("object: isFullScreen: ${chewieAudioController.isFullScreen}"); - if (!chewieAudioController.isFullScreen) { Future.delayed(Duration(seconds: 1), () { widget.exitFull(); diff --git a/lib/home/huixiang_brand_page.dart b/lib/home/huixiang_brand_page.dart index f8e7d829..24849ed2 100644 --- a/lib/home/huixiang_brand_page.dart +++ b/lib/home/huixiang_brand_page.dart @@ -182,7 +182,6 @@ class _BrandPage extends State child: Html( data: value.content, customImageRenders: { - base64DataUriMatcher(): base64ImageRender(), assetUriMatcher(): assetImageRender(), networkSourceMatcher(extension: "svg"): svgNetworkImageRender(), networkSourceMatcher(): networkImageRender( diff --git a/lib/integral_store/integral_store_details_page.dart b/lib/integral_store/integral_store_details_page.dart index f0230751..0aace98c 100644 --- a/lib/integral_store/integral_store_details_page.dart +++ b/lib/integral_store/integral_store_details_page.dart @@ -100,19 +100,10 @@ class _IntegralStoreDetailsPage extends State { child: Html( data: goods != null ? goods.detail : "", customImageRenders: { - base64DataUriMatcher(): base64ImageRender(), - assetUriMatcher(): assetImageRender(), - networkSourceMatcher(extension: "svg"): - svgNetworkImageRender(), networkSourceMatcher(): networkImageRender( loadingWidget: () { - // return Image.asset("assets/image/default_1.png",); return Container(); }, - // mapUrl: (url) { - // print("objectUrl: $url"); - // return "$url?imageMogr2/format/webp/blur/1x0/quality/75"; - // } ), }, ), diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index 1cb07f09..89783777 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -1,7 +1,6 @@ import 'dart:convert'; import 'package:dio/dio.dart'; -import 'package:flare_flutter/flare_testing.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; @@ -11,8 +10,6 @@ import 'package:huixiang/retrofit/data/address.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/down_order.dart'; import 'package:huixiang/retrofit/data/min_order_info.dart'; -import 'package:huixiang/retrofit/data/placeOrderFirst.dart'; -import 'package:huixiang/retrofit/data/settlement_bean.dart'; import 'package:huixiang/retrofit/data/wx_pay.dart'; import 'package:huixiang/view_widget/login_tips_dialog.dart'; import 'package:retrofit/retrofit.dart'; diff --git a/lib/store/store_order.dart b/lib/store/store_order.dart index 835cd311..78dde134 100644 --- a/lib/store/store_order.dart +++ b/lib/store/store_order.dart @@ -59,6 +59,8 @@ class _StoreOrderPage extends State String tenant = ""; String storeId = ""; int numberOfPeople = 0; + ///小程序token + String minToken; @override void initState() { @@ -91,13 +93,13 @@ class _StoreOrderPage extends State token: shared.getString('token'), showLoading: false, ); - queryStoreInfo(); apiService.minLogin(storeId).catchError((onError) { debugPrint(onError); }).then((baseData) { if (baseData != null && baseData.isSuccess) { Map minStoreInfo = baseData.data; - String minToken = minStoreInfo["token"]; + minToken = minStoreInfo["token"]; + queryStoreInfo(); SharedPreferences.getInstance().then( (value) => { value.setString('minToken', minToken), @@ -127,10 +129,8 @@ class _StoreOrderPage extends State ///获取父订单(火锅订单加菜前调用) getParentInfo() async { - BaseData baseData = - await minService.getParentInfo("$tableId").catchError((error) { - debugPrint(error); - }); + BaseData baseData = await minService.getParentInfo("$tableId") + .catchError((error) {debugPrint(error);}); if (baseData != null && baseData.isSuccess) { if (baseData.data != null) { parentId = baseData.data["id"]; @@ -244,58 +244,61 @@ class _StoreOrderPage extends State StretchMode.fadeTitle, StretchMode.blurBackground, ], - background: Stack( - children: [ - Positioned( - child: Column( - children: [ - buildSwiper(), - Expanded( - child: Container( - color: Colors.transparent, - ), - flex: 1, - ), - ], - ), - top: 0, - bottom: 0, - left: 0, - right: 0, - ), - Positioned( - child: Container( + background: Container( + color: Colors.white, + child: Stack( + children: [ + Positioned( child: Column( children: [ - ///门店信息 - StoreInfoView(storeInfo), - - ///门店对应优惠券 - if (storeInfo != null && - storeInfo.couponVOList != null) - UnionCoupon( - storeInfo, - _receiveCoupon, - coupon: true, - ), - - if (storeInfo == null || - storeInfo.couponVOList == null) - SizedBox( - height: 8, + buildSwiper(), + Expanded( + child: Container( + color: Colors.transparent, ), - - ///门店对应VIP信息 - Vip(storeInfo, () {}, false), + flex: 1, + ), ], ), + top: 0, + bottom: 0, + left: 0, + right: 0, ), - top: 110.h, - bottom: 0, - left: 0, - right: 0, - ), - ], + Positioned( + child: Container( + child: Column( + children: [ + ///门店信息 + StoreInfoView(storeInfo), + + ///门店对应优惠券 + if (storeInfo != null && + storeInfo.couponVOList != null) + UnionCoupon( + storeInfo, + _receiveCoupon, + coupon: true, + ), + + if (storeInfo == null || + storeInfo.couponVOList == null) + SizedBox( + height: 8, + ), + + ///门店对应VIP信息 + Vip(storeInfo, () {}, false), + ], + ), + ), + top: 110.h, + bottom: 0, + left: 0, + right: 0, + ), + ], + ), ), ), backgroundColor: Color(0x33FAFAFA), @@ -351,6 +354,8 @@ class _StoreOrderPage extends State storeInfo, shopCarGoods, controller, + minToken, + tenant, _queryMiNiDetail, ), diff --git a/lib/store/store_view/store_order_list.dart b/lib/store/store_view/store_order_list.dart index d3dab061..c879e5f9 100644 --- a/lib/store/store_view/store_order_list.dart +++ b/lib/store/store_view/store_order_list.dart @@ -19,6 +19,8 @@ class StoreOrderListPage extends StatefulWidget { final List activitys; final StoreInfo storeInfo; final ScrollController controller; + final String minToken; + final String tenant; final Function(String id) queryMiNiDetail; ShoppingCart shopCarGoods; @@ -29,6 +31,8 @@ class StoreOrderListPage extends StatefulWidget { this.storeInfo, this.shopCarGoods, this.controller, + this.minToken, + this.tenant, this.queryMiNiDetail, ); @@ -59,13 +63,11 @@ class _StoreOrderListPage extends State { ///小程序查询分组及商品列表 appletGoods() async { SharedPreferences value = await SharedPreferences.getInstance(); - String minToken = value.getString("minToken"); - String tenant = value.getString("tenant"); minService = MinApiService( Dio(), context: context, - token: minToken, - tenant: tenant, + token: widget.minToken, + tenant: widget.tenant, storeId: widget.arguments["id"], ); diff --git a/lib/web/web_page.dart b/lib/web/web_page.dart index e5949299..50808716 100644 --- a/lib/web/web_page.dart +++ b/lib/web/web_page.dart @@ -260,20 +260,25 @@ class _WebPage extends State with WidgetsBindingObserver { WebHeader(widget.arguments, activity, article, 16), /// 富文本的内容 - WebContent(activity, article, () { - setState(() {}); - }), + WebContent( + activity, + article, + () { + setState(() {}); + }, + ), /// 富文本的评论 CommentList( - commentKey, - widget.arguments, - activity, - article, - isKeyBoardShow, - _reply, - _delCommentTips, - 12.sp), + commentKey, + widget.arguments, + activity, + article, + isKeyBoardShow, + _reply, + _delCommentTips, + 12.sp, + ), ], ), ), diff --git a/lib/web/web_view/web_content.dart b/lib/web/web_view/web_content.dart index 2469f0a0..43195e03 100644 --- a/lib/web/web_view/web_content.dart +++ b/lib/web/web_view/web_content.dart @@ -44,7 +44,6 @@ class _WebContent extends State { ) }, customImageRenders: { - base64DataUriMatcher(): base64ImageRender(), assetUriMatcher(): assetImageRender(), networkSourceMatcher(extension: "svg"): svgNetworkImageRender(), @@ -54,57 +53,58 @@ class _WebContent extends State { }, ), }, - customRender: { - "video": - (context, parsedChild, attributes, element) { - var src = attributes['src']; - return videoWidget( - double.tryParse(attributes['width'] ?? ""), - double.tryParse( - element.attributes['height'] ?? ""), - (src != null && - src != "" && - src.endsWith(".mp4")) - ? src - : element - .children.first.attributes["src"], - element.attributes["sandbox"]); - }, - "iframe": - (context, parsedChild, attributes, element) { - var src = attributes['src']; - return videoWidget( - double.tryParse(attributes['width'] ?? ""), - double.tryParse( - element.attributes['height'] ?? ""), - (src != null && - src != "" && - src.endsWith(".mp4")) - ? src - : element - .children.first.attributes["src"], - element.attributes["sandbox"]); - }, - "audio": - (context, parsedChild, attributes, element) { - final sources = [ - if (element.attributes['src'] != null) - element.attributes['src'], - ]; - if (sources == null || - sources.isEmpty || - sources.first == null) { - return EmptyContentElement(); - } - return audioWidget( - attributes['controls'] != null, - attributes['loop'] != null, - attributes['autoplay'] != null, - sources, - context.style.width ?? 300.w, - ); - }, - }, + // customRender: { + // "video": + // (context, parsedChild) { + // var src = attributes['src']; + // parsedChild.toString() + // return videoWidget( + // double.tryParse(attributes['width'] ?? ""), + // double.tryParse( + // element.attributes['height'] ?? ""), + // (src != null && + // src != "" && + // src.endsWith(".mp4")) + // ? src + // : element + // .children.first.attributes["src"], + // element.attributes["sandbox"]); + // }, + // "iframe": + // (context, parsedChild) { + // var src = attributes['src']; + // return videoWidget( + // double.tryParse(attributes['width'] ?? ""), + // double.tryParse( + // element.attributes['height'] ?? ""), + // (src != null && + // src != "" && + // src.endsWith(".mp4")) + // ? src + // : element + // .children.first.attributes["src"], + // element.attributes["sandbox"]); + // }, + // "audio": + // (context, parsedChild) { + // final sources = [ + // if (element.attributes['src'] != null) + // element.attributes['src'], + // ]; + // if (sources == null || + // sources.isEmpty || + // sources.first == null) { + // return EmptyContentElement(); + // } + // return audioWidget( + // attributes['controls'] != null, + // attributes['loop'] != null, + // attributes['autoplay'] != null, + // sources, + // context.style.width ?? 300.w, + // ); + // }, + // }, ); } diff --git a/pubspec.lock b/pubspec.lock index 0f090c29..c39c4206 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,13 +1,6 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: - _fe_analyzer_shared: - dependency: transitive - description: - name: _fe_analyzer_shared - url: "https://pub.flutter-io.cn" - source: hosted - version: "14.0.0" ai_decimal_accuracy: dependency: "direct main" description: @@ -15,13 +8,6 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" - analyzer: - dependency: transitive - description: - name: analyzer - url: "https://pub.flutter-io.cn" - source: hosted - version: "0.41.2" android_intent_plus: dependency: "direct main" description: @@ -29,13 +15,6 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.0.2" - args: - dependency: transitive - description: - name: args - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.3.0" async: dependency: transitive description: @@ -71,62 +50,6 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "0.1.6" - build: - dependency: transitive - description: - name: build - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.6.2" - build_config: - dependency: transitive - description: - name: build_config - url: "https://pub.flutter-io.cn" - source: hosted - version: "0.4.6" - build_daemon: - dependency: transitive - description: - name: build_daemon - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.1.10" - build_resolvers: - dependency: transitive - description: - name: build_resolvers - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.5.3" - build_runner: - dependency: "direct dev" - description: - name: build_runner - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.11.5" - build_runner_core: - dependency: transitive - description: - name: build_runner_core - url: "https://pub.flutter-io.cn" - source: hosted - version: "6.1.10" - built_collection: - dependency: transitive - description: - name: built_collection - url: "https://pub.flutter-io.cn" - source: hosted - version: "4.3.2" - built_value: - dependency: transitive - description: - name: built_value - url: "https://pub.flutter-io.cn" - source: hosted - version: "7.1.0" cached_network_image: dependency: "direct main" description: @@ -148,34 +71,20 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.2.0" - checked_yaml: - dependency: transitive - description: - name: checked_yaml - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.0.4" chewie: dependency: transitive description: name: chewie url: "https://pub.flutter-io.cn" source: hosted - version: "0.12.2" + version: "1.2.2" chewie_audio: dependency: "direct main" description: name: chewie_audio url: "https://pub.flutter-io.cn" source: hosted - version: "1.1.2" - cli_util: - dependency: transitive - description: - name: cli_util - url: "https://pub.flutter-io.cn" - source: hosted - version: "0.3.5" + version: "1.2.0" clock: dependency: transitive description: @@ -183,13 +92,6 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" - code_builder: - dependency: transitive - description: - name: code_builder - url: "https://pub.flutter-io.cn" - source: hosted - version: "3.7.0" collection: dependency: transitive description: @@ -211,20 +113,13 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "2.1.5" - css_colors: - dependency: transitive - description: - name: css_colors - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.1.1" csslib: dependency: transitive description: name: csslib url: "https://pub.flutter-io.cn" source: hosted - version: "0.16.2" + version: "0.17.1" cupertino_icons: dependency: "direct main" description: @@ -232,13 +127,6 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.0.3" - dart_style: - dependency: transitive - description: - name: dart_style - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.3.12" dio: dependency: "direct main" description: @@ -274,13 +162,6 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "6.1.2" - fixnum: - dependency: transitive - description: - name: fixnum - url: "https://pub.flutter-io.cn" - source: hosted - version: "0.10.11" flare_flutter: dependency: "direct main" description: @@ -348,19 +229,26 @@ packages: name: flutter_html url: "https://pub.flutter-io.cn" source: hosted - version: "1.3.0" + version: "2.1.5" flutter_layout_grid: dependency: transitive description: name: flutter_layout_grid url: "https://pub.flutter-io.cn" source: hosted - version: "0.10.5" + version: "1.0.3" flutter_localizations: dependency: "direct main" description: flutter source: sdk version: "0.0.0" + flutter_math_fork: + dependency: transitive + description: + name: flutter_math_fork + url: "https://pub.flutter-io.cn" + source: hosted + version: "0.3.3+1" flutter_page_indicator: dependency: transitive description: @@ -416,7 +304,7 @@ packages: name: flutter_svg url: "https://pub.flutter-io.cn" source: hosted - version: "0.20.0-nullsafety.3" + version: "0.22.0" flutter_swiper: dependency: "direct main" description: @@ -448,13 +336,6 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "9.1.0" - glob: - dependency: transitive - description: - name: glob - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.0.1" graphs: dependency: transitive description: @@ -468,7 +349,7 @@ packages: name: html url: "https://pub.flutter-io.cn" source: hosted - version: "0.14.0+4" + version: "0.15.0" http: dependency: transitive description: @@ -476,13 +357,6 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "0.12.2" - http_multi_server: - dependency: transitive - description: - name: http_multi_server - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.2.0" http_parser: dependency: transitive description: @@ -497,13 +371,6 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" - import_js_library: - dependency: transitive - description: - name: import_js_library - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.0.2" intl: dependency: "direct main" description: @@ -511,13 +378,6 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "0.17.0" - io: - dependency: transitive - description: - name: io - url: "https://pub.flutter-io.cn" - source: hosted - version: "0.3.5" js: dependency: transitive description: @@ -532,13 +392,6 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "3.1.1" - json_serializable: - dependency: "direct dev" - description: - name: json_serializable - url: "https://pub.flutter-io.cn" - source: hosted - version: "3.5.1" keframe: dependency: "direct main" description: @@ -560,13 +413,6 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" - logging: - dependency: transitive - description: - name: logging - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.0.2" matcher: dependency: transitive description: @@ -581,20 +427,20 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.3.0" - mime: + nested: dependency: transitive description: - name: mime + name: nested url: "https://pub.flutter-io.cn" source: hosted - version: "1.0.1" - package_config: + version: "1.0.0" + numerus: dependency: transitive description: - name: package_config + name: numerus url: "https://pub.flutter-io.cn" source: hosted - version: "1.9.3" + version: "1.1.1" package_info: dependency: "direct main" description: @@ -700,13 +546,6 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.0.3" - pool: - dependency: transitive - description: - name: pool - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.5.0" process: dependency: transitive description: @@ -714,20 +553,13 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "4.2.3" - pub_semver: + provider: dependency: transitive description: - name: pub_semver + name: provider url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.0" - pubspec_parse: - dependency: transitive - description: - name: pubspec_parse - url: "https://pub.flutter-io.cn" - source: hosted - version: "0.1.8" + version: "5.0.0" pull_to_refresh: dependency: "direct main" description: @@ -755,7 +587,7 @@ packages: name: quiver url: "https://pub.flutter-io.cn" source: hosted - version: "2.1.5" + version: "3.0.1+1" retrofit: dependency: "direct main" description: @@ -763,13 +595,6 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.3.4+1" - retrofit_generator: - dependency: "direct dev" - description: - name: retrofit_generator - url: "https://pub.flutter-io.cn" - source: hosted - version: "1.4.1+3" rive: dependency: "direct main" description: @@ -833,32 +658,11 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.3.0" - shelf: - dependency: transitive - description: - name: shelf - url: "https://pub.flutter-io.cn" - source: hosted - version: "0.7.9" - shelf_web_socket: - dependency: transitive - description: - name: shelf_web_socket - url: "https://pub.flutter-io.cn" - source: hosted - version: "0.2.4+1" sky_engine: dependency: transitive description: flutter source: sdk version: "0.0.99" - source_gen: - dependency: transitive - description: - name: source_gen - url: "https://pub.flutter-io.cn" - source: hosted - version: "0.9.10+3" source_span: dependency: transitive description: @@ -894,13 +698,6 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" - stream_transform: - dependency: transitive - description: - name: stream_transform - url: "https://pub.flutter-io.cn" - source: hosted - version: "2.0.0" string_scanner: dependency: transitive description: @@ -929,13 +726,6 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "0.3.0" - timing: - dependency: transitive - description: - name: timing - url: "https://pub.flutter-io.cn" - source: hosted - version: "0.1.1+3" tpns_flutter_plugin: dependency: "direct main" description: @@ -958,7 +748,7 @@ packages: name: tuple url: "https://pub.flutter-io.cn" source: hosted - version: "1.0.3" + version: "2.0.0" typed_data: dependency: transitive description: @@ -1028,63 +818,63 @@ packages: name: video_player url: "https://pub.flutter-io.cn" source: hosted - version: "1.0.1" + version: "2.2.3" video_player_platform_interface: dependency: transitive description: name: video_player_platform_interface url: "https://pub.flutter-io.cn" source: hosted - version: "2.2.0" + version: "4.2.0" video_player_web: dependency: transitive description: name: video_player_web url: "https://pub.flutter-io.cn" source: hosted - version: "0.1.4+1" + version: "2.0.4" wakelock: dependency: transitive description: name: wakelock url: "https://pub.flutter-io.cn" source: hosted - version: "0.2.1+1" - wakelock_platform_interface: + version: "0.5.6" + wakelock_macos: dependency: transitive description: - name: wakelock_platform_interface + name: wakelock_macos url: "https://pub.flutter-io.cn" source: hosted - version: "0.1.0+1" - wakelock_web: + version: "0.4.0" + wakelock_platform_interface: dependency: transitive description: - name: wakelock_web + name: wakelock_platform_interface url: "https://pub.flutter-io.cn" source: hosted - version: "0.1.0+3" - watcher: + version: "0.3.0" + wakelock_web: dependency: transitive description: - name: watcher + name: wakelock_web url: "https://pub.flutter-io.cn" source: hosted - version: "1.0.0" - web_socket_channel: + version: "0.4.0" + wakelock_windows: dependency: transitive description: - name: web_socket_channel + name: wakelock_windows url: "https://pub.flutter-io.cn" source: hosted - version: "1.2.0" + version: "0.2.0" webview_flutter: - dependency: "direct main" + dependency: transitive description: name: webview_flutter url: "https://pub.flutter-io.cn" source: hosted - version: "1.0.7" + version: "2.0.13" win32: dependency: transitive description: @@ -1106,13 +896,6 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "5.1.2" - yaml: - dependency: transitive - description: - name: yaml - url: "https://pub.flutter-io.cn" - source: hosted - version: "3.1.0" sdks: dart: ">=2.13.0 <3.0.0" - flutter: ">=2.0.0" + flutter: ">=2.2.0" diff --git a/pubspec.yaml b/pubspec.yaml index f6edf240..9f54aad3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -63,12 +63,11 @@ dependencies: path_provider: ^1.2.0 cached_network_image: ^2.0.0 - flutter_html: ^1.3.0 #2.1.0 - webview_flutter: ^1.0.7 + flutter_html: ^2.1.5 #2.1.0 chewie_audio: ^1.1.2 photo_view: ^0.11.1 - video_player: ^1.0.1 + video_player: ^2.2.3 package_info: ^2.0.2 @@ -80,7 +79,7 @@ dependencies: rive: ^0.6.8 flare_flutter: ^3.0.2 - flutter_svg: ^0.20.0-nullsafety.3 + flutter_svg: ^0.22.0 font_awesome_flutter: ^9.1.0 ai_decimal_accuracy: ^1.1.0 @@ -88,9 +87,9 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - retrofit_generator: ^1.4.1+3 - build_runner: ^1.11.5 - json_serializable: ^3.5.1 +# retrofit_generator: ^1.4.1+3 +# build_runner: ^1.11.5 +# json_serializable: ^3.5.1 flutter: