workbench - 副本 (2).vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. <template>
  2. <view class="headers">
  3. <view class="headers_img">
  4. <image :src="header" mode="aspectFill"></image>
  5. </view>
  6. <view class="headers_nav">
  7. <view class="headers_ul">
  8. <view class="headers_li" v-for="(item,index) in nav" :key="index" @click="go_link(item)">
  9. <view class="headers_li_img">
  10. <image :src="item.icon" mode=""></image>
  11. </view>
  12. <view class="headers_li_text">
  13. {{item.title}}
  14. </view>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="headers_list" v-for="(item,index) in module" :key="index">
  19. <view class="headers_title">
  20. <text class="headers_title_h1">
  21. {{item.title}}
  22. </text>
  23. </view>
  24. <view class="headers_ul">
  25. <view class="headers_li" v-for="(items,index) in item.children" :key="index"
  26. @click="go_link(items)">
  27. <view class="headers_li_img">
  28. <image :src="items.icon" mode=""></image>
  29. </view>
  30. <view class="headers_li_text">
  31. {{items.title}}
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. export default {
  40. data() {
  41. return {
  42. // 当前煤矿编码
  43. mine_code: "",
  44. module: [],
  45. nav: [],
  46. header: "",
  47. };
  48. },
  49. onLoad() {
  50. // 初始化当前煤矿编码
  51. this.mine_code = uni.getStorageSync('mine_code')
  52. this.getworkbench()
  53. },
  54. methods: {
  55. getworkbench() {
  56. this.$api.workbench_index({
  57. }).then((res) => {
  58. console.log(res)
  59. this.header = res.data.data.header
  60. this.nav = res.data.data.nav
  61. this.module = res.data.data.module
  62. })
  63. },
  64. go_link(item) {
  65. // console.log(item)
  66. let link = item.link
  67. // OA系统
  68. if(link.indexOf("oa_system.nxmy.com") != -1 ){
  69. uni.navigateTo({
  70. url:"../../origanization/OA/h5/h5",
  71. success: (res) =>{
  72. // 通过eventChannel向被打开页面传送数据
  73. res.eventChannel.emit('acceptDataFromOpenerPage', {
  74. url: link,
  75. })
  76. }
  77. })
  78. return
  79. }
  80. // 二维码
  81. if (link.indexOf("pageId") != -1 && link.indexOf("app:") == -1) {
  82. let pageId = ""
  83. function GetQueryString(name) {
  84. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  85. var r = link.match(reg);
  86. if (r != null) return unescape(r[2]);
  87. return null;
  88. }
  89. console.log(GetQueryString("pageId"))
  90. if (GetQueryString("pageId")) {
  91. pageId = GetQueryString("pageId")
  92. } else {
  93. pageId = link.split('=')[1]
  94. }
  95. uni.navigateTo({
  96. url: "../../index/record/record?pageId=" + pageId + "&mine_code=" + this.mine_code,
  97. })
  98. }
  99. // h5
  100. if (link.indexOf("pageId") == -1 && link.indexOf("app:") == -1) {
  101. console.log("H5")
  102. // #ifdef APP
  103. if (plus.os.name == 'Android') {
  104. if (link.indexOf("cmb.pb") != -1) {
  105. plus.runtime.launchApplication({
  106. pname: 'cmb.pb'
  107. }, (e) => {
  108. console.log('Open system default browser failed: ' + e.message)
  109. uni.showToast({
  110. icon: "none",
  111. title: "未安装此应用"
  112. })
  113. })
  114. } else if (link.indexOf("com.icbc") != -1) {
  115. plus.runtime.launchApplication({
  116. pname: 'com.icbc'
  117. }, (e) => {
  118. console.log('Open system default browser failed: ' + e.message)
  119. uni.showToast({
  120. icon: "none",
  121. title: "未安装此应用"
  122. })
  123. })
  124. } else {
  125. uni.navigateTo({
  126. url: "../../workbench/h5/h5?url=" + link
  127. })
  128. }
  129. }
  130. // #endif
  131. // #ifdef H5
  132. uni.navigateTo({
  133. url: "../../workbench/h5/h5?url=" + link
  134. })
  135. // #endif
  136. }
  137. // 原生
  138. if (link.indexOf("pageId") == -1 && link.indexOf("app:") != -1) {
  139. console.log("原生")
  140. console.log(link)
  141. // 发票助手
  142. if (link.indexOf("/workBench/invoice") != -1) {
  143. console.log("发票助手")
  144. uni.navigateTo({
  145. url: "../../workbench/invoice_assistant/invoice_assistant"
  146. })
  147. } else if (link.indexOf("/news/news_win") != -1) {
  148. console.log("通知公告")
  149. uni.navigateTo({
  150. url: "../../my/message-reminder/message-reminder"
  151. })
  152. } else if (link.indexOf("/workBench/getDuty") != -1) {
  153. console.log("值班信息")
  154. uni.navigateTo({
  155. url: "../../workbench/duty_information/duty_information"
  156. })
  157. } else if (link.indexOf("/workBench/huiyiList") != -1) {
  158. console.log("会议列表")
  159. uni.navigateTo({
  160. url: "../../workbench/meeting_arrangements/meeting_arrangements"
  161. })
  162. } else if (link.indexOf("/workBench/lifeCircleWin") != -1) {
  163. console.log("生活圈")
  164. uni.showToast({
  165. icon: "none",
  166. title: "暂未开通"
  167. })
  168. } else 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. }else if(link.indexOf("/browseQrcode/gridSubmitItem_win") != -1){
  186. console.log("网格排查")
  187. uni.navigateTo({
  188. url:"../../workbench/gridding/gridding"
  189. })
  190. }else if(link.indexOf("/workBench/evaluate") != -1){
  191. console.log("干部评测")
  192. uni.navigateTo({
  193. url:"../../workbench/h5/h5?mine_code=zaoquan&workBench=pingce"
  194. })
  195. } else {
  196. uni.showToast({
  197. icon: "none",
  198. title: "暂未开通"
  199. })
  200. }
  201. }
  202. }
  203. },
  204. }
  205. </script>
  206. <style>
  207. page {
  208. background-color: #F5F5F5;
  209. }
  210. .headers {
  211. width: 100%;
  212. background-color: #F5F5F5;
  213. }
  214. .headers_img>image {
  215. width: 100%;
  216. height: 360rpx;
  217. }
  218. .headers_nav {
  219. width: 100%;
  220. background-color: #FFFFFF;
  221. margin-bottom: 25rpx;
  222. }
  223. .headers_ul {
  224. width: 100%;
  225. /* display: flex;
  226. flex-wrap: wrap;
  227. justify-content: space-between; */
  228. margin-top: 10rpx;
  229. overflow: hidden;
  230. }
  231. .headers_ul::after {
  232. content: '';
  233. width: 25%;
  234. }
  235. .headers_title {
  236. margin-left: 40rpx;
  237. padding-top: 30rpx;
  238. padding-bottom: 5rpx;
  239. }
  240. .headers_li {
  241. float: left;
  242. width: 25%;
  243. text-align: center;
  244. margin-bottom: 25rpx;
  245. margin-top: 25rpx;
  246. }
  247. .headers_li_img>image {
  248. width: 100rpx;
  249. height: 100rpx;
  250. margin-bottom: 10rpx;
  251. }
  252. .headers_li_text {
  253. font-size: 14px;
  254. }
  255. .headers_title_h1 {
  256. font-weight: 800;
  257. }
  258. .headers_list {
  259. width: 100%;
  260. background-color: #fff;
  261. }
  262. .ly-tree-node__label {
  263. color: #000000;
  264. }
  265. </style>