Browse Source

图片优化更改

ff_new
w-R 3 years ago
parent
commit
7ac70eedbe
  1. 17
      lib/community/community_page.dart
  2. 22
      lib/community/community_view/community_dynamic.dart
  3. 185
      lib/mine/mine_page.dart
  4. 4
      lib/store/store_order.dart

17
lib/community/community_page.dart

@ -82,12 +82,17 @@ class _CommunityPage extends State<CommunityPage>
onTap: () { onTap: () {
_toRelease(); _toRelease();
}, },
action: SvgPicture.asset( action: GestureDetector(
"assets/svg/shequ_fabu.svg", behavior: HitTestBehavior.opaque,
fit: BoxFit.contain, child: Container(color: Colors.transparent,
width: 24, padding: EdgeInsets.only(left: 20,right: 20),
height: 24, child: SvgPicture.asset(
), "assets/svg/shequ_fabu.svg",
fit: BoxFit.contain,
width: 24,
height: 24,
),)
)
), ),
body: Container( body: Container(
padding: EdgeInsets.only(bottom: 76.h), padding: EdgeInsets.only(bottom: 76.h),

22
lib/community/community_view/community_dynamic.dart

@ -174,17 +174,13 @@ class _CommunityDynamic extends State<CommunityDynamic> {
children: [ children: [
GestureDetector( GestureDetector(
onTap: (){ onTap: (){
if(widget?.article?.authorHeadImg == ""){
SmartDialog.showToast("用户暂未设置头像", alignment: Alignment.center);
return;
}
Navigator.push(context, MaterialPageRoute( builder: (context) => PhotoViewGalleryScreen( Navigator.push(context, MaterialPageRoute( builder: (context) => PhotoViewGalleryScreen(
images:[widget?.article?.authorHeadImg ?? ""],//list images:[widget?.article?.authorHeadImg ?? "https://lmg.jj20.com/up/allimg/tx30/09041130358711081.jpg"],//list
index: 0,//index index: 0,//index
), )); ), ));
}, },
child: MImage( child: MImage(
widget?.article?.authorHeadImg ?? "", (widget?.article?.authorHeadImg ?? "https://lmg.jj20.com/up/allimg/tx30/09041130358711081.jpg") + "?imageView2/1/w/200/h/200/format/jpg/q/75",
width: 44, width: 44,
height: 44, height: 44,
isCircle: true, isCircle: true,
@ -356,11 +352,11 @@ class _CommunityDynamic extends State<CommunityDynamic> {
), ), ); ), ), );
}, },
child: MImage( child: MImage(
cnt["images"][0], cnt["images"][0].replaceAll(".jpg",".jpg?imageView2/0/q/75"),
fit: BoxFit.cover, fit: BoxFit.cover,
radius: BorderRadius.circular(2), radius: BorderRadius.circular(2),
width: MediaQuery.of(context).size.width / 1.5, width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.width / 1.5, height: MediaQuery.of(context).size.width,
errorSrc: "assets/image/default_2_1.png", errorSrc: "assets/image/default_2_1.png",
fadeSrc: "assets/image/default_2_1.png", fadeSrc: "assets/image/default_2_1.png",
)), )),
@ -390,7 +386,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
), ), ); ), ), );
}, },
child: MImage( child: MImage(
cnt["images"][position], cnt["images"][position].replaceAll(".jpg",".jpg?imageView2/0/q/75"),
fit: BoxFit.cover, fit: BoxFit.cover,
aspectRatio: 1, aspectRatio: 1,
radius: BorderRadius.circular(1), radius: BorderRadius.circular(1),
@ -411,7 +407,7 @@ class _CommunityDynamic extends State<CommunityDynamic> {
? (MediaQuery.of(context).size.width - 32) / ? (MediaQuery.of(context).size.width - 32) /
videoPlayerController.value.aspectRatio videoPlayerController.value.aspectRatio
: MediaQuery.of(context).size.width / 2, : MediaQuery.of(context).size.width / 2,
!widget.isList ? cnt["video"] : widget.article.coverImg, cnt["video"].replaceAll(".mp4","_poster.jpg"),
); );
} }
return Column( return Column(
@ -463,8 +459,8 @@ class _CommunityDynamic extends State<CommunityDynamic> {
height: height, height: height,
)) ))
: Container( : Container(
width: width, width: MediaQuery.of(context).size.width,
height: width / 7 * 5, height:MediaQuery.of(context).size.width,
color: Colors.black, color: Colors.black,
child: Stack( child: Stack(
children: [ children: [

185
lib/mine/mine_page.dart

@ -53,12 +53,9 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
@override @override
void dispose() { void dispose() {
super.dispose(); super.dispose();
if (_refreshController != null) if (_refreshController != null) _refreshController.dispose();
_refreshController.dispose();
} }
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -118,7 +115,7 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
EasyLoading.dismiss(); EasyLoading.dismiss();
} }
_onRefresh(){ _onRefresh() {
queryUserInfo(); queryUserInfo();
querySocialInfo(); querySocialInfo();
} }
@ -134,7 +131,7 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
); );
BaseData<SocialInfo> baseData = BaseData<SocialInfo> baseData =
await apiService.socialInfo().catchError((onError) { await apiService.socialInfo().catchError((onError) {
_refreshController.refreshFailed(); _refreshController.refreshFailed();
}); });
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
@ -203,9 +200,12 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
tag: "vip", tag: "vip",
ranks: ranks, ranks: ranks,
userInfo: userInfo, userInfo: userInfo,
rank: double.tryParse(userInfo?.expendAmount??"0").toInt(), rank: double.tryParse(
rankMax: userInfo?.memberRankVo?.nextOrigin??0, userInfo?.expendAmount ?? "0")
createTime: userInfo?.createTime??"", .toInt(),
rankMax:
userInfo?.memberRankVo?.nextOrigin ?? 0,
createTime: userInfo?.createTime ?? "",
), ),
], ],
), ),
@ -309,10 +309,10 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
} }
///// /////
Widget attention(){ Widget attention() {
return Container( return Container(
margin: EdgeInsets.only(left: 16,top: 10,right: 16), margin: EdgeInsets.only(left: 16, top: 10, right: 16),
padding: EdgeInsets.only(top: 16,bottom: 16), // padding: EdgeInsets.only(top: 16,bottom: 16),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
@ -325,36 +325,35 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
), ),
], ],
), ),
child:GestureDetector( child: Row(
onTap:(){ mainAxisAlignment: MainAxisAlignment.spaceAround,
Navigator.of(context).pushNamed( crossAxisAlignment: CrossAxisAlignment.start,
'/router/communityFollow', children: [
arguments: {}, Expanded(
); child: GestureDetector(
}, behavior: HitTestBehavior.opaque,
child: Row( onTap: () {
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
GestureDetector(
onTap:(){
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
'/router/communityFollow', '/router/communityFollow',
arguments: {}, arguments: {},
); );
}, },
child: child: Container(
Column( color: Colors.transparent,
padding: EdgeInsets.all(16),
child: Column(
children: [ children: [
Text( Text(
infoNumber != null ?infoNumber.follow.toString() :"0", infoNumber != null ? infoNumber.follow.toString() : "0",
style: TextStyle( style: TextStyle(
color: Color(0xFF000000), color: Color(0xFF000000),
fontSize: 15.sp, fontSize: 15.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
), ),
), ),
SizedBox(height:4,), SizedBox(
height: 4,
),
Text( Text(
S.of(context).guanzhu, S.of(context).guanzhu,
style: TextStyle( style: TextStyle(
@ -364,70 +363,86 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
), ),
), ),
], ],
), )),
), ),
GestureDetector( ),
onTap:(){ Expanded(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
'/router/communityFollow', '/router/communityFollow',
arguments: {}, arguments: {},
); );
}, },
child: child: Container(
Column( color: Colors.transparent,
children: [ padding: EdgeInsets.all(16),
Text( child: Column(
infoNumber != null ?infoNumber.fans.toString() :"0", children: [
style: TextStyle( Text(
color: Color(0xFF000000), infoNumber != null ? infoNumber.fans.toString() : "0",
fontSize: 15.sp, style: TextStyle(
fontWeight: MyFontWeight.medium, color: Color(0xFF000000),
), fontSize: 15.sp,
), fontWeight: MyFontWeight.medium,
SizedBox(height:4,), ),
Text( ),
S.of(context).fensi, SizedBox(
style: TextStyle( height: 4,
color: Color(0xFF000000), ),
fontSize: 14.sp, Text(
fontWeight: MyFontWeight.regular, S.of(context).fensi,
), style: TextStyle(
), color: Color(0xFF000000),
], fontSize: 14.sp,
), fontWeight: MyFontWeight.regular,
),
),
],
)),
), ),
GestureDetector( ),
onTap:(){ Expanded(
Navigator.of(context).pushNamed( child: GestureDetector(
'/router/mine_attainment_page', behavior: HitTestBehavior.opaque,
arguments: {"userInfo":userInfo}, onTap: () {
); Navigator.of(context).pushNamed(
}, '/router/mine_attainment_page',
child: arguments: {"userInfo": userInfo},
Column( );
children: [ },
Text( child: Container(
infoNumber != null ?infoNumber.achievementNumber.toString() :"0", color: Colors.transparent,
style: TextStyle( padding: EdgeInsets.all(16),
color: Color(0xFF000000), child: Column(
fontSize: 15.sp, children: [
fontWeight: MyFontWeight.medium, Text(
), infoNumber != null
), ? infoNumber.achievementNumber.toString()
SizedBox(height:4,), : "0",
Text( style: TextStyle(
"成就", color: Color(0xFF000000),
style: TextStyle( fontSize: 15.sp,
color: Color(0xFF000000), fontWeight: MyFontWeight.medium,
fontSize: 14.sp, ),
fontWeight: MyFontWeight.regular, ),
), SizedBox(
height: 4,
),
Text(
"成就",
style: TextStyle(
color: Color(0xFF000000),
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
),
),
],
), ),
], )),
), )
), ],
],
),
), ),
); );
} }

4
lib/store/store_order.dart

@ -243,10 +243,14 @@ class _StoreOrderPage extends State<StoreOrderPage>
stretch: false, stretch: false,
brightness: Brightness.light, brightness: Brightness.light,
leading: GestureDetector( leading: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
child: Container( child: Container(
width: double.infinity,
height: double.infinity,
color: Colors.transparent,
alignment: Alignment.centerRight, alignment: Alignment.centerRight,
margin: EdgeInsets.only(left: 10), margin: EdgeInsets.only(left: 10),
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),

Loading…
Cancel
Save