Browse Source

店铺推荐样式更改,精彩活动右边加权重,新人奖励弹窗样式优化更改,头条合集:cover

ff_new
w-R 3 years ago
parent
commit
2fafa2b87c
  1. 94
      lib/community/headlines/article_list.dart
  2. 2
      lib/community/headlines/headlines_collection.dart
  3. 218
      lib/home/home_view/featured_acticvity.dart
  4. 52
      lib/home/home_view/quick_order.dart
  5. 8
      lib/retrofit/min_api.dart
  6. 2
      lib/retrofit/min_api.g.dart
  7. 8
      lib/retrofit/retrofit_api.dart
  8. 2
      lib/retrofit/retrofit_api.g.dart
  9. 82
      lib/view_widget/new_people_reward.dart

94
lib/community/headlines/article_list.dart

@ -100,7 +100,7 @@ class _ArticleList extends State<ArticleList> {
children: [ children: [
Expanded( Expanded(
child: Container( child: Container(
height: 96, height: 105,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
@ -115,6 +115,7 @@ class _ArticleList extends State<ArticleList> {
color: Colors.black, color: Colors.black,
), ),
), ),
SizedBox(height:5),
Text( Text(
widget?.articles[position]?.viceTitle ?? "", widget?.articles[position]?.viceTitle ?? "",
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
@ -125,50 +126,49 @@ class _ArticleList extends State<ArticleList> {
color: Color(0xFF353535), color: Color(0xFF353535),
), ),
), ),
// SizedBox(height: 20), Expanded(child:Row(
Row( children: [
children: [ Expanded(
Expanded( child: Text(
child: Text( widget.articles != null
widget.articles != null ? widget.articles[position]?.author?.name ?? ""
? widget.articles[position]?.author?.name ?? "" : "",
: "", overflow: TextOverflow.ellipsis,
overflow: TextOverflow.ellipsis, maxLines: 1,
maxLines: 1, style: TextStyle(
style: TextStyle( fontSize: 12.sp,
fontSize: 12.sp, fontWeight: MyFontWeight.medium,
fontWeight: MyFontWeight.medium, color: Color(0xFF8E8E8E),
color: Color(0xFF8E8E8E), ),
), ),
), ),
), SizedBox(width: 8),
SizedBox(width: 8), Image.asset(
Image.asset( "assets/image/browse.png",
"assets/image/browse.png", width: 14,
width: 14, height: 14,
height: 14, color: Color(0xFF808080),
color: Color(0xFF808080), ),
), Expanded(
Expanded( child: Text(
child: Text( "${widget?.articles[position]?.viewers}" ?? "",
"${widget?.articles[position]?.viewers}" ?? "", style: TextStyle(
style: TextStyle( fontSize: 12.sp,
fontSize: 12.sp, fontWeight: MyFontWeight.regular,
fontWeight: MyFontWeight.regular, color: Color(0xFF8D8D8D),
color: Color(0xFF8D8D8D), ),
), )),
)), Text(
Text( widget?.articles[position]?.createTime?.split(" ")[0] ??
widget?.articles[position]?.createTime?.split(" ")[0] ?? "",
"", style: TextStyle(
style: TextStyle( fontSize: 12.sp,
fontSize: 12.sp, fontWeight: MyFontWeight.regular,
fontWeight: MyFontWeight.regular, color: Color(0xFF8D8D8D),
color: Color(0xFF8D8D8D), ),
), ),
), ],
], ),),
),
], ],
), ),
)), )),
@ -177,8 +177,8 @@ class _ArticleList extends State<ArticleList> {
widget?.articles[position]?.coverImg ?? "", widget?.articles[position]?.coverImg ?? "",
fit: BoxFit.cover, fit: BoxFit.cover,
radius: BorderRadius.all(Radius.circular(2)), radius: BorderRadius.all(Radius.circular(2)),
width: 96, width: 100,
height: 96, height: 100,
), ),
], ],
), ),

2
lib/community/headlines/headlines_collection.dart

@ -86,7 +86,7 @@ class _HeadlinesCollection extends State<HeadlinesCollection> {
headlines?.coverImg ?? "", headlines?.coverImg ?? "",
width: 225.w, width: 225.w,
height: 60.h, height: 60.h,
fit: BoxFit.fill, fit: BoxFit.cover,
errorSrc: "assets/image/default_1.png", errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png", fadeSrc: "assets/image/default_1.png",
), ),

218
lib/home/home_view/featured_acticvity.dart

@ -92,58 +92,60 @@ class _FeaturedActivity extends State<FeaturedActivity> {
), ),
), ),
if (activityList != null && activityList.length > 1) if (activityList != null && activityList.length > 1)
Container( Expanded(
child: Column( child: Container(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, child: Column(
children: [ mainAxisAlignment: MainAxisAlignment.spaceEvenly,
GestureDetector( children: [
onTap: () { GestureDetector(
Navigator.of(context).pushNamed('/router/web_page', onTap: () {
arguments: {"activityId": activityList[1].id}); Navigator.of(context).pushNamed('/router/web_page',
}, arguments: {"activityId": activityList[1].id});
child: Container( },
child: stackItem(12.sp, activityList[1]), child: Container(
margin: EdgeInsets.symmetric(horizontal: 5.w), child: stackItem(12.sp, activityList[1]),
width: (MediaQuery.of(context).size.width - 42) / 2, margin: EdgeInsets.symmetric(horizontal: 5.w),
height: 190.h / 2, width: (MediaQuery.of(context).size.width - 42) / 2,
decoration: BoxDecoration( height: 190.h / 2,
borderRadius: BorderRadius.circular(4), decoration: BoxDecoration(
color: Colors.green, borderRadius: BorderRadius.circular(4),
image: DecorationImage( color: Colors.green,
image: NetworkImage( image: DecorationImage(
activityList[1].coverImg, image: NetworkImage(
activityList[1].coverImg,
),
fit: BoxFit.fill,
), ),
fit: BoxFit.fill,
), ),
), ),
), ),
), SizedBox(
SizedBox( height: 5,
height: 5, ),
), GestureDetector(
GestureDetector( onTap: () {
onTap: () { Navigator.of(context).pushNamed('/router/web_page',
Navigator.of(context).pushNamed('/router/web_page', arguments: {"activityId": activityList[2].id});
arguments: {"activityId": activityList[2].id}); },
}, child: Container(
child: Container( child: stackItem(12.sp, activityList[2]),
child: stackItem(12.sp, activityList[2]), margin: EdgeInsets.symmetric(horizontal: 5.w),
margin: EdgeInsets.symmetric(horizontal: 5.w), width: (MediaQuery.of(context).size.width - 42) / 2,
width: (MediaQuery.of(context).size.width - 42) / 2, height: 190.h / 2,
height: 190.h / 2, decoration: BoxDecoration(
decoration: BoxDecoration( borderRadius: BorderRadius.circular(4),
borderRadius: BorderRadius.circular(4), color: Colors.blue,
color: Colors.blue, image: DecorationImage(
image: DecorationImage( image: NetworkImage(
image: NetworkImage( activityList[2].coverImg,
activityList[2].coverImg, ),
fit: BoxFit.fill,
), ),
fit: BoxFit.fill,
), ),
), ),
), ),
), ],
], ),
), ),
), ),
], ],
@ -157,72 +159,74 @@ class _FeaturedActivity extends State<FeaturedActivity> {
} }
Widget stackItem(double textSize, Activity activity) { Widget stackItem(double textSize, Activity activity) {
return Container(color: Color.fromARGB(80, 0, 0, 0),child: Column( return Container(
mainAxisAlignment: MainAxisAlignment.spaceBetween, color: Color.fromARGB(80, 0, 0, 0),
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
children: [ mainAxisAlignment: MainAxisAlignment.spaceBetween,
Container( crossAxisAlignment: CrossAxisAlignment.start,
margin: EdgeInsets.only(left: 8, top: 8), children: [
child: Column( Container(
crossAxisAlignment: CrossAxisAlignment.start, margin: EdgeInsets.only(left: 8, top: 8),
children: [ child: Column(
Text( crossAxisAlignment: CrossAxisAlignment.start,
activity.mainTitle, children: [
overflow: TextOverflow.ellipsis, Text(
maxLines: 1, activity.mainTitle,
style: TextStyle( overflow: TextOverflow.ellipsis,
fontWeight: MyFontWeight.semi_bold, maxLines: 1,
fontSize: textSize, style: TextStyle(
color: Colors.white, fontWeight: MyFontWeight.semi_bold,
), fontSize: textSize,
color: Colors.white,
),
),
SizedBox(
height: 2,
),
Text(
activity?.viceTitle ?? "",
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 12.sp,
color: Colors.white,
),
),
],
), ),
SizedBox( ),
height: 2, Container(
width: 58.w,
margin: EdgeInsets.only(left: 8, bottom: 8),
padding: EdgeInsets.symmetric(
vertical: 4.h,
horizontal: 8.w,
), ),
Text( decoration: BoxDecoration(
activity?.viceTitle??"", color: Color(0xFF32A060),
style: TextStyle( borderRadius: BorderRadius.circular(20),
fontWeight: MyFontWeight.semi_bold,
fontSize: 12.sp,
color: Colors.white,
),
), ),
], alignment: Alignment.center,
), child: Row(
), mainAxisAlignment: MainAxisAlignment.center,
Container( crossAxisAlignment: CrossAxisAlignment.center,
width: 58.w, children: [
margin: EdgeInsets.only(left: 8, bottom: 8), Text(
padding: EdgeInsets.symmetric( "了解",
vertical: 4.h, style: TextStyle(
horizontal: 8.w, fontSize: 10.sp,
), fontWeight: MyFontWeight.medium,
decoration: BoxDecoration( color: Colors.white,
color: Color(0xFF32A060), ),
borderRadius: BorderRadius.circular(20), ),
), Icon(
alignment: Alignment.center, Icons.keyboard_arrow_right,
child: Row( color: Colors.white,
mainAxisAlignment: MainAxisAlignment.center, size: 12,
crossAxisAlignment: CrossAxisAlignment.center, ),
children: [ ],
Text(
"了解",
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.medium,
color: Colors.white,
),
),
Icon(
Icons.keyboard_arrow_right,
color: Colors.white,
size: 12,
), ),
], ),
), ],
), ));
],
));
} }
} }

52
lib/home/home_view/quick_order.dart

@ -52,8 +52,7 @@ class _QuickOrder extends State<QuickOrder> {
"latitude": latitude, "latitude": latitude,
"longitude": longitude, "longitude": longitude,
"searchKey": searchKey "searchKey": searchKey
}).catchError((error) { }).catchError((error) {});
});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
storeList = baseData.data; storeList = baseData.data;
} }
@ -62,7 +61,7 @@ class _QuickOrder extends State<QuickOrder> {
getLatLng() async { getLatLng() async {
SharedPreferences.getInstance().then( SharedPreferences.getInstance().then(
(value) => { (value) => {
apiService = ApiService(Dio(), apiService = ApiService(Dio(),
context: context, context: context,
token: value.getString('token'), token: value.getString('token'),
@ -116,9 +115,9 @@ class _QuickOrder extends State<QuickOrder> {
latLng = BMFCoordinate(event["latitude"], event["longitude"]); latLng = BMFCoordinate(event["latitude"], event["longitude"]);
} }
BMFCalculateUtils.coordConvert( BMFCalculateUtils.coordConvert(
coordinate: latLng, coordinate: latLng,
fromType: BMF_COORD_TYPE.BD09LL, fromType: BMF_COORD_TYPE.BD09LL,
toType: BMF_COORD_TYPE.COMMON) toType: BMF_COORD_TYPE.COMMON)
.then((value) { .then((value) {
this.latLng = value; this.latLng = value;
saveLatLng( saveLatLng(
@ -143,8 +142,7 @@ class _QuickOrder extends State<QuickOrder> {
}); });
Location.getInstance().prepareLoc(); Location.getInstance().prepareLoc();
Location.getInstance().startLocation(context).then((value) { Location.getInstance().startLocation(context).then((value) {});
});
} }
saveLatLng(BMFCoordinate latLng, province, city, district) async { saveLatLng(BMFCoordinate latLng, province, city, district) async {
@ -171,7 +169,7 @@ class _QuickOrder extends State<QuickOrder> {
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
padding: EdgeInsets.symmetric(horizontal: 10), padding: EdgeInsets.symmetric(horizontal: 10),
itemCount:storeList == null ? 0 : storeList.length, itemCount: storeList == null ? 0 : storeList.length,
itemBuilder: (context, position) { itemBuilder: (context, position) {
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
@ -188,7 +186,7 @@ class _QuickOrder extends State<QuickOrder> {
); );
} }
}, },
child: storeItem(storeList[position],position), child: storeItem(storeList[position], position),
); );
}, },
), ),
@ -197,7 +195,7 @@ class _QuickOrder extends State<QuickOrder> {
); );
} }
Widget storeItem(Store store,position) { Widget storeItem(Store store, position) {
return Container( return Container(
width: 160, width: 160,
height: 160, height: 160,
@ -226,7 +224,7 @@ class _QuickOrder extends State<QuickOrder> {
child: MImage( child: MImage(
store.facade, store.facade,
width: double.infinity, width: double.infinity,
height: 95, height: 100,
fit: BoxFit.cover, fit: BoxFit.cover,
errorSrc: "assets/image/default_1.png", errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png", fadeSrc: "assets/image/default_1.png",
@ -243,7 +241,7 @@ class _QuickOrder extends State<QuickOrder> {
child: SvgPicture.asset( child: SvgPicture.asset(
"assets/svg/kuaijiexiadan_bg.svg", "assets/svg/kuaijiexiadan_bg.svg",
width: double.infinity, width: double.infinity,
height: 95, height: 85,
fit: BoxFit.fill, fit: BoxFit.fill,
), ),
), ),
@ -265,15 +263,18 @@ class _QuickOrder extends State<QuickOrder> {
errorSrc: "assets/image/default_1.png", errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png", fadeSrc: "assets/image/default_1.png",
), ),
Padding(padding: EdgeInsets.only(left: 10,right: 10),child:Text( Padding(
store.storeName, padding: EdgeInsets.only(left: 10, right: 10),
textAlign: TextAlign.center, child: Text(
style: TextStyle( store.storeName,
fontSize: 13.sp, textAlign: TextAlign.center,
fontWeight: MyFontWeight.medium, style: TextStyle(
color: Colors.black, fontSize: 13.sp,
fontWeight: MyFontWeight.medium,
color: Colors.black,
),
), ),
),), ),
// Text( // Text(
// store?.remark ??"", // store?.remark ??"",
// style: TextStyle( // style: TextStyle(
@ -380,7 +381,7 @@ class _QuickOrder extends State<QuickOrder> {
S.of(context).ninxiangjiquanxianweikaiqi, S.of(context).ninxiangjiquanxianweikaiqi,
S.of(context).weilekaipaizhaoxuanzhetouxiang, S.of(context).weilekaipaizhaoxuanzhetouxiang,
S.of(context).kaiqiquanxian, S.of(context).kaiqiquanxian,
(result) async { (result) async {
if (result) { if (result) {
await openAppSettings(); await openAppSettings();
} }
@ -396,7 +397,12 @@ class _QuickOrder extends State<QuickOrder> {
String tableId = uri.queryParameters["tableId"]; String tableId = uri.queryParameters["tableId"];
String tenantCode = uri.queryParameters["tenantCode"]; String tenantCode = uri.queryParameters["tenantCode"];
String shopId = uri.queryParameters["shopId"]; String shopId = uri.queryParameters["shopId"];
if (tableId != null && tableId != "" && tenantCode != null && tenantCode != "" && shopId != null && shopId != "") { if (tableId != null &&
tableId != "" &&
tenantCode != null &&
tenantCode != "" &&
shopId != null &&
shopId != "") {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
'/router/store_order', '/router/store_order',
arguments: { arguments: {

8
lib/retrofit/min_api.dart

@ -21,12 +21,12 @@ import 'data/shoppingCart.dart';
part 'min_api.g.dart'; part 'min_api.g.dart';
// const base_url = "https://pos.api.lotus-wallet.com/app/"; /// const base_url = "https://pos.api.lotus-wallet.com/app/"; ///
// const baseUrl = "https://pos.api.lotus-wallet.com/app/"; /// const baseUrl = "https://pos.api.lotus-wallet.com/app/"; ///
const base_url = "http://user.prod.kunqi.lotus-wallet.com/app/"; ///222 // const base_url = "http://user.prod.kunqi.lotus-wallet.com/app/"; ///222
const baseUrl = "http://user.prod.kunqi.lotus-wallet.com/app/"; ///222 // const baseUrl = "http://user.prod.kunqi.lotus-wallet.com/app/"; ///222
// const base_url = "http://192.168.10.236:8765/app/";/// // const base_url = "http://192.168.10.236:8765/app/";///
// const baseUrl = "http://192.168.10.236:8765/app/";/// // const baseUrl = "http://192.168.10.236:8765/app/";///

2
lib/retrofit/min_api.g.dart

@ -9,7 +9,7 @@ part of 'min_api.dart';
class _MinApiService implements MinApiService { class _MinApiService implements MinApiService {
_MinApiService(this._dio, {this.baseUrl}) { _MinApiService(this._dio, {this.baseUrl}) {
ArgumentError.checkNotNull(_dio, '_dio'); ArgumentError.checkNotNull(_dio, '_dio');
baseUrl ??= 'http://user.prod.kunqi.lotus-wallet.com/app/'; baseUrl ??= 'https://pos.api.lotus-wallet.com/app/';
} }
final Dio _dio; final Dio _dio;

8
lib/retrofit/retrofit_api.dart

@ -53,8 +53,8 @@ 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
@ -66,8 +66,8 @@ part 'retrofit_api.g.dart';
// const baseUrl = "http://192.168.10.37:8766/app/"; // const baseUrl = "http://192.168.10.37:8766/app/";
const base_url = "http://192.168.10.142:8766/app/";/// // const base_url = "http://192.168.10.142:8766/app/";///
const baseUrl = "http://192.168.10.142:8766/app/";/// // const baseUrl = "http://192.168.10.142:8766/app/";///
@RestApi(baseUrl: baseUrl) @RestApi(baseUrl: baseUrl)
abstract class ApiService { abstract class ApiService {

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 ??= 'http://192.168.10.142:8766/app/'; baseUrl ??= 'https://pos.platform.lotus-wallet.com/app/';
} }
final Dio _dio; final Dio _dio;

82
lib/view_widget/new_people_reward.dart

@ -121,7 +121,7 @@ class _NewPeopleReward extends State<NewPeopleReward> {
), ),
), ),
margin: EdgeInsets.symmetric(horizontal: 60, vertical: 5), margin: EdgeInsets.symmetric(horizontal: 60, vertical: 5),
padding: EdgeInsets.only(left: 16.w, right: 33.w), padding: EdgeInsets.only(left: 16.w, right: 25.w),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -138,7 +138,11 @@ class _NewPeopleReward extends State<NewPeopleReward> {
), ),
), ),
TextSpan( TextSpan(
text:newUserCouponList.discountAmount, text: double.tryParse(
"${newUserCouponList.discountAmount}" ?? "0")
.toInt()
.toString() ??
"",
style: TextStyle( style: TextStyle(
fontSize: 35.sp, fontSize: 35.sp,
fontWeight: MyFontWeight.semi_bold, fontWeight: MyFontWeight.semi_bold,
@ -148,44 +152,46 @@ class _NewPeopleReward extends State<NewPeopleReward> {
], ],
), ),
), ),
Padding( Expanded(
padding: EdgeInsets.only(top: 4, bottom: 4), child: Padding(
child: Column( padding: EdgeInsets.only(top: 4, bottom: 4),
crossAxisAlignment: CrossAxisAlignment.center, child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center,
children: [ mainAxisAlignment: MainAxisAlignment.spaceBetween,
Text( children: [
newUserCouponList.storeName, Text(
overflow: TextOverflow.ellipsis, newUserCouponList.storeName,
maxLines: 2, overflow: TextOverflow.ellipsis,
style: TextStyle( maxLines: 2,
fontSize: 14.sp, style: TextStyle(
fontWeight: MyFontWeight.semi_bold, fontSize: 14.sp,
color: Color(0xFF181818), fontWeight: MyFontWeight.semi_bold,
), color: Color(0xFF181818),
), ),
Text(
newUserCouponList.couponName,
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFFD3623D),
), ),
), Text(
Text( newUserCouponList.couponName,
"有效期至:${newUserCouponList.useEndTime}", overflow: TextOverflow.ellipsis,
overflow: TextOverflow.ellipsis, maxLines: 2,
maxLines: 2, style: TextStyle(
style: TextStyle( fontSize: 12.sp,
fontSize: 10.sp, fontWeight: MyFontWeight.medium,
fontWeight: MyFontWeight.regular, color: Color(0xFFD3623D),
color: Color(0xFF727272), ),
), ),
) Text(
], "有效期至:${(newUserCouponList.useEndTime != null && newUserCouponList.useEndTime != "") ? newUserCouponList.useEndTime.split(" ")[0] : "$newUserCouponList.useEndTime"}",
)), overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF727272),
),
)
],
)),
),
], ],
), ),
); );

Loading…
Cancel
Save