马宇豪
2023-07-21 a94d46abe031d827c0e3bc49999cc02782ec09b8
pages/tabBar/notice/notice.vue
@@ -7,6 +7,7 @@
         <!-- 真正的导航栏内容 -->
         <view class="navBar" >
            <view class="barText">{{user.name}}收到的工作通知</view>
            <!-- <view class="barText">{{registerID}}</view> -->
            <!-- <view style="flex: 1;" @click="loginOut">退出</view> -->
         </view>
      </view>
@@ -14,6 +15,11 @@
      <view style="display: flex;flex-direction: column;">
         <view class="buttonGroup">
            <view style="display: flex;">
               <view  class="buttonAll all"
                  :class="{ 'active': selectedSaleAnalysis === 'all'}"
                  @click="handleButtonClick({label: 'all',name: '全部'})">
                  全部
               </view>
               <view v-for="(button, index) in buttons" :key="index" class="buttonItem"
                  :class="{ 'active': selectedSaleAnalysis === button.label,
                   'red': button.label === 'red',
@@ -25,7 +31,7 @@
               </view>
            </view>
            <view class="switchBtn">
               <text style="margin-right: 7px;">是否紧临</text>
               <text style="margin-right: 7px;">仅紧临</text>
               <u-switch v-model="checked" size="20" @change="clickSwitch"></u-switch>
            </view>
         </view>
@@ -45,7 +51,7 @@
                           <u-button @click="toDetail(item)"v-if="item.buttonContent == '已叫应'" size="mini" style="margin-bottom: 10px;background-color:rgb(17, 204, 33);color: white;">
                              {{item.buttonContent}}
                           </u-button>
                           <u-button v-else-if="item.buttonContent == '未叫应'" type="error" size="mini" style="margin-bottom: 10px;" @click="openDialog(item)">
                           <u-button v-else-if="item.buttonContent == '待叫应'" type="error" size="mini" style="margin-bottom: 10px;" @click="openDialog(item)">
                              {{item.buttonContent}}
                           </u-button>
                           <u-button @click="toDetail(item)" v-else type="error" size="mini" style="margin-bottom: 10px;">
@@ -100,15 +106,15 @@
            tabBarLists: [],
            // 状态栏高度
            statusBarHeight: 0,
            checked: true,
            checked: false,
            isReadOnly: false,
            showDialog: false,
            data: {
               pageIndex: 1,
               pageSize: 1000,
               pageSize: 10000000,
               searchParams: {
                  emergType: 1,//1-紧急;2-常规
                  warningLevel: 1,//1-红色预警;2-橙色预警;3-黄色预警;4-蓝色预警
                  emergType: null,//1-紧急;2-常规
                  warningLevel: null,//1-红色预警;2-橙色预警;3-黄色预警;4-蓝色预警
                  readStatus: null//0-未读,1-已读
               }
            },
@@ -129,21 +135,22 @@
               name: '蓝'
            },
            ],
            selectedSaleAnalysis: 'red',
            selectedSaleAnalysis: 'all',
            noticeListCopy: [],
            noticeListCopyRead:[],
            noticeList: [],
            user: {
               name: ''
            },
            page: 'pages/tabBar/notice/notice'
            page: 'pages/tabBar/notice/notice',
            registerID: ''
         }
      },
      onShow () {
         this.tabBarLists = uni.getStorageSync('tabBarList');
         this.user.name = uni.getStorageSync('user').realName + uni.getStorageSync('user').name;
         // this.selectedSaleAnalysis = 'red',
         this.user.name = uni.getStorageSync('user').realName;
         this.getNoticeList();
         // this.registerID = uni.getStorageSync('registrationID');
         // this.page = this.$route.meta.pagePath;
      },
      onLoad() {
@@ -155,10 +162,10 @@
      methods: {
         getNoticeList() {
            this.data.searchParams.readStatus = this.isReadOnly ? 0 : null; 
            this.data.searchParams.emergType = this.checked ? 1 : 2;
            this.data.searchParams.warningLevel = this.selectedSaleAnalysis =='red' ? 1 : this.selectedSaleAnalysis =='orange' ? 2: this.selectedSaleAnalysis =='yellow'? 3 : 4;
            this.data.searchParams.emergType = this.checked ? 1 : null ;
            this.data.searchParams.warningLevel =  this.selectedSaleAnalysis =='all' ? null : this.selectedSaleAnalysis =='red' ? 1 : this.selectedSaleAnalysis =='orange' ? 2: this.selectedSaleAnalysis =='yellow'? 3 : 4;
            getNotice(this.data).then(res => {
               console.log("res",res);
               console.log("dddddr",res);
               if (res.code == 100) {
                  this.noticeList = res.data ? res.data : [];
                  this.noticeListCopy = this.noticeList;
@@ -285,8 +292,24 @@
   height: 30px;
   border-radius: 5px;
}
.buttonAll{
   margin-left:5px;
   color: white;
   display: flex;
   flex-direction: row;
   justify-content: center;
   align-items: center;
   width: 35px;
   height: 30px;
   border-radius: 5px;
   font-size: 12px;
   font-weight: 700;
}
.all {
   background-color: rgb(17,204,33);
}
.active {
   border: 1px solid gray;
   border: 1.5px solid #8d8d8d;
}
.red {
   background-color: red;