Browse Source

文章链接

ff_new
w-R 3 years ago
parent
commit
694e187acc
  1. 2
      lib/community/community_course.dart
  2. 39
      lib/community/community_view/class_details.dart
  3. 30
      lib/web/web_view/web_content.dart
  4. 6
      pubspec.lock

2
lib/community/community_course.dart

@ -213,7 +213,7 @@ class _CommunityCourse extends State<CommunityCourse>
child: SmartRefresher( child: SmartRefresher(
controller: refreshController, controller: refreshController,
enablePullDown: true, enablePullDown: true,
enablePullUp: false, enablePullUp: true,
header: MyHeader(), header: MyHeader(),
onRefresh: _onRefresh, onRefresh: _onRefresh,
onLoading: () { onLoading: () {

39
lib/community/community_view/class_details.dart

@ -45,6 +45,7 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
bool isShowImg = true; bool isShowImg = true;
int chapterIndex = 0; int chapterIndex = 0;
double height = 0; double height = 0;
var isShowMore = false;
@override @override
void initState() { void initState() {
@ -179,7 +180,6 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
], ],
), ),
Container( Container(
height: 123,
margin: EdgeInsets.only(bottom: 16.h), margin: EdgeInsets.only(bottom: 16.h),
padding: EdgeInsets.only(left: 16, top: 16, right: 10), padding: EdgeInsets.only(left: 16, top: 16, right: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
@ -290,14 +290,47 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
), ),
Text( Text(
course != null ? course.introduce : "", course != null ? course.introduce : "",
overflow: TextOverflow.ellipsis, overflow: isShowMore
maxLines: 2, ? 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( style: TextStyle(
fontSize: 12.sp, fontSize: 12.sp,
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
color: Colors.black, color: Colors.black,
), ),
), ),
Icon(
(isShowMore != null && !isShowMore)
? Icons.chevron_right
: Icons.keyboard_arrow_up,
color: Colors.black,
size: 18,
),
],
),
),
SizedBox(height: 3.h),
], ],
), ),
), ),

30
lib/web/web_view/web_content.dart

@ -33,16 +33,36 @@ class _WebContent extends State<WebContent> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Html( return Html(
data: widget.activity != null data: (widget.activity?.content??widget.article?.content??"")+"<a storeName=\"前进麦味烘焙*海峡姐妹茶(哈乐城店)\" storeId=\"1432164681279078400\" tenantCode=\"1175\" href=\"/\">立即购买</a><img storeName=\"前进麦味烘焙*海峡姐妹茶(哈乐城店)\" storeId=\"1432164681279078400\" tenantCode=\"1175\" src=\"https://pos.upload.gznl.top/MDAwMA==/2021/12/6edfe416-aaf9-4f0e-b2a4-4dc85db03489.jpg\" />",
? widget.activity.content
: widget.article != null
? widget.article.content
: "",
style: { style: {
"html": Style( "html": Style(
backgroundColor: Colors.white 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: { customImageRenders: {
assetUriMatcher(): assetImageRender(), assetUriMatcher(): assetImageRender(),
networkSourceMatcher(extension: "svg"): networkSourceMatcher(extension: "svg"):

6
pubspec.lock

@ -269,7 +269,7 @@ packages:
name: flutter_screenutil name: flutter_screenutil
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "5.0.1" version: "5.0.1+3"
flutter_smart_dialog: flutter_smart_dialog:
dependency: "direct main" dependency: "direct main"
description: description:
@ -608,7 +608,7 @@ packages:
name: scan name: scan
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.5.0" version: "1.6.0"
shared_preferences: shared_preferences:
dependency: "direct main" dependency: "direct main"
description: description:
@ -839,7 +839,7 @@ packages:
name: video_player_web name: video_player_web
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.0.4" version: "2.0.5"
wakelock: wakelock:
dependency: transitive dependency: transitive
description: description:

Loading…
Cancel
Save