| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245 |
- <template>
- <view>
- <!-- 工作台头图 -->
- <view class="top">
- <image :src="header"></image>
- </view>
- <!-- nav -->
- <view class="section">
- <view class="list">
- <view class="item" v-for="(item,index) in nav" :key="index" @click="go_link(item)">
- <view class="icon">
- <image :src="item.icon" mode=""></image>
- </view>
- <view class="name">
- <view class="num"
- v-if="item.link.indexOf('http://oa_system.nxjiewei.com:8011/?m=ying&d=we&num=daiban&hideheader=true') != -1 && num_1 > 0">
- {{num_1}}
- </view>
- <view class="num"
- v-if="item.link.indexOf('http://oa_system.nxjiewei.com:8011/?m=ying&d=we&num=todo&hideheader=true') != -1 && num_2 > 0">
- {{num_2}}
- </view>
- <view class="name_title">{{item.title}}</view>
- <view class="sub_title">{{item.sub_title}}</view>
- </view>
- </view>
- </view>
- </view>
- <view class="section" v-for="(item,index) in module" :key="index">
- <view class="title">
- <view class="icon">
- <image :src="item.icon" mode=""></image>
- </view>
- <view class="text">{{item.title}}</view>
- </view>
- <view class="list">
- <view class="item" v-for="(item_2,index_2) in item.children" :key="index_2" @click="go_link(item_2)">
- <view class="icon">
- <image :src="item_2.icon" mode=""></image>
- </view>
- <view class="name">
- <view class="name_title">{{item_2.title}}</view>
- <view class="sub_title">{{item_2.sub_title}}</view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- goToLink
- } from "@/common/common.js"
- export default {
- data() {
- return {
- // 当前煤矿编码
- mine_code: "",
- // 头部图片
- header: "",
- nav: [],
- module: [],
- num_1: 0,
- num_2: 0
- };
- },
- onLoad() {
- // 初始化当前煤矿编码
- this.mine_code = uni.getStorageSync('mine_code')
- this.get_workbench_index()
- },
- onShow() {
- this.get_workflow_todo_query()
- },
- methods: {
- // 获取基础数据
- get_workbench_index() {
- this.$api.workbench_index({
- }).then((res) => {
- // console.log(res.data.data)
- this.header = res.data.data.header
- this.nav = res.data.data.nav
- this.module = res.data.data.module
- })
- },
- // 获取消息提醒数量
- get_workflow_todo_query() {
- this.$api.workflow_todo_query({
- staff_num: uni.getStorageSync('user').staff_num,
- query_type: 2
- }).then((res) => {
- this.num_1 = res.data.content.data
-
- this.$api.workflow_todo_query({
- staff_num: uni.getStorageSync('user').staff_num,
- query_type: 1
- }).then((res) => {
-
- this.num_2 = res.data.content.data
-
- let num = this.num_1 + this.num_2
-
- // if(num > 0){
- // uni.setTabBarBadge({
- // index: 2,
- // text: '' + num + ''
- // })
- // }
-
- })
- })
- },
- go_link(item) {
- // console.log(item)
- goToLink(item, this.mine_code)
- },
-
- },
- }
- </script>
- <style lang="scss">
- page {
- background-color: #F2FAF7;
- margin-bottom: 20rpx;
- }
- .top {
- image {
- width: 750rpx;
- height: 270rpx;
- display: block;
- }
- }
- .section {
- margin-top: 20rpx;
- background-color: #FFFFFF;
- padding: 25rpx;
- .title {
- display: flex;
- align-items: center;
- height: 90rpx;
- .icon {
- margin-right: 20rpx;
- image {
- width: 50rpx;
- height: 50rpx;
- display: block;
- }
- }
- .text {
- font-weight: 700;
- font-size: 34rpx;
- }
- }
- .list {
- margin-top: 30rpx;
- width: 700rpx;
- overflow: hidden;
- .item {
- float: left;
- margin-bottom: 30rpx;
- width: 350rpx;
- display: flex;
- align-items: center;
- height: 140rpx;
- .icon {
- margin-bottom: 10rpx;
- image {
- width: 90rpx;
- height: 90rpx;
- display: block;
- }
- }
- .name {
- position: relative;
- margin-left: 20rpx;
- .num {
- z-index: 10;
- position: absolute;
- top: -10rpx;
- right: -50rpx;
- width: 40rpx;
- text-align: center;
- line-height: 40rpx;
- background-color: #F56C6C;
- border-radius: 50%;
- color: #FFF;
- font-size: 26rpx;
- }
- .name_title {
- font-size: 28rpx;
- margin-bottom: 10rpx;
- }
- .sub_title {
- font-size: 24rpx;
- color: #999;
- }
- }
- }
- .item:nth-child(2n) {
- box-sizing: border-box;
- border-left: 1rpx solid #F2FAF7;
- padding-left: 40rpx;
- }
- }
- }
- </style>
|