common.js 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  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. // 切换域名
  19. if (link.indexOf("set_base_url") != -1) {
  20. uni.$emit('common_update_kuang', {
  21. msg: link.split('=')[1]
  22. })
  23. return
  24. }
  25. // 二维码
  26. if (link.indexOf("pageId") != -1 && link.indexOf("app:") == -1) {
  27. let pageId = ""
  28. function GetQueryString(name) {
  29. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  30. var r = link.match(reg);
  31. if (r != null) return unescape(r[2]);
  32. return null;
  33. }
  34. console.log(GetQueryString("pageId"))
  35. if (GetQueryString("pageId")) {
  36. pageId = GetQueryString("pageId")
  37. } else {
  38. pageId = link.split('=')[1]
  39. }
  40. uni.navigateTo({
  41. url: "../../index/record/record?pageId=" + pageId + "&mine_code=" + mine_code,
  42. })
  43. return
  44. }
  45. // h5
  46. if (link.indexOf("pageId") == -1 && link.indexOf("app:") == -1) {
  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. console.log("app:h5")
  79. uni.navigateTo({
  80. url: "../../index/h5/h5?url=" + link
  81. })
  82. }
  83. }
  84. // #endif
  85. // #ifdef H5
  86. if (link.indexOf("webdevelop.nxjiewei.com/assets/html/pingce") != -1) {
  87. uni.navigateTo({
  88. url: "../../index/h5/h5?url=jinjiaqu_pingce"
  89. })
  90. } else if (link.indexOf("/yinhuanpaicha/yinhuaninfo") != -1) {
  91. uni.navigateTo({
  92. url: "../../index/h5/h5?url=" + link
  93. })
  94. } else {
  95. console.log("h5:h5")
  96. uni.navigateTo({
  97. url: "../../index/h5/h5?url=" + link
  98. })
  99. }
  100. // #endif
  101. return
  102. }
  103. // 原生
  104. if (link.indexOf("pageId") == -1 && link.indexOf("app:") != -1) {
  105. console.log("原生")
  106. if (link.indexOf("/safetyManagementSystem/safetyManagementSystem") != -1) {
  107. console.log("安全管理体系")
  108. uni.navigateTo({
  109. url: "../../index/safetyManagementSystem/safetyManagementSystem"
  110. })
  111. }
  112. if (link.indexOf("/browseQrcode/gridSubmitItem_win") != -1) {
  113. console.log("网格排查")
  114. uni.navigateTo({
  115. url: "../../workbench/gridding/gridding"
  116. })
  117. }
  118. if (link.indexOf("/wordorder/wordOrderGrid_win") != -1) {
  119. console.log(link)
  120. uni.navigateTo({
  121. url: "../../index/business_approval/business_approval"
  122. })
  123. }
  124. if (link.indexOf("app:/workBench/origanization") != -1) {
  125. console.log("组织架构、通讯录")
  126. uni.navigateTo({
  127. url: "../../workbench/origanization/origanization"
  128. })
  129. }
  130. if (link.indexOf("app:/workBench/xuanchuanzhanban") != -1) {
  131. console.log("宣传展板")
  132. uni.navigateTo({
  133. url: "../../index/xuanchuanzhanban/xuanchuanzhanban"
  134. })
  135. }
  136. // 发票助手
  137. if (link.indexOf("/workBench/invoice") != -1) {
  138. console.log("发票助手")
  139. uni.navigateTo({
  140. url: "../../workbench/invoice_assistant/invoice_assistant"
  141. })
  142. }
  143. if (link.indexOf("/news/news_win") != -1) {
  144. console.log("通知公告")
  145. uni.navigateTo({
  146. url: "../../my/message-reminder/message-reminder"
  147. })
  148. }
  149. if (link.indexOf("/workBench/getDuty") != -1) {
  150. console.log("值班信息")
  151. uni.navigateTo({
  152. url: "../../workbench/duty_information/duty_information"
  153. })
  154. }
  155. if (link.indexOf("/workBench/huiyiList") != -1) {
  156. console.log("会议列表")
  157. uni.navigateTo({
  158. url: "../../workbench/meeting_arrangements/meeting_arrangements"
  159. })
  160. }
  161. if (link.indexOf("/workBench/lifeCircleWin") != -1) {
  162. console.log("生活圈")
  163. uni.showToast({
  164. icon: "none",
  165. title: "暂未开通"
  166. })
  167. }
  168. if (link.indexOf("/productionData/logging") != -1) {
  169. console.log("下井记录")
  170. // people_num 特殊值
  171. if (!uni.getStorageSync('people_code')) {
  172. uni.navigateTo({
  173. url: "../../production/personnel_orientation/downhole_statistics/downhole_statistics?people_num=null&depart_name=" +
  174. uni.getStorageSync('user').section + "&name=" + uni.getStorageSync('user')
  175. .name + "&mine=640323B0011010019259"
  176. })
  177. } else {
  178. uni.navigateTo({
  179. url: "../../production/personnel_orientation/downhole_statistics/downhole_statistics?people_num=" +
  180. uni.getStorageSync('user').people_code + "&depart_name=" + uni.getStorageSync(
  181. 'user').section + "&name=" + uni.getStorageSync('user').name +
  182. "&mine=640323B0011010019259"
  183. })
  184. }
  185. }
  186. if (link.indexOf("/browseQrcode/gridSubmitItem_win") != -1) {
  187. console.log("网格排查")
  188. uni.navigateTo({
  189. url: "../../workbench/gridding/gridding"
  190. })
  191. }
  192. if (link.indexOf("/workBench/evaluate") != -1) {
  193. console.log("干部评测")
  194. uni.navigateTo({
  195. url: "../../workbench/h5/h5?workBench=pingce"
  196. })
  197. }
  198. if (link.indexOf("/productionData/persnoalLocation") != -1) {
  199. uni.navigateTo({
  200. url: "../../production/personnel_orientation/personnel_orientation?mine=640181B0011010030750"
  201. })
  202. }
  203. if (link.indexOf("closed_loop_management") != -1) {
  204. uni.navigateTo({
  205. url: "../../workbench/closed_loop_management/closed_loop_management"
  206. })
  207. }
  208. if (link.indexOf("app_url") != -1) {
  209. uni.navigateTo({
  210. url:link.split('app_url=')[1] + "&title=" + item.title
  211. })
  212. }
  213. if (link.indexOf("switch_url") != -1) {
  214. uni.switchTab({
  215. url:link.split('switch_url=')[1]
  216. })
  217. }
  218. }
  219. }