t-w-zaoquan.vue 5.3 KB

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