common.js 6.5 KB

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