common.js 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. export const goToLink = (item, mine_code) => {
  2. let link = item.link
  3. // OA系统
  4. if (link.indexOf("oa_system.nxjiewei.com") != -1) {
  5. uni.navigateTo({
  6. url: "../../origanization/OA/h5/h5",
  7. success: (res) => {
  8. // 通过eventChannel向被打开页面传送数据
  9. res.eventChannel.emit('acceptDataFromOpenerPage', {
  10. url: link,
  11. title: item.title
  12. })
  13. }
  14. })
  15. return
  16. }
  17. // 切换域名
  18. if (link.indexOf("set_base_url") != -1) {
  19. uni.$emit('common_update_kuang', {
  20. msg: link.split('=')[1]
  21. })
  22. return
  23. }
  24. // 二维码
  25. if (link.indexOf("pageId") != -1 && link.indexOf("app:") == -1) {
  26. let pageId = ""
  27. function GetQueryString(name) {
  28. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  29. var r = link.match(reg);
  30. if (r != null) return unescape(r[2]);
  31. return null;
  32. }
  33. console.log(GetQueryString("pageId"))
  34. if (GetQueryString("pageId")) {
  35. pageId = GetQueryString("pageId")
  36. } else {
  37. pageId = link.split('=')[1]
  38. }
  39. uni.navigateTo({
  40. url: "../../index/record/record?pageId=" + pageId + "&mine_code=" + mine_code,
  41. })
  42. return
  43. }
  44. // h5
  45. if (link.indexOf("pageId") == -1 && link.indexOf("app:") == -1) {
  46. console.log("H5")
  47. // #ifdef APP
  48. if (plus.os.name == 'Android') {
  49. if (link.indexOf("cmb.pb") != -1) {
  50. plus.runtime.launchApplication({
  51. pname: 'cmb.pb'
  52. }, (e) => {
  53. console.log('Open system default browser failed: ' + e.message)
  54. uni.showToast({
  55. icon: "none",
  56. title: "未安装此应用"
  57. })
  58. })
  59. } else if (link.indexOf("com.icbc") != -1) {
  60. plus.runtime.launchApplication({
  61. pname: 'com.icbc'
  62. }, (e) => {
  63. console.log('Open system default browser failed: ' + e.message)
  64. uni.showToast({
  65. icon: "none",
  66. title: "未安装此应用"
  67. })
  68. })
  69. } else if (link.indexOf("webdevelop.nxjiewei.com/assets/html/pingce") != -1) {
  70. uni.navigateTo({
  71. url: "../../index/h5/h5?url=jinjiaqu_pingce"
  72. })
  73. } else if (link.indexOf("/yinhuanpaicha/yinhuaninfo") != -1) {
  74. uni.navigateTo({
  75. url: "../../index/h5/h5?url=" + link
  76. })
  77. } else {
  78. uni.navigateTo({
  79. url: "../../index/h5/h5?url=" + link
  80. })
  81. }
  82. }
  83. // #endif
  84. // #ifdef H5
  85. if (link.indexOf("webdevelop.nxjiewei.com/assets/html/pingce") != -1) {
  86. uni.navigateTo({
  87. url: "../../index/h5/h5?url=jinjiaqu_pingce"
  88. })
  89. } else if (link.indexOf("/yinhuanpaicha/yinhuaninfo") != -1) {
  90. uni.navigateTo({
  91. url: "../../index/h5/h5?url=" + link
  92. })
  93. } else {
  94. uni.navigateTo({
  95. url: "../../index/h5/h5?url=" + link
  96. })
  97. }
  98. // #endif
  99. return
  100. }
  101. // 原生
  102. if (link.indexOf("pageId") == -1 && link.indexOf("app:") != -1) {
  103. console.log("原生")
  104. if (link.indexOf("/safetyManagementSystem/safetyManagementSystem") != -1) {
  105. console.log("安全管理体系")
  106. uni.navigateTo({
  107. url: "../../index/safetyManagementSystem/safetyManagementSystem"
  108. })
  109. }
  110. if (link.indexOf("/browseQrcode/gridSubmitItem_win") != -1) {
  111. console.log("网格排查")
  112. uni.navigateTo({
  113. url: "../../workbench/gridding/gridding"
  114. })
  115. }
  116. if (link.indexOf("/wordorder/wordOrderGrid_win") != -1) {
  117. console.log(link)
  118. uni.navigateTo({
  119. url: "../../index/business_approval/business_approval"
  120. })
  121. }
  122. if (link.indexOf("app:/workBench/origanization") != -1) {
  123. console.log("组织架构、通讯录")
  124. uni.navigateTo({
  125. url: "../../workbench/origanization/origanization"
  126. })
  127. }
  128. if (link.indexOf("app:/workBench/xuanchuanzhanban") != -1) {
  129. console.log("宣传展板")
  130. uni.navigateTo({
  131. url: "../../index/xuanchuanzhanban/xuanchuanzhanban"
  132. })
  133. }
  134. // 发票助手
  135. if (link.indexOf("/workBench/invoice") != -1) {
  136. console.log("发票助手")
  137. uni.navigateTo({
  138. url: "../../workbench/invoice_assistant/invoice_assistant"
  139. })
  140. }
  141. if (link.indexOf("/news/news_win") != -1) {
  142. console.log("通知公告")
  143. uni.navigateTo({
  144. url: "../../my/message-reminder/message-reminder"
  145. })
  146. }
  147. if (link.indexOf("/workBench/getDuty") != -1) {
  148. console.log("值班信息")
  149. uni.navigateTo({
  150. url: "../../workbench/duty_information/duty_information"
  151. })
  152. }
  153. if (link.indexOf("/workBench/huiyiList") != -1) {
  154. console.log("会议列表")
  155. uni.navigateTo({
  156. url: "../../workbench/meeting_arrangements/meeting_arrangements"
  157. })
  158. }
  159. if (link.indexOf("/workBench/lifeCircleWin") != -1) {
  160. console.log("生活圈")
  161. uni.showToast({
  162. icon: "none",
  163. title: "暂未开通"
  164. })
  165. }
  166. if (link.indexOf("/productionData/logging") != -1) {
  167. console.log("下井记录")
  168. // people_num 特殊值
  169. if (!uni.getStorageSync('people_code')) {
  170. uni.navigateTo({
  171. url: "../../production/personnel_orientation/downhole_statistics/downhole_statistics?people_num=null&depart_name=" +
  172. uni.getStorageSync('user').section + "&name=" + uni.getStorageSync('user')
  173. .name + "&mine=640323B0011010019259"
  174. })
  175. } else {
  176. uni.navigateTo({
  177. url: "../../production/personnel_orientation/downhole_statistics/downhole_statistics?people_num=" +
  178. uni.getStorageSync('user').people_code + "&depart_name=" + uni.getStorageSync(
  179. 'user').section + "&name=" + uni.getStorageSync('user').name +
  180. "&mine=640323B0011010019259"
  181. })
  182. }
  183. }
  184. if (link.indexOf("/browseQrcode/gridSubmitItem_win") != -1) {
  185. console.log("网格排查")
  186. uni.navigateTo({
  187. url: "../../workbench/gridding/gridding"
  188. })
  189. }
  190. if (link.indexOf("/workBench/evaluate") != -1) {
  191. console.log("干部评测")
  192. uni.navigateTo({
  193. url: "../../workbench/h5/h5?mine_code=" + mine_code + "&workBench=pingce"
  194. })
  195. }
  196. if (link.indexOf("/productionData/persnoalLocation") != -1) {
  197. uni.navigateTo({
  198. url: "../../production/personnel_orientation/personnel_orientation?mine=640181B0011010030750"
  199. })
  200. }
  201. if (link.indexOf("closed_loop_management") != -1) {
  202. uni.navigateTo({
  203. url: "../../workbench/closed_loop_management/closed_loop_management"
  204. })
  205. }
  206. if (link.indexOf("app_url") != -1) {
  207. uni.navigateTo({
  208. url:link.split('app_url=')[1]
  209. })
  210. }
  211. if (link.indexOf("switch_url") != -1) {
  212. uni.switchTab({
  213. url:link.split('switch_url=')[1]
  214. })
  215. }
  216. }
  217. }