From 694e187accb289d59785b22e635acb88f652c785 Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Thu, 23 Dec 2021 21:41:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E7=AB=A0=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/community/community_course.dart | 2 +- .../community_view/class_details.dart | 39 +++++++++++++++++-- lib/web/web_view/web_content.dart | 30 +++++++++++--- pubspec.lock | 6 +-- 4 files changed, 65 insertions(+), 12 deletions(-) diff --git a/lib/community/community_course.dart b/lib/community/community_course.dart index 21cfa78a..378d4ec1 100644 --- a/lib/community/community_course.dart +++ b/lib/community/community_course.dart @@ -213,7 +213,7 @@ class _CommunityCourse extends State child: SmartRefresher( controller: refreshController, enablePullDown: true, - enablePullUp: false, + enablePullUp: true, header: MyHeader(), onRefresh: _onRefresh, onLoading: () { diff --git a/lib/community/community_view/class_details.dart b/lib/community/community_view/class_details.dart index ddde6b88..892b62e6 100644 --- a/lib/community/community_view/class_details.dart +++ b/lib/community/community_view/class_details.dart @@ -45,6 +45,7 @@ class _ClassDetails extends State with WidgetsBindingObserver { bool isShowImg = true; int chapterIndex = 0; double height = 0; + var isShowMore = false; @override void initState() { @@ -179,7 +180,6 @@ class _ClassDetails extends State with WidgetsBindingObserver { ], ), Container( - height: 123, margin: EdgeInsets.only(bottom: 16.h), padding: EdgeInsets.only(left: 16, top: 16, right: 10), decoration: BoxDecoration( @@ -290,14 +290,47 @@ class _ClassDetails extends State with WidgetsBindingObserver { ), Text( course != null ? course.introduce : "", - overflow: TextOverflow.ellipsis, - maxLines: 2, + overflow: isShowMore + ? TextOverflow.visible + : TextOverflow.ellipsis, + maxLines: isShowMore ? 10 : 2, style: TextStyle( fontSize: 12.sp, fontWeight: MyFontWeight.regular, color: Colors.black, ), ), + SizedBox(height: 3.h), + GestureDetector( + onTap: () { + setState(() { + isShowMore = !isShowMore; + }); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisSize: MainAxisSize.max, + children: [ + Text( + S.of(context).gengduo, + style: TextStyle( + fontSize: 12.sp, + fontWeight: MyFontWeight.regular, + color: Colors.black, + ), + ), + Icon( + (isShowMore != null && !isShowMore) + ? Icons.chevron_right + : Icons.keyboard_arrow_up, + color: Colors.black, + size: 18, + ), + ], + ), + ), + SizedBox(height: 3.h), ], ), ), diff --git a/lib/web/web_view/web_content.dart b/lib/web/web_view/web_content.dart index 54c1519d..12c66f9c 100644 --- a/lib/web/web_view/web_content.dart +++ b/lib/web/web_view/web_content.dart @@ -33,16 +33,36 @@ class _WebContent extends State { @override Widget build(BuildContext context) { return Html( - data: widget.activity != null - ? widget.activity.content - : widget.article != null - ? widget.article.content - : "", + data: (widget.activity?.content??widget.article?.content??"")+"立即购买", style: { "html": Style( backgroundColor: Colors.white ) }, + onLinkTap: (url, ct, attributes, element) { + if(attributes.containsKey("storeid")){ + Navigator.of(context).pushNamed( + '/router/store_order', + arguments: { + "id": attributes["storeid"], + "tenant": attributes["tenantcode"], + "storeName": attributes["storename"] + }, + ); + } + }, + onImageTap: (url,ct,attributes, element) { + if(attributes.containsKey("storeid")){ + Navigator.of(context).pushNamed( + '/router/store_order', + arguments: { + "id": attributes["storeid"], + "tenant": attributes["tenantcode"], + "storeName": attributes["storename"] + }, + ); + } + }, customImageRenders: { assetUriMatcher(): assetImageRender(), networkSourceMatcher(extension: "svg"): diff --git a/pubspec.lock b/pubspec.lock index 0fc25a0b..22191450 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -269,7 +269,7 @@ packages: name: flutter_screenutil url: "https://pub.flutter-io.cn" source: hosted - version: "5.0.1" + version: "5.0.1+3" flutter_smart_dialog: dependency: "direct main" description: @@ -608,7 +608,7 @@ packages: name: scan url: "https://pub.flutter-io.cn" source: hosted - version: "1.5.0" + version: "1.6.0" shared_preferences: dependency: "direct main" description: @@ -839,7 +839,7 @@ packages: name: video_player_web url: "https://pub.flutter-io.cn" source: hosted - version: "2.0.4" + version: "2.0.5" wakelock: dependency: transitive description: