Browse Source

图片优化更改

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

9
lib/community/community_page.dart

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

93
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();
} }
@ -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(
onTap:(){
Navigator.of(context).pushNamed(
'/router/communityFollow',
arguments: {},
);
},
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
GestureDetector( Expanded(
onTap:(){ 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,
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,27 +363,34 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
), ),
), ),
], ],
)),
), ),
), ),
GestureDetector( Expanded(
onTap:(){ 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,
padding: EdgeInsets.all(16),
child: Column(
children: [ children: [
Text( Text(
infoNumber != null ?infoNumber.fans.toString() :"0", infoNumber != null ? infoNumber.fans.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).fensi, S.of(context).fensi,
style: TextStyle( style: TextStyle(
@ -394,27 +400,36 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
), ),
), ),
], ],
)),
), ),
), ),
GestureDetector( Expanded(
onTap:(){ child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
'/router/mine_attainment_page', '/router/mine_attainment_page',
arguments: {"userInfo":userInfo}, arguments: {"userInfo": userInfo},
); );
}, },
child: child: Container(
Column( color: Colors.transparent,
padding: EdgeInsets.all(16),
child: Column(
children: [ children: [
Text( Text(
infoNumber != null ?infoNumber.achievementNumber.toString() :"0", infoNumber != null
? infoNumber.achievementNumber.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(
"成就", "成就",
style: TextStyle( style: TextStyle(
@ -425,10 +440,10 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
), ),
], ],
), ),
), )),
)
], ],
), ),
),
); );
} }

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