Browse Source

safety

master
fmk 3 years ago
parent
commit
87bd021e23
  1. 1
      lib/main.dart
  2. 4
      lib/web/web_page.dart
  3. 43
      lib/web/web_view/comment_list.dart
  4. 6
      lib/web/web_view/web_content.dart
  5. 43
      lib/web/web_view/web_header.dart

1
lib/main.dart

@ -54,6 +54,7 @@ import 'package:huixiang/setting/setting_page.dart';
import 'package:huixiang/setting/treaty_page.dart'; import 'package:huixiang/setting/treaty_page.dart';
// import 'package:huixiang/store/settlement.dart'; // import 'package:huixiang/store/settlement.dart';
import 'package:huixiang/store/store_order.dart'; import 'package:huixiang/store/store_order.dart';
import 'package:huixiang/store/store_view/settlement.dart';
import 'package:huixiang/union/location_map_page.dart'; import 'package:huixiang/union/location_map_page.dart';
import 'package:huixiang/web/web_page.dart'; import 'package:huixiang/web/web_page.dart';

4
lib/web/web_page.dart

@ -219,7 +219,7 @@ class _WebPage extends State<WebPage> with WidgetsBindingObserver {
), ),
), ),
), ),
background: Color(0xFFF7F7F7), background: Color(0xFFFFFFFFF),
leadingColor: Colors.black, leadingColor: Colors.black,
title: activity != null title: activity != null
? activity.mainTitle ? activity.mainTitle
@ -262,7 +262,7 @@ class _WebPage extends State<WebPage> with WidgetsBindingObserver {
isKeyBoardShow, isKeyBoardShow,
_reply, _reply,
_delCommentTips, _delCommentTips,
12 12.sp
), ),
], ],
), ),

43
lib/web/web_view/comment_list.dart

@ -25,16 +25,9 @@ class CommentList extends StatefulWidget {
final Function delCommentTips; final Function delCommentTips;
final double fontSize; final double fontSize;
CommentList( CommentList(Key key, this.arguments, this.activity, this.article,
Key key, this.isKeyBoardShow, this.reply, this.delCommentTips, this.fontSize)
this.arguments, : super(key: key);
this.activity,
this.article,
this.isKeyBoardShow,
this.reply,
this.delCommentTips,
this.fontSize
) : super(key: key);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -104,7 +97,7 @@ class _CommentList extends State<CommentList> {
Text( Text(
S.of(context).pinglun_(commentTotal.toString()), S.of(context).pinglun_(commentTotal.toString()),
style: TextStyle( style: TextStyle(
fontSize:widget.fontSize+4, fontSize: widget.fontSize + 4,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Color(0xff1A1A1A), color: Color(0xff1A1A1A),
), ),
@ -116,7 +109,7 @@ class _CommentList extends State<CommentList> {
S.of(context).xihuan_( S.of(context).xihuan_(
"${widget.article?.likes ?? widget.activity?.likes ?? "0"}"), "${widget.article?.likes ?? widget.activity?.likes ?? "0"}"),
style: TextStyle( style: TextStyle(
fontSize:widget.fontSize+4, fontSize: widget.fontSize + 4,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Color(0xff1A1A1A), color: Color(0xff1A1A1A),
), ),
@ -163,7 +156,7 @@ class _CommentList extends State<CommentList> {
child: Text( child: Text(
S.of(context).yixiansquanbupinglun, S.of(context).yixiansquanbupinglun,
style: TextStyle( style: TextStyle(
fontSize:widget.fontSize+2, fontSize: widget.fontSize + 2,
color: Color(0xff353535), color: Color(0xff353535),
), ),
), ),
@ -171,17 +164,15 @@ class _CommentList extends State<CommentList> {
if (memberList == null || memberList.length == 0) if (memberList == null || memberList.length == 0)
Container( Container(
width: double.infinity, width: double.infinity,
height: MediaQuery.of(context).size.height - height: MediaQuery.of(context).size.height - kToolbarHeight
kToolbarHeight - - MediaQuery.of(context).padding.top - 160.h,
MediaQuery.of(context).padding.top -
160.h,
alignment: Alignment.topCenter, alignment: Alignment.topCenter,
color: Color(0xFFF2F2F2), color: Color(0xFFF2F2F2),
padding: EdgeInsets.only(top: 22.h), padding: EdgeInsets.only(top: 22.h),
child: Text( child: Text(
S.of(context).zanwupinglun, S.of(context).zanwupinglun,
style: TextStyle( style: TextStyle(
fontSize:widget.fontSize+2, fontSize: widget.fontSize + 2,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Color(0xFFA0A0A0), color: Color(0xFFA0A0A0),
), ),
@ -216,10 +207,12 @@ class _CommentList extends State<CommentList> {
token: sharedPreferences.getString("token"), token: sharedPreferences.getString("token"),
showLoading: false, showLoading: false,
); );
BaseData<PageInfo<MemberCommentList>> baseData = await apiService.memberCommentList({ BaseData<PageInfo<MemberCommentList>> baseData =
await apiService.memberCommentList({
"pageNum": 1, "pageNum": 1,
"pageSize": 100, "pageSize": 100,
"relationalId": widget.arguments["activityId"] ?? widget.arguments["articleId"], "relationalId":
widget.arguments["activityId"] ?? widget.arguments["articleId"],
"relationalType": 1, "relationalType": 1,
}).catchError((error) {}); }).catchError((error) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
@ -292,7 +285,7 @@ class _CommentList extends State<CommentList> {
text: memberList.username, text: memberList.username,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize:widget.fontSize+2, fontSize: widget.fontSize + 2,
color: Colors.black, color: Colors.black,
), ),
), ),
@ -308,7 +301,7 @@ class _CommentList extends State<CommentList> {
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: 2, maxLines: 2,
style: TextStyle( style: TextStyle(
fontSize:widget.fontSize, fontSize: widget.fontSize,
color: Color(0xff808080), color: Color(0xff808080),
), ),
), ),
@ -359,7 +352,7 @@ class _CommentList extends State<CommentList> {
text, text,
style: TextStyle( style: TextStyle(
color: Color(0xFF1A1A1A), color: Color(0xFF1A1A1A),
fontSize:widget.fontSize, fontSize: widget.fontSize,
), ),
); );
}, },
@ -381,7 +374,7 @@ class _CommentList extends State<CommentList> {
child: Text( child: Text(
memberList.content, memberList.content,
style: TextStyle( style: TextStyle(
fontSize:widget.fontSize+2, fontSize: widget.fontSize + 2,
color: Color(0xff1A1A1A), color: Color(0xff1A1A1A),
), ),
), ),
@ -415,7 +408,7 @@ class _CommentList extends State<CommentList> {
child: Text( child: Text(
memberList.parentContent ?? "", memberList.parentContent ?? "",
style: TextStyle( style: TextStyle(
fontSize:widget.fontSize, fontSize: widget.fontSize,
color: Color(0xff808080), color: Color(0xff808080),
), ),
), ),

6
lib/web/web_view/web_content.dart

@ -7,6 +7,7 @@ import 'package:flutter_html/image_render.dart';
import 'package:chewie/src/chewie_progress_colors.dart' as chewie; import 'package:chewie/src/chewie_progress_colors.dart' as chewie;
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_html/src/replaced_element.dart'; import 'package:flutter_html/src/replaced_element.dart';
import 'package:flutter_html/style.dart';
import 'package:huixiang/retrofit/data/activity.dart'; import 'package:huixiang/retrofit/data/activity.dart';
import 'package:huixiang/retrofit/data/article.dart'; import 'package:huixiang/retrofit/data/article.dart';
import 'package:video_player/video_player.dart'; import 'package:video_player/video_player.dart';
@ -38,6 +39,11 @@ class _WebContent extends State<WebContent> {
: widget.article != null : widget.article != null
? widget.article.content ? widget.article.content
: "", : "",
style: {
"html": Style(
backgroundColor: Colors.white
)
},
customImageRenders: { customImageRenders: {
base64DataUriMatcher(): base64ImageRender(), base64DataUriMatcher(): base64ImageRender(),
assetUriMatcher(): assetImageRender(), assetUriMatcher(): assetImageRender(),

43
lib/web/web_view/web_header.dart

@ -1,23 +1,20 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:huixiang/retrofit/data/activity.dart'; import 'package:huixiang/retrofit/data/activity.dart';
import 'package:huixiang/retrofit/data/article.dart'; import 'package:huixiang/retrofit/data/article.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
class WebHeader extends StatefulWidget { class WebHeader extends StatefulWidget {
final Map arguments; final Map arguments;
final Activity activity; final Activity activity;
final Article article; final Article article;
final double fontSize; final double fontSize;
WebHeader(this.arguments, this.activity, this.article,this.fontSize); WebHeader(this.arguments, this.activity, this.article, this.fontSize);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
return _WebHeader(); return _WebHeader();
} }
} }
class _WebHeader extends State<WebHeader> { class _WebHeader extends State<WebHeader> {
@ -26,15 +23,15 @@ class _WebHeader extends State<WebHeader> {
return Column( return Column(
children: [ children: [
Container( Container(
color: Color(0xFFF7F7F7), color: Color(0xFFFFFFFF),
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
child: Text( child: Text(
widget.activity != null widget.activity != null
? widget.activity.mainTitle ? widget.activity.mainTitle
: widget.article != null : widget.article != null
? widget.article.mainTitle ? widget.article.mainTitle
: "", : "",
style: TextStyle( style: TextStyle(
fontSize: widget.fontSize, fontSize: widget.fontSize,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -43,32 +40,34 @@ class _WebHeader extends State<WebHeader> {
), ),
), ),
Container( Container(
color: Color(0xFFFFFFFF),
padding: EdgeInsets.symmetric(horizontal: 12.w), padding: EdgeInsets.symmetric(horizontal: 12.w),
child: Row( child: Row(
children: [ children: [
InkWell( InkWell(
child: Text( child: Text(
"${widget.activity != null ? (widget.activity.storeName ?? "") : (widget.article != null && widget.article.author != null) ? (widget.article.author.name ?? "") : ""}", "${widget.activity != null ? (widget.activity.storeName ?? "")
: (widget.article != null && widget.article.author != null)
? (widget.article.author.name ?? "") : ""}",
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize:widget.fontSize-2, fontSize: widget.fontSize - 2,
color: Colors.blue, color: Colors.blue,
), ),
), ),
onTap: () { onTap: () {
if (widget.activity != null) { if (widget.activity != null) {
if (widget.arguments["source"] != null && if (widget.arguments["source"] != null &&
widget.arguments["source"] == widget.arguments["source"] == widget.activity.storeId) {
widget.activity.storeId) {
Navigator.of(context).pop(); Navigator.of(context).pop();
} else { } else {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
'/router/union_detail_page', '/router/union_detail_page',
arguments: { arguments: {
"id": widget.activity.storeId, "id": widget.activity.storeId,
"source": "source": widget.arguments["activityId"]
widget.arguments["activityId"] },
}); );
} }
} }
}, },
@ -80,11 +79,11 @@ class _WebHeader extends State<WebHeader> {
widget.activity != null widget.activity != null
? widget.activity.createTime ? widget.activity.createTime
: widget.article != null : widget.article != null
? widget.article.createTime ? widget.article.createTime
: "", : "",
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: widget.fontSize-4, fontSize: widget.fontSize - 4,
color: Colors.grey, color: Colors.grey,
), ),
), ),
@ -94,8 +93,4 @@ class _WebHeader extends State<WebHeader> {
], ],
); );
} }
} }

Loading…
Cancel
Save