Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 056ae914ce | |||
| 022443476c | |||
| 93f4f87e44 | |||
| 20e7d07be3 | |||
| 1834740676 |
+11
-3
@@ -5,14 +5,22 @@ All notable changes to this project will be documented in this file.
|
|||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
## [1.0.12] - 2026-06-04
|
## [1.0.15] - 2026-06-05
|
||||||
|
|
||||||
|
### 修复
|
||||||
|
- 修复 Windows 桌面端打印卡死:打印字体由 OpenType/CFF 改为 TrueType(glyf),dart_pdf 渲染中文不再抛错(此前点「打印」后卡死)
|
||||||
|
|
||||||
|
### 改进
|
||||||
|
- 「关于我们」内容改为真实信息(服务商:岩美技术有限公司;网站:jiu.yanmei.com;邮箱:yammy2023@163.com),且统一从配置文件读取,不再硬编码
|
||||||
|
- Windows 桌面端窗口标题由 jiu_client 改为「岩美酒库」
|
||||||
|
|
||||||
|
## [1.0.13] - 2026-06-04
|
||||||
|
|
||||||
### 新功能
|
### 新功能
|
||||||
- Windows 客户端改为提供安装程序(Inno Setup 打包的 `jiu-windows-x64-setup.exe`,含中文向导、桌面/开始菜单快捷方式、卸载项),不再是解压版 zip
|
- Windows 客户端改为提供安装程序(Inno Setup 打包的 `jiu-windows-x64-setup.exe`,含安装向导、桌面/开始菜单快捷方式、卸载项),不再是解压版 zip
|
||||||
|
|
||||||
### 修复
|
### 修复
|
||||||
- 修复客户端「无法安全下载」:下载地址从内网 HTTP Forgejo(`http://192.168.3.200:3000`,公网不可达且被浏览器拦截)改为同源 HTTPS `https://jiu.51yanmei.com/downloads/...`,Windows、macOS 均生效
|
- 修复客户端「无法安全下载」:下载地址从内网 HTTP Forgejo(`http://192.168.3.200:3000`,公网不可达且被浏览器拦截)改为同源 HTTPS `https://jiu.51yanmei.com/downloads/...`,Windows、macOS 均生效
|
||||||
- 修复 ISCC 编译报「more than one script filename」:调用 Inno Setup 时关闭 Git Bash 的 MSYS 参数路径转换,避免 `/D` 定义参数被改写
|
|
||||||
- 部署时将最新安装包发布到 web 服务(`/opt/jiu/downloads/`,nginx `/downloads/` 提供),仅保留最新版本(清旧放新)
|
- 部署时将最新安装包发布到 web 服务(`/opt/jiu/downloads/`,nginx `/downloads/` 提供),仅保留最新版本(清旧放新)
|
||||||
|
|
||||||
## [1.0.9] - 2026-06-04
|
## [1.0.9] - 2026-06-04
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"provider": "岩美技术有限公司",
|
||||||
|
"website": "https://jiu.yanmei.com",
|
||||||
|
"email": "yammy2023@163.com"
|
||||||
|
}
|
||||||
Binary file not shown.
@@ -0,0 +1,28 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
import 'package:flutter/foundation.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
|
|
||||||
|
/// 应用「关于我们」等品牌信息,从配置文件 assets/config/app_info.json 读取,
|
||||||
|
/// 不硬编码、不走环境变量。在 main() 启动时调用 [load] 加载一次。
|
||||||
|
class AppInfo {
|
||||||
|
const AppInfo._();
|
||||||
|
|
||||||
|
static const _assetPath = 'assets/config/app_info.json';
|
||||||
|
|
||||||
|
static String provider = '';
|
||||||
|
static String website = '';
|
||||||
|
static String email = '';
|
||||||
|
|
||||||
|
/// 加载配置文件。失败时保留为空(不影响应用启动)。
|
||||||
|
static Future<void> load() async {
|
||||||
|
try {
|
||||||
|
final raw = await rootBundle.loadString(_assetPath);
|
||||||
|
final map = jsonDecode(raw) as Map<String, dynamic>;
|
||||||
|
provider = (map['provider'] as String?) ?? '';
|
||||||
|
website = (map['website'] as String?) ?? '';
|
||||||
|
email = (map['email'] as String?) ?? '';
|
||||||
|
} catch (e) {
|
||||||
|
debugPrint('AppInfo.load failed: $e');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,6 +4,7 @@ import 'package:flutter_localizations/flutter_localizations.dart';
|
|||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
import 'package:flutter_web_plugins/url_strategy.dart';
|
import 'package:flutter_web_plugins/url_strategy.dart';
|
||||||
import 'core/auth/auth_state.dart';
|
import 'core/auth/auth_state.dart';
|
||||||
|
import 'core/config/app_info.dart';
|
||||||
import 'core/errors/error_reporter.dart';
|
import 'core/errors/error_reporter.dart';
|
||||||
import 'core/router/app_router.dart';
|
import 'core/router/app_router.dart';
|
||||||
import 'core/theme/app_theme.dart';
|
import 'core/theme/app_theme.dart';
|
||||||
@@ -24,7 +25,11 @@ void main() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
runZonedGuarded(
|
runZonedGuarded(
|
||||||
() => runApp(const ProviderScope(child: JiuApp())),
|
() async {
|
||||||
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
|
await AppInfo.load(); // 从配置文件加载「关于我们」品牌信息
|
||||||
|
runApp(const ProviderScope(child: JiuApp()));
|
||||||
|
},
|
||||||
(error, stack) {
|
(error, stack) {
|
||||||
debugPrint('═══ Zone Error ═══════════════════════════════');
|
debugPrint('═══ Zone Error ═══════════════════════════════');
|
||||||
debugPrint(error.toString());
|
debugPrint(error.toString());
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import 'package:intl/intl.dart';
|
|||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
import '../../core/auth/auth_state.dart';
|
import '../../core/auth/auth_state.dart';
|
||||||
import '../../core/config/app_config.dart';
|
import '../../core/config/app_config.dart';
|
||||||
|
import '../../core/config/app_info.dart';
|
||||||
import '../../core/theme/app_theme.dart';
|
import '../../core/theme/app_theme.dart';
|
||||||
import '../../models/number_rule.dart';
|
import '../../models/number_rule.dart';
|
||||||
import '../../models/user.dart';
|
import '../../models/user.dart';
|
||||||
@@ -828,9 +829,9 @@ class _SettingsScreenState extends ConsumerState<SettingsScreen> {
|
|||||||
_AboutSection(
|
_AboutSection(
|
||||||
title: '关于我们',
|
title: '关于我们',
|
||||||
children: [
|
children: [
|
||||||
const _AboutRow(label: '开发商', value: '酒库科技有限公司'),
|
_AboutRow(label: '服务商', value: AppInfo.provider),
|
||||||
const _AboutRow(label: '官方网站', value: 'https://jiu.example.com'),
|
_AboutRow(label: '官方网站', value: AppInfo.website),
|
||||||
const _AboutRow(label: '联系邮箱', value: 'support@jiu.example.com'),
|
_AboutRow(label: '联系邮箱', value: AppInfo.email),
|
||||||
const _AboutRow(label: '技术支持', value: '周一至周五 9:00 - 18:00'),
|
const _AboutRow(label: '技术支持', value: '周一至周五 9:00 - 18:00'),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
Wrap(
|
Wrap(
|
||||||
@@ -838,8 +839,8 @@ class _SettingsScreenState extends ConsumerState<SettingsScreen> {
|
|||||||
children: [
|
children: [
|
||||||
OutlinedButton.icon(
|
OutlinedButton.icon(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
final uri = Uri.parse('mailto:support@jiu.example.com'
|
final uri = Uri.parse(
|
||||||
'?subject=酒库管理系统咨询');
|
'mailto:${AppInfo.email}?subject=酒库管理系统咨询');
|
||||||
if (await canLaunchUrl(uri)) launchUrl(uri);
|
if (await canLaunchUrl(uri)) launchUrl(uri);
|
||||||
},
|
},
|
||||||
icon: const Icon(Icons.email_outlined, size: 16),
|
icon: const Icon(Icons.email_outlined, size: 16),
|
||||||
@@ -887,17 +888,14 @@ class _SettingsScreenState extends ConsumerState<SettingsScreen> {
|
|||||||
context: context,
|
context: context,
|
||||||
builder: (ctx) => AlertDialog(
|
builder: (ctx) => AlertDialog(
|
||||||
title: const Text('续费 / 升级授权'),
|
title: const Text('续费 / 升级授权'),
|
||||||
content: const Column(
|
content: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text('请联系我们获取续费报价:'),
|
const Text('请联系我们获取续费报价:'),
|
||||||
SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
SelectableText('📧 support@jiu.example.com',
|
SelectableText('📧 ${AppInfo.email}',
|
||||||
style: TextStyle(fontSize: 13)),
|
style: const TextStyle(fontSize: 13)),
|
||||||
SizedBox(height: 6),
|
|
||||||
SelectableText('📞 400-000-0000',
|
|
||||||
style: TextStyle(fontSize: 13)),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
actions: [
|
actions: [
|
||||||
@@ -908,7 +906,7 @@ class _SettingsScreenState extends ConsumerState<SettingsScreen> {
|
|||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
await Clipboard.setData(
|
await Clipboard.setData(
|
||||||
const ClipboardData(text: 'support@jiu.example.com'));
|
ClipboardData(text: AppInfo.email));
|
||||||
if (ctx.mounted) {
|
if (ctx.mounted) {
|
||||||
Navigator.pop(ctx);
|
Navigator.pop(ctx);
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
@@ -952,7 +950,7 @@ class _SettingsScreenState extends ConsumerState<SettingsScreen> {
|
|||||||
final subject = Uri.encodeComponent(isBug ? 'Bug反馈' : '功能建议');
|
final subject = Uri.encodeComponent(isBug ? 'Bug反馈' : '功能建议');
|
||||||
final body = Uri.encodeComponent(ctrl.text);
|
final body = Uri.encodeComponent(ctrl.text);
|
||||||
final uri = Uri.parse(
|
final uri = Uri.parse(
|
||||||
'mailto:support@jiu.example.com?subject=$subject&body=$body');
|
'mailto:${AppInfo.email}?subject=$subject&body=$body');
|
||||||
if (await canLaunchUrl(uri)) launchUrl(uri);
|
if (await canLaunchUrl(uri)) launchUrl(uri);
|
||||||
if (ctx.mounted) Navigator.pop(ctx);
|
if (ctx.mounted) Navigator.pop(ctx);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -37,3 +37,4 @@ flutter:
|
|||||||
|
|
||||||
assets:
|
assets:
|
||||||
- assets/fonts/NotoSansSC-Regular.ttf
|
- assets/fonts/NotoSansSC-Regular.ttf
|
||||||
|
- assets/config/app_info.json
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:pdf/widgets.dart' as pw;
|
||||||
|
|
||||||
|
// 回归测试:打印用的中文字体必须是 TrueType(glyf) 轮廓。
|
||||||
|
// 若误用 OpenType/CFF 字体(如 Noto 的 .otf),dart_pdf 渲染中文会抛
|
||||||
|
// "This font does not support Unicode characters",标签打印会在原生 onLayout
|
||||||
|
// 回调里抛异常导致 Windows 打印卡死。此测试确保打印 PDF 能正常生成中文。
|
||||||
|
void main() {
|
||||||
|
TestWidgetsFlutterBinding.ensureInitialized();
|
||||||
|
|
||||||
|
test('打印字体能渲染中文(防止退回 CFF 字体导致打印卡死)', () async {
|
||||||
|
final data = await rootBundle.load('assets/fonts/NotoSansSC-Regular.ttf');
|
||||||
|
final font = pw.Font.ttf(data);
|
||||||
|
|
||||||
|
final doc = pw.Document();
|
||||||
|
doc.addPage(pw.Page(
|
||||||
|
build: (_) => pw.Text('入库单 茅台飞天 53度 500ml 扫码溯源',
|
||||||
|
style: pw.TextStyle(font: font, fontSize: 12)),
|
||||||
|
));
|
||||||
|
|
||||||
|
// 若字体是 CFF,会在此抛 Latin1/Unicode 异常。
|
||||||
|
final bytes = await doc.save();
|
||||||
|
expect(bytes.isNotEmpty, true);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -2,6 +2,8 @@
|
|||||||
#include <flutter/flutter_view_controller.h>
|
#include <flutter/flutter_view_controller.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include "flutter_window.h"
|
#include "flutter_window.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
@@ -27,7 +29,19 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
|
|||||||
FlutterWindow window(project);
|
FlutterWindow window(project);
|
||||||
Win32Window::Point origin(10, 10);
|
Win32Window::Point origin(10, 10);
|
||||||
Win32Window::Size size(1280, 720);
|
Win32Window::Size size(1280, 720);
|
||||||
if (!window.Create(L"jiu_client", origin, size)) {
|
// Window title as UTF-8 bytes (hex-escaped to keep this source pure ASCII and
|
||||||
|
// avoid MSVC C4819 under GBK code page 936). Decoded to UTF-16 for Win32.
|
||||||
|
// Bytes below are the UTF-8 encoding of the Chinese app title.
|
||||||
|
const std::string title_utf8 =
|
||||||
|
"\xE5\xB2\xA9\xE7\xBE\x8E\xE9\x85\x92\xE5\xBA\x93";
|
||||||
|
int title_len = ::MultiByteToWideChar(CP_UTF8, 0, title_utf8.c_str(), -1,
|
||||||
|
nullptr, 0);
|
||||||
|
std::wstring window_title(title_len > 0 ? title_len - 1 : 0, L'\0');
|
||||||
|
if (title_len > 0) {
|
||||||
|
::MultiByteToWideChar(CP_UTF8, 0, title_utf8.c_str(), -1, &window_title[0],
|
||||||
|
title_len);
|
||||||
|
}
|
||||||
|
if (!window.Create(window_title, origin, size)) {
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
window.SetQuitOnClose(true);
|
window.SetQuitOnClose(true);
|
||||||
|
|||||||
@@ -35,8 +35,9 @@ ArchitecturesInstallIn64BitMode=x64
|
|||||||
UninstallDisplayName={#MyAppName}
|
UninstallDisplayName={#MyAppName}
|
||||||
UninstallDisplayIcon={app}\{#MyAppExe}
|
UninstallDisplayIcon={app}\{#MyAppExe}
|
||||||
|
|
||||||
[Languages]
|
; 说明:未声明 [Languages],使用 Inno Setup 内置英文向导(简体中文语言文件
|
||||||
Name: "chinesesimp"; MessagesFile: "compiler:Languages\ChineseSimplified.isl"
|
; ChineseSimplified.isl 默认不随 Inno Setup 安装,依赖它会导致编译找不到文件)。
|
||||||
|
; app 名称与快捷方式仍为中文(下方 UTF-8 字符串,与向导语言无关)。
|
||||||
|
|
||||||
[Tasks]
|
[Tasks]
|
||||||
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: checkedonce
|
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: checkedonce
|
||||||
|
|||||||
Reference in New Issue
Block a user