123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250 |
- export const goToLink = (item, mine_code) => {
- console.log(item)
- let link = item.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("set_base_url") != -1) {
- uni.$emit('common_update_kuang', {
- msg: link.split('=')[1]
- })
- 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,
- })
- return
- }
- // h5
- if (link.indexOf("pageId") == -1 && link.indexOf("app:") == -1) {
- // #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 {
- console.log("app:h5")
- 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 {
- console.log("h5:h5")
- uni.navigateTo({
- url: "../../index/h5/h5?url=" + link
- })
- }
- // #endif
- return
- }
- // 原生
- if (link.indexOf("pageId") == -1 && link.indexOf("app:") != -1) {
- console.log("原生")
- if (link.indexOf("/safetyManagementSystem/safetyManagementSystem") != -1) {
- console.log("安全管理体系")
- uni.navigateTo({
- url: "../../index/safetyManagementSystem/safetyManagementSystem"
- })
- }
-
- if (link.indexOf("/browseQrcode/gridSubmitItem_win") != -1) {
- console.log("网格排查")
- uni.navigateTo({
- url: "../../workbench/gridding/gridding"
- })
- }
- if (link.indexOf("/wordorder/wordOrderGrid_win") != -1) {
- console.log(link)
- uni.navigateTo({
- url: "../../index/business_approval/business_approval"
- })
- }
- if (link.indexOf("app:/workBench/origanization") != -1) {
- console.log("组织架构、通讯录")
- uni.navigateTo({
- url: "../../workbench/origanization/origanization"
- })
- }
- if (link.indexOf("app:/workBench/xuanchuanzhanban") != -1) {
- console.log("宣传展板")
- uni.navigateTo({
- url: "../../index/xuanchuanzhanban/xuanchuanzhanban"
- })
- }
- // 发票助手
- if (link.indexOf("/workBench/invoice") != -1) {
- console.log("发票助手")
- uni.navigateTo({
- url: "../../workbench/invoice_assistant/invoice_assistant"
- })
- }
- if (link.indexOf("/news/news_win") != -1) {
- console.log("通知公告")
- uni.navigateTo({
- url: "../../my/message-reminder/message-reminder"
- })
- }
- if (link.indexOf("/workBench/getDuty") != -1) {
- console.log("值班信息")
- uni.navigateTo({
- url: "../../workbench/duty_information/duty_information"
- })
- }
- if (link.indexOf("/workBench/huiyiList") != -1) {
- console.log("会议列表")
- uni.navigateTo({
- url: "../../workbench/meeting_arrangements/meeting_arrangements"
- })
- }
- if (link.indexOf("/workBench/lifeCircleWin") != -1) {
- console.log("生活圈")
- uni.showToast({
- icon: "none",
- title: "暂未开通"
- })
- }
- if (link.indexOf("/productionData/logging") != -1) {
- console.log("下井记录")
- // people_num 特殊值
- if (!uni.getStorageSync('people_code')) {
- uni.navigateTo({
- url: "../../production/personnel_orientation/downhole_statistics/downhole_statistics?people_num=null&depart_name=" +
- uni.getStorageSync('user').section + "&name=" + uni.getStorageSync('user')
- .name + "&mine=640323B0011010019259"
- })
- } else {
- uni.navigateTo({
- url: "../../production/personnel_orientation/downhole_statistics/downhole_statistics?people_num=" +
- uni.getStorageSync('user').people_code + "&depart_name=" + uni.getStorageSync(
- 'user').section + "&name=" + uni.getStorageSync('user').name +
- "&mine=640323B0011010019259"
- })
- }
- }
- if (link.indexOf("/browseQrcode/gridSubmitItem_win") != -1) {
- console.log("网格排查")
- uni.navigateTo({
- url: "../../workbench/gridding/gridding"
- })
- }
- if (link.indexOf("/workBench/evaluate") != -1) {
- console.log("干部评测")
- uni.navigateTo({
- url: "../../workbench/h5/h5?mine_code=" + mine_code + "&workBench=pingce"
- })
- }
- if (link.indexOf("/productionData/persnoalLocation") != -1) {
- uni.navigateTo({
- url: "../../production/personnel_orientation/personnel_orientation?mine=640181B0011010030750"
- })
- }
-
- if (link.indexOf("closed_loop_management") != -1) {
- uni.navigateTo({
- url: "../../workbench/closed_loop_management/closed_loop_management"
- })
- }
-
- if (link.indexOf("app_url") != -1) {
-
- uni.navigateTo({
- url:link.split('app_url=')[1] + "&title=" + item.title
- })
- }
- if (link.indexOf("switch_url") != -1) {
- uni.switchTab({
- url:link.split('switch_url=')[1]
- })
-
- }
- }
- }
|