完善工作台
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
<manifest xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<uses-permission android:name="android.permission.INTERNET"/>
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
<application
|
<application
|
||||||
android:label="捷兑通-商家端"
|
android:label="捷兑通-商家版"
|
||||||
android:name="${applicationName}"
|
android:name="${applicationName}"
|
||||||
android:icon="@mipmap/ic_launcher">
|
android:icon="@mipmap/ic_launcher">
|
||||||
<activity
|
<activity
|
||||||
@@ -11,7 +12,8 @@
|
|||||||
android:theme="@style/LaunchTheme"
|
android:theme="@style/LaunchTheme"
|
||||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||||
android:hardwareAccelerated="true"
|
android:hardwareAccelerated="true"
|
||||||
android:windowSoftInputMode="adjustResize">
|
android:windowSoftInputMode="adjustResize"
|
||||||
|
tools:targetApi="honeycomb">
|
||||||
<!-- Specifies an Android theme to apply to this Activity as soon as
|
<!-- 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
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>flutter_jdt_store</string>
|
<string>捷兑通-商家版</string>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
|
|||||||
@@ -4,11 +4,16 @@ import 'package:flutter/services.dart';
|
|||||||
import './utils/utils.dart';
|
import './utils/utils.dart';
|
||||||
|
|
||||||
class Global {
|
class Global {
|
||||||
static String appName = "Flutter Demo";
|
|
||||||
|
static const String appName = "捷兑通-商家版";
|
||||||
|
|
||||||
// 是否 release
|
// 是否 release
|
||||||
static bool get isRelease => const bool.fromEnvironment("dart.vm.product");
|
static bool get isRelease => const bool.fromEnvironment("dart.vm.product");
|
||||||
|
|
||||||
|
static final baseUrl = isRelease
|
||||||
|
? "https://www.wanzhuanyongcheng.cn/app"
|
||||||
|
: "https://test.wanzhuanyongcheng.cn/app";
|
||||||
|
|
||||||
static String tokenKey = "token";
|
static String tokenKey = "token";
|
||||||
|
|
||||||
static String firstOpenKey = "device_first_open";
|
static String firstOpenKey = "device_first_open";
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import 'utils/utils.dart';
|
|||||||
import 'initial_binding.dart';
|
import 'initial_binding.dart';
|
||||||
|
|
||||||
Future<void> main() async {
|
Future<void> main() async {
|
||||||
|
// debugPrint(const String.fromEnvironment('APP_ENV', defaultValue: 'dev'));
|
||||||
await Global.init();
|
await Global.init();
|
||||||
// 强制竖屏
|
// 强制竖屏
|
||||||
StatusBarKit.setPortrait().then((_) {
|
StatusBarKit.setPortrait().then((_) {
|
||||||
@@ -32,9 +33,10 @@ class MainApp extends StatelessWidget {
|
|||||||
final botToastBuilder = BotToastInit();
|
final botToastBuilder = BotToastInit();
|
||||||
|
|
||||||
return GetMaterialApp(
|
return GetMaterialApp(
|
||||||
|
title: Global.appName,
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
// 日志
|
// 日志
|
||||||
enableLog: true,
|
enableLog: !Global.isRelease,
|
||||||
logWriterCallback: Logger.write,
|
logWriterCallback: Logger.write,
|
||||||
defaultTransition: Transition.cupertino,
|
defaultTransition: Transition.cupertino,
|
||||||
// 路由
|
// 路由
|
||||||
|
|||||||
@@ -5,6 +5,56 @@ import 'home_state.dart';
|
|||||||
class HomeLogic extends GetxController {
|
class HomeLogic extends GetxController {
|
||||||
final HomeState state = HomeState();
|
final HomeState state = HomeState();
|
||||||
|
|
||||||
|
final List<Map<String, String>> list = [
|
||||||
|
{
|
||||||
|
"title": "今日成交额",
|
||||||
|
"value": "100000",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "昨日成交额",
|
||||||
|
"value": "2000",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "本月成交额",
|
||||||
|
"value": "10000",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "今日订单数",
|
||||||
|
"value": "100",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "昨日订单数",
|
||||||
|
"value": "200",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "本月订单数",
|
||||||
|
"value": "5000",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
final List<Map<String, String>> list2 = [
|
||||||
|
{
|
||||||
|
"title": "全部",
|
||||||
|
"value": "2000",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "待付款",
|
||||||
|
"value": "10",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "待核销",
|
||||||
|
"value": "200",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "已核销",
|
||||||
|
"value": "2000",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "已过期",
|
||||||
|
"value": "100",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onReady() {
|
void onReady() {
|
||||||
// TODO: implement onReady
|
// TODO: implement onReady
|
||||||
|
|||||||
441
lib/pages/layout/home/home_view copy.dart
Normal file
441
lib/pages/layout/home/home_view copy.dart
Normal file
@@ -0,0 +1,441 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:tdesign_flutter/tdesign_flutter.dart';
|
||||||
|
|
||||||
|
import '../../../utils/utils.dart';
|
||||||
|
import 'home_logic.dart';
|
||||||
|
|
||||||
|
class HomePage extends StatelessWidget {
|
||||||
|
const HomePage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final logic = Get.find<HomeLogic>();
|
||||||
|
final state = Get.find<HomeLogic>().state;
|
||||||
|
|
||||||
|
double statusBarHeight = MediaQuery.of(context).padding.top;
|
||||||
|
|
||||||
|
return PopScope(
|
||||||
|
canPop: false,
|
||||||
|
onPopInvoked: (_) {
|
||||||
|
ToolFn().isExit();
|
||||||
|
},
|
||||||
|
child: Scaffold(
|
||||||
|
body: Stack(
|
||||||
|
fit: StackFit.expand,
|
||||||
|
children: [
|
||||||
|
Image.asset(
|
||||||
|
'assets/images/home-tab-normal-bg.png',
|
||||||
|
fit: BoxFit.fitWidth,
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding:
|
||||||
|
EdgeInsets.only(top: statusBarHeight, left: 10, right: 10),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(50),
|
||||||
|
child: Image.network(
|
||||||
|
"https://pic.ziyuan.wang/user/guest/2023/12/微信图片_20231109211458_c1a41ab0fd7dd.jpg",
|
||||||
|
width: 50.0,
|
||||||
|
)),
|
||||||
|
const SizedBox(
|
||||||
|
width: 5,
|
||||||
|
),
|
||||||
|
const Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
"商家: GAGA酒吧",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.w500),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
"Huakk,欢迎回来!!!",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.w400),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
ToolFn.tips("点击了核销按钮");
|
||||||
|
},
|
||||||
|
child: const Icon(
|
||||||
|
Icons.qr_code_scanner,
|
||||||
|
size: 32,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 20,
|
||||||
|
),
|
||||||
|
Wrap(
|
||||||
|
direction: Axis.horizontal,
|
||||||
|
spacing: 70,
|
||||||
|
runSpacing: 10,
|
||||||
|
alignment: WrapAlignment.center,
|
||||||
|
children: logic.list.map((item) {
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
item["title"]!,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.grey,
|
||||||
|
fontSize: 15,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
item["value"]!,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.black,
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}).toList()),
|
||||||
|
// const SizedBox(
|
||||||
|
// height: 10,
|
||||||
|
// ),
|
||||||
|
ListView(shrinkWrap: true, children: [
|
||||||
|
Container(
|
||||||
|
constraints: const BoxConstraints.tightFor(
|
||||||
|
width: double.maxFinite,
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.blueAccent,
|
||||||
|
borderRadius: BorderRadius.circular(15),
|
||||||
|
),
|
||||||
|
child: Wrap(
|
||||||
|
direction: Axis.horizontal,
|
||||||
|
spacing: 25,
|
||||||
|
runSpacing: 10,
|
||||||
|
alignment: WrapAlignment.center,
|
||||||
|
children: logic.list2.map((item) {
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
ToolFn.tips("点击了${item["title"]}");
|
||||||
|
},
|
||||||
|
child: SizedBox(
|
||||||
|
height: 100,
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
item["value"]!,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
item["title"]!,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 15,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}).toList()),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
constraints: const BoxConstraints.tightFor(
|
||||||
|
width: double.maxFinite,
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.blueAccent,
|
||||||
|
borderRadius: BorderRadius.circular(15),
|
||||||
|
),
|
||||||
|
child: Wrap(
|
||||||
|
direction: Axis.horizontal,
|
||||||
|
spacing: 25,
|
||||||
|
runSpacing: 10,
|
||||||
|
alignment: WrapAlignment.center,
|
||||||
|
children: logic.list2.map((item) {
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
ToolFn.tips("点击了${item["title"]}");
|
||||||
|
},
|
||||||
|
child: SizedBox(
|
||||||
|
height: 100,
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
item["value"]!,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
item["title"]!,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 15,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}).toList()),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
constraints: const BoxConstraints.tightFor(
|
||||||
|
width: double.maxFinite,
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.blueAccent,
|
||||||
|
borderRadius: BorderRadius.circular(15),
|
||||||
|
),
|
||||||
|
child: Wrap(
|
||||||
|
direction: Axis.horizontal,
|
||||||
|
spacing: 25,
|
||||||
|
runSpacing: 10,
|
||||||
|
alignment: WrapAlignment.center,
|
||||||
|
children: logic.list2.map((item) {
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
ToolFn.tips("点击了${item["title"]}");
|
||||||
|
},
|
||||||
|
child: SizedBox(
|
||||||
|
height: 100,
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
item["value"]!,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
item["title"]!,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 15,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}).toList()),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
constraints: const BoxConstraints.tightFor(
|
||||||
|
width: double.maxFinite,
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.blueAccent,
|
||||||
|
borderRadius: BorderRadius.circular(15),
|
||||||
|
),
|
||||||
|
child: Wrap(
|
||||||
|
direction: Axis.horizontal,
|
||||||
|
spacing: 25,
|
||||||
|
runSpacing: 10,
|
||||||
|
alignment: WrapAlignment.center,
|
||||||
|
children: logic.list2.map((item) {
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
ToolFn.tips("点击了${item["title"]}");
|
||||||
|
},
|
||||||
|
child: SizedBox(
|
||||||
|
height: 100,
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
item["value"]!,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
item["title"]!,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 15,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}).toList()),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
constraints: const BoxConstraints.tightFor(
|
||||||
|
width: double.maxFinite,
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.blueAccent,
|
||||||
|
borderRadius: BorderRadius.circular(15),
|
||||||
|
),
|
||||||
|
child: Wrap(
|
||||||
|
direction: Axis.horizontal,
|
||||||
|
spacing: 25,
|
||||||
|
runSpacing: 10,
|
||||||
|
alignment: WrapAlignment.center,
|
||||||
|
children: logic.list2.map((item) {
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
ToolFn.tips("点击了${item["title"]}");
|
||||||
|
},
|
||||||
|
child: SizedBox(
|
||||||
|
height: 100,
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
item["value"]!,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
item["title"]!,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 15,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}).toList()),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
constraints: const BoxConstraints.tightFor(
|
||||||
|
width: double.maxFinite,
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.blueAccent,
|
||||||
|
borderRadius: BorderRadius.circular(15),
|
||||||
|
),
|
||||||
|
child: Wrap(
|
||||||
|
direction: Axis.horizontal,
|
||||||
|
spacing: 25,
|
||||||
|
runSpacing: 10,
|
||||||
|
alignment: WrapAlignment.center,
|
||||||
|
children: logic.list2.map((item) {
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
ToolFn.tips("点击了${item["title"]}");
|
||||||
|
},
|
||||||
|
child: SizedBox(
|
||||||
|
height: 100,
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
item["value"]!,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
item["title"]!,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 15,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}).toList()),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
constraints: const BoxConstraints.tightFor(
|
||||||
|
width: double.maxFinite,
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.blueAccent,
|
||||||
|
borderRadius: BorderRadius.circular(15),
|
||||||
|
),
|
||||||
|
child: Wrap(
|
||||||
|
direction: Axis.horizontal,
|
||||||
|
spacing: 25,
|
||||||
|
runSpacing: 10,
|
||||||
|
alignment: WrapAlignment.center,
|
||||||
|
children: logic.list2.map((item) {
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
ToolFn.tips("点击了${item["title"]}");
|
||||||
|
},
|
||||||
|
child: SizedBox(
|
||||||
|
height: 100,
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
item["value"]!,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
item["title"]!,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 15,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}).toList()),
|
||||||
|
),
|
||||||
|
]),
|
||||||
|
],
|
||||||
|
))
|
||||||
|
],
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -13,80 +13,146 @@ class HomePage extends StatelessWidget {
|
|||||||
final logic = Get.find<HomeLogic>();
|
final logic = Get.find<HomeLogic>();
|
||||||
final state = Get.find<HomeLogic>().state;
|
final state = Get.find<HomeLogic>().state;
|
||||||
|
|
||||||
double statusBarHeight = MediaQuery.of(context).padding.top;
|
|
||||||
|
|
||||||
return PopScope(
|
return PopScope(
|
||||||
canPop: false,
|
canPop: false,
|
||||||
onPopInvoked: (_) {
|
onPopInvoked: (_) {
|
||||||
ToolFn().isExit();
|
ToolFn().isExit();
|
||||||
},
|
},
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
body: Stack(
|
body: Container(
|
||||||
fit: StackFit.expand,
|
padding: const EdgeInsets.only(top: 0, left: 10, right: 10),
|
||||||
children: [
|
decoration: const BoxDecoration(
|
||||||
Image.asset(
|
image: DecorationImage(
|
||||||
'assets/images/home-tab-normal-bg.png',
|
image: AssetImage('assets/images/home-tab-normal-bg.png'),
|
||||||
fit: BoxFit.fitWidth,
|
fit: BoxFit.cover,
|
||||||
),
|
),
|
||||||
Padding(
|
),
|
||||||
padding:
|
child: ListView(
|
||||||
EdgeInsets.only(top: statusBarHeight, left: 10, right: 10),
|
children: [
|
||||||
child: Column(
|
Row(
|
||||||
children: [
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
Row(
|
children: [
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
Row(
|
||||||
|
children: [
|
||||||
|
ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(50),
|
||||||
|
child: Image.network(
|
||||||
|
"https://pic.ziyuan.wang/user/guest/2023/12/微信图片_20231109211458_c1a41ab0fd7dd.jpg",
|
||||||
|
width: 50.0,
|
||||||
|
)),
|
||||||
|
const SizedBox(
|
||||||
|
width: 5,
|
||||||
|
),
|
||||||
|
const Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
"商家: GAGA酒吧",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16, fontWeight: FontWeight.w500),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
"Huakk,欢迎回来!!!",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16, fontWeight: FontWeight.w400),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
ToolFn.tips("点击了核销按钮");
|
||||||
|
},
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.qr_code_scanner,
|
||||||
|
size: 32,
|
||||||
|
))
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 20,
|
||||||
|
),
|
||||||
|
Wrap(
|
||||||
|
direction: Axis.horizontal,
|
||||||
|
spacing: 70,
|
||||||
|
runSpacing: 10,
|
||||||
|
alignment: WrapAlignment.center,
|
||||||
|
children: logic.list.map((item) {
|
||||||
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Text(
|
||||||
children: [
|
item["title"]!,
|
||||||
ClipRRect(
|
style: const TextStyle(
|
||||||
borderRadius: BorderRadius.circular(50),
|
color: Colors.grey,
|
||||||
child: Image.network(
|
fontSize: 15,
|
||||||
"https://pic.ziyuan.wang/user/guest/2023/12/微信图片_20231109211458_c1a41ab0fd7dd.jpg",
|
),
|
||||||
width: 50.0,
|
),
|
||||||
)),
|
Text(
|
||||||
const SizedBox(
|
item["value"]!,
|
||||||
width: 5,
|
style: const TextStyle(
|
||||||
),
|
color: Colors.black,
|
||||||
const Column(
|
fontSize: 20,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
fontWeight: FontWeight.bold),
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
"商家: GAGA酒吧",
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 16,
|
|
||||||
fontWeight: FontWeight.w500),
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
"Huakk,欢迎回来!!!",
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 16,
|
|
||||||
fontWeight: FontWeight.w400),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
const Row(
|
|
||||||
children: [
|
|
||||||
Icon(
|
|
||||||
TDIcons.search,
|
|
||||||
size: 35,
|
|
||||||
),
|
|
||||||
Icon(
|
|
||||||
TDIcons.scan,
|
|
||||||
size: 35,
|
|
||||||
),
|
|
||||||
Icon(
|
|
||||||
TDIcons.sound,
|
|
||||||
size: 35,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
],
|
],
|
||||||
)
|
);
|
||||||
],
|
}).toList()),
|
||||||
))
|
const SizedBox(
|
||||||
],
|
height: 10,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
constraints: const BoxConstraints.tightFor(
|
||||||
|
width: double.maxFinite,
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.blueAccent,
|
||||||
|
borderRadius: BorderRadius.circular(15),
|
||||||
|
),
|
||||||
|
child: Wrap(
|
||||||
|
direction: Axis.horizontal,
|
||||||
|
spacing: 25,
|
||||||
|
runSpacing: 10,
|
||||||
|
alignment: WrapAlignment.center,
|
||||||
|
children: logic.list2.map((item) {
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
ToolFn.tips("点击了${item["title"]}");
|
||||||
|
},
|
||||||
|
child: SizedBox(
|
||||||
|
height: 100,
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
item["value"]!,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
item["title"]!,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 15,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}).toList()),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
|
|
||||||
class TabState {
|
class TabState {
|
||||||
late int currentPage;
|
|
||||||
PageController? pageController;
|
PageController? pageController;
|
||||||
|
|
||||||
|
late int currentPage;
|
||||||
|
|
||||||
TabState() {
|
TabState() {
|
||||||
///Initialize variables
|
///Initialize variables
|
||||||
currentPage = 0;
|
currentPage = 0;
|
||||||
|
|||||||
@@ -17,17 +17,15 @@ class TabPage extends StatelessWidget {
|
|||||||
|
|
||||||
/// 内容页
|
/// 内容页
|
||||||
Widget buildPageView() {
|
Widget buildPageView() {
|
||||||
return GetBuilder<TabLogic>(builder: (_) {
|
return PageView(
|
||||||
return PageView(
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
controller: state.pageController,
|
||||||
controller: state.pageController,
|
onPageChanged: logic.handlePageChanged,
|
||||||
onPageChanged: logic.handlePageChanged,
|
children: const <Widget>[
|
||||||
children: const <Widget>[
|
HomePage(),
|
||||||
HomePage(),
|
UserPage(),
|
||||||
UserPage(),
|
],
|
||||||
],
|
);
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
List<BottomNavigationBarItem> createBottomItems() {
|
List<BottomNavigationBarItem> createBottomItems() {
|
||||||
@@ -60,30 +58,30 @@ class TabPage extends StatelessWidget {
|
|||||||
/// 底部导航
|
/// 底部导航
|
||||||
Widget buildBottomNavigationBar() {
|
Widget buildBottomNavigationBar() {
|
||||||
List<BottomNavigationBarItem> bottomItems = createBottomItems();
|
List<BottomNavigationBarItem> bottomItems = createBottomItems();
|
||||||
return GetBuilder<TabLogic>(builder: (_) {
|
return BottomNavigationBar(
|
||||||
return BottomNavigationBar(
|
items: bottomItems,
|
||||||
items: bottomItems,
|
currentIndex: state.currentPage,
|
||||||
currentIndex: state.currentPage,
|
backgroundColor: Colors.white,
|
||||||
backgroundColor: Colors.white,
|
unselectedItemColor: Colors.grey,
|
||||||
unselectedItemColor: Colors.grey,
|
selectedItemColor: const Color.fromRGBO(0, 82, 217, 1),
|
||||||
selectedItemColor: const Color.fromRGBO(0, 82, 217, 1),
|
type: BottomNavigationBarType.fixed,
|
||||||
type: BottomNavigationBarType.fixed,
|
onTap: logic.handleNavBarTap,
|
||||||
onTap: logic.handleNavBarTap,
|
selectedFontSize: 10.sp,
|
||||||
selectedFontSize: 10.sp,
|
unselectedFontSize: 10.sp,
|
||||||
unselectedFontSize: 10.sp,
|
iconSize: 32.w,
|
||||||
iconSize: 32.w,
|
);
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return PopScope(
|
return GetBuilder<TabLogic>(builder: (_) {
|
||||||
canPop: false,
|
return PopScope(
|
||||||
onPopInvoked: (_) {
|
canPop: false,
|
||||||
ToolFn().isExit();
|
onPopInvoked: (_) {
|
||||||
},
|
ToolFn().isExit();
|
||||||
child: Scaffold(
|
},
|
||||||
body: buildPageView(),
|
child: Scaffold(
|
||||||
bottomNavigationBar: buildBottomNavigationBar(),
|
body: buildPageView(),
|
||||||
));
|
bottomNavigationBar: buildBottomNavigationBar(),
|
||||||
|
));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,10 +18,14 @@ class AppPages {
|
|||||||
binding: SplashBinding()),
|
binding: SplashBinding()),
|
||||||
GetPage(
|
GetPage(
|
||||||
name: AppPages.login, page: () => LoginPage(), binding: LoginBinding()),
|
name: AppPages.login, page: () => LoginPage(), binding: LoginBinding()),
|
||||||
// GetPage(
|
GetPage(
|
||||||
// name: AppPages.home, page: () => HomePage(), binding: HomeBinding()),
|
name: AppPages.home,
|
||||||
// GetPage(
|
page: () => const HomePage(),
|
||||||
// name: AppPages.user, page: () => UserPage(), binding: UserBinding()),
|
binding: HomeBinding()),
|
||||||
|
GetPage(
|
||||||
|
name: AppPages.user,
|
||||||
|
page: () => const UserPage(),
|
||||||
|
binding: UserBinding()),
|
||||||
GetPage(
|
GetPage(
|
||||||
name: AppPages.tab, page: () => const TabPage(), binding: TabBinding()),
|
name: AppPages.tab, page: () => const TabPage(), binding: TabBinding()),
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
|
import 'package:flutter_jdt_store/global.dart';
|
||||||
import 'package:flutter_jdt_store/utils/utils.dart';
|
import 'package:flutter_jdt_store/utils/utils.dart';
|
||||||
|
import '../global.dart';
|
||||||
|
|
||||||
class Request {
|
class Request {
|
||||||
// 构造函数
|
// 构造函数
|
||||||
@@ -11,10 +13,9 @@ class Request {
|
|||||||
|
|
||||||
static void init() {
|
static void init() {
|
||||||
// 基本配置
|
// 基本配置
|
||||||
_dio.options.baseUrl =
|
_dio.options.baseUrl = Global.baseUrl;
|
||||||
"https://www.wanzhuanyongcheng.cn/app"; // 替换为你的 API 地址
|
_dio.options.connectTimeout = const Duration(seconds: 10);
|
||||||
_dio.options.connectTimeout = const Duration(seconds: 15); // 连接超时时间,单位是毫秒
|
_dio.options.receiveTimeout = const Duration(seconds: 10);
|
||||||
_dio.options.receiveTimeout = const Duration(seconds: 15); // 接收超时时间,单位是毫秒
|
|
||||||
|
|
||||||
_dio.options.headers["Content-Type"] = "application/json; charset=utf-8";
|
_dio.options.headers["Content-Type"] = "application/json; charset=utf-8";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user