吉安感知网项目-前端
chenyao
2026-02-26 1fafffd842ee6ee1da3c45b35fd8af308d092850
Merge remote-tracking branch 'origin/master'
5 files modified
51 ■■■■ changed files
uniapps/work-app/src/App.vue 3 ●●●● patch | view | raw | blame | history
uniapps/work-app/src/hooks/useGlobalWS.js 2 ●●●●● patch | view | raw | blame | history
uniapps/work-app/src/pages/map/index.vue 37 ●●●●● patch | view | raw | blame | history
uniapps/work-app/src/subPackages/voiceCallDetail/index.vue 1 ●●●● patch | view | raw | blame | history
uniapps/work-app/src/utils/common/index.js 8 ●●●● patch | view | raw | blame | history
uniapps/work-app/src/App.vue
@@ -33,7 +33,6 @@
allowFloat()
// #endif
useGlobalWS()
onShow(async () => {
@@ -60,7 +59,7 @@
    // #ifdef APP-PLUS
    keepAliveStart()
    // 请求用户允许忽略电池优化(重要:用于保活)
    setTimeout(requestIgnoreBatteryOptimization, 120000)
    setTimeout(requestIgnoreBatteryOptimization, 10000)
    // #endif
}
uniapps/work-app/src/hooks/useGlobalWS.js
@@ -1,6 +1,7 @@
import { useUserStore } from "@/store/index.js";
import useAppStore from "../store/modules/app/index.js";
import websocketService from "@/utils/websocket.js";
import { openDialog, allowFloat, getBatteryCapacity } from '@/uni_modules/lgh-dialog'
export function useGlobalWS() {
    const userStore = useUserStore();
@@ -36,6 +37,7 @@
        type: 'incoming'
      };
            openDialog()
      // 转义参数以便在URL中传递
      const encodedParams = encodeURIComponent(JSON.stringify(callParams));
uniapps/work-app/src/pages/map/index.vue
@@ -23,9 +23,6 @@
const userParams = userStore?.userInfo ? JSON.stringify(userStore.userInfo) : '{}';
const updateKey = ref(0);
// const viewUrl = computed(() => {
//   return `https://192.168.1.157:5176/mobile-web-view/#/webViewWrapper/defaultMap?params=${encodeURIComponent(userParams)}&isWeb=${envParam}&updateKey=${updateKey.value}`;
// });
const viewUrl = computed(() => {
  return getWebViewUrl("/defaultMap", {
    isWeb: envParam,
@@ -34,40 +31,6 @@
});
const onPostMessage = (data) => {
  // #ifdef MP-WEIXIN
  if (data.type === "scanCode") {
  } else if (data.type === "jumpAddWork") {
  } else if (data.type === "jumpMapNav") {
    //事件导航
  } else if (data.type === "workid") {
    //事件详情
  }
  // #endif
  // #ifndef MP-WEIXIN
  if (data.type === "scanCode") {
    uni.navigateTo({
      url: "/subPackages/qrCode/index",
    });
  } else if (data.type === "jumpAddWork") {
    //新建任务
    const encodedData = encodeURIComponent(JSON.stringify(data.rowItem));
    uni.setStorageSync("webview_params", encodedData);
    uni.navigateTo({
      url: `/subPackages/taskDetail/addTask/index`,
    });
  } else if (data.type === "jumpMapNav") {
    //事件导航
    uni.navigateTo({
      url: `/subPackages/workDetail/mapWork/index?currentItem=${data.eventNum}`,
    });
  } else if (data.type === "workid") {
    //事件详情
    uni.navigateTo({
      url: `/subPackages/workDetail/index?eventNum=${data.eventNum}`,
    });
  }
  // #endif
};
onShow(() => {
uniapps/work-app/src/subPackages/voiceCallDetail/index.vue
@@ -74,7 +74,6 @@
  const contact = options.contact ? JSON.parse(decodeURIComponent(options.contact)) : null;
  // 构建viewUrl,将contact参数拼接到URL中
  const contactParam = contact ? encodeURIComponent(JSON.stringify(contact)) : '';
  // viewUrl.value = `https://192.168.1.157:5176/mobile-web-view/#/webViewWrapper/voiceCallDetail?params=${encodeURIComponent(userParams)}&contact=${contactParam}`;
  viewUrl.value = getWebViewUrl("/voiceCallDetail", { contact: options.contact ,voiceparams: options.voiceparams});
});
uniapps/work-app/src/utils/common/index.js
@@ -72,8 +72,12 @@
  // 1. 处理用户参数
  const userParams = userStore?.userInfo ? JSON.stringify(userStore.userInfo) : '{}'
  // 2. 构建查询参数字符串
  let queryString = `params=${encodeURIComponent(userParams)}&topMargin=${statusBarHeight}&uniPlatform=${uniPlatform}`
  let queryString = null
  if(targetUrl === '/workDetail') {
    queryString = `topMargin=${statusBarHeight}&uniPlatform=${uniPlatform}`
  }else{
    queryString = `params=${encodeURIComponent(userParams)}&topMargin=${statusBarHeight}&uniPlatform=${uniPlatform}`
  }
  // 3. 处理 otherParams 对象
  if (otherParams && typeof otherParams === 'object') {
    Object.keys(otherParams).forEach(key => {