chenyao
2025-10-22 80501686a22bef80b38d8855707db593e97ab29c
feat:更新代码
6 files modified
57 ■■■■ changed files
src/App.vue 7 ●●●●● patch | view | raw | blame | history
src/pages/inspectionTask/index.vue 7 ●●●● patch | view | raw | blame | history
src/pages/map/index.vue 14 ●●●● patch | view | raw | blame | history
src/pages/user/index.vue 4 ●●●● patch | view | raw | blame | history
src/pages/work/index.vue 6 ●●●● patch | view | raw | blame | history
src/subPackages/taskDetail/addTask/index.vue 19 ●●●● patch | view | raw | blame | history
src/App.vue
@@ -38,4 +38,11 @@
/* 每个页面公共css */
@import "uview-plus/index.scss";
@import "@/static/styles/common.scss";
.uni-tabbar__item:nth-child(4) {
  .uni-tabbar__bd {
    .uni-tabbar__icon {
      width: 60px !important;
    }
  }
}
</style>
src/pages/inspectionTask/index.vue
@@ -7,6 +7,7 @@
import { getWebViewUrl } from "@/utils/index.js";
import WebViewPlus from "@/components/WebViewPlus.vue";
import {onHide, onShow} from "@dcloudio/uni-app";
import {errorFactory} from "sass-loader/dist/utils.js";
const viewUrl = getWebViewUrl('/inspectionTask')
@@ -28,10 +29,14 @@
  isApp.value = true
  uni.setTabBarItem({
    index: 2, // Tab 的索引(从0开始)
    text: '新建任务',
    // text: '新建任务',
    visible: true,
    "pagePath": "subPackages/taskDetail/addTask/index"
  });
  uni.setTabBarItem({
    index: 3, // Tab
    visible: false,
  });
});
onHide(() => {
src/pages/map/index.vue
@@ -25,12 +25,14 @@
    uni.navigateTo({
      url: "/subPackages/qrCode/index",
    });
  }else if(data.type === "jumpAddWork"){//新建工单
  } else if(data.type === "jumpAddWork"){//新建任务
    console.log(data.rowItem, '9999')
    const encodedData = encodeURIComponent(JSON.stringify(data.rowItem))
    uni.setStorageSync('webview_params', encodedData)
      uni.switchTab({
        url: "/subPackages/taskDetail/addTask/index",
        url: `/subPackages/taskDetail/addTask/index`,
      });
  }
  else if(data.type === 'jumpMapNav'){  //事件导航
  } else if(data.type === 'jumpMapNav'){  //事件导航
           uni.navigateTo({
            url:`/subPackages/workDetail/mapWork/index?currentItem=${data.eventNum}`
          });
@@ -46,6 +48,10 @@
    index: 2, // Tab 的索引(从0开始)
    visible: false,
  })
  uni.setTabBarItem({
    index: 3, // Tab
    visible: true,
  });
})
</script>
src/pages/user/index.vue
@@ -63,6 +63,10 @@
      index: 2, // Tab 的索引(从0开始)
      visible: false,
    })
    uni.setTabBarItem({
      index: 3, // Tab
      visible: true,
    });
  })
  // window.addEventListener('message', (event) => {
  //   console.log('message')
src/pages/work/index.vue
@@ -28,10 +28,14 @@
    onShow(() => {
    uni.setTabBarItem({
      index: 2, // Tab 的索引(从0开始)
      text: '新建工单',
      // text: '新建工单',
      visible: true,
      "pagePath": "subPackages/workDetail/addWork/index"
    });
    uni.setTabBarItem({
      index: 3, // Tab
      visible: false,
    });
      isApp.value = true
    });
src/subPackages/taskDetail/addTask/index.vue
@@ -7,9 +7,12 @@
import WebViewPlus from "@/components/WebViewPlus.vue";
import {getWebViewUrl} from "@/utils/index.js";
import {onHide, onShow} from "@dcloudio/uni-app";
import {onHide, onLoad, onShow} from "@dcloudio/uni-app";
const viewUrl = ref(getWebViewUrl('/addTask'))
// const viewUrl = ref(getWebViewUrl('/addTask'))
const sWebViewRef = ref(null);
const viewUrl = ref('')
function onPostMessage(data) {
  if (data.type === 'submitSuccess'){
    uni.switchTab({
@@ -17,9 +20,21 @@
    });
  }
}
// onLoad( (options) => {
//   console.log(options, '8888')
//   const sns = options.device_sn
//
// });
const isApp = ref(false)
onShow(() => {
  isApp.value = true
  let params = {}
  const encodedData = uni.getStorageSync('webview_params')
  params = JSON.parse(decodeURIComponent(encodedData))
console.log(params, '6666')
  viewUrl.value = getWebViewUrl('/addTask', params)
});
onHide(() => {