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(
controller: refreshController,
enablePullDown: true,
enablePullUp: false,
enablePullUp: true,
header: MyHeader(),
onRefresh: _onRefresh,
onLoading: () {

39
lib/community/community_view/class_details.dart

@ -45,6 +45,7 @@ class _ClassDetails extends State<ClassDetails> 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<ClassDetails> 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<ClassDetails> 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),
],
),
),

30
lib/web/web_view/web_content.dart

@ -33,16 +33,36 @@ class _WebContent extends State<WebContent> {
@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??"")+"<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\" />",
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"):

6
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:

Loading…
Cancel
Save