123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234 |
- <template>
- <view class="headers">
- <view class="headers_img">
- <image :src="header" mode="aspectFill"></image>
- </view>
- <view class="headers_nav">
- <view class="headers_ul">
- <view class="headers_li" v-for="(item,index) in nav" :key="index" @click="getnav(item.link)">
- <view class="headers_li_img">
- <image :src="item.icon" mode=""></image>
- </view>
- <view class="headers_li_text">
- {{item.title}}
- </view>
- </view>
- </view>
- </view>
-
-
- <view class="headers_list" v-for="(item,index) in module" :key="index">
- <view class="headers_title">
- <text class="headers_title_h1">
- {{item.title}}
- </text>
- </view>
- <view class="headers_ul" >
- <view class="headers_li" v-for="(items,index) in item.children" :key="index" @click="getmodule(items.link)">
- <view class="headers_li_img">
- <image :src="items.icon" mode=""></image>
- </view>
- <view class="headers_li_text">
- {{items.title}}
- </view>
-
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- props: [
- "mine_code"
- ],
- data() {
- return {
- module:[],
- nav:[],
- header:"",
- };
- },
- created() {
- this.getworkbench()
- },
- methods:{
- getworkbench(){
- this.$api.workbench_index({
-
- }).then((res)=>{
- console.log(res)
- this.header=res.data.data.header
- this.nav=res.data.data.nav
- this.module=res.data.data.module
-
- })
- },
- getnav(link){
- console.log(link)
- // 二维码
- if(link.indexOf("pageId") != -1 && link.indexOf("app:") == -1){
- let pageId = ""
- function GetQueryString(name) {
- var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
- var r = link.match(reg);
- if (r != null) return unescape(r[2]);
- return null;
- }
- console.log(GetQueryString("pageId"))
- if (GetQueryString("pageId")) {
- pageId = GetQueryString("pageId")
- } else {
- pageId = link.split('=')[1]
- }
-
- uni.navigateTo({
- url:"../../index/record/record?pageId=" + pageId + "&mine_code=" + this.mine_code,
- })
- }
- // h5
- if(link.indexOf("pageId") == -1 && link.indexOf("app:") == -1){
- uni.navigateTo({
- url:"../../workbench/h5/h5?url=" + link
- })
- }
- // 原生
- if(link.indexOf("pageId") == -1 && link.indexOf("app:") != -1){
- console.log("原生")
-
- console.log(link)
-
- if(link.indexOf("/news/news_win") != -1){
- console.log("通知公告")
-
- uni.navigateTo({
- url:"../../my/message-reminder/message-reminder"
- })
- }
- if(link.indexOf("/workBench/getDuty") != -1){
- console.log("值班信息")
-
- uni.navigateTo({
- url:"../../workbench/duty_information/duty_information"
- })
- }
- }
- },
- getmodule(link){
- console.log(link)
- console.log(this.mine_code)
-
- // 二维码
- if(link.indexOf("pageId") != -1 && link.indexOf("app:") == -1){
- let pageId = ""
- function GetQueryString(name) {
- var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
- var r = link.match(reg);
- if (r != null) return unescape(r[2]);
- return null;
- }
- console.log(GetQueryString("pageId"))
- if (GetQueryString("pageId")) {
- pageId = GetQueryString("pageId")
- } else {
- pageId = link.split('=')[1]
- }
-
- uni.navigateTo({
- url:"../../index/record/record?pageId=" + pageId + "&mine_code=" + this.mine_code,
- })
- }
- // h5
- if(link.indexOf("pageId") == -1 && link.indexOf("app:") == -1){
- uni.navigateTo({
- url:"../../workbench/h5/h5?url=" + link
- })
- }
- // 原生
- if(link.indexOf("pageId") == -1 && link.indexOf("app:") != -1){
- console.log("原生")
-
- console.log(link)
- // 发票助手
- if(link.indexOf("/workBench/invoice") != -1){
- console.log("发票助手")
- uni.navigateTo({
- url:"../../workbench/invoice_assistant/invoice_assistant"
- })
- }
- // 下井记录
- if(link.indexOf("/productionData/logging") != -1){
- console.log("下井记录")
- // uni.navigateTo({
- // url:"../../production/personnel_orientation/downhole_statistics/downhole_statistics?people_num="+people_num+"&depart_name="+depart_name+"&name="+name+"&mine="+this.mine
- // })
-
- // people_num 特殊值
- uni.navigateTo({
- url:"../../production/personnel_orientation/downhole_statistics/downhole_statistics"
- })
- }
- }
-
- }
- },
-
- }
- </script>
- <style>
- .headers{
- width: 100%;
- background-color: #F5F5F5;
- }
- .headers_img>image{
- width: 100%;
- height: 360rpx;
- }
- .headers_nav{
- width: 100%;
- background-color: #FFFFFF;
- margin-bottom: 25rpx;
- }
- .headers_ul{
- width: 100%;
- display: flex;
- flex-wrap:wrap;
- justify-content: space-around;
- margin-top: 10rpx;
- }
- .headers_ul::after{
- content: '';
- width: 25%;
- }
- .headers_title{
- margin-left: 40rpx;
- padding-top: 30rpx;
- padding-bottom: 5rpx;
- }
- .headers_li{
- width: 25%;
- text-align: center;
- margin-bottom: 25rpx;
- margin-top: 25rpx;
- }
- .headers_li_img>image{
- width: 100rpx;
- height: 100rpx;
- margin-bottom: 20rpx;
- }
- .headers_li_text{
- font-size: 14px;
- }
- .headers_title_h1{
- font-weight: 800;
- }
- .headers_list{
- width: 100%;
- background-color: #fff;
- }
- .ly-tree-node__label{
- color: #000000;
- }
- </style>
|