export const goToLink = (item, mine_code) => { let link = item.link console.log(link) // OA系统 if (link.indexOf("oa_system.nxjiewei.com") != -1) { uni.navigateTo({ url: "../../origanization/OA/h5/h5", success: (res) => { // 通过eventChannel向被打开页面传送数据 res.eventChannel.emit('acceptDataFromOpenerPage', { url: link, title: item.title }) } }) return } // 二维码 if (link.indexOf("pageId") != -1 && link.indexOf("app:") == -1) { let pageId = "" function GetQueryString(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); var r = link.match(reg); if (r != null) return unescape(r[2]); return null; } console.log(GetQueryString("pageId")) if (GetQueryString("pageId")) { pageId = GetQueryString("pageId") } else { pageId = link.split('=')[1] } uni.navigateTo({ url: "../../index/record/record?pageId=" + pageId + "&mine_code=" + mine_code, }) } // h5 if (link.indexOf("pageId") == -1 && link.indexOf("app:") == -1) { console.log("H5") // #ifdef APP if (plus.os.name == 'Android') { if (link.indexOf("cmb.pb") != -1) { plus.runtime.launchApplication({ pname: 'cmb.pb' }, (e) => { console.log('Open system default browser failed: ' + e.message) uni.showToast({ icon: "none", title: "未安装此应用" }) }) } else if (link.indexOf("com.icbc") != -1) { plus.runtime.launchApplication({ pname: 'com.icbc' }, (e) => { console.log('Open system default browser failed: ' + e.message) uni.showToast({ icon: "none", title: "未安装此应用" }) }) } else if (link.indexOf("webdevelop.nxjiewei.com/assets/html/pingce") != -1) { uni.navigateTo({ url: "../../index/h5/h5?url=jinjiaqu_pingce" }) } else if (link.indexOf("/yinhuanpaicha/yinhuaninfo") != -1) { uni.navigateTo({ url: "../../index/h5/h5?url=" + link }) } else { uni.navigateTo({ url: "../../index/h5/h5?url=" + link }) } } // #endif // #ifdef H5 if (link.indexOf("webdevelop.nxjiewei.com/assets/html/pingce") != -1) { uni.navigateTo({ url: "../../index/h5/h5?url=jinjiaqu_pingce" }) } else if (link.indexOf("/yinhuanpaicha/yinhuaninfo") != -1) { uni.navigateTo({ url: "../../index/h5/h5?url=" + link }) } else { uni.navigateTo({ url: "../../index/h5/h5?url=" + link }) } // #endif } // 原生 if (link.indexOf("pageId") == -1 && link.indexOf("app:") != -1) { console.log("原生") if (link.indexOf("/browseQrcode/gridSubmitItem_win") != -1) { console.log("网格排查") uni.navigateTo({ url: "../../workbench/gridding/gridding" }) } else if (link.indexOf("/wordorder/wordOrderGrid_win") != -1) { console.log(link) uni.navigateTo({ url: "../../index/business_approval/business_approval" }) } } else { console.log(link) } }