chenyao
2025-12-01 08fcc710d0a2acb185b3477d72fe32aff6f2e29a
src/subPackages/taskDetail/addTask/index.vue
@@ -7,19 +7,50 @@
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.setStorageSync('joinParams', {
      type: 'add'
    });
    // console.log('打印新增成功')
    uni.switchTab({
      url: '/pages/inspectionTask/index'
    });
    // uni.redirectTo({
    //   url: `/pages/inspectionTask/index?addLog=1111`
    // });
  }
}
// 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))
  viewUrl.value = getWebViewUrl('/addTask', params)
  uni.setTabBarItem({
    index: 3, // Tab
    visible: false,
  });
  uni.setTabBarItem({
    index: 2, // Tab 的索引(从0开始)
    // text: '新建任务',
    visible: true,
    "pagePath": "subPackages/taskDetail/addTask/index"
  });
});
onHide(() => {