Signed-off-by: 吴文峰 <kevin@lmve.net>
This commit is contained in:
@@ -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`:版本信息同时显示文件名和修改时间
|
||||||
@@ -12,32 +12,28 @@ if (empty($apkFiles)) {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 解析 APK 文件名中的日期,格式: __UNI__8A0DE5E__20260424215857.apk
|
// 按文件修改时间排序,取最新的
|
||||||
// 日期部分: 20260424215857 (YYYYMMDDHHmmss)
|
|
||||||
$latestFile = null;
|
$latestFile = null;
|
||||||
$latestDate = 0;
|
$latestMtime = 0;
|
||||||
|
|
||||||
foreach ($apkFiles as $file) {
|
foreach ($apkFiles as $file) {
|
||||||
$filename = basename($file);
|
$mtime = filemtime($file);
|
||||||
|
if ($mtime > $latestMtime) {
|
||||||
// 提取日期部分 (文件名最后一段,移除 .apk 后缀)
|
$latestMtime = $mtime;
|
||||||
if (preg_match('/(\d{14})\.apk$/i', $filename, $matches)) {
|
|
||||||
$date = intval($matches[1]);
|
|
||||||
if ($date > $latestDate) {
|
|
||||||
$latestDate = $date;
|
|
||||||
$latestFile = $file;
|
$latestFile = $file;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ($latestFile && file_exists($latestFile)) {
|
if ($latestFile && file_exists($latestFile)) {
|
||||||
// 返回当前目录下的 APK 文件路径
|
$filename = basename($latestFile);
|
||||||
$relativePath = './' . basename($latestFile);
|
$dateStr = date('Y-m-d H:i:s', $latestMtime);
|
||||||
|
|
||||||
|
// 返回相对于 download_app 目录的路径(需要上跳一级)
|
||||||
echo json_encode([
|
echo json_encode([
|
||||||
'success' => true,
|
'success' => true,
|
||||||
'file' => $relativePath,
|
'file' => '../' . rawurlencode($filename),
|
||||||
'date' => substr($latestDate, 0, 8) . ' ' . substr($latestDate, 8, 2) . ':' . substr($latestDate, 10, 2) . ':' . substr($latestDate, 12, 2)
|
'filename' => $filename,
|
||||||
|
'date' => $dateStr
|
||||||
]);
|
]);
|
||||||
} else {
|
} else {
|
||||||
echo json_encode([
|
echo json_encode([
|
||||||
|
|||||||
@@ -112,7 +112,7 @@
|
|||||||
.then(data => {
|
.then(data => {
|
||||||
loading.style.display = 'none';
|
loading.style.display = 'none';
|
||||||
if (data.success && data.file) {
|
if (data.success && data.file) {
|
||||||
version.textContent = '版本: ' + data.date;
|
version.textContent = data.filename + ' (' + data.date + ')';
|
||||||
window.location.href = data.file;
|
window.location.href = data.file;
|
||||||
} else {
|
} else {
|
||||||
content.style.display = 'block';
|
content.style.display = 'block';
|
||||||
|
|||||||
+1
-1
Submodule frontend/ops2_uniapp updated: 7bcd159605...36c96a3cdc
Reference in New Issue
Block a user