t-w-jinjiaqu.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  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="getnav(item.link)">
  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="getmodule(items.link)">
  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. props: [
  41. "mine_code"
  42. ],
  43. data() {
  44. return {
  45. module: [],
  46. nav: [],
  47. header: "",
  48. };
  49. },
  50. created() {
  51. this.getworkbench()
  52. },
  53. methods: {
  54. getworkbench() {
  55. this.$api.workbench_index({
  56. }).then((res) => {
  57. // console.log(res)
  58. this.header = res.data.data.header
  59. this.nav = res.data.data.nav
  60. this.module = res.data.data.module
  61. })
  62. },
  63. getnav(link) {
  64. console.log(link)
  65. // 二维码
  66. if (link.indexOf("pageId") != -1 && link.indexOf("app:") == -1) {
  67. let pageId = ""
  68. function GetQueryString(name) {
  69. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  70. var r = link.match(reg);
  71. if (r != null) return unescape(r[2]);
  72. return null;
  73. }
  74. console.log(GetQueryString("pageId"))
  75. if (GetQueryString("pageId")) {
  76. pageId = GetQueryString("pageId")
  77. } else {
  78. pageId = link.split('=')[1]
  79. }
  80. // uni.navigateTo({
  81. // url: "../../index/record/record?pageId=" + pageId + "&mine_code=" + this.mine_code,
  82. // })
  83. }
  84. // h5
  85. if (link.indexOf("pageId") == -1 && link.indexOf("app:") == -1) {
  86. // uni.navigateTo({
  87. // url: "../../workbench/h5/h5?url=" + link
  88. // })
  89. }
  90. // 原生
  91. if (link.indexOf("pageId") == -1 && link.indexOf("app:") != -1) {
  92. console.log("原生")
  93. if(link.indexOf("/news/news_win") != -1){
  94. console.log("通知公告")
  95. uni.navigateTo({
  96. url:"../../my/message-reminder/message-reminder"
  97. })
  98. }else if(link.indexOf("/workBench/getDuty") != -1){
  99. console.log("值班信息")
  100. uni.navigateTo({
  101. url:"../../workbench/duty_information/duty_information"
  102. })
  103. }else if (link.indexOf("/workBench/huiyiList") != -1) {
  104. uni.navigateTo({
  105. url:"../../workbench/meeting_arrangements/meeting_arrangements"
  106. })
  107. }else{
  108. uni.showToast({
  109. icon:"none",
  110. title:"暂未开通"
  111. })
  112. }
  113. }
  114. },
  115. getmodule(link) {
  116. console.log(link)
  117. console.log(this.mine_code)
  118. // 二维码
  119. if (link.indexOf("pageId") != -1 && link.indexOf("app:") == -1) {
  120. let pageId = ""
  121. function GetQueryString(name) {
  122. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  123. var r = link.match(reg);
  124. if (r != null) return unescape(r[2]);
  125. return null;
  126. }
  127. console.log(GetQueryString("pageId"))
  128. if (GetQueryString("pageId")) {
  129. pageId = GetQueryString("pageId")
  130. } else {
  131. pageId = link.split('=')[1]
  132. }
  133. uni.navigateTo({
  134. url: "../../index/record/record?pageId=" + pageId + "&mine_code=" + this.mine_code,
  135. })
  136. }
  137. // h5
  138. if (link.indexOf("pageId") == -1 && link.indexOf("app:") == -1) {
  139. uni.navigateTo({
  140. url: "../../workbench/h5/h5?url=" + link
  141. })
  142. }
  143. // 原生
  144. if (link.indexOf("pageId") == -1 && link.indexOf("app:") != -1) {
  145. console.log("原生")
  146. console.log(link)
  147. // 发票助手
  148. if (link.indexOf("/workBench/invoice") != -1) {
  149. console.log("发票助手")
  150. uni.navigateTo({
  151. url: "../../workbench/invoice_assistant/invoice_assistant"
  152. })
  153. }else if(link.indexOf("/productionData/logging") != -1){
  154. console.log("下井记录")
  155. // uni.navigateTo({
  156. // url:"../../production/personnel_orientation/downhole_statistics/downhole_statistics?people_num="+people_num+"&depart_name="+depart_name+"&name="+name+"&mine="+this.mine
  157. // })
  158. // people_num 特殊值
  159. if(!uni.getStorageSync('people_code')){
  160. uni.navigateTo({
  161. url:"../../production/personnel_orientation/downhole_statistics/downhole_statistics?people_num=null&depart_name="+uni.getStorageSync('user').section+"&name="+uni.getStorageSync('user').name+"&mine=640323B0011010019259"
  162. })
  163. }else{
  164. uni.navigateTo({
  165. url:"../../production/personnel_orientation/downhole_statistics/downhole_statistics?people_num="+uni.getStorageSync('user').people_code+"&depart_name="+uni.getStorageSync('user').section+"&name="+uni.getStorageSync('user').name+"&mine=640323B0011010019259"
  166. })
  167. }
  168. }else{
  169. uni.showToast({
  170. icon:"none",
  171. title:"暂未开通"
  172. })
  173. }
  174. }
  175. }
  176. },
  177. }
  178. </script>
  179. <style>
  180. .headers {
  181. width: 100%;
  182. background-color: #F5F5F5;
  183. }
  184. .headers_img>image {
  185. width: 100%;
  186. height: 360rpx;
  187. }
  188. .headers_nav {
  189. width: 100%;
  190. background-color: #FFFFFF;
  191. margin-bottom: 25rpx;
  192. }
  193. .headers_ul {
  194. width: 100%;
  195. /* display: flex;
  196. flex-wrap: wrap;
  197. justify-content: space-between; */
  198. margin-top: 10rpx;
  199. overflow: hidden;
  200. }
  201. .headers_ul::after {
  202. content: '';
  203. width: 25%;
  204. }
  205. .headers_title {
  206. margin-left: 40rpx;
  207. padding-top: 30rpx;
  208. padding-bottom: 5rpx;
  209. }
  210. .headers_li {
  211. float: left;
  212. width: 25%;
  213. text-align: center;
  214. margin-bottom: 25rpx;
  215. margin-top: 25rpx;
  216. }
  217. .headers_li_img>image {
  218. width: 100rpx;
  219. height: 100rpx;
  220. margin-bottom: 10rpx;
  221. }
  222. .headers_li_text {
  223. font-size: 14px;
  224. }
  225. .headers_title_h1 {
  226. font-weight: 800;
  227. }
  228. .headers_list {
  229. width: 100%;
  230. background-color: #fff;
  231. }
  232. .ly-tree-node__label {
  233. color: #000000;
  234. }
  235. </style>