Browse Source

.sw,bug处理

ff_new
w-R 3 years ago
parent
commit
3b6845c547
  1. BIN
      assets/image/2x/activity_q.png
  2. BIN
      assets/image/3x/activity_q.png
  3. BIN
      assets/image/activity_q.png
  4. 156
      lib/community/headlines/activity_top_list.dart
  5. 16
      lib/community/headlines/article_page.dart
  6. 3
      lib/community/headlines/headlines_column_details.dart
  7. 13
      lib/home/home_page.dart
  8. 4
      lib/home/home_view/featured_acticvity.dart
  9. 6
      lib/message/system_details.dart
  10. 203
      lib/view_widget/activity_coupons.dart
  11. 11
      lib/view_widget/login_tips.dart
  12. 4
      lib/view_widget/new_people_reward.dart
  13. 7
      lib/view_widget/text_image_dialog.dart

BIN
assets/image/2x/activity_q.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

BIN
assets/image/3x/activity_q.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 KiB

BIN
assets/image/activity_q.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

156
lib/community/headlines/activity_top_list.dart

@ -60,7 +60,7 @@ class _ActivityTopList extends State<ActivityTopList> {
Widget headlinesCollectionItem(Article articles, index) { Widget headlinesCollectionItem(Article articles, index) {
return Container( return Container(
width: 320.w, width: 340.w,
height: 220.h, height: 220.h,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4), borderRadius: BorderRadius.circular(4),
@ -77,89 +77,93 @@ class _ActivityTopList extends State<ActivityTopList> {
margin: EdgeInsets.symmetric( margin: EdgeInsets.symmetric(
horizontal: 6, horizontal: 6,
), ),
child: Stack( child:Column(
alignment: Alignment.bottomLeft,
children: [ children: [
Stack( Stack(
alignment: Alignment.bottomLeft,
children: [ children: [
ClipRRect( Stack(
child: Opacity( children: [
opacity: 0.8, ClipRRect(
child: MImage( child: Opacity(
widget?.articleTop[index]?.coverImg ?? "", opacity: 0.8,
width: 320.w, child: MImage(
height: 220.h, widget?.articleTop[index]?.coverImg ?? "",
fit: BoxFit.cover, width: 340.w,
errorSrc: "assets/image/default_1.png", height: 220.h,
fadeSrc: "assets/image/default_1.png", fit: BoxFit.cover,
), errorSrc: "assets/image/default_1.png",
), fadeSrc: "assets/image/default_1.png",
borderRadius: BorderRadius.vertical(
top: Radius.circular(4),
bottom: Radius.circular(4),
),
),
Container(
padding: EdgeInsets.only(left: 12.w, right: 12.w, top: 8),
alignment: Alignment.topLeft,
child: Row(
children: [
Image.asset(
"assets/image/activity_hot.png",
width: 20,
height: 20,
fit: BoxFit.fill,
),
SizedBox(
width: 4.w,
), ),
Expanded( ),
child: Text( borderRadius: BorderRadius.vertical(
"精选好文", top: Radius.circular(4),
overflow: TextOverflow.ellipsis, bottom: Radius.circular(4),
maxLines: 2, ),
style: TextStyle( ),
fontSize: 14.sp, Container(
fontWeight: MyFontWeight.semi_bold, padding: EdgeInsets.only(left: 12.w, right: 12.w, top: 8),
color: Colors.white, alignment: Alignment.topLeft,
child: Row(
children: [
Image.asset(
"assets/image/activity_hot.png",
width: 20,
height: 20,
fit: BoxFit.fill,
), ),
), SizedBox(
), width: 4.w,
], ),
)), Expanded(
], child: Text(
), "精选好文",
Positioned( overflow: TextOverflow.ellipsis,
top:130, maxLines: 2,
left: 12, style: TextStyle(
child: Column( fontSize: 14.sp,
crossAxisAlignment: CrossAxisAlignment.start, fontWeight: MyFontWeight.semi_bold,
children: [ color: Colors.white,
Text( ),
widget?.articleTop[index]?.mainTitle ?? "", ),
overflow: TextOverflow.ellipsis, ),
maxLines: 2, ],
style: TextStyle( )),
fontSize: 14.sp, ],
fontWeight: MyFontWeight.semi_bold,
color: Colors.white,
),
),
Text(
widget?.articleTop[index]?.viceTitle ?? "",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold,
color: Colors.white,
),
), ),
], Padding(padding:EdgeInsets.only(left: 12.w, right: 12.w, bottom: 8),
)) child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
widget?.articleTop[index]?.mainTitle ?? "",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 16.sp,
fontWeight: MyFontWeight.semi_bold,
color: Colors.white,
),
),
SizedBox(height: 5.h),
Opacity(opacity:0.8,
child: Text(
widget?.articleTop[index]?.viceTitle ?? "",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Colors.white,
),
),)
],
)),
],
),
], ],
), )
); );
} }
} }

16
lib/community/headlines/article_page.dart

@ -18,6 +18,7 @@ import 'package:huixiang/retrofit/data/headlines_list_details.dart';
import 'package:huixiang/retrofit/data/page.dart'; import 'package:huixiang/retrofit/data/page.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/event_type.dart'; import 'package:huixiang/utils/event_type.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/classic_header.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/my_footer.dart'; import 'package:huixiang/view_widget/my_footer.dart';
@ -247,6 +248,21 @@ class _ArticlePage extends State<ArticlePage>
SizedBox(height: 28), SizedBox(height: 28),
Container(
width: double.infinity,
margin: EdgeInsets.only(left: 16,bottom:5),
child:Text(
"文章专栏",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
color: Colors.black,
),
)
),
/// ///
HeadlinesCollection(headlines, articles), HeadlinesCollection(headlines, articles),

3
lib/community/headlines/headlines_column_details.dart

@ -79,7 +79,7 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
"state": 1, "state": 1,
"type": 2, "type": 2,
"categoryId": categoryId, "categoryId": categoryId,
"isHot":"", "isHot":false,
}).catchError((onError) { }).catchError((onError) {
refreshController.refreshFailed(); refreshController.refreshFailed();
refreshController.loadFailed(); refreshController.loadFailed();
@ -114,6 +114,7 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
children: [ children: [
Positioned( Positioned(
child: Container( child: Container(
color: Colors.white,
child: SmartRefresher( child: SmartRefresher(
controller: refreshController, controller: refreshController,
enablePullDown: true, enablePullDown: true,

13
lib/home/home_page.dart

@ -26,6 +26,7 @@ import 'package:huixiang/retrofit/data/page.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/event_type.dart'; import 'package:huixiang/utils/event_type.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/activity_coupons.dart';
import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/classic_header.dart';
import 'package:huixiang/view_widget/invite_success_dialog.dart'; import 'package:huixiang/view_widget/invite_success_dialog.dart';
import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/my_appbar.dart';
@ -302,6 +303,8 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
Navigator.of(context).pushNamed('/router/system_msg_page'); Navigator.of(context).pushNamed('/router/system_msg_page');
///
// activityShowAlertDialog();
}, },
child: Container( child: Container(
height: 24, height: 24,
@ -523,6 +526,16 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
); );
} }
activityShowAlertDialog() {
//
showDialog(
context: context,
builder: (BuildContext context) {
return ActivityCoupons();
},
);
}
@override @override
bool get wantKeepAlive => true; bool get wantKeepAlive => true;
} }

4
lib/home/home_view/featured_acticvity.dart

@ -86,7 +86,7 @@ class _FeaturedActivity extends State<FeaturedActivity> {
image: NetworkImage( image: NetworkImage(
activityList[0].coverImg, activityList[0].coverImg,
), ),
fit: BoxFit.fill, fit: BoxFit.cover,
), ),
), ),
), ),
@ -114,7 +114,7 @@ class _FeaturedActivity extends State<FeaturedActivity> {
image: NetworkImage( image: NetworkImage(
activityList[1].coverImg, activityList[1].coverImg,
), ),
fit: BoxFit.fill, fit: BoxFit.cover,
), ),
), ),
), ),

6
lib/message/system_details.dart

@ -110,7 +110,7 @@ class _SystemDetails extends State<SystemDetails> {
/// ///
_reply(messageRelational) { _reply(messageRelational) {
var messageRelational = jsonDecode(messages[indexMsg].relational); var messageRelational = jsonDecode(messages[indexMsg].relational);
messageRelational["mid"].toString(); messageRelational["additionId"].toString();
hintText = S.of(context).huifu_("${messageRelational["nickname"]}"); hintText = S.of(context).huifu_("${messageRelational["nickname"]}");
} }
@ -119,13 +119,11 @@ class _SystemDetails extends State<SystemDetails> {
var messageRelational = jsonDecode(messages[indexMsg].relational); var messageRelational = jsonDecode(messages[indexMsg].relational);
BaseData baseData = await apiService.memberComment({ BaseData baseData = await apiService.memberComment({
"content": content, "content": content,
"parentId": messageRelational["mid"].toString(), "parentId": messageRelational["additionId"].toString(),
"relationalId":messageRelational["businessId"].toString(), "relationalId":messageRelational["businessId"].toString(),
"relationalType":4 "relationalType":4
}).catchError((error) {}); }).catchError((error) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
// CommentListState state = commentKey.currentState;
// state.queryMemberCommentList();
commentTextController.text = ""; commentTextController.text = "";
FocusScope.of(context).unfocus(); FocusScope.of(context).unfocus();
Navigator.of(context).pop(); Navigator.of(context).pop();

203
lib/view_widget/activity_coupons.dart

@ -0,0 +1,203 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/login_info.dart';
import 'package:huixiang/utils/flutter_utils.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/receive_success.dart';
import 'package:huixiang/view_widget/round_button.dart';
import 'package:huixiang/view_widget/separator.dart';
class ActivityCoupons extends StatefulWidget {
// final List<NewUserCouponList> newUserCouponList;
//
// ActivityCoupons(this.newUserCouponList);
@override
State<StatefulWidget> createState() {
return _ActivityCoupons();
}
}
class _ActivityCoupons extends State<ActivityCoupons> {
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.only(top:150.h),
height: MediaQuery.of(context).size.height / 2,
child: Column(
children: [
Container(
width: double.infinity,
height:MediaQuery.of(context).size.height / 2,
padding: EdgeInsets.only(top: 210.h),
margin: EdgeInsets.only(top: 20.h, left: 20, right: 20),
decoration: BoxDecoration(
image: DecorationImage(
fit: BoxFit.fill,
image: AssetImage("assets/image/activity_q.png"),
),
),
child: Column(
children: [
Expanded(
child: reward(),
),
GestureDetector(
onTap: () {
Navigator.of(context).pop();
SmartDialog.showToast("领取成功",alignment: Alignment.center);
},
child: Container(
margin: EdgeInsets.only(
left: 60.w, right: 60.w, top: 20.h, bottom:20.h),
decoration: BoxDecoration(
gradient: new LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: [
Color(0xFFFFDCA1),
Color(0xFFFAE4C0),
]),
borderRadius: BorderRadius.circular(22.5),
),
width: MediaQuery.of(context).size.width,
height: 40,
alignment: Alignment.center,
child: Text(
"立即领取",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14.sp,
color: Color(0xFF4A4748),
),
),
),
),
],
),
),
SizedBox(height: 35),
GestureDetector(
onTap: () {
setState(() {
Navigator.of(context).pop();
});
},
child: Image.asset(
"assets/image/yq_qx.png",
width: 34,
height: 34,
),
)
],
),
);
}
Widget reward() {
return ListView.builder(
padding: EdgeInsets.zero,
itemCount: 4,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {},
child: rewardItem(),
);
},
);
}
Widget rewardItem() {
return Container(
height: 69.h,
width: double.infinity,
decoration: BoxDecoration(
image: DecorationImage(
fit: BoxFit.fill,
image: AssetImage("assets/image/xin_rq.png"),
),
),
margin: EdgeInsets.symmetric(horizontal: 60, vertical: 5),
padding: EdgeInsets.only(left: 16.w, right: 25.w),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text.rich(
TextSpan(
children: [
TextSpan(
text: "¥",
style: TextStyle(
fontSize: 25.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFFDE5F3B),
),
),
TextSpan(
// text: double.tryParse(
// "${newUserCouponList.discountAmount}" ?? "0")
// .toInt()
// .toString() ??
// "",
text: "10",
style: TextStyle(
fontSize: 35.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFFDE5F3B),
),
),
],
),
),
Expanded(child:Padding(
padding: EdgeInsets.only(top: 4, bottom: 4,left:10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"海峡姐妹茶吧",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF181818),
),
),
Text(
"10元代金劵一张",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFFD3623D),
),
),
Text(
// "有效期至:${(newUserCouponList.useEndTime != null && newUserCouponList.useEndTime != "")
// ? newUserCouponList.useEndTime.split(" ")[0]
// : "$newUserCouponList.useEndTime"}",
"有效期至:2021-07-30",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF727272),
),
)
],
))),
],
),
);
}
}

11
lib/view_widget/login_tips.dart

@ -19,8 +19,11 @@ class LoginTips extends StatelessWidget {
type: MaterialType.transparency, type: MaterialType.transparency,
child: Center( child: Center(
child: Container( child: Container(
width: 0.7867.sw, // width: 0.7867.sw,
height: 0.7867.sw / (Platform.isAndroid ? 0.86 : 0.9), // height: 0.7867.sw / (Platform.isAndroid ? 0.86 : 0.9),
width:double.infinity,
height:MediaQuery.of(context).size.width / 1,
margin: EdgeInsets.symmetric(horizontal:16.w),
padding: EdgeInsets.symmetric(vertical: 20.h, horizontal: 24.w), padding: EdgeInsets.symmetric(vertical: 20.h, horizontal: 24.w),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
@ -33,8 +36,8 @@ class LoginTips extends StatelessWidget {
children: [ children: [
Image.asset( Image.asset(
"assets/image/icon_login_tips.png", "assets/image/icon_login_tips.png",
width: 0.7867.sw * 0.6, // width: 0.7867.sw * 0.6,
height: 0.7867.sw * 0.6 * 0.7, // height: 0.7867.sw * 0.6 * 0.7,
fit: BoxFit.fill, fit: BoxFit.fill,
), ),
SizedBox( SizedBox(

4
lib/view_widget/new_people_reward.dart

@ -1,12 +1,8 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/login_info.dart'; import 'package:huixiang/retrofit/data/login_info.dart';
import 'package:huixiang/utils/flutter_utils.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/round_button.dart';
import 'package:huixiang/view_widget/separator.dart';
class NewPeopleReward extends StatefulWidget { class NewPeopleReward extends StatefulWidget {
final List<NewUserCouponList> newUserCouponList; final List<NewUserCouponList> newUserCouponList;

7
lib/view_widget/text_image_dialog.dart

@ -37,7 +37,8 @@ class _TextImageWidget extends State<TextImageWidget> {
type: MaterialType.transparency, type: MaterialType.transparency,
child: Center( child: Center(
child: Container( child: Container(
width: widget.width ?? 0.7867.sw, width: double.infinity,
margin: EdgeInsets.symmetric(horizontal:16.w),
padding: EdgeInsets.symmetric(vertical: 20.h, horizontal: 24.w), padding: EdgeInsets.symmetric(vertical: 20.h, horizontal: 24.w),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
@ -50,8 +51,8 @@ class _TextImageWidget extends State<TextImageWidget> {
children: [ children: [
Image.asset( Image.asset(
widget.src, widget.src,
width: 0.7867.sw * 0.9, // width: 0.7867.sw * 0.9,
height: 0.7867.sw * 0.9 * 0.7, // height: 0.7867.sw * 0.9 * 0.7,
fit: BoxFit.fill, fit: BoxFit.fill,
), ),
SizedBox( SizedBox(

Loading…
Cancel
Save