This commit is contained in:
2026-09-11 10:45:04 +08:00
parent 5c8c0f6ad7
commit 9b34426c9f
8 changed files with 54 additions and 12 deletions
@@ -6,7 +6,7 @@ import '../models/model_manager.dart';
String _variantLabel(String v) => v == kVariantN ? '高性能' : '高精度'; String _variantLabel(String v) => v == kVariantN ? '高性能' : '高精度';
/// 设置弹层「模型清单」区块:顶部「识别档位」分段控件(高性能/高精度,默认 /// 设置弹层「模型清单」区块:顶部「识别档位」分段控件(高性能/高精度,默认
/// 高精度,持久化本地)选择**目标档位**——只记录偏好,不直接切换运行中的 /// 高性能,持久化本地)选择**目标档位**——只记录偏好,不直接切换运行中的
/// 模型,决定卡片主按钮面向哪一档(2026-09-11 回归单按钮制:卡内不再同列 /// 模型,决定卡片主按钮面向哪一档(2026-09-11 回归单按钮制:卡内不再同列
/// 两档按钮)。多物种综合识别 App 端下线(2026-09-11):目录中 combined 条目 /// 两档按钮)。多物种综合识别 App 端下线(2026-09-11):目录中 combined 条目
/// 直接忽略、不展示,服务端/管理端综合训练功能保持不变。下方 2 列封面网格, /// 直接忽略、不展示,服务端/管理端综合训练功能保持不变。下方 2 列封面网格,
+3 -3
View File
@@ -3,17 +3,17 @@ class AppConfig {
/// 后端服务器地址(订单创建/授权查询/套餐价格) /// 后端服务器地址(订单创建/授权查询/套餐价格)
/// 默认指向线上域名;本地联调构建时用 --dart-define=API_BASE_URL=http://127.0.0.1:8080 覆盖 /// 默认指向线上域名;本地联调构建时用 --dart-define=API_BASE_URL=http://127.0.0.1:8080 覆盖
static const String apiBaseUrl = String.fromEnvironment('API_BASE_URL', static const String apiBaseUrl = String.fromEnvironment('API_BASE_URL',
defaultValue: 'http://observer.redpowerfuture.com'); defaultValue: 'https://animal-spot.icu');
/// 微信开放平台 AppID(需在微信开放平台注册包名+签名) /// 微信开放平台 AppID(需在微信开放平台注册包名+签名)
static const String wechatAppId = 'wx0000000000000000'; static const String wechatAppId = 'wx0000000000000000';
static const String wechatUniversalLink = static const String wechatUniversalLink =
'https://YOUR_DOMAIN.com/wechat/'; 'https://animal-spot.icu/wechat/';
/// 支付宝开放平台 AppID /// 支付宝开放平台 AppID
static const String alipayAppId = '2020000000000000'; static const String alipayAppId = '2020000000000000';
static const String alipayUniversalLink = static const String alipayUniversalLink =
'https://YOUR_DOMAIN.com/alipay/'; 'https://animal-spot.icu/alipay/';
/// iOS URL Scheme(微信/支付宝拉起回调,需与 Info.plist 一致) /// iOS URL Scheme(微信/支付宝拉起回调,需与 Info.plist 一致)
static const String wechatUrlScheme = 'wx0000000000000000'; static const String wechatUrlScheme = 'wx0000000000000000';
+2 -1
View File
@@ -134,7 +134,8 @@ class ModelManager extends ChangeNotifier {
final Map<ModelKey, double> _progress = {}; final Map<ModelKey, double> _progress = {};
final Map<ModelKey, String> _errors = {}; final Map<ModelKey, String> _errors = {};
final Set<ModelKey> _cancelRequested = {}; final Set<ModelKey> _cancelRequested = {};
String _mode = kVariantS; // 默认高性能(n):未持久化偏好时的新装默认档(2026-09-11 用户定案)
String _mode = kVariantN;
bool _modeLoaded = false; bool _modeLoaded = false;
bool _ready = false; bool _ready = false;
bool _refreshing = false; bool _refreshing = false;
+2 -2
View File
@@ -2,7 +2,7 @@ name: observer
description: "视野 - 动物实时识别 (环颈雉鸡/生境), YOLOv8 + 充值付费" description: "视野 - 动物实时识别 (环颈雉鸡/生境), YOLOv8 + 充值付费"
publish_to: 'none' publish_to: 'none'
version: 1.0.39+44 version: 1.0.40+45
environment: environment:
sdk: ^3.12.2 sdk: ^3.12.2
@@ -44,7 +44,7 @@ fluwx:
tobias: tobias:
url_scheme: alipay0000000000 url_scheme: alipay0000000000
ios: ios:
universal_link: https://YOUR_DOMAIN.com/alipay/ universal_link: https://animal-spot.icu/alipay/
# camera_android_camerax 屏蔽:Android 相机走自写 CameraChannel,不需要 CameraX # camera_android_camerax 屏蔽:Android 相机走自写 CameraChannel,不需要 CameraX
# 插件注册即初始化 CameraX,无相机环境(模拟器)下回调线程直接 # 插件注册即初始化 CameraX,无相机环境(模拟器)下回调线程直接
+35
View File
@@ -0,0 +1,35 @@
package common
import (
"os"
"github.com/gogf/gf/v2/os/gcfg"
"github.com/gogf/gf/v2/frame/g"
)
// init 数据库配置的环境变量覆盖(同一份 config.yml 线上线下通用,不用改文件切环境):
// Docker 部署由 docker-compose 注入 DB_HOST/DB_NAME 指向容器网络内的 postgres
// 本地开发不注入,走 config.yml 默认值(127.0.0.1/animal_spot)。
// Set 是纯内存覆盖(不落盘),且必须发生在任何 g.DB() 调用(含 dao 包 init 建表)之前——
// common 包先于依赖它的 dao 包初始化,天然满足时序。
func init() {
overrides := [][2]string{
{"DB_HOST", "database.default.host"},
{"DB_NAME", "database.default.name"},
{"DB_PORT", "database.default.port"},
{"DB_USER", "database.default.user"},
{"DB_PASS", "database.default.pass"},
}
adapter, ok := g.Cfg().GetAdapter().(*gcfg.AdapterFile)
if !ok {
panic("数据库环境变量覆盖失败:默认配置适配器不是文件适配器")
}
for _, kv := range overrides {
if v := os.Getenv(kv[0]); v != "" {
if err := adapter.Set(kv[1], v); err != nil {
panic("环境变量覆盖配置失败 " + kv[0] + ": " + err.Error())
}
}
}
}
+6 -3
View File
@@ -8,7 +8,10 @@ server:
database: database:
default: default:
type: pgsql type: pgsql
# PostgreSQL 连接(本机 Docker pg16 容器;分字段写法规避密码特殊字符的 URL 转义问题) # PostgreSQL 连接(分字段写法规避密码特殊字符的 URL 转义问题)
# 下面是本地开发默认值;服务器部署由 docker-compose 只注入 DB_HOST=postgres(容器名直连),
# 库名等其余项两边一致直接用这里的默认值。见 common/config_env.go(支持 DB_HOST/DB_NAME/
# DB_PORT/DB_USER/DB_PASS 五项,按需注入)。
host: "127.0.0.1" host: "127.0.0.1"
port: "5432" port: "5432"
user: "259278618@qq.com" user: "259278618@qq.com"
@@ -180,11 +183,11 @@ payment:
apiV3Key: "" # APIv3 密钥 apiV3Key: "" # APIv3 密钥
serialNo: "" # 商户证书序列号 serialNo: "" # 商户证书序列号
privateKey: "" # 商户 API 私钥文件路径(PEM) privateKey: "" # 商户 API 私钥文件路径(PEM)
notifyUrl: "" # 回调地址,如 https://api.example.com/api/v1/payment/wechat/notify notifyUrl: "" # 回调地址,如 https://animal-spot.icu/api/v1/payment/wechat/notify
alipay: alipay:
# 支付宝 APP 支付,未配置时接口返回「支付未配置」 # 支付宝 APP 支付,未配置时接口返回「支付未配置」
appid: "" # 开放平台 AppID appid: "" # 开放平台 AppID
privateKey: "" # 应用私钥文件路径(PEM) privateKey: "" # 应用私钥文件路径(PEM)
alipayPublicKey: "" # 支付宝公钥文件路径(PEM) alipayPublicKey: "" # 支付宝公钥文件路径(PEM)
sellerId: "" # 收款方 PID(回调校验 app_id/seller_id 用) sellerId: "" # 收款方 PID(回调校验 app_id/seller_id 用)
notifyUrl: "" # 回调地址,如 https://api.example.com/api/v1/payment/alipay/notify notifyUrl: "" # 回调地址,如 https://animal-spot.icu/api/v1/payment/alipay/notify
+3
View File
@@ -20,5 +20,8 @@ services:
- /workspace:/app/workspace - /workspace:/app/workspace
environment: environment:
TZ: Asia/Shanghai TZ: Asia/Shanghai
# 数据库 host 覆盖(同一份 config.yml:线上注入容器名连 postgres,本地不注入走默认值 127.0.0.1;
# 库名等其余项两边一致直接用配置默认值。机制见 common/config_env.go
DB_HOST: postgres
networks: networks:
- redfuture-net - redfuture-net
+2 -2
View File
@@ -82,7 +82,7 @@
<div class="app-name">视野</div> <div class="app-name">视野</div>
<div class="app-slogan">动物实时识别</div> <div class="app-slogan">动物实时识别</div>
<div class="version-tip">Android 版</div> <div class="version-tip">Android 版</div>
<a class="btn-download" href="http://observer.redpowerfuture.com/download/observer-latest.apk"> <a class="btn-download" href="https://animal-spot.icu/download/observer-latest.apk">
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true"> <svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
<path d="M12 3a1 1 0 0 1 1 1v9.6l3.3-3.3a1 1 0 1 1 1.4 1.4l-5 5a1 1 0 0 1-1.4 0l-5-5a1 1 0 1 1 1.4-1.4l3.3 3.3V4a1 1 0 0 1 1-1zM5 20a1 1 0 0 1 1-1h12a1 1 0 1 1 0 2H6a1 1 0 0 1-1-1z" fill="#fff"/> <path d="M12 3a1 1 0 0 1 1 1v9.6l3.3-3.3a1 1 0 1 1 1.4 1.4l-5 5a1 1 0 0 1-1.4 0l-5-5a1 1 0 1 1 1.4-1.4l3.3 3.3V4a1 1 0 0 1 1-1zM5 20a1 1 0 0 1 1-1h12a1 1 0 1 1 0 2H6a1 1 0 0 1-1-1z" fill="#fff"/>
</svg> </svg>
@@ -107,7 +107,7 @@
<rect x="136" y="27" width="6" height="6" rx="1.5" fill="#1f2329"/> <rect x="136" y="27" width="6" height="6" rx="1.5" fill="#1f2329"/>
<!-- 浏览器地址栏 --> <!-- 浏览器地址栏 -->
<rect x="70" y="38" width="100" height="14" rx="7" fill="#eef0f2"/> <rect x="70" y="38" width="100" height="14" rx="7" fill="#eef0f2"/>
<text x="82" y="47" font-size="6.5" fill="#8a9199" font-family="Arial">observer.redpowerfuture.com</text> <text x="82" y="47" font-size="6.5" fill="#8a9199" font-family="Arial">animal-spot.icu</text>
<!-- 右上角 ··· 按钮 --> <!-- 右上角 ··· 按钮 -->
<circle cx="166" cy="45" r="6.5" fill="#f2f3f5" stroke="#d8dce0" stroke-width="0.8"/> <circle cx="166" cy="45" r="6.5" fill="#f2f3f5" stroke="#d8dce0" stroke-width="0.8"/>
<circle cx="163.4" cy="45" r="0.9" fill="#1f2329"/> <circle cx="163.4" cy="45" r="0.9" fill="#1f2329"/>