| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 | //监听uni-app的事件window.appType = {};document.addEventListener('UniAppJSBridgeReady', () => {    uni.getEnv(res => {        window.appType = res;    });    //接受子页面传递过来的消息数据    window.addEventListener('message', (event) => {        if (event.data.source === 'web') {            uni.postMessage({                data: event.data            });        }    });});//app改变显示模式function editTypeClick(type){    window?.postMessage({        type: 'editTypeClick',        source: 'app',        data: type,    })}//app的表单提交保存function formSave(){    window?.postMessage({        type: 'formSave',        source: 'app',        data: {},    })}//切换日志填报的页码function pageTap(index){    window?.postMessage({        type: 'pageTap',        source: 'app',        data: index,    })}//日志填报,新增表格function addFormTap(){    window?.postMessage({        type: 'addForm',        source: 'app',        data: {},    })}//日志填报,删除当前表格function delFormTap(){    window?.postMessage({        type: 'delForm',        source: 'app',        data: {},    })}//日志填报,更新关联工序function linkIdsTap(data){    window?.postMessage({        type: 'linkIds',        source: 'app',        data: data,    })}//复制当前表格及内容function copyFormData(){    window?.postMessage({        type: 'copyFormData',        source: 'app',        data: {},    })}//获取PDF地址function getPdfUrl(){    window?.postMessage({        type: 'getPdfUrl',        source: 'app',        data: {},    })}
 |