Browse Source

Merge remote-tracking branch 'origin/remove_uniapp' into remove_uniapp

ff_new
fmk 3 years ago
parent
commit
f04f6404ad
  1. BIN
      assets/image/2x/activity_hot.png
  2. BIN
      assets/image/2x/activity_q.png
  3. BIN
      assets/image/3x/activity_hot.png
  4. BIN
      assets/image/3x/activity_q.png
  5. BIN
      assets/image/activity_hot.png
  6. BIN
      assets/image/activity_q.png
  7. 3
      lib/community/community_view/class_details.dart
  8. 5
      lib/community/community_view/home_class.dart
  9. 169
      lib/community/headlines/activity_top_list.dart
  10. 46
      lib/community/headlines/article_page.dart
  11. 4
      lib/community/headlines/headlines_column_details.dart
  12. 19
      lib/home/home_page.dart
  13. 4
      lib/home/home_view/featured_acticvity.dart
  14. 21
      lib/message/system_details.dart
  15. 8
      lib/message/system_message.dart
  16. 184
      lib/mine/mine_view/wallet_coupon_view.dart
  17. 8
      lib/retrofit/retrofit_api.dart
  18. 2
      lib/retrofit/retrofit_api.g.dart
  19. 203
      lib/view_widget/activity_coupons.dart
  20. 11
      lib/view_widget/login_tips.dart
  21. 4
      lib/view_widget/new_people_reward.dart
  22. 7
      lib/view_widget/text_image_dialog.dart

BIN
assets/image/2x/activity_hot.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
assets/image/2x/activity_q.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

BIN
assets/image/3x/activity_hot.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
assets/image/3x/activity_q.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 KiB

BIN
assets/image/activity_hot.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 812 B

BIN
assets/image/activity_q.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

3
lib/community/community_view/class_details.dart

@ -200,7 +200,7 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
Row( Row(
children: [ children: [
Container( Container(
height: 22.h, // height: 22.h,
padding:EdgeInsets.only(left:2,right:2), padding:EdgeInsets.only(left:2,right:2),
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
@ -216,6 +216,7 @@ class _ClassDetails extends State<ClassDetails> with WidgetsBindingObserver {
course.tags.length > 0) course.tags.length > 0)
? course.tags[0] ? course.tags[0]
: "", : "",
overflow:TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,

5
lib/community/community_view/home_class.dart

@ -220,7 +220,7 @@ class _HomeClass extends State<HomeClass> {
Container( Container(
margin: EdgeInsets.only(top: 8, right: 8), margin: EdgeInsets.only(top: 8, right: 8),
padding: EdgeInsets.only(left: 2, right: 2), padding: EdgeInsets.only(left: 2, right: 2),
height: 16.h, height: 20.h,
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2), borderRadius: BorderRadius.circular(2),
@ -230,8 +230,9 @@ class _HomeClass extends State<HomeClass> {
(collect?.tags != null && collect.tags.length > 0) (collect?.tags != null && collect.tags.length > 0)
? collect.tags[0] ? collect.tags[0]
: "", : "",
overflow:TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 11.sp,
fontWeight: MyFontWeight.medium, fontWeight: MyFontWeight.medium,
color: Color(0xFF634815), color: Color(0xFF634815),
), ),

169
lib/community/headlines/activity_top_list.dart

@ -0,0 +1,169 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart';
import 'package:huixiang/retrofit/data/article.dart';
import 'package:huixiang/retrofit/data/collect_class_list.dart';
import 'package:huixiang/retrofit/data/course_list.dart';
import 'package:huixiang/retrofit/data/headlines_list.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/new_people_reward.dart';
class ActivityTopList extends StatefulWidget {
final List<Article> articleTop;
ActivityTopList(this.articleTop);
@override
State<StatefulWidget> createState() {
return _ActivityTopList();
}
}
class _ActivityTopList extends State<ActivityTopList> {
ApiService apiService;
BMFCoordinate latLng;
final TextEditingController editingController = TextEditingController();
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return Container(
height: 220.h,
margin: EdgeInsets.only(top: 10),
child: ListView.builder(
scrollDirection: Axis.horizontal,
physics: BouncingScrollPhysics(),
padding: EdgeInsets.symmetric(horizontal: 10),
itemCount: widget.articleTop == null ? 0 : widget.articleTop.length,
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {
Navigator.of(context).pushNamed(
'/router/headlines_column_details',
arguments: {"id": widget.articleTop[position].id});
},
child: headlinesCollectionItem(widget.articleTop[position], position),
);
},
),
);
}
Widget headlinesCollectionItem(Article articles, index) {
return Container(
width: 340.w,
height: 220.h,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(10),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
color: Colors.black,
),
margin: EdgeInsets.symmetric(
horizontal: 6,
),
child:Column(
children: [
Stack(
alignment: Alignment.bottomLeft,
children: [
Stack(
children: [
ClipRRect(
child: Opacity(
opacity: 0.8,
child: MImage(
widget?.articleTop[index]?.coverImg ?? "",
width: 340.w,
height: 220.h,
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(
"精选好文",
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,
),
),)
],
)),
],
),
],
)
);
}
}

46
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';
@ -25,6 +26,7 @@ import 'package:huixiang/view_widget/store_title_tab.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'activity_top_list.dart';
import 'article_list.dart'; import 'article_list.dart';
class ArticlePage extends StatefulWidget { class ArticlePage extends StatefulWidget {
@ -44,6 +46,7 @@ class _ArticlePage extends State<ArticlePage>
List<Brand> brands = []; List<Brand> brands = [];
List<BannerData> bannerData = []; List<BannerData> bannerData = [];
List<Article> articles = []; List<Article> articles = [];
List<Article> articleTop = [];
List<HeadlinesList> headlines = []; List<HeadlinesList> headlines = [];
int pageNum = 1; int pageNum = 1;
@ -57,7 +60,8 @@ class _ArticlePage extends State<ArticlePage>
setState(() {}); setState(() {});
} }
}); });
queryArticleList(); queryArticleList(false);
queryArticleList(true);
queryHeadlinesBanner(); queryHeadlinesBanner();
queryHeadlinesList(); queryHeadlinesList();
} }
@ -95,7 +99,7 @@ class _ArticlePage extends State<ArticlePage>
} }
/// ///
queryArticleList() async { queryArticleList(bool isHot) async {
if (apiService == null) { if (apiService == null) {
SharedPreferences value = await SharedPreferences.getInstance(); SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService( apiService = ApiService(
@ -109,7 +113,9 @@ class _ArticlePage extends State<ArticlePage>
"pageSize": 10, "pageSize": 10,
"searchKey": "", "searchKey": "",
"state": 1, "state": 1,
"type": 2 "type": 2,
"storeId":"",
"isHot":isHot
}).catchError((onError) { }).catchError((onError) {
refreshController.refreshFailed(); refreshController.refreshFailed();
refreshController.loadFailed(); refreshController.loadFailed();
@ -118,9 +124,15 @@ class _ArticlePage extends State<ArticlePage>
refreshController.refreshCompleted(); refreshController.refreshCompleted();
refreshController.loadComplete(); refreshController.loadComplete();
if (pageNum == 1) { if (pageNum == 1) {
if(!isHot)
articles.clear(); articles.clear();
else
articleTop.clear();
} }
if(!isHot)
articles.addAll(baseData.data.list); articles.addAll(baseData.data.list);
else
articleTop.addAll(baseData.data.list);
if (baseData.data.pageNum == baseData.data.pages) { if (baseData.data.pageNum == baseData.data.pages) {
refreshController.loadNoData(); refreshController.loadNoData();
} else { } else {
@ -160,7 +172,8 @@ class _ArticlePage extends State<ArticlePage>
_onRefresh() { _onRefresh() {
queryHeadlinesBanner(); queryHeadlinesBanner();
queryHeadlinesList(); // queryHeadlinesList(); //
queryArticleList(); queryArticleList(false);
queryArticleList(true);
} }
@override @override
@ -182,7 +195,7 @@ class _ArticlePage extends State<ArticlePage>
), ),
onRefresh: _onRefresh, onRefresh: _onRefresh,
onLoading: () { onLoading: () {
queryArticleList(); queryArticleList(false);
}, },
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
scrollController: scrollController, scrollController: scrollController,
@ -227,12 +240,29 @@ class _ArticlePage extends State<ArticlePage>
List<Widget> classChildItem() { List<Widget> classChildItem() {
var widgets = <Widget>[ var widgets = <Widget>[
///banner ///banner
HeadlinesBanner( // HeadlinesBanner(
bannerData, // bannerData,
), // ),
ActivityTopList(articleTop),
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),

4
lib/community/headlines/headlines_column_details.dart

@ -78,7 +78,8 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
"searchKey": "", "searchKey": "",
"state": 1, "state": 1,
"type": 2, "type": 2,
"categoryId": categoryId "categoryId": categoryId,
"isHot":false,
}).catchError((onError) { }).catchError((onError) {
refreshController.refreshFailed(); refreshController.refreshFailed();
refreshController.loadFailed(); refreshController.loadFailed();
@ -113,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,

19
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';
@ -66,6 +67,7 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
setState(() {}); setState(() {});
} }
}); });
queryMsgStats();
if ((widget.invite ?? "") != "" || if ((widget.invite ?? "") != "" ||
widget.interviewCouponList != null && widget.interviewCouponList != null &&
@ -259,12 +261,13 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
BaseData<List<MsgStats>> baseData = await apiService.stats().catchError((onError) {}); BaseData<List<MsgStats>> baseData = await apiService.stats().catchError((onError) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
setState(() { setState(() {
totalMsg = 0;
baseData.data.forEach((element) { baseData.data.forEach((element) {
totalMsg += element.number; totalMsg += element.number;
}); });
}); });
refreshController.loadComplete(); // refreshController.loadComplete();
refreshController.refreshCompleted(); // refreshController.refreshCompleted();
} }
EasyLoading.dismiss(); EasyLoading.dismiss();
} }
@ -300,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,
@ -521,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,
), ),
), ),
), ),

21
lib/message/system_details.dart

@ -37,13 +37,14 @@ class _SystemDetails extends State<SystemDetails> {
int pageNum = 1; int pageNum = 1;
List<Message> messages = []; List<Message> messages = [];
int msgType = 0; int msgType = 0;
String parenId = "0"; // String parenId = "0";
var commentFocus = FocusNode(); var commentFocus = FocusNode();
String hintText = S.current.liuxianinjingcaidepinglunba; String hintText = S.current.liuxianinjingcaidepinglunba;
bool isKeyBoardShow = false; bool isKeyBoardShow = false;
final GlobalKey commentKey = GlobalKey(); final GlobalKey commentKey = GlobalKey();
final GlobalKey inputKey = GlobalKey(); final GlobalKey inputKey = GlobalKey();
final TextEditingController commentTextController = TextEditingController(); final TextEditingController commentTextController = TextEditingController();
int indexMsg = 0;
@override @override
@ -108,29 +109,28 @@ class _SystemDetails extends State<SystemDetails> {
/// ///
_reply(messageRelational) { _reply(messageRelational) {
var messageRelational = jsonDecode(messages[0].relational), var messageRelational = jsonDecode(messages[indexMsg].relational);
parenId = messageRelational["mid"].toString(); messageRelational["additionId"].toString();
hintText = S.of(context).huifu_("${messageRelational["nickname"]}"); hintText = S.of(context).huifu_("${messageRelational["nickname"]}");
} }
/// ///
_queryMemberComment(String content) async { _queryMemberComment(String content) async {
var messageRelational = jsonDecode(messages[indexMsg].relational);
BaseData baseData = await apiService.memberComment({ BaseData baseData = await apiService.memberComment({
"content": content, "content": content,
"parentId": parenId, "parentId": messageRelational["additionId"].toString(),
"relationalId": messages[0].mid, "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();
SmartDialog.showToast("发布成功", alignment: Alignment.center); SmartDialog.showToast("发布成功", alignment: Alignment.center);
} }
else{ else{
SmartDialog.showToast("发布失败", alignment: Alignment.center); SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
} }
} }
@ -627,14 +627,14 @@ class _SystemDetails extends State<SystemDetails> {
}, },
); );
}, },
child: commentMessageItem(messages[position]), child: commentMessageItem(messages[position],position),
); );
}), }),
], ],
) )
); );
} }
Widget commentMessageItem(Message message) { Widget commentMessageItem(Message message,index) {
var messageRelational = jsonDecode(message.relational); var messageRelational = jsonDecode(message.relational);
return Container( return Container(
child: child:
@ -697,6 +697,7 @@ class _SystemDetails extends State<SystemDetails> {
GestureDetector( GestureDetector(
onTap: (){ onTap: (){
setState(() { setState(() {
indexMsg = index;
showDeleteDialog(); showDeleteDialog();
_reply(messageRelational); _reply(messageRelational);
}); });

8
lib/message/system_message.dart

@ -28,7 +28,6 @@ class _SystemMessagePage extends State<SystemMessagePage> {
ApiService apiService; ApiService apiService;
int pageNum = 1; int pageNum = 1;
List<Message> messages = []; List<Message> messages = [];
List<MsgStats> msgStats = [];
Map <String,int> msgNumber = { Map <String,int> msgNumber = {
"1":0, "1":0,
"2":0, "2":0,
@ -106,9 +105,10 @@ class _SystemMessagePage extends State<SystemMessagePage> {
BaseData<List<MsgStats>> baseData = await apiService.stats().catchError((onError) {}); BaseData<List<MsgStats>> baseData = await apiService.stats().catchError((onError) {});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
setState(() { setState(() {
msgStats.clear(); msgNumber.forEach((key, value) {
msgStats = baseData.data; msgNumber[key] = 0;
msgStats.forEach((element) { });
baseData.data.forEach((element) {
if(msgNumber.containsKey(element.name)){ if(msgNumber.containsKey(element.name)){
msgNumber[element.name] = element.number; msgNumber[element.name] = element.number;
} }

184
lib/mine/mine_view/wallet_coupon_view.dart

@ -1,3 +1,4 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
@ -30,11 +31,8 @@ class _WalletCoupon extends State<WalletCoupon> {
), ),
], ],
), ),
child: Row( child: (Theme.of(context).platform == TargetPlatform.android)
children: [ ? GestureDetector(
Expanded(
flex: 1,
child: GestureDetector(
onTap: () { onTap: () {
SharedPreferences.getInstance().then((value) { SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null || if (value.getString("token") == null ||
@ -46,8 +44,6 @@ class _WalletCoupon extends State<WalletCoupon> {
}); });
}, },
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Image.asset( Image.asset(
"assets/image/icon_mine_invoice_assistant.png", "assets/image/icon_mine_invoice_assistant.png",
@ -58,70 +54,128 @@ class _WalletCoupon extends State<WalletCoupon> {
width: 12.w, width: 12.w,
), ),
Expanded( Expanded(
child: Text( child: Column(
S.of(context).lingquanzhongxin, crossAxisAlignment: CrossAxisAlignment.start,
overflow: TextOverflow.ellipsis, children: [
style: TextStyle( Text(
fontWeight: MyFontWeight.medium, S.of(context).lingquanzhongxin,
fontSize: 16.sp, overflow: TextOverflow.ellipsis,
color: Color(0xFF353535), style: TextStyle(
), fontWeight: MyFontWeight.medium,
fontSize: 16.sp,
color: Color(0xFF353535),
),
),
SizedBox(
height: 3,
),
Text(
"联盟下单享不停、海量优惠券等你来领!",
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 12.sp,
color: Color(0xFF7B7B7B),
),
),
],
), ),
flex: 1, )
),
], ],
), ))
), : Row(
), children: [
Container( Expanded(
width: 2.w, flex: 1,
height: 32.h, child: GestureDetector(
margin: EdgeInsets.only(left: 20.w, right: 20.w), onTap: () {
color: Color(0xFFF7F7F7), SharedPreferences.getInstance().then((value) {
), if (value.getString("token") == null ||
Expanded( value.getString("token") == "") {
flex: 1, LoginTipsDialog().show(context);
child: GestureDetector( return;
onTap: () { }
SharedPreferences.getInstance().then((value) { Navigator.of(context)
if (value.getString("token") == null || .pushNamed('/router/roll_center_page');
value.getString("token") == "") { });
LoginTipsDialog().show(context); },
return; child: Row(
} mainAxisAlignment: MainAxisAlignment.center,
Navigator.of(context).pushNamed('/router/mine_wallet'); crossAxisAlignment: CrossAxisAlignment.center,
}); children: [
}, Image.asset(
child: Row( "assets/image/icon_mine_invoice_assistant.png",
mainAxisAlignment: MainAxisAlignment.center, width: 48.h,
crossAxisAlignment: CrossAxisAlignment.center, height: 48.h,
children: [ ),
Image.asset( SizedBox(
"assets/image/icon_mine_wallet.png", width: 12.w,
width: 48.h, ),
height: 48.h, Expanded(
), child: Text(
SizedBox( S.of(context).lingquanzhongxin,
width: 12.w, overflow: TextOverflow.ellipsis,
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 16.sp,
color: Color(0xFF353535),
),
),
flex: 1,
),
],
),
), ),
Expanded( ),
child: Text( Container(
S.of(context).wodeqianbao, width: 2.w,
overflow: TextOverflow.ellipsis, height: 32.h,
style: TextStyle( margin: EdgeInsets.only(left: 20.w, right: 20.w),
fontWeight: MyFontWeight.medium, color: Color(0xFFF7F7F7),
fontSize: 16.sp, ),
color: Color(0xFF353535), Expanded(
), flex: 1,
child: GestureDetector(
onTap: () {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
value.getString("token") == "") {
LoginTipsDialog().show(context);
return;
}
Navigator.of(context).pushNamed('/router/mine_wallet');
});
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
"assets/image/icon_mine_wallet.png",
width: 48.h,
height: 48.h,
),
SizedBox(
width: 12.w,
),
Expanded(
child: Text(
S.of(context).wodeqianbao,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 16.sp,
color: Color(0xFF353535),
),
),
flex: 1,
),
],
), ),
flex: 1,
), ),
], ),
), ],
), ),
),
],
),
); );
} }
} }

8
lib/retrofit/retrofit_api.dart

@ -54,14 +54,14 @@ import 'data/wx_pay.dart';
part 'retrofit_api.g.dart'; part 'retrofit_api.g.dart';
const base_url = "https://pos.platform.lotus-wallet.com/app/"; /// // const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///
const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; /// // const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///
// const base_url = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222 // const base_url = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222
// const baseUrl = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222 // const baseUrl = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222
// const base_url = "http://192.168.10.236:8766/app/"; /// const base_url = "http://192.168.10.236:8766/app/"; ///
// const baseUrl = "http://192.168.10.236:8766/app/"; /// const baseUrl = "http://192.168.10.236:8766/app/"; ///
// const base_url = "http://192.168.10.159:8766/app/"; /// // const base_url = "http://192.168.10.159:8766/app/"; ///
// const baseUrl = "http://192.168.10.159:8766/app/"; /// // const baseUrl = "http://192.168.10.159:8766/app/"; ///

2
lib/retrofit/retrofit_api.g.dart

@ -9,7 +9,7 @@ part of 'retrofit_api.dart';
class _ApiService implements ApiService { class _ApiService implements ApiService {
_ApiService(this._dio, {this.baseUrl}) { _ApiService(this._dio, {this.baseUrl}) {
ArgumentError.checkNotNull(_dio, '_dio'); ArgumentError.checkNotNull(_dio, '_dio');
baseUrl ??= 'https://pos.platform.lotus-wallet.com/app/'; baseUrl ??= 'http://192.168.10.236:8766/app/';
} }
final Dio _dio; final Dio _dio;

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