我的接口补充
This commit is contained in:
@@ -1,14 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:ln_jq_app/common/styles/theme.dart';
|
||||
import 'package:ln_jq_app/storage_service.dart';
|
||||
import 'controller.dart';
|
||||
|
||||
// 假设您的 Controller 在这里,如果还没有,可以先创建一个空类
|
||||
// import 'controller.dart';
|
||||
|
||||
// 为了演示,我们先创建一个空的 Controller
|
||||
// class MineController extends GetxController {}
|
||||
|
||||
class MinePage extends GetView<MineController> {
|
||||
const MinePage({super.key});
|
||||
|
||||
@@ -18,7 +13,6 @@ class MinePage extends GetView<MineController> {
|
||||
init: MineController(),
|
||||
id: 'mine',
|
||||
builder: (_) {
|
||||
// 将所有 UI 构建逻辑放在这里
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.grey[100],
|
||||
body: SingleChildScrollView(
|
||||
@@ -28,14 +22,15 @@ class MinePage extends GetView<MineController> {
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
_buildUserInfoCard(),
|
||||
const SizedBox(height: 12),
|
||||
const SizedBox(height: 5),
|
||||
_buildDriverScoreCard(),
|
||||
const SizedBox(height: 12),
|
||||
const SizedBox(height: 5),
|
||||
_buildMonthlyRecordCard(),
|
||||
const SizedBox(height: 12),
|
||||
const SizedBox(height: 5),
|
||||
_buildTipsCard(),
|
||||
const SizedBox(height: 20),
|
||||
_buildLogoutButton(),
|
||||
const SizedBox(height: 20),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -114,9 +109,9 @@ class MinePage extends GetView<MineController> {
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
_buildStatItem('0', '违章总数'),
|
||||
_buildStatItem('0', '扣分总数'),
|
||||
_buildStatItem('0', '已处理'),
|
||||
_buildStatItem(controller.violationTotal, '违章总数'),
|
||||
_buildStatItem(controller.violationScore, '扣分总数'),
|
||||
_buildStatItem(controller.violationDispose, '已处理'),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -160,7 +155,7 @@ class MinePage extends GetView<MineController> {
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
CircularProgressIndicator(
|
||||
value: 0.8, // 假设得分80%
|
||||
value: 10, // 假设得分80%
|
||||
strokeWidth: 8,
|
||||
backgroundColor: Colors.grey[200],
|
||||
valueColor: AlwaysStoppedAnimation<Color>(Colors.blue),
|
||||
@@ -265,13 +260,15 @@ class MinePage extends GetView<MineController> {
|
||||
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
_buildRecordRow(Icons.autorenew, '加氢预约践行率', '100%'),
|
||||
_buildRecordRow(Icons.rate_review, '加氢预约践行率', controller.rate),
|
||||
const Divider(),
|
||||
_buildRecordRow(Icons.report_problem_outlined, '违章', '0起'),
|
||||
_buildRecordRow(
|
||||
Icons.report_problem_outlined,
|
||||
'违章',
|
||||
"${controller.historyBreakRules}起",
|
||||
),
|
||||
const Divider(),
|
||||
_buildRecordRow(Icons.warning_amber_rounded, '危险驾驶', '0起'),
|
||||
const Divider(),
|
||||
_buildRecordRow(Icons.car_crash_outlined, '交通事故', '0起'),
|
||||
_buildRecordRow(Icons.car_crash_outlined, '交通事故', "${controller.accident}起"),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -291,9 +288,7 @@ class MinePage extends GetView<MineController> {
|
||||
trailing: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(value, style: const TextStyle(color: Colors.grey, fontSize: 14)),
|
||||
const SizedBox(width: 8),
|
||||
const Icon(Icons.arrow_forward_ios, size: 14, color: Colors.grey),
|
||||
Text(value, style: const TextStyle(color: AppTheme.themeColor, fontSize: 14)),
|
||||
],
|
||||
),
|
||||
onTap: () {
|
||||
@@ -315,7 +310,7 @@ class MinePage extends GetView<MineController> {
|
||||
const SizedBox(height: 10),
|
||||
_buildInfoItem(Icons.rule, '遵守交通规则,避免违章扣分'),
|
||||
const SizedBox(height: 10),
|
||||
_buildInfoItem(Icons.headset_mic_outlined, '如有疑问请联系客服: 400-123-4567'),
|
||||
_buildInfoItem(Icons.headset_mic_outlined, '如有疑问请联系客服: 400-021-1773'),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -335,7 +330,6 @@ class MinePage extends GetView<MineController> {
|
||||
);
|
||||
}
|
||||
|
||||
/// 5. 构建退出登录按钮
|
||||
Widget _buildLogoutButton() {
|
||||
return ElevatedButton(
|
||||
onPressed: () {
|
||||
|
||||
Reference in New Issue
Block a user