t-w-zaoquan.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  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. // 发票助手
  94. if(link.indexOf("/workBench/invoice") != -1){
  95. console.log("发票助手")
  96. }
  97. }
  98. },
  99. getmodule(link){
  100. console.log(link)
  101. console.log(this.mine_code)
  102. // 二维码
  103. if(link.indexOf("pageId") != -1 && link.indexOf("app:") == -1){
  104. let pageId = ""
  105. function GetQueryString(name) {
  106. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  107. var r = link.match(reg);
  108. if (r != null) return unescape(r[2]);
  109. return null;
  110. }
  111. console.log(GetQueryString("pageId"))
  112. if (GetQueryString("pageId")) {
  113. pageId = GetQueryString("pageId")
  114. } else {
  115. pageId = link.split('=')[1]
  116. }
  117. uni.navigateTo({
  118. url:"../../index/record/record?pageId=" + pageId + "&mine_code=" + this.mine_code,
  119. })
  120. }
  121. // h5
  122. if(link.indexOf("pageId") == -1 && link.indexOf("app:") == -1){
  123. uni.navigateTo({
  124. url:"../../workbench/h5/h5?url=" + link
  125. })
  126. }
  127. // 原生
  128. if(link.indexOf("pageId") == -1 && link.indexOf("app:") != -1){
  129. console.log("原生")
  130. console.log(link)
  131. // 发票助手
  132. if(link.indexOf("/workBench/invoice") != -1){
  133. console.log("发票助手")
  134. uni.navigateTo({
  135. url:"../../workbench/invoice_assistant/invoice_assistant"
  136. })
  137. }
  138. // 下井记录
  139. if(link.indexOf("/productionData/logging") != -1){
  140. console.log("下井记录")
  141. // uni.navigateTo({
  142. // url:"../../production/personnel_orientation/downhole_statistics/downhole_statistics?people_num="+people_num+"&depart_name="+depart_name+"&name="+name+"&mine="+this.mine
  143. // })
  144. // people_num 特殊值
  145. uni.navigateTo({
  146. url:"../../production/personnel_orientation/downhole_statistics/downhole_statistics"
  147. })
  148. }
  149. }
  150. }
  151. },
  152. }
  153. </script>
  154. <style>
  155. .headers{
  156. width: 100%;
  157. background-color: #F5F5F5;
  158. }
  159. .headers_img>image{
  160. width: 100%;
  161. height: 360rpx;
  162. }
  163. .headers_nav{
  164. width: 100%;
  165. background-color: #FFFFFF;
  166. margin-bottom: 25rpx;
  167. }
  168. .headers_ul{
  169. width: 100%;
  170. display: flex;
  171. flex-wrap:wrap;
  172. justify-content: space-around;
  173. margin-top: 10rpx;
  174. }
  175. .headers_ul::after{
  176. content: '';
  177. width: 25%;
  178. }
  179. .headers_title{
  180. margin-left: 40rpx;
  181. padding-top: 30rpx;
  182. padding-bottom: 5rpx;
  183. }
  184. .headers_li{
  185. width: 25%;
  186. text-align: center;
  187. margin-bottom: 25rpx;
  188. margin-top: 25rpx;
  189. }
  190. .headers_li_img>image{
  191. width: 100rpx;
  192. height: 100rpx;
  193. margin-bottom: 20rpx;
  194. }
  195. .headers_li_text{
  196. font-size: 14px;
  197. }
  198. .headers_title_h1{
  199. font-weight: 800;
  200. }
  201. .headers_list{
  202. width: 100%;
  203. background-color: #fff;
  204. }
  205. .ly-tree-node__label{
  206. color: #000000;
  207. }
  208. </style>