Merge branch 'master' of https://git.oa00.com/bee/aku_community
commit
82f5ae0e20
After Width: | Height: | Size: 2.5 KiB |
@ -0,0 +1,54 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import 'package:qr_code_scanner/qr_code_scanner.dart';
|
||||
|
||||
class BeeQR {
|
||||
static Future<String?> scan() async {
|
||||
return await Get.to(() => _QRScanPage());
|
||||
}
|
||||
}
|
||||
|
||||
class _QRScanPage extends StatefulWidget {
|
||||
_QRScanPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
__QRScanPageState createState() => __QRScanPageState();
|
||||
}
|
||||
|
||||
class __QRScanPageState extends State<_QRScanPage> {
|
||||
final GlobalKey qrKey = GlobalKey(debugLabel: 'QR');
|
||||
QRViewController? _controller;
|
||||
bool _doneTag = false;
|
||||
@override
|
||||
void dispose() {
|
||||
_controller?.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(),
|
||||
body: SizedBox(
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
child: QRView(
|
||||
key: qrKey,
|
||||
overlay: QrScannerOverlayShape(
|
||||
borderRadius: 8,
|
||||
),
|
||||
onQRViewCreated: (controller) {
|
||||
_controller = controller;
|
||||
controller.scannedDataStream.listen((event) {
|
||||
if (!_doneTag) {
|
||||
_doneTag = true;
|
||||
Get.back(result: event.code);
|
||||
}
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:aku_community/widget/bee_scaffold.dart';
|
||||
|
||||
class FacilityPage extends StatefulWidget {
|
||||
FacilityPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_FacilityPageState createState() => _FacilityPageState();
|
||||
}
|
||||
|
||||
class _FacilityPageState extends State<FacilityPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BeeScaffold(
|
||||
title: '设施预约',
|
||||
actions: [
|
||||
IconButton(
|
||||
icon: Icon(Icons.add_circle_outline_rounded, color: Colors.black87),
|
||||
onPressed: () {},
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,179 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:bot_toast/bot_toast.dart';
|
||||
import 'package:flustars/flustars.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import 'package:aku_community/base/base_style.dart';
|
||||
import 'package:aku_community/constants/api.dart';
|
||||
import 'package:aku_community/constants/app_theme.dart';
|
||||
import 'package:aku_community/models/facility/facility_type_model.dart';
|
||||
import 'package:aku_community/provider/app_provider.dart';
|
||||
import 'package:aku_community/ui/community/facility/pick_facility_page.dart';
|
||||
import 'package:aku_community/ui/profile/house/pick_my_house_page.dart';
|
||||
import 'package:aku_community/utils/headers.dart';
|
||||
import 'package:aku_community/utils/network/net_util.dart';
|
||||
import 'package:aku_community/widget/bee_divider.dart';
|
||||
import 'package:aku_community/widget/bee_scaffold.dart';
|
||||
import 'package:aku_community/widget/buttons/bottom_button.dart';
|
||||
import 'package:aku_community/widget/picker/bee_date_picker.dart';
|
||||
|
||||
class FacilityPreorderPage extends StatefulWidget {
|
||||
FacilityPreorderPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_FacilityPreorderPageState createState() => _FacilityPreorderPageState();
|
||||
}
|
||||
|
||||
class _FacilityPreorderPageState extends State<FacilityPreorderPage> {
|
||||
FacilityTypeModel? typeModel;
|
||||
DateTime? startDate;
|
||||
DateTime? endDate;
|
||||
|
||||
bool get canTap => startDate != null && endDate != null && typeModel != null;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final appProvider = Provider.of<AppProvider>(context);
|
||||
return BeeScaffold(
|
||||
title: '添加预订',
|
||||
bodyColor: Colors.white,
|
||||
systemStyle: SystemStyle.yellowBottomBar,
|
||||
body: ListView(
|
||||
padding: EdgeInsets.symmetric(vertical: 32.w),
|
||||
children: [
|
||||
Text('业主房屋').pSymmetric(h: 32.w),
|
||||
ListTile(
|
||||
leading: Image.asset(
|
||||
R.ASSETS_ICONS_HOUSE_PNG,
|
||||
height: 60.w,
|
||||
width: 60.w,
|
||||
),
|
||||
onTap: () => Get.to(() => PickMyHousePage()),
|
||||
title: Text(S.of(context)!.tempPlotName),
|
||||
subtitle: Text(appProvider.selectedHouse?.roomName ?? '选择房间'),
|
||||
trailing: Icon(CupertinoIcons.chevron_forward),
|
||||
),
|
||||
BeeDivider(
|
||||
indent: 32.w,
|
||||
endIndent: 32.w,
|
||||
),
|
||||
32.hb,
|
||||
Text('选择设施').pSymmetric(h: 32.w),
|
||||
ListTile(
|
||||
leading: Image.asset(
|
||||
R.ASSETS_ICONS_FACILITY_PNG,
|
||||
height: 60.w,
|
||||
width: 60.w,
|
||||
),
|
||||
onTap: () async {
|
||||
FacilityTypeModel? model = await Get.to(() => PickFacilityPage());
|
||||
if (model != null) typeModel = model;
|
||||
setState(() {});
|
||||
},
|
||||
title: Text(S.of(context)!.tempPlotName),
|
||||
subtitle: Text(typeModel?.name ?? '选择设施'),
|
||||
trailing: Icon(CupertinoIcons.chevron_forward),
|
||||
),
|
||||
BeeDivider(
|
||||
indent: 32.w,
|
||||
endIndent: 32.w,
|
||||
),
|
||||
32.hb,
|
||||
Text('预约时间').pSymmetric(h: 32.w),
|
||||
SizedBox(
|
||||
height: 120.w,
|
||||
child: Row(
|
||||
children: [
|
||||
MaterialButton(
|
||||
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
height: 120.w,
|
||||
onPressed: () async {
|
||||
DateTime? date = await BeeDatePicker.pick(
|
||||
DateTime.now(),
|
||||
mode: CupertinoDatePickerMode.dateAndTime,
|
||||
min: DateTime.now().subtract(Duration(seconds: 1)),
|
||||
max: DateTime.now().add(Duration(days: 30)),
|
||||
);
|
||||
if (date != null) {
|
||||
startDate = date;
|
||||
setState(() {});
|
||||
}
|
||||
},
|
||||
child: Text(
|
||||
startDate == null
|
||||
? '请选择开始时间'
|
||||
: DateUtil.formatDate(
|
||||
startDate,
|
||||
format: 'yyyy-MM-dd HH:mm',
|
||||
),
|
||||
style: TextStyle(
|
||||
color: ktextSubColor,
|
||||
),
|
||||
),
|
||||
).expand(),
|
||||
Icon(Icons.arrow_forward),
|
||||
MaterialButton(
|
||||
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
height: 120.w,
|
||||
onPressed: () async {
|
||||
DateTime? date = await BeeDatePicker.pick(
|
||||
startDate == null ? DateTime.now() : startDate!,
|
||||
min: startDate == null
|
||||
? DateTime.now().subtract(Duration(seconds: 1))
|
||||
: startDate!,
|
||||
max: startDate == null
|
||||
? DateTime.now().add(Duration(days: 1))
|
||||
: (startDate!).add(Duration(days: 1)),
|
||||
mode: CupertinoDatePickerMode.dateAndTime,
|
||||
);
|
||||
if (date != null) {
|
||||
endDate = date;
|
||||
setState(() {});
|
||||
}
|
||||
},
|
||||
child: Text(
|
||||
endDate == null
|
||||
? '请选择结束时间'
|
||||
: DateUtil.formatDate(
|
||||
endDate,
|
||||
format: 'yyyy-MM-dd HH:mm',
|
||||
),
|
||||
style: TextStyle(
|
||||
color: ktextSubColor,
|
||||
),
|
||||
),
|
||||
).expand(),
|
||||
],
|
||||
),
|
||||
),
|
||||
BeeDivider(
|
||||
indent: 32.w,
|
||||
endIndent: 32.w,
|
||||
),
|
||||
],
|
||||
),
|
||||
bottomNavi: BottomButton(
|
||||
onPressed: canTap
|
||||
? () async {
|
||||
final cancel = BotToast.showLoading();
|
||||
var model = await NetUtil().post(
|
||||
API.manager.facility.add,
|
||||
params: {
|
||||
'estateId': appProvider.selectedHouse?.estateId ?? 0,
|
||||
'facilitiesManageId': typeModel!.id,
|
||||
'appointmentStartDate': NetUtil.getDate(startDate!),
|
||||
'appointmentEndDate': NetUtil.getDate(endDate!),
|
||||
},
|
||||
showMessage: true,
|
||||
);
|
||||
cancel();
|
||||
if (model.status == true) Get.back(result: true);
|
||||
}
|
||||
: null,
|
||||
child: Text('确认提交'),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:aku_community/utils/headers.dart';
|
||||
import 'package:aku_community/widget/bee_scaffold.dart';
|
||||
|
||||
class CategoryPage extends StatefulWidget {
|
||||
CategoryPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_CategoryPageState createState() => _CategoryPageState();
|
||||
}
|
||||
|
||||
class _CategoryPageState extends State<CategoryPage> {
|
||||
int _index = 0;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BeeScaffold(
|
||||
title: '分类',
|
||||
actions: [
|
||||
IconButton(
|
||||
icon: Icon(CupertinoIcons.search),
|
||||
onPressed: () {},
|
||||
),
|
||||
],
|
||||
bgColor: Colors.white,
|
||||
appBarBottom: PreferredSize(
|
||||
child: Divider(height: 1),
|
||||
preferredSize: Size.fromHeight(1),
|
||||
),
|
||||
body: Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 203.w,
|
||||
child: ListView.builder(
|
||||
itemBuilder: (context, index) {
|
||||
bool sameIndex = index == _index;
|
||||
return Stack(
|
||||
children: [
|
||||
MaterialButton(
|
||||
height: 100.w,
|
||||
minWidth: double.infinity,
|
||||
onPressed: () {
|
||||
_index = index;
|
||||
|
||||
setState(() {});
|
||||
},
|
||||
child: Text(
|
||||
'TEST',
|
||||
style: TextStyle(),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
itemCount: 10,
|
||||
),
|
||||
),
|
||||
VerticalDivider(
|
||||
color: Color(0xFFE8E8E8),
|
||||
width: 1,
|
||||
thickness: 1,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,93 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:aku_community/base/base_style.dart';
|
||||
import 'package:aku_community/utils/headers.dart';
|
||||
|
||||
class GoodsCard extends StatelessWidget {
|
||||
const GoodsCard({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialButton(
|
||||
color: Colors.white,
|
||||
elevation: 0,
|
||||
padding: EdgeInsets.zero,
|
||||
onPressed: () {},
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
AspectRatio(
|
||||
aspectRatio: 1,
|
||||
child: Stack(
|
||||
children: [
|
||||
Image.asset(
|
||||
R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
Positioned(
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
child: Container(
|
||||
height: 38.w,
|
||||
color: Colors.black54,
|
||||
alignment: Alignment.centerLeft,
|
||||
padding: EdgeInsets.symmetric(horizontal: 12.w),
|
||||
child: Text(
|
||||
'分别是紫色烦恼则妇女色泽封闭周四鹅u部分紫色部分',
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18.sp,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 12.w,
|
||||
vertical: 20.w,
|
||||
),
|
||||
child: Text(
|
||||
'袁隆平水稻大米精选 56kg唇齿流香 无常有机稻花 无常有机稻花',
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 24.sp,
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 12.w,
|
||||
),
|
||||
child: RichText(
|
||||
text: TextSpan(
|
||||
children: [
|
||||
TextSpan(
|
||||
text: '¥123.45 ',
|
||||
style: TextStyle(
|
||||
color: Colors.red,
|
||||
fontSize: 28.sp,
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
text: '123已付款',
|
||||
style: TextStyle(
|
||||
color: ktextSubColor,
|
||||
fontSize: 20.sp,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
16.hb,
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,88 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:waterfall_flow/waterfall_flow.dart';
|
||||
|
||||
import 'package:aku_community/ui/market/goods/goods_card.dart';
|
||||
import 'package:aku_community/utils/headers.dart';
|
||||
import 'package:aku_community/widget/bee_scaffold.dart';
|
||||
|
||||
class GoodsListView extends StatefulWidget {
|
||||
GoodsListView({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_GoodsListViewState createState() => _GoodsListViewState();
|
||||
}
|
||||
|
||||
class _GoodsListViewState extends State<GoodsListView> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BeeScaffold(
|
||||
title: 'TEST',
|
||||
actions: [
|
||||
IconButton(
|
||||
icon: Icon(CupertinoIcons.search),
|
||||
onPressed: () {},
|
||||
)
|
||||
],
|
||||
appBarBottom: PreferredSize(
|
||||
child: SizedBox(
|
||||
height: 220.w,
|
||||
child: ListView(
|
||||
padding: EdgeInsets.symmetric(horizontal: 18.w),
|
||||
scrollDirection: Axis.horizontal,
|
||||
children: [
|
||||
GoodsSubTypeButton(),
|
||||
],
|
||||
),
|
||||
),
|
||||
preferredSize: Size.fromHeight(220.w),
|
||||
),
|
||||
body: WaterfallFlow(
|
||||
padding: EdgeInsets.all(32.w),
|
||||
gridDelegate: SliverWaterfallFlowDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 2,
|
||||
mainAxisSpacing: 20.w,
|
||||
crossAxisSpacing: 20.w,
|
||||
),
|
||||
children: [
|
||||
GoodsCard(),
|
||||
GoodsCard(),
|
||||
GoodsCard(),
|
||||
GoodsCard(),
|
||||
GoodsCard(),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class GoodsSubTypeButton extends StatelessWidget {
|
||||
const GoodsSubTypeButton({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialButton(
|
||||
minWidth: 136.w,
|
||||
padding: EdgeInsets.zero,
|
||||
onPressed: () {},
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
|
||||
width: 100.w,
|
||||
height: 100.w,
|
||||
),
|
||||
20.hb,
|
||||
Text(
|
||||
'健康运动',
|
||||
style: TextStyle(
|
||||
fontSize: 24.sp,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue