jiangping
2025-06-06 a2299a6d4a6f99e9c11132138f5d3e9ec68f03ea
h5/pages/index.vue
@@ -1,6 +1,6 @@
<template>
   <view class="main_app">
      <view class="hone_name title">{{ userInfo.realname }},欢迎登录</view>
      <view class="hone_name title">{{ userInfo.realname }},欢迎登录~</view>
      <view class="home_con">
         <image class="bg" src="@/static/home/home_bg.jpg" mode=""></image>
         <view class="h1">阜宁文体中心</view>
@@ -17,21 +17,24 @@
      <view class="list">
         <view v-for="item in list2" class="item" @click="itemClick(item)">
            <image :src="item.img"></image>
            <view class="name">{{item.name}}</view>
            <view class="name">{{item.name}}</view>
            <view v-if="item.name == '待办中心' && taskNum" class="superscript">{{taskNum}}</view>
         </view>
      </view>
      <view class="loginout" @click="loginOut">退出登陆</view>
   </view>
</template>
<script>
   import { logoutPost } from '@/api'
<script>
   import {
      logoutPost,
      myNoticesH5
   } from '@/api'
   export default {
      data() {
         return {
            userInfo: uni.getStorageSync('userInfo') || {},
            list1: [
               {
            list1: [{
                  name: '新增工单',
                  url: '/pages/workOrder/edit',
                  img: require('@/static/home/ic_xinzenggongdan@2x.png'),
@@ -48,6 +51,12 @@
                  url: '/pages/operation/device',
                  img: require('@/static/home/ic_fangkebaobe@2x.png'),
                  auth: 'weixin:menu:visitcar'
               },
               {
                  name: '库存盘点',
                  url: '/pages/inventory/index',
                  img: require('@/static/home/ic_pandian@2x.png'),
                  auth: 'weixin:menu:visitcar'
               },
            ],
            list2: [{
@@ -61,12 +70,21 @@
                  url: '/pages/operation/record',
                  img: require('@/static/home/ic_wodehuiyi@2x.png'),
                  auth: 'weixin:menu:visitcar'
               },
               {
                  name: '待办中心',
                  url: '/pages/workOrder/wait',
                  img: require('@/static/home/ic_daiban@2x.png'),
                  auth: 'weixin:menu:visitcar'
               },
            ]
            ],
            taskNum: 0
         }
      },
      onLoad() {
      onShow() {
         myNoticesH5({ page: 1, capacity: 1,model: {status: 0}}).then(res => {
            this.taskNum = res.data.total
         })
      },
      methods: {
         itemClick(item) {
@@ -74,12 +92,15 @@
               url: item.url
            })
         },
         loginOut() {
            logoutPost()
            this.$store.commit('empty')
            uni.redirectTo({
               url: '/pages/login'
            })
         loginOut() {
            logoutPost().then(res => {
               this.$store.commit('empty')
               setTimeout(() => {
                  uni.redirectTo({
                     url: '/pages/login'
                  })
               }, 300)
            })
            // window.location.href= 'https://zhcg.fnwtzx.com/fn_h5'
         },
@@ -128,8 +149,8 @@
            display: flex;
            flex-direction: column;
            align-items: center;
            width: 25%;
            width: 25%;
            position: relative;
            image {
               width: 88rpx;
               height: 88rpx;
@@ -139,6 +160,20 @@
            .name {
               font-size: 26rpx;
            }
            .superscript{
               height: 40rpx;
               width: 40rpx;
               position: absolute;
               top: -16rpx;
               right: 24rpx;
               background-color: red;
               color: #fff;
               font-size: 24rpx;
               display: flex;
               align-items: center;
               justify-content: center;
               border-radius: 50%;
            }
         }
      }