Browse Source

規格更改

master
w-R 3 years ago
parent
commit
d4403a770a
  1. 472
      lib/retrofit/data/miNiDetail.dart
  2. 9
      lib/retrofit/min_api.dart
  3. 95
      lib/store/store_order.dart
  4. 206
      lib/store/store_view/store_order_list.dart
  5. 338
      lib/union/union_view/store_info.dart
  6. 2
      pubspec.lock

472
lib/retrofit/data/miNiDetail.dart

File diff suppressed because one or more lines are too long

9
lib/retrofit/min_api.dart

@ -1,6 +1,7 @@
import 'dart:convert'; import 'dart:convert';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flare_flutter/flare_testing.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart';
@ -11,8 +12,7 @@ import 'package:huixiang/view_widget/login_tips_dialog.dart';
import 'package:retrofit/retrofit.dart'; import 'package:retrofit/retrofit.dart';
import 'data/findMiNiGroupList.dart'; import 'data/findMiNiGroupList.dart';
import 'data/page.dart'; import 'data/miNiDetail.dart';
part 'min_api.g.dart'; part 'min_api.g.dart';
// const base_url = "https://pos.platform.lotus-wallet.com/app/"; /// // const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///
@ -114,5 +114,10 @@ abstract class MinApiService {
@Body() Map<String, dynamic> param,Map<String, dynamic> header); @Body() Map<String, dynamic> param,Map<String, dynamic> header);
////
@GET("/product/queryMiNiProductDetail?id={id}")
Future<BaseData<MiNiDetail>> miNiDetail(@Path("id") String id);
} }

95
lib/store/store_order.dart

@ -3,9 +3,11 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/gestures.dart'; import 'package:flutter/gestures.dart';
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_swiper/flutter_swiper.dart';
import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/activity.dart'; import 'package:huixiang/retrofit/data/activity.dart';
import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/findMiNiGroupList.dart';
import 'package:huixiang/retrofit/data/order_info.dart'; import 'package:huixiang/retrofit/data/order_info.dart';
import 'package:huixiang/retrofit/data/store_info.dart'; import 'package:huixiang/retrofit/data/store_info.dart';
import 'package:huixiang/retrofit/min_api.dart'; import 'package:huixiang/retrofit/min_api.dart';
@ -17,6 +19,7 @@ import 'package:huixiang/union/union_view/union_coupon.dart';
import 'package:huixiang/union/union_view/vip.dart'; import 'package:huixiang/union/union_view/vip.dart';
import 'package:huixiang/utils/font_weight.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:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/my_tab.dart'; import 'package:huixiang/view_widget/my_tab.dart';
import 'package:huixiang/view_widget/round_button.dart'; import 'package:huixiang/view_widget/round_button.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
@ -24,12 +27,8 @@ import 'package:shared_preferences/shared_preferences.dart';
class StoreOrderPage extends StatefulWidget { class StoreOrderPage extends StatefulWidget {
final Map arguments; final Map arguments;
final List<Activity> activitys;
final StoreInfo storeInfo;
final List<ProductList> productList;
StoreOrderPage({this.arguments});
StoreOrderPage({this.arguments, this.activitys, this.storeInfo,this.productList});
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -38,11 +37,12 @@ class StoreOrderPage extends StatefulWidget {
} }
class _StoreOrderPage extends State<StoreOrderPage> class _StoreOrderPage extends State<StoreOrderPage>
with TickerProviderStateMixin /*, AutomaticKeepAliveClientMixin */ { with TickerProviderStateMixin, AutomaticKeepAliveClientMixin {
TabController tabcontroller; TabController tabcontroller;
ApiService apiService; ApiService apiService;
MinApiService minService; MinApiService minService;
StoreInfo storeInfo; StoreInfo storeInfo;
List<Activity> activitys;
RefreshController refreshController; RefreshController refreshController;
List<Widget> _widgetOptions; List<Widget> _widgetOptions;
@ -60,13 +60,17 @@ class _StoreOrderPage extends State<StoreOrderPage>
_widgetOptions = [ _widgetOptions = [
StoreOrderListPage( StoreOrderListPage(
widget.arguments, widget.activitys, storeInfo, controller), widget.arguments,
activitys,
storeInfo,
controller,
),
///, ///,
StoreActivity( StoreActivity(
widget.arguments, widget.arguments,
widget.activitys, activitys,
), ),
]; ];
@ -81,7 +85,6 @@ class _StoreOrderPage extends State<StoreOrderPage>
context: context, context: context,
token: value.getString('token'), token: value.getString('token'),
); );
BaseData baseData = await apiService BaseData baseData = await apiService
.queryStoreInfo(widget.arguments["id"]) .queryStoreInfo(widget.arguments["id"])
.catchError((error) { .catchError((error) {
@ -90,6 +93,9 @@ class _StoreOrderPage extends State<StoreOrderPage>
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
refreshController.refreshCompleted(); refreshController.refreshCompleted();
storeInfo = StoreInfo.fromJson(baseData.data); storeInfo = StoreInfo.fromJson(baseData.data);
activitys = storeInfo.informationVOPageVO.list
.map((e) => Activity.fromJson(e))
.toList();
if (mounted) { if (mounted) {
setState(() {}); setState(() {});
} }
@ -126,7 +132,8 @@ class _StoreOrderPage extends State<StoreOrderPage>
(BuildContext context, bool innerBoxIsScrolled) { (BuildContext context, bool innerBoxIsScrolled) {
return [ return [
SliverOverlapAbsorber( SliverOverlapAbsorber(
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context), handle: NestedScrollView.sliverOverlapAbsorberHandleFor(
context),
sliver: SliverAppBar( sliver: SliverAppBar(
expandedHeight: (storeInfo != null && expandedHeight: (storeInfo != null &&
storeInfo.couponVOList != null) storeInfo.couponVOList != null)
@ -167,12 +174,13 @@ class _StoreOrderPage extends State<StoreOrderPage>
Positioned( Positioned(
child: Column( child: Column(
children: [ children: [
Image.asset( // Image.asset(
"assets/image/share_image_bg.png", // "assets/image/share_image_bg.png",
fit: BoxFit.cover, // fit: BoxFit.cover,
width: MediaQuery.of(context).size.width, // width: MediaQuery.of(context).size.width,
height: 180.h, // height: 180.h,
), // ),
buildSwiper(),
Expanded( Expanded(
child: Container( child: Container(
color: Colors.transparent, color: Colors.transparent,
@ -211,7 +219,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
], ],
), ),
), ),
top: 110.h, top: 90.h,
bottom: 0, bottom: 0,
left: 0, left: 0,
right: 0, right: 0,
@ -359,6 +367,45 @@ class _StoreOrderPage extends State<StoreOrderPage>
); );
} }
Widget buildSwiper() {
return Container(
width: double.infinity,
height: 180.h,
child: Swiper(
pagination: SwiperPagination(
alignment: Alignment.bottomCenter,
builder: DotSwiperPaginationBuilder(
size: 8.w,
activeSize: 8.w,
space: 5.w,
activeColor: Colors.white,
color: Colors.white.withAlpha(76),
),
),
itemBuilder: (context, position) {
return Container(
margin: EdgeInsets.only(left: 10.w, right: 10.w),
child: MImage(
(storeInfo != null &&
storeInfo.bannerList != null &&
position < storeInfo.bannerList.length)
? storeInfo.bannerList[position].imgUrl
: "",
fit: BoxFit.cover,
radius: BorderRadius.circular(4),
errorSrc: "assets/image/default_2_1.png",
fadeSrc: "assets/image/default_2_1.png",
),
);
},
itemCount: (storeInfo != null && storeInfo.bannerList != null)
? storeInfo.bannerList.length
: 1),
);
}
List<ProductList> productLists = [];
/// ///
showShoppingCart() { showShoppingCart() {
showModalBottomSheet( showModalBottomSheet(
@ -419,14 +466,13 @@ class _StoreOrderPage extends State<StoreOrderPage>
right: 16, right: 16,
), ),
child: ListView.builder( child: ListView.builder(
itemCount: widget.productList == null ? 0 : widget.productList.length, itemCount: productLists == null ? 0 : productLists.length,
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
itemBuilder: (context, position) { itemBuilder: (context, position) {
// return shoppGoodsItem(); // return shoppGoodsItem();
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {},
}, child: shoppGoodsItem(productLists[position], position),
child: shoppGoodsItem(widget.productList[position], position),
); );
}, },
), ),
@ -637,8 +683,8 @@ class _StoreOrderPage extends State<StoreOrderPage>
); );
} }
// @override @override
// bool get wantKeepAlive => true; bool get wantKeepAlive => true;
} }
class Title extends StatefulWidget { class Title extends StatefulWidget {
@ -668,7 +714,8 @@ class _Title extends State<Title> {
if (alphaProgress <= 1) { if (alphaProgress <= 1) {
alphatemp = 1; alphatemp = 1;
} else if (alphaProgress <= alphaHeight) { } else if (alphaProgress <= alphaHeight) {
alphatemp = (((alphaHeight - alphaProgress) / alphaHeight) > 0.5) ? 1 : 0; alphatemp =
(((alphaHeight - alphaProgress) / alphaHeight) > 0.5) ? 1 : 0;
} else { } else {
alphatemp = 0; alphatemp = 0;
} }

206
lib/store/store_view/store_order_list.dart

@ -8,11 +8,13 @@ import 'package:huixiang/retrofit/data/findMiNiGroupList.dart';
import 'package:huixiang/retrofit/data/findMiNiGroupList.dart'; import 'package:huixiang/retrofit/data/findMiNiGroupList.dart';
import 'package:huixiang/retrofit/data/findMiNiGroupList.dart'; import 'package:huixiang/retrofit/data/findMiNiGroupList.dart';
import 'package:huixiang/retrofit/data/findMiNiGroupList.dart'; import 'package:huixiang/retrofit/data/findMiNiGroupList.dart';
import 'package:huixiang/retrofit/data/miNiDetail.dart';
import 'package:huixiang/retrofit/data/store_info.dart'; import 'package:huixiang/retrofit/data/store_info.dart';
import 'package:huixiang/retrofit/data/user_entity.dart'; import 'package:huixiang/retrofit/data/user_entity.dart';
import 'package:huixiang/retrofit/min_api.dart'; import 'package:huixiang/retrofit/min_api.dart';
import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/utils/min.dart';
import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/round_button.dart'; import 'package:huixiang/view_widget/round_button.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -25,7 +27,11 @@ class StoreOrderListPage extends StatefulWidget {
final ScrollController controller; final ScrollController controller;
StoreOrderListPage( StoreOrderListPage(
this.arguments, this.activitys, this.storeInfo, this.controller); this.arguments,
this.activitys,
this.storeInfo,
this.controller,
);
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
@ -33,24 +39,7 @@ class StoreOrderListPage extends StatefulWidget {
} }
} }
class testModel {
String name;
bool isSelected;
testModel(String name) {
this.name = name;
this.isSelected = false;
}
}
class _StoreOrderListPage extends State<StoreOrderListPage> { class _StoreOrderListPage extends State<StoreOrderListPage> {
List<testModel> temperatureStoreList = [
testModel("正常冰"),
testModel("少冰"),
testModel("多冰"),
testModel("去冰")
];
List<testModel> sweetnessStoreList = [testModel("正常糖"), testModel("5分糖")];
int isSelected = 0; int isSelected = 0;
int isChoice = 0; int isChoice = 0;
int tempClickIndex = 0; int tempClickIndex = 0;
@ -76,16 +65,18 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
context: context, context: context,
token: value.getString('token'), token: value.getString('token'),
); );
apiService.minLogin(widget.arguments["id"]) apiService
.catchError((onError){}).then((baseData) { .minLogin(widget.arguments["id"])
.catchError((onError) {})
.then((baseData) {
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
Map<String, dynamic> minStoreInfo = baseData.data; Map<String, dynamic> minStoreInfo = baseData.data;
String minToken = minStoreInfo["token"]; String minToken = minStoreInfo["token"];
String tenant = widget.arguments["tenant"]; String tenant = widget.arguments["tenant"];
SharedPreferences.getInstance().then((value) => { SharedPreferences.getInstance().then((value) => {
value.setString('minToken', minToken), value.setString('minToken', minToken),
value.setString('tenant', tenant), value.setString('tenant', tenant),
}); });
minService = MinApiService( minService = MinApiService(
Dio(), Dio(),
context: context, context: context,
@ -93,33 +84,42 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
// tenant: tenant, // tenant: tenant,
); );
appletGoods(); appletGoods();
// queryMiNiDetail(widget.arguments["id"]);
} }
}); });
} }
/// ///
appletGoods() async{ appletGoods() async {
BaseData<List<FindMiNiGroupList>> baseData = await minService.findMiNiGroupList({ BaseData<List<FindMiNiGroupList>> baseData = await minService
"id":widget.arguments["id"] .findMiNiGroupList({"id": widget.arguments["id"]},
},{ {"store_id": widget.arguments["id"], "tenant": "1175"});
"store_id":widget.arguments["id"],
"tenant":"1175"
});
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
setState(() { setState(() {
appletProducts = baseData.data; appletProducts = baseData.data;
if(appletProducts.length > 0) if (appletProducts.length > 0)
productListBeans = appletProducts[0].productList; productListBeans = appletProducts[0].productList;
}); });
} }
} }
///
queryMiNiDetail(String id) async {
BaseData<MiNiDetail> baseData = await minService.miNiDetail(id);
if (baseData != null && baseData.isSuccess) {
setState(() {
showStoreSelector(baseData.data);
});
}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height - (kToolbarHeight + 38 + 54.h), height: MediaQuery.of(context).size.height - (kToolbarHeight + 38 + 54.h),
margin: EdgeInsets.only(top: (MediaQuery.of(context).padding.top + 38 + kToolbarHeight)), margin: EdgeInsets.only(
top: (MediaQuery.of(context).padding.top + 38 + kToolbarHeight)),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
@ -131,7 +131,7 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
controller: controller1, controller: controller1,
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
itemBuilder: (context, position) { itemBuilder: (context, position) {
return orderItem(appletProducts[position],position); return orderItem(appletProducts[position], position);
}, },
), ),
), ),
@ -154,14 +154,14 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
ScrollController controller1 = ScrollController(); ScrollController controller1 = ScrollController();
ScrollController controller2 = ScrollController(); ScrollController controller2 = ScrollController();
Widget orderItem(FindMiNiGroupList findMiNiGroupList,int index) { Widget orderItem(FindMiNiGroupList findMiNiGroupList, int index) {
return Container( return Container(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
GestureDetector( GestureDetector(
onTap:() { onTap: () {
setState(() { setState(() {
isSelected = index; isSelected = index;
productListBeans = findMiNiGroupList.productList; productListBeans = findMiNiGroupList.productList;
@ -189,17 +189,19 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
); );
} }
Widget goodsItem(ProductListBean productListBean,position) { Widget goodsItem(ProductListBean productListBean, position) {
return Container( return Container(
color: Colors.white, color: Colors.white,
padding: EdgeInsets.only(right: 16.w, bottom: 10.h,top:10.h), padding: EdgeInsets.only(right: 16.w, bottom: 10.h, top: 10.h),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
SizedBox(width: 12.w), SizedBox(width: 12.w),
MImage( MImage(
productListBean != null ? productListBean.imgPath : "", productListBean != null ? productListBean.imgPath : "",
width: 70, width: 70,
height:70, height: 70,
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",
@ -207,7 +209,7 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
SizedBox(width: 10), SizedBox(width: 10),
Expanded( Expanded(
child: Column( child: Column(
// crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
productListBean.productName, productListBean.productName,
@ -220,17 +222,18 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
SizedBox(height: 2), SizedBox(height: 2),
Row( Row(
children: [ children: [
Expanded(child: Text( Expanded(
productListBean.shortName, child: Text(
overflow: TextOverflow.ellipsis, productListBean.shortName,
maxLines: 2, overflow: TextOverflow.ellipsis,
style: TextStyle( maxLines: 2,
color: Color(0xFF4C4C4C), style: TextStyle(
fontSize: 10.sp, color: Color(0xFF4C4C4C),
fontWeight: MyFontWeight.regular, fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
),
), ),
), ), ),
SizedBox(width: 10), SizedBox(width: 10),
], ],
), ),
@ -287,7 +290,8 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
true true
? GestureDetector( ? GestureDetector(
onTap: () { onTap: () {
showStoreSelector(productListBean); // showStoreSelector(productListBean);
queryMiNiDetail(productListBean.id);
}, },
child: RoundButton( child: RoundButton(
width: 49.w, width: 49.w,
@ -339,8 +343,12 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
); );
} }
List<ProductListBean> shopCarList() {
return productListBeans;
}
/// ///
showStoreSelector(ProductListBean productListBean) { showStoreSelector(MiNiDetail miNiDetail) {
showModalBottomSheet( showModalBottomSheet(
context: context, context: context,
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
@ -366,7 +374,7 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
MImage( MImage(
productListBean.imgPath, miNiDetail.imgs[0],
width: 70, width: 70,
height: 70, height: 70,
fit: BoxFit.cover, fit: BoxFit.cover,
@ -378,7 +386,7 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
productListBean.productName, miNiDetail.productName,
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 16.sp, fontSize: 16.sp,
@ -407,7 +415,7 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
), ),
), ),
Text( Text(
productListBean.applyPrice, miNiDetail.price,
style: TextStyle( style: TextStyle(
color: Color(0xFFFF7A1A), color: Color(0xFFFF7A1A),
fontSize: 14.sp, fontSize: 14.sp,
@ -434,51 +442,23 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
SizedBox( SizedBox(
height: 23, height: 23,
), ),
Text( Expanded(child: ListView.builder(
"温度", itemCount: miNiDetail.attrList.length,
style: TextStyle( scrollDirection: Axis.vertical,
color: Colors.black, physics: BouncingScrollPhysics(),
fontSize: 14.sp, itemBuilder: (context, position) {
fontWeight: MyFontWeight.regular, return attrItem(() {
), state(() {
), for (var i = 0; i < miNiDetail.attrList[position].attrValueList.length; i++) {
SizedBox( if (tempClickIndex == i)
height: 15, miNiDetail.attrList[position].attrValueList[i].isSelected = true;
), else
sweetnessStore(() { miNiDetail.attrList[position].attrValueList[i].isSelected = false;
state(() { }
for (var i = 0; i < temperatureStoreList.length; i++) { });
if (tempClickIndex == i) }, miNiDetail.attrList[position]);
temperatureStoreList[i].isSelected = true; },
else )),
temperatureStoreList[i].isSelected = false;
}
});
}, temperatureStoreList),
SizedBox(
height: 24,
),
Text(
"甜度",
style: TextStyle(
color: Colors.black,
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
),
),
SizedBox(
height: 15,
),
sweetnessStore(() {
state(() {
for (var i = 0; i < sweetnessStoreList.length; i++) {
if (tempClickIndex == i)
sweetnessStoreList[i].isSelected = true;
else
sweetnessStoreList[i].isSelected = false;
}
});
}, sweetnessStoreList),
SizedBox( SizedBox(
height: 24, height: 24,
), ),
@ -505,7 +485,7 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
Padding( Padding(
padding: EdgeInsets.only(left: 8, right: 8), padding: EdgeInsets.only(left: 8, right: 8),
child: Text( child: Text(
productListBean.buyNum.toString(), "1",
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 14.sp, fontSize: 14.sp,
@ -548,7 +528,27 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
); );
} }
Widget sweetnessStore(Function fc, List<testModel> arrays) { Widget attrItem(Function fc,AttrListBean attrListBean){
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
attrListBean.attrName,
style: TextStyle(
color: Colors.black,
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
),
),
SizedBox(
height: 15,
),
sweetnessStore(fc, attrListBean.attrValueList),
],
);
}
Widget sweetnessStore(Function fc, List<AttrValueListBean> arrays) {
return GridView.builder( return GridView.builder(
itemCount: arrays.length, itemCount: arrays.length,
shrinkWrap: true, shrinkWrap: true,
@ -568,7 +568,7 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
tempClickIndex = index; tempClickIndex = index;
fc(); fc();
}, },
child: sweetnessItem(arrays[index].name, arrays[index].isSelected), child: sweetnessItem(arrays[index].attrValue, arrays[index].isSelected??false),
); );
}, },
); );

338
lib/union/union_view/store_info.dart

@ -177,175 +177,175 @@ class _StoreInfos extends State<StoreInfos> {
], ],
), ),
); );
return AspectRatio( // return AspectRatio(
aspectRatio: 1, // aspectRatio: 1,
child: Container( // child: Container(
margin: EdgeInsets.fromLTRB(16, 20, 16, 8), // margin: EdgeInsets.fromLTRB(16, 20, 16, 8),
padding: EdgeInsets.fromLTRB(10, 20, 10, 14), // padding: EdgeInsets.fromLTRB(10, 20, 10, 14),
decoration: BoxDecoration( // decoration: BoxDecoration(
color: Colors.white, // color: Colors.white,
borderRadius: BorderRadius.circular(8), // borderRadius: BorderRadius.circular(8),
boxShadow: [ // boxShadow: [
BoxShadow( // BoxShadow(
color: Colors.black.withAlpha(25), // color: Colors.black.withAlpha(25),
offset: Offset(0, 1), // offset: Offset(0, 1),
blurRadius: 12, // blurRadius: 12,
spreadRadius: 0, // spreadRadius: 0,
), // ),
], // ],
), // ),
child: Column( // child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, // mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start, // crossAxisAlignment: CrossAxisAlignment.start,
children: [ // children: [
AspectRatio( // AspectRatio(
aspectRatio: 1.8, // aspectRatio: 1.8,
child: buildSwiper(), // child: buildSwiper(),
), // ),
Expanded( // Expanded(
child: Container( // child: Container(
margin: EdgeInsets.only( // margin: EdgeInsets.only(
left: 10.w, // left: 10.w,
right: 10.w, // right: 10.w,
top: 16.h, // top: 16.h,
), // ),
child: Column( // child: Column(
mainAxisAlignment: // mainAxisAlignment:
MainAxisAlignment.spaceBetween, // MainAxisAlignment.spaceBetween,
crossAxisAlignment: // crossAxisAlignment:
CrossAxisAlignment.start, // CrossAxisAlignment.start,
children: [ // children: [
Row( // Row(
children: [ // children: [
Expanded( // Expanded(
child: Container( // child: Container(
alignment: // alignment:
Alignment.centerLeft, // Alignment.centerLeft,
child: Text( // child: Text(
widget.storeInfo != null // widget.storeInfo != null
? widget.storeInfo.storeName // ? widget.storeInfo.storeName
: "", // : "",
overflow: TextOverflow.ellipsis, // overflow: TextOverflow.ellipsis,
style: TextStyle( // style: TextStyle(
fontSize: 16.sp, // fontSize: 16.sp,
color: Colors.black, // color: Colors.black,
fontWeight: MyFontWeight.medium, // fontWeight: MyFontWeight.medium,
), // ),
), // ),
), // ),
), // ),
Text( // Text(
S.of(context).ren( // S.of(context).ren(
widget.storeInfo != null // widget.storeInfo != null
? widget.storeInfo // ? widget.storeInfo
.perCapitaConsumption // .perCapitaConsumption
: "", // : "",
), // ),
overflow: TextOverflow.ellipsis, // overflow: TextOverflow.ellipsis,
style: TextStyle( // style: TextStyle(
fontSize: 14.sp, // fontSize: 14.sp,
fontWeight: MyFontWeight.regular, // fontWeight: MyFontWeight.regular,
color: Color(0xFF353535), // color: Color(0xFF353535),
), // ),
), // ),
], // ],
), // ),
Text( // Text(
widget.storeInfo != null // widget.storeInfo != null
? widget.storeInfo.address // ? widget.storeInfo.address
: "", // : "",
maxLines: 2, // maxLines: 2,
textAlign: TextAlign.justify, // textAlign: TextAlign.justify,
style: TextStyle( // style: TextStyle(
color: Color(0xFF353535), // color: Color(0xFF353535),
fontWeight: MyFontWeight.regular, // fontWeight: MyFontWeight.regular,
fontSize: 12.sp, // fontSize: 12.sp,
), // ),
), // ),
Row( // Row(
children: itemServer( // children: itemServer(
widget.storeInfo != null // widget.storeInfo != null
? widget.storeInfo.businessService // ? widget.storeInfo.businessService
: "", // : "",
), // ),
), // ),
Row( // Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, // mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end, // crossAxisAlignment: CrossAxisAlignment.end,
children: [ // children: [
Expanded( // Expanded(
child: Text( // child: Text(
S.of(context).yingyeshijian(widget.storeInfo == // S.of(context).yingyeshijian(widget.storeInfo ==
null // null
? "" // ? ""
: (widget.storeInfo.openStartTime == // : (widget.storeInfo.openStartTime ==
null && // null &&
widget.storeInfo // widget.storeInfo
.openEndTime == // .openEndTime ==
null) // null)
? S.of(context).quantian // ? S.of(context).quantian
: "${widget.storeInfo.openStartTime.substring(0, widget.storeInfo.openStartTime.lastIndexOf(":"))} " // : "${widget.storeInfo.openStartTime.substring(0, widget.storeInfo.openStartTime.lastIndexOf(":"))} "
"- ${widget.storeInfo.openEndTime.substring(0, widget.storeInfo.openEndTime.lastIndexOf(":"))}"), // "- ${widget.storeInfo.openEndTime.substring(0, widget.storeInfo.openEndTime.lastIndexOf(":"))}"),
style: TextStyle( // style: TextStyle(
color: Color(0xFF353535), // color: Color(0xFF353535),
fontWeight: MyFontWeight.regular, // fontWeight: MyFontWeight.regular,
fontSize: 12.sp, // fontSize: 12.sp,
), // ),
), // ),
), // ),
SizedBox( // SizedBox(
width: 16.w, // width: 16.w,
), // ),
InkWell( // InkWell(
onTap: () { // onTap: () {
if (widget.storeInfo == null || // if (widget.storeInfo == null ||
widget.storeInfo.latitude == // widget.storeInfo.latitude ==
null || // null ||
widget.storeInfo.longitude == // widget.storeInfo.longitude ==
null || // null ||
widget.storeInfo.latitude == "" || // widget.storeInfo.latitude == "" ||
widget.storeInfo.longitude == "") // widget.storeInfo.longitude == "")
return; // return;
Navigator.of(context).pushNamed( // Navigator.of(context).pushNamed(
'/router/location_map', // '/router/location_map',
arguments: { // arguments: {
"lat": widget.storeInfo.latitude, // "lat": widget.storeInfo.latitude,
"lng": // "lng":
widget.storeInfo.longitude, // widget.storeInfo.longitude,
"storeName": // "storeName":
widget.storeInfo.storeName, // widget.storeInfo.storeName,
}); // });
}, // },
child: Image.asset( // child: Image.asset(
"assets/image/icon_union_location.png", // "assets/image/icon_union_location.png",
width: 24.w, // width: 24.w,
height: 24.h, // height: 24.h,
), // ),
), // ),
SizedBox( // SizedBox(
width: 16.w, // width: 16.w,
), // ),
InkWell( // InkWell(
onTap: () { // onTap: () {
showCallMobile(); // showCallMobile();
}, // },
child: Image.asset( // child: Image.asset(
"assets/image/icon_union_call.png", // "assets/image/icon_union_call.png",
width: 24, // width: 24,
height: 24, // height: 24,
), // ),
), // ),
], // ],
), // ),
], // ],
), // ),
), // ),
flex: 1, // flex: 1,
), // ),
], // ],
), // ),
), // ),
); // );
} }
Widget buildSwiper() { Widget buildSwiper() {

2
pubspec.lock

@ -388,7 +388,7 @@ packages:
name: flutter_smart_dialog name: flutter_smart_dialog
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.3.1" version: "2.3.6"
flutter_spinkit: flutter_spinkit:
dependency: "direct main" dependency: "direct main"
description: description:

Loading…
Cancel
Save