Signed-off-by: 吴文峰 <kevin@lmve.net>

This commit is contained in:
2026-04-28 10:54:03 +08:00
parent 43c0783410
commit 4b2619d94f
4 changed files with 30 additions and 19 deletions
+15
View File
@@ -0,0 +1,15 @@
# 2026-04-28 工作记录
## 搜索页面条码识别 bug 修复
- 修复搜索页面 `res.data.orders``res.data.all_orders`(工单和采购订单列表API返回字段名均为 `all_orders`
- 搜索页添加条码格式识别:`wo:ID`→工单、`item:ID`→物品、`warehouse:ID`→容器
- 容器跳转用 `uni.$emit('barcode-navigate-container')` + `switchTab`tabBar页面不能 navigateTo
- 搜索页添加扫码按钮(📷)
- App端扫码:`uni.getSetting` 仅小程序支持,App端需用 `plus.android` 检查权限
- 条件编译:`#ifdef APP-PLUS``#ifdef MP-WEIXIN``#ifdef H5` 分平台处理
## download_app 改造
- `download.php`:改为扫描 `__DIR__/../` 根目录下的所有 `.apk`,用 `filemtime()` 取最新,不再依赖文件名格式
- `index.php`:版本信息同时显示文件名和修改时间
+13 -17
View File
@@ -12,32 +12,28 @@ if (empty($apkFiles)) {
exit;
}
// 解析 APK 文件名中的日期,格式: __UNI__8A0DE5E__20260424215857.apk
// 日期部分: 20260424215857 (YYYYMMDDHHmmss)
// 按文件修改时间排序,取最新的
$latestFile = null;
$latestDate = 0;
$latestMtime = 0;
foreach ($apkFiles as $file) {
$filename = basename($file);
// 提取日期部分 (文件名最后一段,移除 .apk 后缀)
if (preg_match('/(\d{14})\.apk$/i', $filename, $matches)) {
$date = intval($matches[1]);
if ($date > $latestDate) {
$latestDate = $date;
$latestFile = $file;
}
$mtime = filemtime($file);
if ($mtime > $latestMtime) {
$latestMtime = $mtime;
$latestFile = $file;
}
}
if ($latestFile && file_exists($latestFile)) {
// 返回当前目录下的 APK 文件路径
$relativePath = './' . basename($latestFile);
$filename = basename($latestFile);
$dateStr = date('Y-m-d H:i:s', $latestMtime);
// 返回相对于 download_app 目录的路径(需要上跳一级)
echo json_encode([
'success' => true,
'file' => $relativePath,
'date' => substr($latestDate, 0, 8) . ' ' . substr($latestDate, 8, 2) . ':' . substr($latestDate, 10, 2) . ':' . substr($latestDate, 12, 2)
'file' => '../' . rawurlencode($filename),
'filename' => $filename,
'date' => $dateStr
]);
} else {
echo json_encode([
+1 -1
View File
@@ -112,7 +112,7 @@
.then(data => {
loading.style.display = 'none';
if (data.success && data.file) {
version.textContent = '版本: ' + data.date;
version.textContent = data.filename + ' (' + data.date + ')';
window.location.href = data.file;
} else {
content.style.display = 'block';
Submodule frontend/ops2_uniapp updated: 7bcd159605...36c96a3cdc