From edf1c9540ee80d6891c582de15e2f4f44d763229 Mon Sep 17 00:00:00 2001
From: chenyao <1219716595@qq.com>
Date: Fri, 12 Dec 2025 10:51:46 +0800
Subject: [PATCH] Merge branch 'refs/heads/feature/v8.0/8.0.4' into feature/v9.0/9.0.1
---
src/config/env.js | 2 +-
src/subPackages/taskDetail/execution/index.vue | 5 +++--
src/hooks/useGlobalWS.js | 30 +++++++++++++++++++++++++++++-
README.md | 19 ++++++++++++++-----
src/pages/inspectionTask/index.vue | 2 +-
5 files changed, 48 insertions(+), 10 deletions(-)
diff --git a/README.md b/README.md
index 293637e..43db26e 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,21 @@
npm install pnpm -g
pnpm install
pnpm run dev
+
+node:16.18.0
+npm:更换为淘宝镜像
+pnpm:8.6.12
```
+
+# h5更新步骤
+
+打开软件,发行,自定义发行,选择对应的环境
+
+然后把代码拷贝到服务器上
+
+# app更新步骤
+
+修改 /src/config 里面的development的参数,改为对应环境的对应变量
@@ -225,11 +239,6 @@
# 构建生产环境
pnpm build:h5-prod
pnpm build:mp-weixin-prod
-```
-
-### 代码提交
-```bash
-pnpm cz
```
### 更新uniapp版本
diff --git a/src/config/env.js b/src/config/env.js
index b9da4ec..4ea2a2e 100644
--- a/src/config/env.js
+++ b/src/config/env.js
@@ -20,7 +20,7 @@
VITE_APP_ENV:'production',
VITE_APP_WEBVIEW_URL: 'https://aisky.org.cn/drone-app-web-view/#/webViewWrapper',
VITE_API_BASE_URL: 'https://aisky.org.cn/api',
- VITE_APP_WS_API_URL:'wss://wrj.shuixiongit.com/drone-wss/api/v1/ws'
+ VITE_APP_WS_API_URL:'wss://aisky.org.cn/drone-wss/api/v1/ws'
}
export default {
diff --git a/src/hooks/useGlobalWS.js b/src/hooks/useGlobalWS.js
index 303727c..eee6a81 100644
--- a/src/hooks/useGlobalWS.js
+++ b/src/hooks/useGlobalWS.js
@@ -15,7 +15,6 @@
// 消息处理
function messageHandler(payload) {
- console.log(payload, '767')
switch (payload.biz_code) {
case 'JOB_ISREFRESH':
appStore.setJobUpdateKeyAdd()
@@ -70,7 +69,36 @@
socketTask.onMessage((result) => {
messageHandler(JSON.parse(result.data))
})
+ //==================================
+ // 监听连接打开
+ socketTask.onOpen((res) => {
+ console.log('✅ WebSocket连接已建立')
+ // reconnectAttempts = 0 // 连接成功后重置重连次数
+ // 可以在这里发送心跳或订阅消息
+ // startHeartbeat()
+ })
+ // 监听连接关闭
+ socketTask.onClose((res) => {
+ console.log(`WebSocket连接关闭,代码: ${res.code}, 原因: ${res.reason}`)
+
+ // 根据不同的关闭代码处理
+ if (res.code === 1000) { // 正常关闭
+ console.log('连接正常关闭')
+ } else if (res.code === 1006) { // 异常关闭
+ console.log('连接异常关闭,尝试重连...')
+ } else if (res.code === 1011) { // 服务器内部错误
+ console.log('服务器内部错误(1011),延迟重连...')
+ } else {
+ console.log('其他原因关闭,尝试重连...')
+ }
+ })
+
+ // 监听错误
+ socketTask.onError((err) => {
+ console.error('WebSocket发生错误:', err)
+ })
}
+
watch(access_token, initWS, {immediate: true})
}
diff --git a/src/pages/inspectionTask/index.vue b/src/pages/inspectionTask/index.vue
index 904984e..b76d02f 100644
--- a/src/pages/inspectionTask/index.vue
+++ b/src/pages/inspectionTask/index.vue
@@ -33,7 +33,7 @@
});
} else {
uni.navigateTo({
- url: `/subPackages/taskDetail/execution/index?wayLineJobInfoId=${data.rowItem.id}`
+ url: `/subPackages/taskDetail/execution/index?wayLineJobInfoId=${data.rowItem.id}&waylineJobId=${data.rowItem.wayline_job_id}&batch_no=${data.rowItem.batch_no}`
});
}
}
diff --git a/src/subPackages/taskDetail/execution/index.vue b/src/subPackages/taskDetail/execution/index.vue
index dcf2d93..2d6071c 100644
--- a/src/subPackages/taskDetail/execution/index.vue
+++ b/src/subPackages/taskDetail/execution/index.vue
@@ -39,7 +39,7 @@
onLoad((options) => {
wayLineJobInfoId.value = options.wayLineJobInfoId
- viewUrl.value = getWebViewUrl('/execution', {wayLineJobInfoId: wayLineJobInfoId.value})
+ viewUrl.value = getWebViewUrl('/execution', {wayLineJobInfoId: wayLineJobInfoId.value, waylineJobId: options.waylineJobId, batch_no: options.batch_no})
})
const isApp = ref(false)
onShow(() => {
@@ -47,7 +47,8 @@
});
onHide(() => {
- isApp.value = false
+ // 如果工单详情返回任务详情,那么tab栏对应的是关联事件一项
+ // isApp.value = false
});
</script>
--
Gitblit v1.9.3