common.js 5.4 KB

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