123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241 |
- <template>
- <div class="all-box" :class="isIos ? 'isIos' : ''">
- <div style="height: 100%;">
- <initHome v-if="active_index===0" @activeMenu="activeMenu" ref="initHome"/>
- <department v-if="active_index===1" isHide></department>
- <userCenter v-if="active_index===2" ref="userCenter"></userCenter>
- </div>
- <!-- 导航 -->
- <van-tabbar v-model="active_index" :class="isIos ? 'padding-m' : ''" :fixed="false">
- <van-tabbar-item>
- <icon :name="tabs == 0? 'statistics_checked':'statistics'" :class="tabs == 0? 'active':''"></icon>
- <span>首页</span>
- </van-tabbar-item>
- <van-tabbar-item>
- <icon :name="tabs == 1? 'footer_nav_work_press':'footer_nav_work'" :class="tabs == 1? 'active':''"></icon>
- <span>组织</span>
- </van-tabbar-item>
- <van-tabbar-item>
- <icon :name="tabs == 2? 'footer_nav_me_press':'footer_nav_me'" :class="tabs == 2? 'active':''"></icon>
- <span>我的</span>
- </van-tabbar-item>
- </van-tabbar>
- <van-popup v-model="updateVisible" :close-on-click-overlay="false" style="border-radius: 0.15rem; background: #fff0; overflow: visible;">
- <div class="buyPopupBody" style="width: 85vw;">
- <div class="buyPopupContent">
- <div class="buyPopupTitle"> {{announcement.type == 1? '版本更新':'系统公告'}}</div>
- <div style="padding: 0.5rem 0.3rem 0.3rem 0.3rem; overflow-y: auto;font-size: 0.3rem; box-sizing: border-box;" v-html="announcement.focus"></div>
- <van-row gutter="20">
- <van-col span="12"><van-button block type="info" @click="updateVisible=false">我知道了</van-button></van-col>
- <van-col span="12"><van-button block type="default" @click="getItemBuyPopupPage">查看详情</van-button></van-col>
- </van-row>
- </div>
- </div>
- </van-popup>
- </div>
- </template>
- <script>
- import initHome from '@/view/body/initHome';
- import userCenter from '@/view/body/userCenter';
- import department from '@/view/user/department';
- // import management from '@/point/view/body/management';
- // import messageList from '@/point/view/body/messageList';
- import {get_employee_all} from '@/api/login';
- export default {
- components: {userCenter,initHome,department},
- data() {
- return {
- isIos:this.$getCache('iPhone'),
- active_index:0,
- tabs:0,
- manNUm: 0, // 绩效数
- // 公共
- updateVisible:false,
- announcement:'',
- };
- },
- watch: {
- active_index(val){
- this.tabs = val;
- }
- },
- methods: {
- IsPC() {
- var userAgentInfo = navigator.userAgent;
- var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"];
- var flag = true;
- for (var v = 0; v < Agents.length; v++) {
- if (userAgentInfo.indexOf(Agents[v]) > 0) {
- flag = false;
- break;
- }
- }
- return flag;
- },
- //系统公告
- noticeList() {
- let params = { page: 1, page_size: 10 };
- this.$axiosUser('get', '/api/pro/announcement/list', params).then(res => {
- if (res.data.code == 1) {
- let list = res.data.data.list[0];
- if(!list){
- return false
- }
- if (localStorage.getItem('noticeId')) {
- if (localStorage.getItem('noticeId') != list.id) {
- this.updateVisible = true;
- localStorage.setItem('noticeId', list.id);
- }
- } else {
- localStorage.setItem('noticeId', list.id);
- this.updateVisible = true;
- }
- this.announcement = list;
- }
- });
- },
- getItemBuyPopupPage() {
- this.updateVisible = false;
- this.$router.push({ path: '/noticeList' });
- },
- setEmployee() {
- get_employee_all().then(res => {
- if (res.data.code == 1) {
- let list = res.data.data.list;
- let data = {};
- list.forEach((item, index) => {
- if (item.status == 2) {
- item.name = item.name + '(已离职)';
- }
- data[item.id] = item;
- });
- if (window.plus) {
- plus.storage.setItem('SET_EMPLOYEE_MAP_JX', JSON.stringify(data));
- } else {
- localStorage.setItem('SET_EMPLOYEE_MAP_JX', JSON.stringify(data));
- }
- }
- });
- },
- activeMenu() {
- this.active_index = 1;
- },
- shwoCunt() {
- this.$axiosUser('get', '/api/pro/notice/number').then(res => {
- this.cuntNum = res.data.data;
- });
- },
- },
- created() {
- if (this.IsPC()&&process.env.NODE_ENV == 'production') {
- this.$router.replace({name: 'error'}); // 提示去APP端
- return false
- }
- this.shwoCunt();
- this.setEmployee();
- this.noticeList();
- },
- };
- </script>
- <style scoped lang="scss">
- .all-box{
- height: calc(100% - 1rem) !important;
- position: relative;
- }
- .isIos {
- height: calc(100% - 1.4rem) !important;
- }
- .padding-m {
- padding-bottom: 0.4rem;
- }
- /deep/ .shortcut-option-btn .van-icon {
- font-size: 0.6rem;
- }
- .all-box /deep/ .van-tabbar-item {
- text-align: center;
- position: relative;
- }
- .all-box /deep/ .van-tabbar-item .svg-icon {
- color: #606266;
- height: 0.36rem;
- margin-bottom: 0.08rem;
- }
- .all-box .footer_nav_add_press {
- height: 0.8rem !important;
- }
- .all-box /deep/ .van-tabbar-item .active {
- color: #238dfa;
- }
- .all-box /deep/ .van-tabbar-item span {
- display: block;
- font-size: 0.2rem;
- margin-bottom: 0.08rem;
- }
- // .buyPopupBody {
- // width: 85vw;
- // }
- // .buyPopupContent{
- // background: white;
- // padding:0.2rem 0.24rem;
- // border-radius: 0.15rem;
- // }
- // .buyPopupTitle{
- // background: #1a89fa;
- // text-align: center;
- // border-radius: 0.1rem;
- // font-weight: normal;
- // font-size: 0.32rem;
- // height: 0.8rem;
- // line-height: 0.8rem;
- // color: #fff;
- // margin-top: 0.24rem;
- // }
- .buyPopupBody {
- width: 85vw;
- .buyPopupContent {
- position: relative;
- background: white;
- padding: 0 5vw 5vw 5vw;
- border-radius: 0.15rem;
- .buyPopupTitle {
- background: #1a89fa;
- position: absolute;
- left: 0.6rem;
- right: 0.6rem;
- top: -0.3rem;
- text-align: center;
- border-radius: 0.1rem;
- line-height: 2;
- font-weight: normal;
- font-size: 0.36rem;
- color: #fff;
- }
- .buyPopupTxt {
- font-size: 0.32rem;
- line-height: 1.8;
- padding-top: 0.8rem;
- }
- .buyPopupTel {
- color: #1a89fa;
- font-weight: bold;
- }
- }
- }
- .buyPopupContent /deep/ img,.buyPopupContent /deep/ ul,.buyPopupContent /deep/ li,.buyPopupContent /deep/ p{
- width: 100%;
- }
- </style>
|