123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- 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)
- }
- }
|