jiangping
2024-05-09 a168fee5f88202e1cb3bec88b3d78d02c2368774
h5/pages/staff/meetingSub.vue
@@ -1,9 +1,9 @@
<template>
   <view class="main_app">
      <view class="heade_title">
         <image class="icon" src="../../static/staff/ar_left@2x.png" mode="widthFix"></image>
         <text class="date">{{ activeDate }}</text>
         <image class="icon" src="../../static/staff/ar_right@2x.png" mode="widthFix"></image>
         <image class="icon" src="../../static/staff/ar_left@2x.png" @click="changeDate(-1)" mode="widthFix"></image>
         <text class="date">{{ activeDateCum }}</text>
         <image class="icon" src="../../static/staff/ar_right@2x.png" @click="changeDate(1)" mode="widthFix"></image>
      </view>
      <!--  -->
      <view class="meeting_list">
@@ -56,11 +56,12 @@
</template>
<script>
   import dayjs from 'dayjs'
   export default {
      data() {
         return {
            activeDate: '2022年',
            isShowDetail: true,
            activeDate: '',
            isShowDetail: false,
            meetingList: [
               { name: '201会议室' },
               { name: '201会议室' },
@@ -81,6 +82,23 @@
            ]
            
         };
      },
      computed: {
         activeDateCum(){
            const { activeDate } = this
            let weeks = ['周日', '周一','周二','周三','周四','周五','周六']
            return dayjs(activeDate).format('YYYY年M月D日') + ' ' + weeks[dayjs(activeDate).day()]
         }
      },
      created() {
         this.activeDate = dayjs().format('YYYY-MM-DD')
      },
      methods: {
         changeDate(num){
            const { activeDate } = this
            let fn = num > 0 ? 'add' : 'subtract'
            this.activeDate = dayjs(activeDate)[fn](1, 'days').format('YYYY-MM-DD')
         }
      }
   }
</script>