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

2
lib/community/headlines/headlines_collection.dart

@ -86,7 +86,7 @@ class _HeadlinesCollection extends State<HeadlinesCollection> {
headlines?.coverImg ?? "",
width: 225.w,
height: 60.h,
fit: BoxFit.fill,
fit: BoxFit.cover,
errorSrc: "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)
Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
GestureDetector(
onTap: () {
Navigator.of(context).pushNamed('/router/web_page',
arguments: {"activityId": activityList[1].id});
},
child: Container(
child: stackItem(12.sp, activityList[1]),
margin: EdgeInsets.symmetric(horizontal: 5.w),
width: (MediaQuery.of(context).size.width - 42) / 2,
height: 190.h / 2,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
color: Colors.green,
image: DecorationImage(
image: NetworkImage(
activityList[1].coverImg,
Expanded(
child: Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
GestureDetector(
onTap: () {
Navigator.of(context).pushNamed('/router/web_page',
arguments: {"activityId": activityList[1].id});
},
child: Container(
child: stackItem(12.sp, activityList[1]),
margin: EdgeInsets.symmetric(horizontal: 5.w),
width: (MediaQuery.of(context).size.width - 42) / 2,
height: 190.h / 2,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
color: Colors.green,
image: DecorationImage(
image: NetworkImage(
activityList[1].coverImg,
),
fit: BoxFit.fill,
),
fit: BoxFit.fill,
),
),
),
),
SizedBox(
height: 5,
),
GestureDetector(
onTap: () {
Navigator.of(context).pushNamed('/router/web_page',
arguments: {"activityId": activityList[2].id});
},
child: Container(
child: stackItem(12.sp, activityList[2]),
margin: EdgeInsets.symmetric(horizontal: 5.w),
width: (MediaQuery.of(context).size.width - 42) / 2,
height: 190.h / 2,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
color: Colors.blue,
image: DecorationImage(
image: NetworkImage(
activityList[2].coverImg,
SizedBox(
height: 5,
),
GestureDetector(
onTap: () {
Navigator.of(context).pushNamed('/router/web_page',
arguments: {"activityId": activityList[2].id});
},
child: Container(
child: stackItem(12.sp, activityList[2]),
margin: EdgeInsets.symmetric(horizontal: 5.w),
width: (MediaQuery.of(context).size.width - 42) / 2,
height: 190.h / 2,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
color: Colors.blue,
image: DecorationImage(
image: NetworkImage(
activityList[2].coverImg,
),
fit: BoxFit.fill,
),
fit: BoxFit.fill,
),
),
),
),
],
],
),
),
),
],
@ -157,72 +159,74 @@ class _FeaturedActivity extends State<FeaturedActivity> {
}
Widget stackItem(double textSize, Activity activity) {
return Container(color: Color.fromARGB(80, 0, 0, 0),child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(left: 8, top: 8),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
activity.mainTitle,
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: textSize,
color: Colors.white,
),
return Container(
color: Color.fromARGB(80, 0, 0, 0),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(left: 8, top: 8),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
activity.mainTitle,
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
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(
activity?.viceTitle??"",
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 12.sp,
color: Colors.white,
),
decoration: BoxDecoration(
color: Color(0xFF32A060),
borderRadius: BorderRadius.circular(20),
),
],
),
),
Container(
width: 58.w,
margin: EdgeInsets.only(left: 8, bottom: 8),
padding: EdgeInsets.symmetric(
vertical: 4.h,
horizontal: 8.w,
),
decoration: BoxDecoration(
color: Color(0xFF32A060),
borderRadius: BorderRadius.circular(20),
),
alignment: Alignment.center,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
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,
alignment: Alignment.center,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
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,
"longitude": longitude,
"searchKey": searchKey
}).catchError((error) {
});
}).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
storeList = baseData.data;
}
@ -62,7 +61,7 @@ class _QuickOrder extends State<QuickOrder> {
getLatLng() async {
SharedPreferences.getInstance().then(
(value) => {
(value) => {
apiService = ApiService(Dio(),
context: context,
token: value.getString('token'),
@ -116,9 +115,9 @@ class _QuickOrder extends State<QuickOrder> {
latLng = BMFCoordinate(event["latitude"], event["longitude"]);
}
BMFCalculateUtils.coordConvert(
coordinate: latLng,
fromType: BMF_COORD_TYPE.BD09LL,
toType: BMF_COORD_TYPE.COMMON)
coordinate: latLng,
fromType: BMF_COORD_TYPE.BD09LL,
toType: BMF_COORD_TYPE.COMMON)
.then((value) {
this.latLng = value;
saveLatLng(
@ -143,8 +142,7 @@ class _QuickOrder extends State<QuickOrder> {
});
Location.getInstance().prepareLoc();
Location.getInstance().startLocation(context).then((value) {
});
Location.getInstance().startLocation(context).then((value) {});
}
saveLatLng(BMFCoordinate latLng, province, city, district) async {
@ -171,7 +169,7 @@ class _QuickOrder extends State<QuickOrder> {
scrollDirection: Axis.horizontal,
physics: BouncingScrollPhysics(),
padding: EdgeInsets.symmetric(horizontal: 10),
itemCount:storeList == null ? 0 : storeList.length,
itemCount: storeList == null ? 0 : storeList.length,
itemBuilder: (context, position) {
return GestureDetector(
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(
width: 160,
height: 160,
@ -226,7 +224,7 @@ class _QuickOrder extends State<QuickOrder> {
child: MImage(
store.facade,
width: double.infinity,
height: 95,
height: 100,
fit: BoxFit.cover,
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
@ -243,7 +241,7 @@ class _QuickOrder extends State<QuickOrder> {
child: SvgPicture.asset(
"assets/svg/kuaijiexiadan_bg.svg",
width: double.infinity,
height: 95,
height: 85,
fit: BoxFit.fill,
),
),
@ -265,15 +263,18 @@ class _QuickOrder extends State<QuickOrder> {
errorSrc: "assets/image/default_1.png",
fadeSrc: "assets/image/default_1.png",
),
Padding(padding: EdgeInsets.only(left: 10,right: 10),child:Text(
store.storeName,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 13.sp,
fontWeight: MyFontWeight.medium,
color: Colors.black,
Padding(
padding: EdgeInsets.only(left: 10, right: 10),
child: Text(
store.storeName,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 13.sp,
fontWeight: MyFontWeight.medium,
color: Colors.black,
),
),
),),
),
// Text(
// store?.remark ??"",
// style: TextStyle(
@ -380,7 +381,7 @@ class _QuickOrder extends State<QuickOrder> {
S.of(context).ninxiangjiquanxianweikaiqi,
S.of(context).weilekaipaizhaoxuanzhetouxiang,
S.of(context).kaiqiquanxian,
(result) async {
(result) async {
if (result) {
await openAppSettings();
}
@ -396,7 +397,12 @@ class _QuickOrder extends State<QuickOrder> {
String tableId = uri.queryParameters["tableId"];
String tenantCode = uri.queryParameters["tenantCode"];
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(
'/router/store_order',
arguments: {

8
lib/retrofit/min_api.dart

@ -21,12 +21,12 @@ import 'data/shoppingCart.dart';
part 'min_api.g.dart';
// const base_url = "https://pos.api.lotus-wallet.com/app/"; ///
// const baseUrl = "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 base_url = "http://user.prod.kunqi.lotus-wallet.com/app/"; ///222
const baseUrl = "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 base_url = "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 {
_MinApiService(this._dio, {this.baseUrl}) {
ArgumentError.checkNotNull(_dio, '_dio');
baseUrl ??= 'http://user.prod.kunqi.lotus-wallet.com/app/';
baseUrl ??= 'https://pos.api.lotus-wallet.com/app/';
}
final Dio _dio;

8
lib/retrofit/retrofit_api.dart

@ -53,8 +53,8 @@ import 'data/wx_pay.dart';
part 'retrofit_api.g.dart';
// const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///
// const baseUrl = "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 base_url = "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 base_url = "http://192.168.10.142:8766/app/";///
const baseUrl = "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/";///
@RestApi(baseUrl: baseUrl)
abstract class ApiService {

2
lib/retrofit/retrofit_api.g.dart

@ -9,7 +9,7 @@ part of 'retrofit_api.dart';
class _ApiService implements ApiService {
_ApiService(this._dio, {this.baseUrl}) {
ArgumentError.checkNotNull(_dio, '_dio');
baseUrl ??= 'http://192.168.10.142:8766/app/';
baseUrl ??= 'https://pos.platform.lotus-wallet.com/app/';
}
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),
padding: EdgeInsets.only(left: 16.w, right: 33.w),
padding: EdgeInsets.only(left: 16.w, right: 25.w),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -138,7 +138,11 @@ class _NewPeopleReward extends State<NewPeopleReward> {
),
),
TextSpan(
text:newUserCouponList.discountAmount,
text: double.tryParse(
"${newUserCouponList.discountAmount}" ?? "0")
.toInt()
.toString() ??
"",
style: TextStyle(
fontSize: 35.sp,
fontWeight: MyFontWeight.semi_bold,
@ -148,44 +152,46 @@ class _NewPeopleReward extends State<NewPeopleReward> {
],
),
),
Padding(
padding: EdgeInsets.only(top: 4, bottom: 4),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
newUserCouponList.storeName,
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 14.sp,
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),
Expanded(
child: Padding(
padding: EdgeInsets.only(top: 4, bottom: 4),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
newUserCouponList.storeName,
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF181818),
),
),
),
Text(
"有效期至:${newUserCouponList.useEndTime}",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF727272),
Text(
newUserCouponList.couponName,
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"}",
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF727272),
),
)
],
)),
),
],
),
);

Loading…
Cancel
Save