张萌 4 years ago
commit 263cdbd328

@ -5,3 +5,7 @@ A new Flutter application.
## Getting Started ## Getting Started
### 使用`fgen`生成图片 ### 使用`fgen`生成图片
### password
password `1Xpn6hhbxztA6PC0oFiZ`

@ -25,6 +25,11 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android { android {
compileSdkVersion 29 compileSdkVersion 29
@ -45,13 +50,19 @@ android {
versionName flutterVersionName versionName flutterVersionName
} }
buildTypes { signingConfigs {
release { release {
// TODO: Add your own signing config for the release build. keyAlias keystoreProperties['keyAlias']
// Signing with the debug keys for now, so `flutter run --release` works. keyPassword keystoreProperties['keyPassword']
signingConfig signingConfigs.debug storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
} storePassword keystoreProperties['storePassword']
} }
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
} }
flutter { flutter {

@ -1,47 +1,30 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.akucommunity.aku_community_manager">
package="com.akucommunity.aku_community_manager"> <!-- io.flutter.app.FlutterApplication is an android.app.Application that
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method. calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. --> FlutterApplication and put your custom class here. -->
<application <application android:name="io.flutter.app.FlutterApplication" android:label="aku_community_manager" android:icon="@mipmap/ic_launcher">
android:name="io.flutter.app.FlutterApplication" <meta-data android:name="com.amap.api.v2.apikey" android:value="872b909f2ebc8150b809d692c4349f22"/>
android:label="aku_community_manager" <activity android:name=".MainActivity" android:launchMode="singleTop" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize">
android:icon="@mipmap/ic_launcher"> <!-- Specifies an Android theme to apply to this Activity as soon as
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. --> to determine the Window background behind the Flutter UI. -->
<meta-data <meta-data android:name="io.flutter.embedding.android.NormalTheme" android:resource="@style/NormalTheme" />
android:name="io.flutter.embedding.android.NormalTheme" <!-- Displays an Android View that continues showing the launch screen
android:resource="@style/NormalTheme"
/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of gap between the end of Android's launch screen and the painting of
Flutter's first frame. --> Flutter's first frame. -->
<meta-data <meta-data android:name="io.flutter.embedding.android.SplashScreenDrawable" android:resource="@drawable/launch_background" />
android:name="io.flutter.embedding.android.SplashScreenDrawable" <intent-filter>
android:resource="@drawable/launch_background" <action android:name="android.intent.action.MAIN"/>
/> <category android:name="android.intent.category.LAUNCHER"/>
<intent-filter> </intent-filter>
<action android:name="android.intent.action.MAIN"/> </activity>
<category android:name="android.intent.category.LAUNCHER"/> <!-- Don't delete the meta-data below.
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java --> This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data <meta-data android:name="flutterEmbedding" android:value="2" />
android:name="flutterEmbedding" </application>
android:value="2" />
</application>
</manifest> </manifest>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 807 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

@ -4,6 +4,7 @@ import 'package:aku_community_manager/provider/manage_provider.dart';
import 'package:aku_community_manager/provider/outdoor_provider.dart'; import 'package:aku_community_manager/provider/outdoor_provider.dart';
import 'package:aku_community_manager/provider/user_provider.dart'; import 'package:aku_community_manager/provider/user_provider.dart';
import 'package:aku_community_manager/ui/home/home_page.dart'; import 'package:aku_community_manager/ui/home/home_page.dart';
import 'package:amap_map_fluttify/amap_map_fluttify.dart';
import 'package:bot_toast/bot_toast.dart'; import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -11,7 +12,8 @@ import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
void main() { void main() async {
await AmapCore.init('');
runApp(MyApp()); runApp(MyApp());
} }

@ -0,0 +1,92 @@
import 'package:aku_community_manager/const/resource.dart';
import 'package:aku_community_manager/mock_models/borrow/borrow_model.dart';
class BorrowData {
static List<BorrowModel> get checkModels => models.where((e) {
return e.borrowGoods.status == BORROW_STATUS.WAIT_CHECK;
}).toList();
static List<BorrowModel> get borrowModels => models.where((e) {
return e.borrowGoods.status == BORROW_STATUS.BORROWING;
}).toList();
static List<BorrowModel> get doneModels => models.where((e) {
return e.borrowGoods.status == BORROW_STATUS.DONE;
}).toList();
static List<BorrowModel> models = [
BorrowModel(
title: '归还梯子一个',
borrowPerson: '李慧珍',
borrowTime: 5,
goodsStatus: GOODS_STATUS.BROKEN,
phone: '19981712931',
borrowGoods: SingleBorrowGoods(
name: '梯子',
assetpath: R.ASSETS_STATIC_TEMP_LADDER_PNG,
code: '3193713894',
status: BORROW_STATUS.WAIT_CHECK,
),
date: DateTime(2020, 5, 5, 12, 35, 45),
),
BorrowModel(
title: '归还梯子一个',
borrowPerson: '李慧珍',
borrowTime: 5,
goodsStatus: GOODS_STATUS.BROKEN,
phone: '19981712931',
borrowGoods: SingleBorrowGoods(
name: '梯子',
assetpath: R.ASSETS_STATIC_TEMP_LADDER_PNG,
code: '3193713894',
status: BORROW_STATUS.DONE,
),
date: DateTime(2020, 5, 5, 12, 35, 45),
),
BorrowModel(
title: '借用电钻一把',
borrowPerson: '刘虎门',
borrowTime: 12,
goodsStatus: GOODS_STATUS.NORMAL,
phone: '19981738879',
borrowGoods: SingleBorrowGoods(
name: '电钻',
assetpath: R.ASSETS_STATIC_TEMP_DRILL_PNG,
code: '31937293841',
status: BORROW_STATUS.BORROWING,
),
date: DateTime(2020, 4, 5, 12, 35, 45),
),
BorrowModel(
borrowPerson: '刘海保',
borrowTime: 5,
title: '借用榔头一把',
goodsStatus: GOODS_STATUS.NORMAL,
phone: '19981738879',
borrowGoods: SingleBorrowGoods(
name: '榔头',
assetpath: R.ASSETS_STATIC_TEMP_HAMMER_PNG,
code: '3193794102481',
status: BORROW_STATUS.BORROWING,
),
date: DateTime(2020, 3, 5, 12, 35, 45),
),
];
static List<BorrowObject> borrowObjects = [
BorrowObject.init(
name: '电钻',
assetPath: R.ASSETS_STATIC_TEMP_DRILL_PNG,
allNumber: 5,
),
BorrowObject.init(
name: '梯子',
assetPath: R.ASSETS_STATIC_TEMP_LADDER_PNG,
allNumber: 3,
),
BorrowObject.init(
name: '三角榔头',
assetPath: R.ASSETS_STATIC_TEMP_HAMMER_PNG,
allNumber: 8,
),
];
}

@ -0,0 +1,88 @@
import 'dart:math';
import 'package:meta/meta.dart';
enum BORROW_STATUS {
///
BORROWING,
///
WAIT_CHECK,
///
NOT_BORROW,
///
DONE,
}
enum GOODS_STATUS {
NORMAL,
BROKEN,
LOST,
}
class BorrowModel {
String borrowPerson;
String phone;
int borrowTime;
GOODS_STATUS goodsStatus;
String title;
SingleBorrowGoods borrowGoods;
DateTime date;
BorrowModel({
@required this.borrowPerson,
@required this.phone,
@required this.borrowTime,
@required this.goodsStatus,
@required this.borrowGoods,
@required this.title,
@required this.date,
});
}
class BorrowObject {
String name;
int allNumber;
dynamic assetPath;
int borrowNumber;
int get restNumber => allNumber - borrowNumber;
List<SingleBorrowGoods> items;
BorrowObject.init({
this.name,
this.allNumber,
this.assetPath,
}) {
this.borrowNumber = 0;
items = List.generate(
this.allNumber,
(index) => SingleBorrowGoods(
name: '${this.name}${index + 1}',
code: (179264234 + Random().nextInt(999999)).toString(),
status: BORROW_STATUS.NOT_BORROW,
assetpath: this.assetPath,
),
);
}
}
class SingleBorrowGoods {
String name;
String code;
dynamic assetpath;
BORROW_STATUS status;
String get borrowValue => {
BORROW_STATUS.BORROWING: '出借中',
BORROW_STATUS.DONE: '已归还',
BORROW_STATUS.NOT_BORROW: '未出借',
BORROW_STATUS.WAIT_CHECK: '待检查',
}[status];
SingleBorrowGoods({
this.name,
this.code,
this.assetpath,
this.status,
});
}

@ -20,6 +20,101 @@ class DecorationData {
), ),
cycleCheck: CycleCheck(), cycleCheck: CycleCheck(),
), ),
DecorationModel(
decorationDate: DateTime(2020, 1, 23, 12, 23, 0),
type: DecorationType.HAND_OUT,
statusType: DecorationStatusType.DONE,
userHomeModel: UserHomeModel(
userName: '李慧珍',
plot: '深圳华茂悦峰',
detailAddr: '1幢-1单元-302室',
phone: '18201939840',
),
decorationTeamModel: DecorationTeamModel(
name: '深圳莫川装修有限公司',
userName: '李惠政',
phone: '19298540192',
),
cycleCheck: CycleCheck(
authPerson: FixerModel(name: '林鸿章', phone: '18294859301'),
startDate: DateTime(2020, 1, 23, 20, 23, 0),
checkCycle: 7,
checkDetails: [
CHECK_TYPE.ELECTRIC,
CHECK_TYPE.WATER,
CHECK_TYPE.WALL,
CHECK_TYPE.DOOR_AND_WINDOWS,
],
),
workFinishCheck: WorkFinishCheck(
authPerson: FixerModel(name: '林鸿章', phone: '18294859301'),
startDate: DateTime(2020, 1, 23, 20, 23, 0),
checkDetails: [
CHECK_TYPE.ELECTRIC,
CHECK_TYPE.WATER,
CHECK_TYPE.WALL,
CHECK_TYPE.DOOR_AND_WINDOWS,
CHECK_TYPE.SECURITY,
],
),
checkInfomations: [
CheckInfomation(
checkDate: DateTime(2020, 3, 20, 12, 00),
info: '正常',
checkType: '完工检查',
details: [
CheckDetail(type: CHECK_TYPE.ELECTRIC),
CheckDetail(type: CHECK_TYPE.WATER),
CheckDetail(type: CHECK_TYPE.WALL),
CheckDetail(type: CHECK_TYPE.DOOR_AND_WINDOWS),
],
),
CheckInfomation(
checkDate: DateTime(2020, 2, 14, 12, 00),
info: '正常',
checkType: '周期检查',
details: [
CheckDetail(type: CHECK_TYPE.ELECTRIC),
CheckDetail(type: CHECK_TYPE.WATER),
CheckDetail(type: CHECK_TYPE.WALL),
CheckDetail(type: CHECK_TYPE.DOOR_AND_WINDOWS),
],
),
CheckInfomation(
checkDate: DateTime(2020, 2, 7, 12, 00),
info: '厨房水路异常',
checkType: '周期检查',
details: [
CheckDetail(type: CHECK_TYPE.ELECTRIC),
CheckDetail(type: CHECK_TYPE.WATER, status: false),
CheckDetail(type: CHECK_TYPE.WALL),
CheckDetail(type: CHECK_TYPE.DOOR_AND_WINDOWS),
],
),
CheckInfomation(
checkDate: DateTime(2020, 1, 30, 12, 00),
info: '正常',
checkType: '周期检查',
details: [
CheckDetail(type: CHECK_TYPE.ELECTRIC),
CheckDetail(type: CHECK_TYPE.WATER),
CheckDetail(type: CHECK_TYPE.WALL),
CheckDetail(type: CHECK_TYPE.DOOR_AND_WINDOWS),
],
),
CheckInfomation(
checkDate: DateTime(2020, 1, 23, 12, 00),
info: '正常',
checkType: '周期检查',
details: [
CheckDetail(type: CHECK_TYPE.ELECTRIC),
CheckDetail(type: CHECK_TYPE.WATER),
CheckDetail(type: CHECK_TYPE.WALL),
CheckDetail(type: CHECK_TYPE.DOOR_AND_WINDOWS),
],
),
],
),
DecorationModel( DecorationModel(
decorationDate: DateTime(2020, 1, 23, 12, 23, 0), decorationDate: DateTime(2020, 1, 23, 12, 23, 0),
type: DecorationType.DONE, type: DecorationType.DONE,

@ -112,7 +112,13 @@ class CycleCheck {
///check cycle in days ///check cycle in days
int checkCycle; int checkCycle;
List<CHECK_TYPE> checkDetails; List<CHECK_TYPE> checkDetails = [
CHECK_TYPE.ELECTRIC,
CHECK_TYPE.WATER,
CHECK_TYPE.WALL,
CHECK_TYPE.DOOR_AND_WINDOWS,
CHECK_TYPE.SECURITY,
];
CycleCheck({ CycleCheck({
this.authPerson, this.authPerson,
this.startDate, this.startDate,

@ -1,6 +1,7 @@
import 'package:aku_community_manager/const/resource.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:aku_community_manager/const/resource.dart';
enum FIX_ENUM { enum FIX_ENUM {
/// ///
HAND_OUT, HAND_OUT,
@ -110,15 +111,6 @@ class FixModel {
title: '分派给李保国师傅', date: DateTime(2020, 10, 23, 10, 32, 14)), title: '分派给李保国师傅', date: DateTime(2020, 10, 23, 10, 32, 14)),
FixStatus(title: '师傅已接单', date: DateTime(2020, 10, 23, 10, 38, 26)), FixStatus(title: '师傅已接单', date: DateTime(2020, 10, 23, 10, 38, 26)),
], ],
result: FixResult(
detail: '电饭煲插头没插',
material: '',
imgs: [R.ASSETS_STATIC_FIX_FOOD_PNG],
),
review: UserReviewInfo(
rate: 5,
content: '师傅太用心了',
),
), ),
), ),
FixModel( FixModel(
@ -130,7 +122,7 @@ class FixModel {
userName: '杨建', userName: '杨建',
userPhoneNumber: '18882929292', userPhoneNumber: '18882929292',
fixArea: 'A区', fixArea: 'A区',
type: FIX_PAYMENT_TYPE.FREE, type: FIX_PAYMENT_TYPE.PAY,
limit: FIX_DATE_LIMIT.HOUR_24, limit: FIX_DATE_LIMIT.HOUR_24,
subType: FIX_SUB_TYPE.NORMAL, subType: FIX_SUB_TYPE.NORMAL,
fixStatuses: [ fixStatuses: [
@ -149,6 +141,10 @@ class FixModel {
rate: 5, rate: 5,
content: '师傅太用心了', content: '师傅太用心了',
), ),
priceDetail: FixPriceDetail(
humanPrice: 10,
materialPrice: 0,
),
), ),
), ),
]; ];
@ -228,6 +224,8 @@ class FixDetailModel {
FixResult result; FixResult result;
UserReviewInfo review; UserReviewInfo review;
FixPriceDetail priceDetail;
FixDetailModel({ FixDetailModel({
this.userName, this.userName,
this.userPhoneNumber, this.userPhoneNumber,
@ -238,6 +236,7 @@ class FixDetailModel {
this.fixStatuses, this.fixStatuses,
this.result, this.result,
this.review, this.review,
this.priceDetail,
}); });
} }
@ -271,3 +270,13 @@ class UserReviewInfo {
this.content, this.content,
}); });
} }
class FixPriceDetail {
double humanPrice;
double materialPrice;
FixPriceDetail({
this.humanPrice,
this.materialPrice,
});
double get allPrice => humanPrice + materialPrice;
}

@ -1,6 +1,3 @@
import 'package:flutter/material.dart';
import 'package:aku_community_manager/const/resource.dart';
class GreenManageCardModel { class GreenManageCardModel {
String title; String title;
String task; String task;

@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
export 'package:flutter_screenutil/flutter_screenutil.dart'; export 'package:flutter_screenutil/flutter_screenutil.dart';
export 'package:aku_community_manager/const/resource.dart';
class AppStyle { class AppStyle {
// //

@ -0,0 +1,13 @@
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:flutter/material.dart';
class AgreementPage extends StatelessWidget {
const AgreementPage({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return AkuScaffold(
title: '服务协议',
);
}
}

@ -0,0 +1,13 @@
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:flutter/material.dart';
class PrivacyPage extends StatelessWidget {
const PrivacyPage({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return AkuScaffold(
title: '隐私协议',
);
}
}

@ -1,6 +1,8 @@
import 'package:aku_community_manager/ui/manage_pages/green_manage/green_manage_page.dart'; import 'package:aku_community_manager/ui/manage_pages/green_manage/green_manage_page.dart';
import 'package:aku_community_manager/ui/manage_pages/inspection_manage/inspection_manage_page.dart'; import 'package:aku_community_manager/ui/manage_pages/inspection_manage/inspection_manage_page.dart';
import 'package:aku_community_manager/ui/sub_pages/activity_manager/activity_manager_page.dart'; import 'package:aku_community_manager/ui/sub_pages/activity_manager/activity_manager_page.dart';
import 'package:aku_community_manager/ui/sub_pages/borrow_manager/borrow_manager_page.dart';
import 'package:aku_community_manager/ui/sub_pages/business_and_fix/business_and_fix_page.dart';
import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_manager_page.dart'; import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_manager_page.dart';
import 'package:aku_community_manager/ui/sub_pages/items_outdoor/items_outdoor_page.dart'; import 'package:aku_community_manager/ui/sub_pages/items_outdoor/items_outdoor_page.dart';
import 'package:aku_community_manager/ui/sub_pages/visitor_manager/visitor_manager_page.dart'; import 'package:aku_community_manager/ui/sub_pages/visitor_manager/visitor_manager_page.dart';
@ -45,19 +47,21 @@ class _ApplicationPageState extends State<ApplicationPage>
AppApplication( AppApplication(
'活动管理', R.ASSETS_HOME_IC_ACTIVITY_PNG, ActivityManagerPage()), '活动管理', R.ASSETS_HOME_IC_ACTIVITY_PNG, ActivityManagerPage()),
AppApplication('访客管理', R.ASSETS_HOME_IC_VISITORS_PNG, VisitorManagerPage()), AppApplication('访客管理', R.ASSETS_HOME_IC_VISITORS_PNG, VisitorManagerPage()),
AppApplication('便民电话', '', Scaffold()), AppApplication('借还管理', R.ASSETS_HOME_IC_BORROW_PNG, BorrowManagerPage()),
AppApplication('借还管理', R.ASSETS_HOME_IC_BORROW_PNG, Scaffold()),
AppApplication('工单管理', '', Scaffold()),
AppApplication('语音管家', '', Scaffold()),
AppApplication('一键报警', R.ASSETS_HOME_IC_POLICE_PNG, Scaffold()), AppApplication('一键报警', R.ASSETS_HOME_IC_POLICE_PNG, Scaffold()),
AppApplication('问卷调查', '', Scaffold()),
]; ];
List<AppApplication> _wisdomApplications = [ List<AppApplication> _wisdomApplications = [
AppApplication('绿化管理', R.ASSETS_HOME_IC_GREENING_PNG, GreenManagePage()), AppApplication('一键报警', R.ASSETS_HOME_IC_POLICE_PNG, Scaffold()),
AppApplication('巡检管理', R.ASSETS_HOME_IC_PATROL_PNG, InspectionManagePage()), AppApplication('访客管理', R.ASSETS_HOME_IC_VISITORS_PNG, VisitorManagerPage()),
AppApplication('报事报修', R.ASSETS_HOME_IC_SERVICE_PNG, BusinessAndFixPage()),
AppApplication('物品出户', R.ASSETS_HOME_IC_ARTICLE_PNG, ItemsOutdoorPage()),
AppApplication( AppApplication(
'装修管理', R.ASSETS_HOME_IC_DECORATION_PNG, DecorationManagerPage()), '装修管理', R.ASSETS_HOME_IC_DECORATION_PNG, DecorationManagerPage()),
AppApplication('物品出户', R.ASSETS_HOME_IC_ARTICLE_PNG, ItemsOutdoorPage()), AppApplication(
'活动管理', R.ASSETS_HOME_IC_ACTIVITY_PNG, ActivityManagerPage()),
AppApplication('借还管理', R.ASSETS_HOME_IC_BORROW_PNG, BorrowManagerPage()),
AppApplication('巡检管理', R.ASSETS_HOME_IC_PATROL_PNG, InspectionManagePage()),
AppApplication('绿化管理', R.ASSETS_HOME_IC_GREENING_PNG, GreenManagePage()),
]; ];
@override @override
@ -174,7 +178,6 @@ class _ApplicationPageState extends State<ApplicationPage>
/// ///
_buildBottomApps() { _buildBottomApps() {
final appProvider = Provider.of<AppProvider>(context);
return Expanded( return Expanded(
child: Row( child: Row(
children: [ children: [

@ -1,4 +1,5 @@
import 'package:aku_community_manager/const/resource.dart'; import 'package:aku_community_manager/const/resource.dart';
import 'package:aku_community_manager/provider/app_provider.dart';
import 'package:aku_community_manager/provider/user_provider.dart'; import 'package:aku_community_manager/provider/user_provider.dart';
import 'package:aku_community_manager/style/app_style.dart'; import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/screen_tool.dart'; import 'package:aku_community_manager/tools/screen_tool.dart';
@ -30,6 +31,7 @@ class HomePage extends StatefulWidget {
class _HomePageState extends State<HomePage> { class _HomePageState extends State<HomePage> {
///bar ///bar
Widget _menuButton(String assetPath, String text, Widget page) { Widget _menuButton(String assetPath, String text, Widget page) {
final appProvider = Provider.of<AppProvider>(context);
return Expanded( return Expanded(
child: AkuButton( child: AkuButton(
radius: 8.w, radius: 8.w,
@ -37,9 +39,10 @@ class _HomePageState extends State<HomePage> {
onPressed: () { onPressed: () {
final userProvider = final userProvider =
Provider.of<UserProvider>(context, listen: false); Provider.of<UserProvider>(context, listen: false);
if (userProvider.isSigned) if (userProvider.isSigned) {
Get.to(page); Get.to(page);
else appProvider.addRecentApp(AppApplication(text, assetPath, page));
} else
Get.to(LoginPage()); Get.to(LoginPage());
}, },
child: Column( child: Column(

@ -56,56 +56,62 @@ class _PersonalDrawState extends State<PersonalDraw> {
child: ListView( child: ListView(
children: [ children: [
SizedBox( SizedBox(
height: 80.w - 40.w + ScreenUtil().statusBarHeight, height: ScreenUtil().statusBarHeight,
), ),
//leading //leading
Container( InkWell(
margin: EdgeInsets.only(bottom: 80.w), onTap: () {
width: double.infinity, if (!userProvider.isSigned) {
child: Row( Get.to(LoginPage());
children: [ }
SizedBox(width: 32.w), },
// child: Container(
AkuRoundButton( margin: EdgeInsets.only(bottom: 80.w, top: 40.w),
height: 72.w, width: double.infinity,
onPressed: () {}, child: Row(
child: CircleAvatar( children: [
radius: 36.w, SizedBox(width: 32.w),
backgroundImage: userProvider.userInfoModel.avatar == null //
? null AkuRoundButton(
: FileImage(userProvider.userInfoModel.avatar), height: 72.w,
backgroundColor: Colors.white, onPressed: () {},
child: userProvider.isSigned child: CircleAvatar(
? userProvider.userInfoModel.avatar == null radius: 36.w,
? Icon(Icons.person_outline) backgroundImage:
: null userProvider.userInfoModel.avatar == null
: Icon(Icons.person), ? null
), : FileImage(userProvider.userInfoModel.avatar),
), backgroundColor: Colors.white,
SizedBox(width: 24.w),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
//
InkWell(
onTap: () {},
child: userProvider.isSigned child: userProvider.isSigned
? userProvider.userInfoModel.avatar == null
? Icon(Icons.person_outline)
: null
: Icon(Icons.person),
),
),
SizedBox(width: 24.w),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
//
userProvider.isSigned
? Text( ? Text(
userProvider.userInfoModel.nickName, userProvider.userInfoModel.nickName,
style: TextStyle( style: TextStyle(
color: AppStyle.primaryTextColor, color: AppStyle.primaryTextColor,
fontSize: 28.sp, fontSize: 28.sp,
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold,
),
) )
: Text('登录', : Text(
'登录',
style: TextStyle( style: TextStyle(
color: AppStyle.primaryTextColor, color: AppStyle.primaryTextColor,
fontSize: 28.sp, fontSize: 28.sp,
fontWeight: FontWeight.bold)), fontWeight: FontWeight.bold,
), ),
InkWell( ),
onTap: () {}, Row(
child: Row(
children: [ children: [
Icon(Icons.location_on_outlined, size: 33.w), Icon(Icons.location_on_outlined, size: 33.w),
Text( Text(
@ -116,10 +122,10 @@ class _PersonalDrawState extends State<PersonalDraw> {
), ),
], ],
), ),
), ],
], ),
), ],
], ),
), ),
), ),
_myListTile( _myListTile(

@ -2,6 +2,8 @@ import 'dart:ui';
import 'package:aku_community_manager/style/app_style.dart'; import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/widget_tool.dart'; import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/agreements/agreement_page.dart';
import 'package:aku_community_manager/ui/agreements/privacy_page.dart';
import 'package:aku_community_manager/ui/login/login_sms_page.dart'; import 'package:aku_community_manager/ui/login/login_sms_page.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_back_button.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_back_button.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
@ -67,7 +69,6 @@ class _LoginPageState extends State<LoginPage> {
Container( Container(
width: double.infinity, width: double.infinity,
child: TextField( child: TextField(
autofocus: true,
controller: _textController, controller: _textController,
onChanged: (text) { onChanged: (text) {
setState(() {}); setState(() {});
@ -148,6 +149,9 @@ class _LoginPageState extends State<LoginPage> {
), ),
ExtendedWidgetSpan( ExtendedWidgetSpan(
child: GestureDetector( child: GestureDetector(
onTap: () {
Get.to(AgreementPage());
},
child: Text( child: Text(
'《服务协议》', '《服务协议》',
style: TextStyle( style: TextStyle(
@ -162,6 +166,9 @@ class _LoginPageState extends State<LoginPage> {
), ),
ExtendedWidgetSpan( ExtendedWidgetSpan(
child: GestureDetector( child: GestureDetector(
onTap: () {
Get.to(PrivacyPage());
},
child: Text( child: Text(
'《隐私政策》', '《隐私政策》',
style: TextStyle( style: TextStyle(

@ -1,14 +1,10 @@
import 'package:aku_community_manager/mock_models/manage_models/manage_model.dart';
import 'package:aku_community_manager/provider/manage_provider.dart'; import 'package:aku_community_manager/provider/manage_provider.dart';
import 'package:aku_community_manager/style/app_style.dart'; import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/manage_pages/inspection_manage/inspection_manage_card.dart'; import 'package:aku_community_manager/ui/manage_pages/inspection_manage/inspection_manage_card.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_ui/common_widgets/aku_common_widgets.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:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:aku_community_manager/const/resource.dart';
class InspectionManagePage extends StatefulWidget { class InspectionManagePage extends StatefulWidget {
InspectionManagePage({Key key}) : super(key: key); InspectionManagePage({Key key}) : super(key: key);

@ -21,6 +21,7 @@ class SettingsPage extends StatefulWidget {
} }
class _SettingsPageState extends State<SettingsPage> { class _SettingsPageState extends State<SettingsPage> {
bool _info = false;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final userProvider = Provider.of<UserProvider>(context); final userProvider = Provider.of<UserProvider>(context);
@ -35,8 +36,12 @@ class _SettingsPageState extends State<SettingsPage> {
title: Text('是否接受信息通知'), title: Text('是否接受信息通知'),
arrow: false, arrow: false,
suffix: CupertinoSwitch( suffix: CupertinoSwitch(
value: false, value: _info,
onChanged: (value) {}, onChanged: (value) {
setState(() {
_info = value;
});
},
), ),
), ),
Divider(height: 1.w), Divider(height: 1.w),

@ -4,7 +4,6 @@ import 'package:aku_community_manager/ui/widgets/common/aku_tile.dart';
import 'package:aku_community_manager/ui/widgets/inner/pick_image.dart'; import 'package:aku_community_manager/ui/widgets/inner/pick_image.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:aku_community_manager/tools/screen_tool.dart'; import 'package:aku_community_manager/tools/screen_tool.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class UserInfoPage extends StatefulWidget { class UserInfoPage extends StatefulWidget {

@ -0,0 +1,174 @@
import 'dart:io';
import 'dart:math';
import 'package:aku_community_manager/mock_models/borrow/borrow_model.dart';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_community_manager/ui/widgets/inner/pick_image.dart';
import 'package:aku_ui/common_widgets/aku_material_button.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
class AddBorrowItemPage extends StatefulWidget {
final BorrowObject object;
AddBorrowItemPage({Key key, @required this.object}) : super(key: key);
@override
_AddBorrowItemPageState createState() => _AddBorrowItemPageState();
}
class _AddBorrowItemPageState extends State<AddBorrowItemPage> {
TextEditingController _textEditingController = TextEditingController();
String code = '';
File file;
@override
void initState() {
super.initState();
code = (10000000 + Random().nextInt(999999)).toString();
}
@override
Widget build(BuildContext context) {
return AkuScaffold(
title: '物品详情',
actions: [
AkuMaterialButton(
minWidth: 120.w,
onPressed: () {
if (TextUtil.isEmpty(_textEditingController.text)) {
BotToast.showText(text: '名称不能为空');
} else if (file == null) {
BotToast.showText(text: '图片不能为空');
} else {
widget.object.items.insert(
0,
SingleBorrowGoods(
name: _textEditingController.text,
code: code,
assetpath: file,
status: BORROW_STATUS.NOT_BORROW,
));
}
},
child: Text(
'完成',
style: TextStyle(
fontSize: 28.w,
color: AppStyle.primaryTextColor,
),
),
),
],
body: ListView(
padding: EdgeInsets.symmetric(vertical: 16.w),
children: [
Container(
color: Colors.white,
padding: EdgeInsets.symmetric(horizontal: 32.w),
child: Column(
children: [
_buildRow(
'物品名称',
TextField(
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 28.sp,
fontWeight: FontWeight.bold,
),
controller: _textEditingController,
decoration: InputDecoration(
border: InputBorder.none,
hintText: '请输入物品名称',
),
)),
Divider(height: 1.w),
_buildRow(
'物品单号',
Text(
code,
style: TextStyle(
color: AppStyle.minorTextColor,
fontSize: 28.sp,
fontWeight: FontWeight.bold,
),
)),
_buildRow(
'物品图片',
file == null
? InkWell(
onTap: () {
akuPickImage().then((value) {
if (value != null) file = value;
setState(() {});
});
},
child: Container(
height: 184.w,
width: 184.w,
alignment: Alignment.center,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Icon(
Icons.image,
size: 60.w,
color: AppStyle.minorTextColor,
),
Text(
'上传图片',
style: TextStyle(
color: AppStyle.minorTextColor,
fontSize: 22.sp,
),
),
],
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.w),
border: Border.all(
width: 1.w,
color: AppStyle.minorTextColor,
),
),
),
)
: Image.file(
file,
height: 184.w,
width: 184.w,
fit: BoxFit.cover,
),
),
AkuBox.h(28),
],
),
),
],
),
);
}
_buildRow(String title, Widget child) {
return Row(
children: [
AkuBox.h(96),
Text(
title,
style: TextStyle(
color: AppStyle.minorTextColor,
fontSize: 28.w,
),
),
AkuBox.w(80),
Expanded(
child: Align(
alignment: Alignment.centerLeft,
child: child,
),
),
],
);
}
}

@ -0,0 +1,214 @@
import 'dart:io';
import 'package:aku_community_manager/mock_models/borrow/borrow_data.dart';
import 'package:aku_community_manager/mock_models/borrow/borrow_model.dart';
import 'package:aku_community_manager/mock_models/users/user_info_model.dart';
import 'package:aku_community_manager/provider/user_provider.dart';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_community_manager/ui/widgets/inner/aku_bottom_button.dart';
import 'package:aku_community_manager/ui/widgets/inner/pick_image.dart';
import 'package:aku_ui/common_widgets/aku_material_button.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
class AddBorrowObjectPage extends StatefulWidget {
AddBorrowObjectPage({Key key}) : super(key: key);
@override
_AddBorrowObjectPageState createState() => _AddBorrowObjectPageState();
}
class _AddBorrowObjectPageState extends State<AddBorrowObjectPage> {
TextEditingController _textEditingController = TextEditingController();
TextEditingController _numberController = TextEditingController();
File file;
List<BorrowObject> get objects => BorrowData.borrowObjects;
@override
Widget build(BuildContext context) {
final userProvider = Provider.of<UserProvider>(context);
return AkuScaffold(
title: '物品详情',
actions: [
userProvider.userInfoModel.role != USER_ROLE.MANAGER
? AkuMaterialButton(
minWidth: 120.w,
onPressed: () {
if (TextUtil.isEmpty(_textEditingController.text)) {
BotToast.showText(text: '名称不能为空');
} else if (file == null) {
BotToast.showText(text: '图片不能为空');
} else if (int.tryParse(_numberController.text) == null) {
BotToast.showText(text: '数量错误');
} else {
objects.insert(
0,
BorrowObject.init(
name: _textEditingController.text,
allNumber: int.parse(_numberController.text),
assetPath: file,
),
);
Get.back();
}
},
child: Text(
'完成',
style: TextStyle(
fontSize: 28.w,
color: AppStyle.primaryTextColor,
),
),
)
: SizedBox(),
],
body: ListView(
padding: EdgeInsets.symmetric(vertical: 16.w),
children: [
Container(
color: Colors.white,
padding: EdgeInsets.symmetric(horizontal: 32.w),
child: Column(
children: [
_buildRow(
'总类名称',
TextField(
onChanged: (_) {
setState(() {});
},
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 28.sp,
fontWeight: FontWeight.bold,
),
controller: _textEditingController,
decoration: InputDecoration(
border: InputBorder.none,
hintText: '请输入总类名称',
),
)),
Divider(height: 1.w),
_buildRow(
'物品数量',
TextField(
onChanged: (_) {
setState(() {});
},
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 28.sp,
fontWeight: FontWeight.bold,
),
controller: _numberController,
decoration: InputDecoration(
border: InputBorder.none,
hintText: '请输入物品数量',
),
)),
Divider(height: 1.w),
AkuBox.h(24),
_buildRow(
'物品图片',
file == null
? InkWell(
onTap: () {
akuPickImage().then((value) {
if (value != null) file = value;
setState(() {});
});
},
child: Container(
height: 184.w,
width: 184.w,
alignment: Alignment.center,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Icon(
Icons.image,
size: 60.w,
color: AppStyle.minorTextColor,
),
Text(
'上传图片',
style: TextStyle(
color: AppStyle.minorTextColor,
fontSize: 22.sp,
),
),
],
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.w),
border: Border.all(
width: 1.w,
color: AppStyle.minorTextColor,
),
),
),
)
: Image.file(
file,
height: 184.w,
width: 184.w,
fit: BoxFit.cover,
),
),
AkuBox.h(28),
],
),
),
AkuBox.h(470),
Padding(
padding: EdgeInsets.symmetric(horizontal: 64.w),
child: AkuBottomButton(
title: '确定',
onTap: TextUtil.isEmpty(_textEditingController.text) ||
TextUtil.isEmpty(_numberController.text) ||
file == null ||
int.tryParse(_numberController.text) == null
? null
: () {
BorrowData.borrowObjects.add(
BorrowObject.init(
name: _textEditingController.text,
allNumber: int.parse(_numberController.text),
assetPath: file,
),
);
Get.back();
},
),
),
],
),
);
}
_buildRow(String title, Widget child) {
return Row(
children: [
AkuBox.h(96),
Text(
title,
style: TextStyle(
color: AppStyle.minorTextColor,
fontSize: 28.w,
),
),
AkuBox.w(80),
Expanded(
child: Align(
alignment: Alignment.centerLeft,
child: child,
),
),
],
);
}
}

@ -0,0 +1,130 @@
import 'package:aku_community_manager/mock_models/borrow/borrow_data.dart';
import 'package:aku_community_manager/mock_models/borrow/borrow_model.dart';
import 'package:aku_community_manager/mock_models/users/user_info_model.dart';
import 'package:aku_community_manager/provider/user_provider.dart';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/sub_pages/borrow_manager/add_borrow_object_page.dart';
import 'package:aku_community_manager/ui/sub_pages/borrow_manager/borrow_items_page.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_ui/common_widgets/aku_material_button.dart';
import 'package:aku_community_manager/const/resource.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
class AllBorrowGoods extends StatefulWidget {
AllBorrowGoods({Key key}) : super(key: key);
@override
_AllBorrowGoodsState createState() => _AllBorrowGoodsState();
}
class _AllBorrowGoodsState extends State<AllBorrowGoods> {
@override
Widget build(BuildContext context) {
final userProvider = Provider.of<UserProvider>(context);
return AkuScaffold(
title: '全部物品',
actions: [
userProvider.userInfoModel.role == USER_ROLE.MANAGER
? AkuMaterialButton(
minWidth: 120.w,
onPressed: () {
Get.to(AddBorrowObjectPage());
},
child: Text(
'新增',
style: TextStyle(
fontSize: 28.w,
color: AppStyle.primaryTextColor,
),
),
)
: SizedBox(),
],
body: ListView.builder(
padding: EdgeInsets.symmetric(
horizontal: 32.w,
),
itemBuilder: (context, index) {
return _buildCard(BorrowData.borrowObjects[index]);
},
itemCount: BorrowData.borrowObjects.length,
),
);
}
_buildCard(BorrowObject object) {
return GestureDetector(
onTap: () => Get.to(BorrowItemPage(object: object)),
child: Container(
padding: EdgeInsets.all(24.w),
margin: EdgeInsets.only(top: 16.w),
child: Row(
children: [
ClipRRect(
borderRadius: BorderRadius.circular(4.w),
child: (object.assetPath is String)
? Image.asset(
object.assetPath,
width: 184.w,
height: 184.w,
fit: BoxFit.cover,
)
: Image.file(
object.assetPath,
width: 184.w,
height: 184.w,
fit: BoxFit.cover,
),
),
AkuBox.w(24),
Expanded(
child: Column(
children: [
_buildRow(R.ASSETS_MANAGE_ARTICLE_PNG, '物品名称', object.name),
AkuBox.h(12),
_buildRow(R.ASSETS_MANAGE_BORROW_PNG, '借出数量',
object.borrowNumber.toString()),
AkuBox.h(12),
_buildRow(R.ASSETS_MANAGE_REMAINING_PNG, '剩余数量',
object.items.length.toString()),
],
)),
],
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.w),
color: Colors.white,
),
),
);
}
_buildRow(String assetPath, String title, String subTitle) {
return Row(
children: [
Image.asset(
assetPath,
height: 40.w,
width: 40.w,
),
Text(
'$title\:',
style: TextStyle(
color: AppStyle.minorTextColor,
fontSize: 28.w,
),
),
Text(
subTitle,
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 28.w,
),
),
],
);
}
}

@ -0,0 +1,154 @@
import 'package:aku_community_manager/mock_models/borrow/borrow_model.dart';
import 'package:aku_community_manager/mock_models/users/user_info_model.dart';
import 'package:aku_community_manager/provider/user_provider.dart';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_ui/common_widgets/aku_material_button.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class BorrowItemDetailPage extends StatefulWidget {
final SingleBorrowGoods item;
BorrowItemDetailPage({Key key, this.item}) : super(key: key);
@override
_BorrowItemDetailPageState createState() => _BorrowItemDetailPageState();
}
class _BorrowItemDetailPageState extends State<BorrowItemDetailPage> {
bool _isEditing = false;
TextEditingController _textEditingController;
@override
void initState() {
super.initState();
_textEditingController = TextEditingController(text: widget.item.name);
}
@override
void dispose() {
_textEditingController?.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
final userProvider = Provider.of<UserProvider>(context);
return AkuScaffold(
title: '物品详情',
actions: [
userProvider.userInfoModel.role == USER_ROLE.MANAGER
? AkuMaterialButton(
minWidth: 120.w,
onPressed: () {
setState(() {
_isEditing = !_isEditing;
});
},
child: Text(
_isEditing ? '完成' : '编辑',
style: TextStyle(
fontSize: 28.w,
color: AppStyle.primaryTextColor,
),
),
)
: SizedBox(),
],
body: ListView(
padding: EdgeInsets.symmetric(vertical: 16.w),
children: [
Container(
color: Colors.white,
padding: EdgeInsets.symmetric(horizontal: 32.w),
child: Column(
children: [
_buildRow(
'物品名称',
TextField(
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 28.sp,
fontWeight: FontWeight.bold,
),
controller: _textEditingController,
enabled: _isEditing,
onChanged: (text) {
widget.item.name = text;
},
decoration: InputDecoration(
border: InputBorder.none,
),
)),
Divider(height: 1.w),
_buildRow(
'物品单号',
Text(
widget.item.code,
style: TextStyle(
color: _isEditing
? AppStyle.minorTextColor
: AppStyle.primaryTextColor,
fontSize: 28.sp,
fontWeight: FontWeight.bold,
),
)),
_buildRow(
'出借状态',
Text(
'未出借',
style: TextStyle(
color: _isEditing
? AppStyle.minorTextColor
: AppStyle.primaryTextColor,
fontSize: 28.sp,
fontWeight: FontWeight.bold,
),
)),
_buildRow(
'物品图片',
(widget.item.assetpath is String)
? Image.asset(
widget.item.assetpath,
height: 184.w,
width: 184.w,
fit: BoxFit.cover,
)
: Image.file(
widget.item.assetpath,
height: 184.w,
width: 184.w,
fit: BoxFit.cover,
),
),
AkuBox.h(28),
],
),
),
],
),
);
}
_buildRow(String title, Widget child) {
return Row(
children: [
AkuBox.h(96),
Text(
title,
style: TextStyle(
color: AppStyle.minorTextColor,
fontSize: 28.w,
),
),
AkuBox.w(80),
Expanded(
child: Align(
alignment: Alignment.centerLeft,
child: child,
),
),
],
);
}
}

@ -0,0 +1,211 @@
import 'package:aku_community_manager/mock_models/borrow/borrow_model.dart';
import 'package:aku_community_manager/mock_models/users/user_info_model.dart';
import 'package:aku_community_manager/provider/user_provider.dart';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/sub_pages/borrow_manager/add_borrow_item_page.dart';
import 'package:aku_community_manager/ui/sub_pages/borrow_manager/borrow_item_detail_page.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_ui/common_widgets/aku_material_button.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
class BorrowItemPage extends StatefulWidget {
final BorrowObject object;
BorrowItemPage({Key key, @required this.object}) : super(key: key);
@override
_BorrowItemPageState createState() => _BorrowItemPageState();
}
class _BorrowItemPageState extends State<BorrowItemPage> {
@override
Widget build(BuildContext context) {
final userProvider = Provider.of<UserProvider>(context);
return AkuScaffold(
title: '物品查看',
actions: [
userProvider.userInfoModel.role == USER_ROLE.MANAGER
? AkuMaterialButton(
minWidth: 120.w,
onPressed: () {
Get.to(AddBorrowItemPage(object: widget.object));
},
child: Text(
'新增',
style: TextStyle(
fontSize: 28.w,
color: AppStyle.primaryTextColor,
),
),
)
: SizedBox(),
],
body: ListView.builder(
padding: EdgeInsets.symmetric(horizontal: 32.w),
itemBuilder: (context, index) {
return _buildCard(widget.object.items[index]);
},
itemCount: widget.object.items.length,
),
);
}
_buildCard(SingleBorrowGoods item) {
final userProvider = Provider.of<UserProvider>(context);
return GestureDetector(
onTap: () {
Get.to(BorrowItemDetailPage(item: item));
},
child: Container(
margin: EdgeInsets.only(top: 16.w),
child: Column(
children: [
Row(
children: [
AkuBox.h(93),
AkuBox.w(24),
Text(
item.name,
style: TextStyle(
color: AppStyle.primaryTextColor,
fontWeight: FontWeight.bold,
fontSize: 32.sp,
),
),
Spacer(),
userProvider.userInfoModel.role == USER_ROLE.MANAGER
? AkuMaterialButton(
padding: EdgeInsets.symmetric(horizontal: 24.w),
onPressed: () {
showCupertinoDialog(
context: context,
builder: (context) {
return CupertinoAlertDialog(
title: Text('删除物品'),
content: Text('确定要删除${item.name}该物品吗?'),
actions: [
CupertinoDialogAction(
child: Text('取消'),
onPressed: () {
Get.back();
},
),
CupertinoDialogAction(
child: Text('删除'),
onPressed: () {
widget.object.items.remove(item);
setState(() {});
Get.back();
},
),
],
);
},
);
},
child: Row(
children: [
Icon(
Icons.delete,
color: AppStyle.minorTextColor,
size: 40.w,
),
Text(
'删除',
style: TextStyle(
color: AppStyle.minorTextColor,
fontSize: 28.sp,
),
),
],
),
)
: SizedBox(),
],
),
Divider(
height: 1.w,
),
AkuBox.h(28),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AkuBox.w(24),
ClipRRect(
borderRadius: BorderRadius.circular(4.w),
child: (item.assetpath is String)
? Image.asset(
item.assetpath,
height: 184.w,
width: 184.w,
fit: BoxFit.cover,
)
: Image.file(
item.assetpath,
height: 184.w,
width: 184.w,
fit: BoxFit.cover,
),
),
AkuBox.w(24),
Expanded(
child: Column(
children: [
_buildRow(
R.ASSETS_MANAGE_IC_RENWU_PNG, '物品单号', item.code),
_buildRow(
R.ASSETS_MANAGE_BORROW_PNG,
'出借状态',
'未借出',
color: AppStyle.secondaryColor,
),
],
),
),
],
),
AkuBox.h(32),
],
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8.w),
),
),
);
}
_buildRow(
String assetPath,
String title,
String subTitle, {
Color color = AppStyle.primaryTextColor,
}) {
return Row(
children: [
Image.asset(
assetPath,
height: 40.w,
width: 40.w,
),
Text(
'$title\:',
style: TextStyle(
color: AppStyle.minorTextColor,
fontSize: 28.w,
),
),
Text(
subTitle,
style: TextStyle(
color: color,
fontSize: 28.w,
),
),
],
);
}
}

@ -0,0 +1,221 @@
import 'package:aku_community_manager/mock_models/borrow/borrow_model.dart';
import 'package:aku_community_manager/mock_models/users/user_info_model.dart';
import 'package:aku_community_manager/provider/user_provider.dart';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/sub_pages/borrow_manager/borrow_manager_check_page.dart';
import 'package:aku_community_manager/ui/widgets/inner/aku_chip_box.dart';
import 'package:aku_ui/common_widgets/aku_material_button.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
class BorrowManagerCard extends StatefulWidget {
final BorrowModel model;
BorrowManagerCard({Key key, this.model}) : super(key: key);
@override
_BorrowManagerCardState createState() => _BorrowManagerCardState();
}
class _BorrowManagerCardState extends State<BorrowManagerCard> {
USER_ROLE get role =>
Provider.of<UserProvider>(context, listen: false).userInfoModel.role;
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.only(top: 16.w),
padding: EdgeInsets.all(24.w),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8.w),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
AkuChipBox(title: '借还管理'),
AkuBox.w(24),
Text(
DateUtil.formatDate(widget.model.date),
style: TextStyle(),
),
Spacer(),
Text(
widget.model.borrowGoods.borrowValue,
style: TextStyle(
color: AppStyle.failColor,
fontWeight: FontWeight.bold,
fontSize: 24.sp,
),
),
],
),
AkuBox.h(24),
Text(
widget.model.title,
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 32.sp,
fontWeight: FontWeight.bold,
),
),
AkuBox.h(16),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
(widget.model.borrowGoods.assetpath is String)
? Image.asset(
widget.model.borrowGoods.assetpath,
height: 184.w,
width: 183.w,
fit: BoxFit.cover,
)
: Image.file(
widget.model.borrowGoods.assetpath,
height: 184.w,
width: 183.w,
fit: BoxFit.cover,
),
AkuBox.w(24),
Expanded(
child: Column(
children: [
_buildRow(R.ASSETS_MESSAGE_IC_PEOPLE_PNG, '借用人员',
widget.model.borrowPerson),
_buildRow(R.ASSETS_MESSAGE_IC_PHONE_PNG, '联系电话',
widget.model.phone),
_buildRow(R.ASSETS_MANAGE_IC_TIME_PNG, '借用时常',
'${widget.model.borrowTime}'),
_buildRow(
R.ASSETS_MANAGE_INFO_PNG,
'物品状态',
widget.model.goodsStatus == GOODS_STATUS.BROKEN
? '损坏'
: widget.model.goodsStatus == GOODS_STATUS.LOST
? '丢失'
: '正常',
color: widget.model.goodsStatus == GOODS_STATUS.NORMAL
? AppStyle.primaryTextColor
: AppStyle.failColor,
),
],
),
),
],
),
..._buildCard(),
],
),
);
}
List<Widget> _buildCard() {
if (role != USER_ROLE.MANAGER)
return [];
else if (widget.model.borrowGoods.status == BORROW_STATUS.DONE) {
return [];
} else
return [
Divider(height: 48.w),
Row(
children: [
Spacer(),
MaterialButton(
minWidth: 160.w,
height: 64.w,
child: Text(
'电话联系',
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 28.sp,
fontWeight: FontWeight.bold,
),
),
onPressed: () {
launch('tel:${widget.model.phone}');
},
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.w),
side: BorderSide(color: AppStyle.primaryColor, width: 2.w),
),
),
AkuBox.w(24),
widget.model.borrowGoods.status == BORROW_STATUS.BORROWING
? AkuMaterialButton(
minWidth: 160.w,
height: 64.w,
color: AppStyle.primaryColor,
radius: 4.w,
onPressed: () {
BotToast.showText(text: '已提醒用户');
},
child: Text(
'提醒归还',
style: TextStyle(
color: AppStyle.primaryTextColor,
fontWeight: FontWeight.bold,
fontSize: 28.w,
),
),
)
: SizedBox(),
widget.model.borrowGoods.status == BORROW_STATUS.WAIT_CHECK
? AkuMaterialButton(
minWidth: 160.w,
height: 64.w,
color: AppStyle.primaryColor,
radius: 4.w,
onPressed: () {
Get.to(BorrowManagerCheckPage(model: widget.model));
},
child: Text(
'检查信息',
style: TextStyle(
color: AppStyle.primaryTextColor,
fontWeight: FontWeight.bold,
fontSize: 28.w,
),
),
)
: SizedBox(),
],
),
];
}
_buildRow(
String assetPath,
String title,
String subTitle, {
Color color = AppStyle.primaryTextColor,
}) {
return Row(
children: [
Image.asset(
assetPath,
height: 40.w,
width: 40.w,
),
Text(
'$title\:',
style: TextStyle(
color: AppStyle.minorTextColor,
fontSize: 28.w,
),
),
Text(
subTitle,
style: TextStyle(
color: color,
fontSize: 28.w,
),
),
],
);
}
}

@ -0,0 +1,170 @@
import 'package:aku_community_manager/mock_models/borrow/borrow_model.dart';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_community_manager/ui/widgets/inner/aku_bottom_button.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
class BorrowManagerCheckPage extends StatefulWidget {
final BorrowModel model;
BorrowManagerCheckPage({Key key, @required this.model}) : super(key: key);
@override
_BorrowManagerCheckPageState createState() => _BorrowManagerCheckPageState();
}
class _BorrowManagerCheckPageState extends State<BorrowManagerCheckPage> {
GOODS_STATUS borrowStatus = GOODS_STATUS.NORMAL;
@override
Widget build(BuildContext context) {
return AkuScaffold(
title: '检查物品',
bottom: AkuBottomButton(
title: '确认归还',
onTap: () {
widget.model.goodsStatus = borrowStatus;
widget.model.borrowGoods.status = BORROW_STATUS.DONE;
Get.back();
},
),
body: ListView(
padding: EdgeInsets.symmetric(vertical: 16.w),
children: [
Container(
color: Colors.white,
padding: EdgeInsets.symmetric(horizontal: 32.w),
child: Column(
children: [
_buildRow(
'物品名称',
Text(
widget.model.borrowGoods.name,
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 28.sp,
fontWeight: FontWeight.bold,
),
),
),
Divider(height: 1.w),
_buildRow(
'物品单号',
Text(
widget.model.borrowGoods.code,
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 28.sp,
fontWeight: FontWeight.bold,
),
),
),
Divider(height: 1.w),
_buildRow(
'归还数量',
Text(
'1',
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 28.sp,
fontWeight: FontWeight.bold,
),
)),
Divider(height: 1.w),
_buildRow(
'物品情况',
Row(
children: [
_buildCard(GOODS_STATUS.NORMAL),
AkuBox.w(24),
_buildCard(GOODS_STATUS.BROKEN),
AkuBox.w(24),
_buildCard(GOODS_STATUS.LOST),
],
),
),
Divider(height: 1.w),
AkuBox.h(16),
_buildRow(
'物品图片',
(widget.model.borrowGoods.assetpath is String)
? Image.asset(
widget.model.borrowGoods.assetpath,
height: 184.w,
width: 184.w,
fit: BoxFit.cover,
)
: Image.file(
widget.model.borrowGoods.assetpath,
height: 184.w,
width: 184.w,
fit: BoxFit.cover,
),
),
AkuBox.h(28),
],
),
),
],
),
);
}
_buildRow(String title, Widget child) {
return Row(
children: [
AkuBox.h(96),
Text(
title,
style: TextStyle(
color: AppStyle.minorTextColor,
fontSize: 28.w,
),
),
AkuBox.w(80),
Expanded(
child: Align(
alignment: Alignment.centerLeft,
child: child,
),
),
],
);
}
_buildCard(GOODS_STATUS status) {
return GestureDetector(
onTap: () {
borrowStatus = status;
setState(() {});
},
child: Container(
height: 56.w,
width: 112.w,
child: Text(
{
GOODS_STATUS.NORMAL: '完好',
GOODS_STATUS.BROKEN: '损坏',
GOODS_STATUS.LOST: '丢失',
}[status],
style: TextStyle(
color: borrowStatus == status
? AppStyle.secondaryColor
: AppStyle.minorTextColor,
fontSize: 28.sp,
),
),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
border: Border.all(
color: borrowStatus == status
? AppStyle.secondaryColor
: AppStyle.minorTextColor,
width: 2.w,
),
),
),
);
}
}

@ -0,0 +1,99 @@
import 'package:aku_community_manager/mock_models/borrow/borrow_data.dart';
import 'package:aku_community_manager/mock_models/borrow/borrow_model.dart';
import 'package:aku_community_manager/mock_models/users/user_info_model.dart';
import 'package:aku_community_manager/provider/user_provider.dart';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/ui/sub_pages/borrow_manager/all_borrow_goods.dart';
import 'package:aku_community_manager/ui/sub_pages/borrow_manager/borrow_manager_card.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_community_manager/ui/widgets/inner/aku_tab_bar.dart';
import 'package:aku_ui/common_widgets/aku_material_button.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
class BorrowManagerPage extends StatefulWidget {
BorrowManagerPage({Key key}) : super(key: key);
@override
_BorrowManagerPageState createState() => _BorrowManagerPageState();
}
class _BorrowManagerPageState extends State<BorrowManagerPage>
with TickerProviderStateMixin {
USER_ROLE get role =>
Provider.of<UserProvider>(context, listen: false).userInfoModel.role;
TabController _tabController;
List<String> get _tabs {
switch (role) {
case USER_ROLE.MANAGER:
return ['全部', '出借中', '待检查', '已归还'];
default:
return ['全部', '出借中', '已归还'];
}
}
@override
void initState() {
super.initState();
_tabController = TabController(length: _tabs.length, vsync: this);
}
@override
Widget build(BuildContext context) {
return AkuScaffold(
title: '物品清单',
appBarBottom: PreferredSize(
child: AkuTabBar(
controller: _tabController,
tabs: _tabs,
),
preferredSize: Size.fromHeight(96.w)),
actions: [
AkuMaterialButton(
minWidth: 178.w,
onPressed: () {
Get.to(AllBorrowGoods());
},
child: Text(
'全部物品',
style: TextStyle(
fontSize: 28.w,
color: AppStyle.primaryTextColor,
),
),
),
],
body: TabBarView(
controller: _tabController,
children: _getChildren(),
),
);
}
List<Widget> _getChildren() {
switch (role) {
case USER_ROLE.MANAGER:
return [
getView(BorrowData.models),
getView(BorrowData.borrowModels),
getView(BorrowData.checkModels),
getView(BorrowData.doneModels),
];
break;
default:
return [];
}
}
}
Widget getView(List<BorrowModel> models) {
return ListView.builder(
itemBuilder: (context, index) {
return BorrowManagerCard(
model: models[index],
);
},
itemCount: models.length,
);
}

@ -8,6 +8,7 @@ import 'package:aku_community_manager/tools/screen_tool.dart';
import 'package:aku_community_manager/ui/widgets/inner/aku_title_box.dart'; import 'package:aku_community_manager/ui/widgets/inner/aku_title_box.dart';
import 'package:aku_community_manager/ui/widgets/inner/pick_image.dart'; import 'package:aku_community_manager/ui/widgets/inner/pick_image.dart';
import 'package:aku_ui/common_widgets/aku_material_button.dart'; import 'package:aku_ui/common_widgets/aku_material_button.dart';
import 'package:common_utils/common_utils.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
@ -24,6 +25,18 @@ class _FixWorkFinishPageState extends State<FixWorkFinishPage> {
List<File> _imgs = []; List<File> _imgs = [];
TextEditingController _descriptionController = TextEditingController(); TextEditingController _descriptionController = TextEditingController();
TextEditingController _materialController = TextEditingController(); TextEditingController _materialController = TextEditingController();
TextEditingController _humanController = TextEditingController();
TextEditingController _materialPriceController = TextEditingController();
@override
void dispose() {
_descriptionController?.dispose();
_materialController?.dispose();
_materialPriceController?.dispose();
_humanController?.dispose();
super.dispose();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AkuScaffold( return AkuScaffold(
@ -243,10 +256,85 @@ class _FixWorkFinishPageState extends State<FixWorkFinishPage> {
) )
], ],
), ),
// widget.model.detail.type == FIX_PAYMENT_TYPE.FREE
// ? SizedBox()
// :
AkuTitleBox( AkuTitleBox(
title: '费用明细', title: '费用明细',
spacing: 16,
children: [ children: [
Row(
children: [
AkuBox.h(96),
Text('人工费'),
Expanded(
child: TextField(
controller: _humanController,
onChanged: (_) => setState(() {}),
keyboardType: TextInputType.number,
textAlign: TextAlign.end,
decoration: InputDecoration(
border: InputBorder.none,
hintText: '请输入',
hintStyle: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 28.sp,
color: AppStyle.minorTextColor,
),
),
),
),
],
),
Divider(height: 1.w),
Row(
children: [
AkuBox.h(96),
Text('材料费'),
Expanded(
child: TextField(
onChanged: (_) => setState(() {}),
controller: _materialPriceController,
textAlign: TextAlign.end,
keyboardType: TextInputType.number,
decoration: InputDecoration(
border: InputBorder.none,
hintText: '请输入',
hintStyle: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 28.sp,
color: AppStyle.minorTextColor,
),
),
),
),
],
),
Divider(height: 1.w),
Row(
children: [
AkuBox.h(96),
Text('总计费用'),
Spacer(),
Builder(
builder: (context) {
double humanPrice =
double.tryParse(_humanController.text);
double materialPrice =
double.tryParse(_materialPriceController.text);
if (TextUtil.isEmpty(_humanController.text) ||
TextUtil.isEmpty(_materialPriceController.text)) {
return Text('人工费或材料费不能为空');
} else if (humanPrice == null || materialPrice == null)
return Text('输入有误');
else
return Text(
'¥${(humanPrice + materialPrice).toStringAsFixed(2)}');
},
),
],
),
], ],
), ),
], ],
@ -269,6 +357,11 @@ class _FixWorkFinishPageState extends State<FixWorkFinishPage> {
imgs: _imgs, imgs: _imgs,
); );
widget.model.type = FIX_ENUM.DONE; widget.model.type = FIX_ENUM.DONE;
if (widget.model.detail.type == FIX_PAYMENT_TYPE.PAY)
widget.model.detail.priceDetail = FixPriceDetail(
humanPrice: double.parse(_humanController.text),
materialPrice: double.parse(_materialController.text),
);
Get.back(); Get.back();
}, },
), ),

@ -1,6 +1,5 @@
import 'package:aku_community_manager/const/resource.dart'; import 'package:aku_community_manager/const/resource.dart';
import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart'; import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart';
import 'package:aku_community_manager/mock_models/fix/fix_model.dart';
import 'package:aku_community_manager/mock_models/fix/fixer_model.dart'; import 'package:aku_community_manager/mock_models/fix/fixer_model.dart';
import 'package:aku_community_manager/provider/fix_provider.dart'; import 'package:aku_community_manager/provider/fix_provider.dart';
import 'package:aku_community_manager/style/app_style.dart'; import 'package:aku_community_manager/style/app_style.dart';

@ -0,0 +1,270 @@
import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_checkbox.dart';
import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_success_page.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_community_manager/ui/widgets/inner/aku_bottom_button.dart';
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
class DecorationFollowCheck extends StatefulWidget {
final DecorationModel model;
DecorationFollowCheck({Key key, @required this.model}) : super(key: key);
@override
_DecorationFollowCheckState createState() => _DecorationFollowCheckState();
}
class _DecorationFollowCheckState extends State<DecorationFollowCheck> {
Map<CHECK_TYPE, bool> checkStatus = {
CHECK_TYPE.ELECTRIC: true,
CHECK_TYPE.WATER: true,
CHECK_TYPE.WALL: true,
CHECK_TYPE.DOOR_AND_WINDOWS: true,
CHECK_TYPE.SECURITY: true,
};
bool get success {
for (var item in checkStatus.keys) {
if (checkStatus[item] == false) return false;
}
return true;
}
TextEditingController _textEditingController = TextEditingController();
@override
void dispose() {
_textEditingController?.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return AkuScaffold(
title: '跟踪检查',
body: ListView(
padding: EdgeInsets.symmetric(vertical: 16.w),
children: [
Container(
color: Colors.white,
padding: EdgeInsets.symmetric(
horizontal: 32.w,
vertical: 16.w,
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
child: Row(
children: [
Container(
height: 56.w,
width: 56.w,
alignment: Alignment.center,
child: Text(
'',
style: TextStyle(
color: AppStyle.secondaryColor,
fontSize: 24.sp,
fontWeight: FontWeight.bold,
),
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(28.w),
color: Color(0xFFE9F2FF),
),
),
AkuBox.w(30),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
widget.model.userHomeModel.plot,
style: TextStyle(
fontWeight: FontWeight.bold,
color: AppStyle.primaryTextColor,
fontSize: 24.sp,
),
),
Text(
widget.model.userHomeModel.detailAddr,
style: TextStyle(
fontWeight: FontWeight.bold,
color: AppStyle.primaryTextColor,
fontSize: 24.sp,
),
),
],
),
),
],
),
padding: EdgeInsets.symmetric(
vertical: 26.w,
horizontal: 32.w,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.w),
color: Color(0xFFF9F9F9),
),
),
AkuBox.h(16),
Container(
child: Row(
children: [
Container(
height: 56.w,
width: 56.w,
alignment: Alignment.center,
child: Text(
'',
style: TextStyle(
color: AppStyle.secondaryColor,
fontSize: 24.sp,
fontWeight: FontWeight.bold,
),
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(28.w),
color: Color(0xFFE9F2FF),
),
),
AkuBox.w(30),
Expanded(
child: Text(
widget.model.decorationTeamModel.name,
style: TextStyle(
fontWeight: FontWeight.bold,
color: AppStyle.primaryTextColor,
fontSize: 24.sp,
),
),
),
],
),
padding: EdgeInsets.symmetric(
vertical: 26.w,
horizontal: 32.w,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8.w),
color: Color(0xFFF9F9F9),
),
),
AkuBox.h(16),
Row(
children: [
Text(
'${DateUtil.formatDate(
DateTime.now(),
format: 'yyyy-MM-dd',
)} ',
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 28.w,
fontWeight: FontWeight.bold,
),
),
Spacer(),
AkuBox.h(96),
Text(
success ? '正常' : '异常',
style: TextStyle(
color: success
? AppStyle.successColor
: AppStyle.failColor,
fontSize: 28.w,
fontWeight: FontWeight.bold,
),
),
],
),
_buildRow(CHECK_TYPE.ELECTRIC),
_buildRow(CHECK_TYPE.WATER),
_buildRow(CHECK_TYPE.WALL),
_buildRow(CHECK_TYPE.DOOR_AND_WINDOWS),
_buildRow(CHECK_TYPE.SECURITY),
TextField(
minLines: 3,
maxLines: 99,
controller: _textEditingController,
decoration: InputDecoration(
contentPadding: EdgeInsets.symmetric(
vertical: 16.w,
horizontal: 24.w,
),
hintText: '请输入检查描述',
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8.w),
borderSide: BorderSide(
width: 2.w,
color: Color(0xFFE8E8E8),
),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(8.w),
borderSide: BorderSide(
width: 2.w,
color: Color(0xFFE8E8E8),
),
),
),
),
],
),
),
],
),
bottom: AkuBottomButton(
onTap: () {
widget.model.checkInfomations.add(
CheckInfomation(
checkDate: DateTime.now(),
checkType: '周期检查',
info: _textEditingController.text,
details: checkStatus.entries.map((e) {
return CheckDetail(type: e.key, status: e.value);
}).toList(),
),
);
widget.model.type = DecorationType.DONE;
Get.off(DecorationSuccessPage());
},
title: '确认提交',
),
);
}
_buildRow(
CHECK_TYPE type,
) {
return Row(
children: [
Image.asset(
checkAssetMap[type],
height: 40.w,
width: 40.w,
),
Text(
checkTypeMap[type],
style: TextStyle(
fontSize: 28.w,
color: AppStyle.primaryTextColor,
),
),
Spacer(),
DecorationCheckBox(
initValue: checkStatus[type],
onChange: (state) {
checkStatus[type] = state;
setState(() {});
},
),
Spacer(),
],
);
}
}

@ -1,12 +1,16 @@
import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart'; import 'package:aku_community_manager/mock_models/decoration/decoration_model.dart';
import 'package:aku_community_manager/mock_models/users/user_info_model.dart';
import 'package:aku_community_manager/provider/user_provider.dart';
import 'package:aku_community_manager/style/app_style.dart'; import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/widget_tool.dart'; import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_check_row.dart'; import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_check_row.dart';
import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_checkbox.dart'; import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_checkbox.dart';
import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_department_page.dart'; import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_department_page.dart';
import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_follow_check.dart';
import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_util.dart'; import 'package:aku_community_manager/ui/sub_pages/decoration_manager/decoration_util.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_back_button.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_back_button.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_community_manager/ui/widgets/inner/aku_bottom_button.dart';
import 'package:aku_community_manager/ui/widgets/inner/aku_title_box.dart'; import 'package:aku_community_manager/ui/widgets/inner/aku_title_box.dart';
import 'package:aku_community_manager/tools/screen_tool.dart'; import 'package:aku_community_manager/tools/screen_tool.dart';
import 'package:aku_community_manager/const/resource.dart'; import 'package:aku_community_manager/const/resource.dart';
@ -17,6 +21,7 @@ import 'package:expandable/expandable.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:provider/provider.dart';
class DecorationManagerDetailPage extends StatefulWidget { class DecorationManagerDetailPage extends StatefulWidget {
final DecorationModel model; final DecorationModel model;
@ -31,6 +36,8 @@ class DecorationManagerDetailPage extends StatefulWidget {
class _DecorationManagerDetailStatePage class _DecorationManagerDetailStatePage
extends State<DecorationManagerDetailPage> { extends State<DecorationManagerDetailPage> {
bool get isWaitHandOut => widget.model.type == DecorationType.WAIT_HAND_OUT; bool get isWaitHandOut => widget.model.type == DecorationType.WAIT_HAND_OUT;
USER_ROLE get role =>
Provider.of<UserProvider>(context, listen: false).userInfoModel.role;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AkuScaffold( return AkuScaffold(
@ -43,11 +50,51 @@ class _DecorationManagerDetailStatePage
? SizedBox() ? SizedBox()
: _buildFinishWorkCheck(), : _buildFinishWorkCheck(),
_buildCycleCheck(), _buildCycleCheck(),
widget.model.type == DecorationType.WAIT_HAND_OUT widget.model.checkInfomations == null
? SizedBox() ? SizedBox()
: _buildCheckDetail(), : _buildCheckDetail(),
], ],
), ),
bottom: Builder(builder: (context) {
final CycleCheck cycleCheck = widget.model.cycleCheck;
if (role == USER_ROLE.MANAGER) {
switch (widget.model.type) {
case DecorationType.WAIT_HAND_OUT:
return AkuBottomButton(
title: '立即安排',
onTap: cycleCheck.authPerson != null &&
cycleCheck.checkCycle != null &&
cycleCheck.startDate != null
? () {
widget.model.type = DecorationType.HAND_OUT;
setState(() {});
}
: null,
);
break;
default:
return SizedBox();
break;
}
// else if(widget.model.type)
} else if (role == USER_ROLE.PROPERTY) {
switch (widget.model.type) {
case DecorationType.HAND_OUT:
return AkuBottomButton(
title: '立即执行',
onTap: () {
Get.to(DecorationFollowCheck(model: widget.model));
},
);
break;
default:
return SizedBox();
break;
}
} else
return SizedBox();
}),
); );
} }

@ -0,0 +1,71 @@
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_ui/common_widgets/aku_material_button.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
class DecorationSuccessPage extends StatefulWidget {
DecorationSuccessPage({Key key}) : super(key: key);
@override
_DecorationSuccessPageState createState() => _DecorationSuccessPageState();
}
class _DecorationSuccessPageState extends State<DecorationSuccessPage> {
@override
Widget build(BuildContext context) {
return AkuScaffold(
title: '跟踪检查',
backgroundColor: Color(0xFFF9F9F9),
body: Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
height: 100.w,
width: 100.w,
child: Placeholder(),
),
Text(
'提交成功',
style: TextStyle(
fontWeight: FontWeight.bold,
color: AppStyle.primaryTextColor,
fontSize: 40.sp,
),
),
Text(
'你的装修跟踪检查记录已提交',
style: TextStyle(
fontWeight: FontWeight.bold,
color: AppStyle.minorTextColor,
fontSize: 26.sp,
),
),
AkuBox.h(80),
AkuMaterialButton(
height: 88.w,
minWidth: 280.w,
radius: 8.w,
onPressed: () {
Get.back();
Get.back();
},
color: AppStyle.primaryColor,
child: Text(
'查看',
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 32.w,
fontWeight: FontWeight.bold,
),
),
),
],
),
),
);
}
}

@ -4,35 +4,46 @@ import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/sub_pages/visitor_manager/visitor_manager_page.dart'; import 'package:aku_community_manager/ui/sub_pages/visitor_manager/visitor_manager_page.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';
class VisitorManagerCard extends StatefulWidget { class VisitorManagerCard extends StatefulWidget {
final String adress; final String adress;
final String name; final String name;
final String plate; final String plate;
final String time; final String time;
final VisitorStatus status; final VisitorStatus status;
VisitorManagerCard({Key key, @required this.adress,@required this.name, this.plate, this.time,@required this.status}) : super(key: key); VisitorManagerCard(
{Key key,
@required this.adress,
@required this.name,
this.plate,
this.time,
@required this.status})
: super(key: key);
@override @override
_VisitorManagerCardState createState() => _VisitorManagerCardState(); _VisitorManagerCardState createState() => _VisitorManagerCardState();
} }
class _VisitorManagerCardState extends State<VisitorManagerCard> { class _VisitorManagerCardState extends State<VisitorManagerCard> {
TextStyle _textStyle = TextStyle(
TextStyle _textStyle=TextStyle(color:AppStyle.primaryTextColor,fontSize:28.sp,); color: AppStyle.primaryTextColor,
String _adress; fontSize: 28.sp,
String _name; );
String _plate; String _adress;
String _time; String _name;
VisitorStatus _status; String _plate;
String _time;
VisitorStatus _status;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
_adress=widget.adress; _adress = widget.adress;
_name=widget.name; _name = widget.name;
_plate=widget.plate??'无信息'; _plate = widget.plate ?? '无信息';
_time=widget.time??'无信息'; _time = widget.time ?? '无信息';
_status=widget.status; _status = widget.status;
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Column( return Column(
@ -42,49 +53,80 @@ VisitorStatus _status;
color: Color(0xFFFFFFFF), color: Color(0xFFFFFFFF),
width: double.infinity, width: double.infinity,
height: 201.w, height: 201.w,
padding: EdgeInsets.only(top:24.w,left:24.w,bottom: 28.w), padding: EdgeInsets.only(top: 24.w, left: 24.w, bottom: 28.w),
child: Stack(children: [ child: Stack(
Column( children: [
crossAxisAlignment: CrossAxisAlignment.start, Column(
children:[ crossAxisAlignment: CrossAxisAlignment.start,
Text(_adress,style: TextStyle(color:AppStyle.primaryTextColor,fontSize:32.sp,fontWeight: FontWeight.bold),), children: [
AkuBox.h(16), Text(
Row(children: [ _adress,
Image.asset(R.ASSETS_USER_IC_PERSON_PNG,width:40.w ,height: 40.w,), style: TextStyle(
AkuBox.w(8), color: AppStyle.primaryTextColor,
Text('$_name先生',style:_textStyle,), fontSize: 32.sp,
AkuBox.w(137), fontWeight: FontWeight.bold),
Image.asset(R.ASSETS_HOME_IC_BORROW_PNG,width: 40.w,height: 40.w,), ),
AkuBox.w(8), AkuBox.h(16),
Text(_plate,style: _textStyle,), Row(
children: [
Image.asset(
R.ASSETS_USER_IC_PERSON_PNG,
width: 40.w,
height: 40.w,
),
AkuBox.w(8),
Text(
'$_name先生',
style: _textStyle,
),
AkuBox.w(137),
Image.asset(
R.ASSETS_HOME_IC_BORROW_PNG,
width: 40.w,
height: 40.w,
),
AkuBox.w(8),
Text(
_plate,
style: _textStyle,
),
Spacer(),
],
),
Spacer(), Spacer(),
],), Row(
Spacer(), children: [
Row(children: [ Image.asset(
Image.asset(R.ASSETS_HOME_IC_ARTICLE_PNG,width: 40.w,height: 40.w,), R.ASSETS_HOME_IC_ARTICLE_PNG,
AkuBox.w(8), width: 40.w,
Text(_time,style:_textStyle), height: 40.w,
Spacer(), ),
],), AkuBox.w(8),
], Text(_time, style: _textStyle),
), Spacer(),
Positioned( ],
left: 582.w, ),
bottom: 104.w, ],
child:_statusImage(_status) ), ),
],), Positioned(
left: 582.w, bottom: 104.w, child: _statusImage(_status)),
],
),
), ),
], ],
); );
} }
Widget _statusImage(VisitorStatus status){
Widget _statusImage(VisitorStatus status) {
switch (status) { switch (status) {
case VisitorStatus.NOT_VISIT: case VisitorStatus.NOT_VISIT:
return Placeholder(); return Placeholder();
case VisitorStatus.VISIT_DONE: case VisitorStatus.VISIT_DONE:
return Placeholder(); return Placeholder();
case VisitorStatus.OUTDATE: case VisitorStatus.OUTDATE:
return Placeholder(); return Placeholder();
default:
return Placeholder();
} }
} }
} }

@ -6,7 +6,7 @@ import 'package:aku_community_manager/tools/screen_tool.dart';
class AkuScaffold extends StatefulWidget { class AkuScaffold extends StatefulWidget {
///AppBar 使 `title`,`titleStyle`,`leading`, ///AppBar 使 `title`,`titleStyle`,`leading`,
///`brightness`,`appBarColor`,`` ///`brightness`,`appBarColor`,`actions`
final PreferredSizeWidget appBar; final PreferredSizeWidget appBar;
///title ///title
@ -45,6 +45,8 @@ class AkuScaffold extends StatefulWidget {
final Color appBarColor; final Color appBarColor;
final List<Widget> actions;
final PreferredSizeWidget appBarBottom; final PreferredSizeWidget appBarBottom;
AkuScaffold({ AkuScaffold({
Key key, Key key,
@ -58,6 +60,7 @@ class AkuScaffold extends StatefulWidget {
this.bottom, this.bottom,
this.appBarColor = Colors.white, this.appBarColor = Colors.white,
this.appBarBottom, this.appBarBottom,
this.actions = const [],
}) : super(key: key); }) : super(key: key);
@override @override
@ -86,6 +89,7 @@ class _AkuScaffoldState extends State<AkuScaffold> {
child: Text(widget.title ?? ''), child: Text(widget.title ?? ''),
), ),
bottom: widget.appBarBottom, bottom: widget.appBarBottom,
actions: widget.actions,
), ),
body: widget.body, body: widget.body,
bottomNavigationBar: widget.bottom, bottomNavigationBar: widget.bottom,

@ -1,4 +1,3 @@
import 'package:aku_ui/common_widgets/aku_material_button.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:aku_community_manager/tools/screen_tool.dart'; import 'package:aku_community_manager/tools/screen_tool.dart';

@ -0,0 +1,34 @@
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_ui/common_widgets/aku_material_button.dart';
import 'package:flutter/material.dart';
class AkuBottomButton extends StatefulWidget {
final VoidCallback onTap;
final String title;
AkuBottomButton({Key key, this.onTap, @required this.title})
: super(key: key);
@override
_AkuBottomButtonState createState() => _AkuBottomButtonState();
}
class _AkuBottomButtonState extends State<AkuBottomButton> {
@override
Widget build(BuildContext context) {
return AkuMaterialButton(
height: 98.w,
color: AppStyle.primaryColor,
nullColor: AppStyle.minorColor,
onPressed: widget.onTap,
child: Text(
widget.title,
style: TextStyle(
fontWeight: FontWeight.bold,
color: widget.onTap == null
? AppStyle.minorTextColor
: AppStyle.primaryTextColor,
),
),
);
}
}

@ -10,6 +10,34 @@ packages:
url: "http://test.akuhotel.com:8099/aku_fe/aku_ui.git" url: "http://test.akuhotel.com:8099/aku_fe/aku_ui.git"
source: git source: git
version: "0.0.1" version: "0.0.1"
amap_core_fluttify:
dependency: transitive
description:
name: amap_core_fluttify
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.12.0"
amap_location_fluttify:
dependency: transitive
description:
name: amap_location_fluttify
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.18.0"
amap_map_fluttify:
dependency: "direct main"
description:
name: amap_map_fluttify
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.29.0"
amap_search_fluttify:
dependency: transitive
description:
name: amap_search_fluttify
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.14.0"
async: async:
dependency: transitive dependency: transitive
description: description:
@ -80,6 +108,13 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.1" version: "2.1.1"
core_location_fluttify:
dependency: transitive
description:
name: core_location_fluttify
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.4.1"
crypto: crypto:
dependency: transitive dependency: transitive
description: description:
@ -172,6 +207,18 @@ packages:
description: flutter description: flutter
source: sdk source: sdk
version: "0.0.0" version: "0.0.0"
flutter_web_plugins:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
foundation_fluttify:
dependency: transitive
description:
name: foundation_fluttify
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.9.10+1"
get: get:
dependency: "direct main" dependency: "direct main"
description: description:
@ -338,6 +385,48 @@ packages:
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.3.0-nullsafety.3" version: "1.3.0-nullsafety.3"
url_launcher:
dependency: "direct main"
description:
name: url_launcher
url: "https://pub.flutter-io.cn"
source: hosted
version: "5.7.10"
url_launcher_linux:
dependency: transitive
description:
name: url_launcher_linux
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.0.1+4"
url_launcher_macos:
dependency: transitive
description:
name: url_launcher_macos
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.0.1+9"
url_launcher_platform_interface:
dependency: transitive
description:
name: url_launcher_platform_interface
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.9"
url_launcher_web:
dependency: transitive
description:
name: url_launcher_web
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.1.5+1"
url_launcher_windows:
dependency: transitive
description:
name: url_launcher_windows
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.0.1+3"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
@ -347,4 +436,4 @@ packages:
version: "2.1.0-nullsafety.3" version: "2.1.0-nullsafety.3"
sdks: sdks:
dart: ">=2.10.0 <2.11.0" dart: ">=2.10.0 <2.11.0"
flutter: ">=1.20.0 <2.0.0" flutter: ">=1.22.0 <2.0.0"

@ -56,6 +56,10 @@ dependencies:
expandable: ^4.1.4 expandable: ^4.1.4
url_launcher: ^5.7.10
amap_map_fluttify: ^0.29.0
aku_ui: aku_ui:
git: git:
url: http://test.akuhotel.com:8099/aku_fe/aku_ui.git url: http://test.akuhotel.com:8099/aku_fe/aku_ui.git

Loading…
Cancel
Save