diff --git a/src/assets/icons/NoMessage.vue b/src/assets/icons/NoMessage.vue new file mode 100644 index 0000000..730e8c9 --- /dev/null +++ b/src/assets/icons/NoMessage.vue @@ -0,0 +1,3 @@ + diff --git a/src/directives/time.ts b/src/directives/time.ts index eaaff3e..37995f1 100644 --- a/src/directives/time.ts +++ b/src/directives/time.ts @@ -29,9 +29,7 @@ var Time = { //获取标准年月日 getLastDate: function (time) { var date = new Date(time); - var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1; - var day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate(); - return date.getFullYear() + '-' + month + '-' + day; + return date.getFullYear(); }, //转换时间 getFormateTime: function (timestamp) { @@ -52,8 +50,12 @@ var Time = { tip = Math.floor(timer / 3600) + '小时前'; } else if (timer / 86400 <= 31) { tip = Math.ceil(timer / 86400) + '天前'; + } else if (timer / 259200 <= 12) { + tip = Math.ceil(timer / 259200) + '月前'; + } else if (timer / 31536000 <= 10) { + tip = Math.ceil(timer / 31536000) + '年前'; } else { - tip = this.getLastDate(timestamp); + tip = this.getLastDate(timestamp) + '年'; } return tip; } diff --git a/src/layout/components/tags.vue b/src/layout/components/tags.vue index 901bc43..52c6dbd 100644 --- a/src/layout/components/tags.vue +++ b/src/layout/components/tags.vue @@ -4,6 +4,9 @@
  • + + + {{ tag.meta.title }} diff --git a/src/layout/components/userbar.vue b/src/layout/components/userbar.vue index 5738cdb..6b0a116 100644 --- a/src/layout/components/userbar.vue +++ b/src/layout/components/userbar.vue @@ -21,15 +21,46 @@ -
    - - - - - - - - +
    + + + +
    @@ -49,9 +80,10 @@
    - + - +
    @@ -81,13 +113,16 @@ const {proxy} = getCurrentInstance() const router = useRouter() const {t} = useI18n() +const msgVisible = ref(true); let searchVisible = ref(false) let msg = ref(false) -let msgNum = ref(0) +let msgNum = ref(2) +let msgList = ref([]) const tasksVisible = ref(false) let taskNum = ref(0) const settingDialog = ref(false) const userInfo = tools.data.get("USER_INFO"); +let msgTab = ref("notice") let realname = userInfo.realname; let realnameF = realname.substring(0, 1); @@ -183,25 +218,50 @@ function screen() { tools.screen(document.documentElement) } -//显示短消息 -function showMsg() { - msg.value = true -} - -function closeMsg(num) { - if (num > -1) { - msgNum.value = num - } - msg.value = false -} - async function loadData() { // let res = await this.$API.home.message.newCount() // this.msgNum = res.data.count + msgNum.value = 5 + msgList.value.push({ + title: '您有一笔新的订单请及时处理。您有一笔新的订单请及时处理', + time: '2025-06-17 17:59:21' + }) + msgList.value.push({ + title: '您有一笔新的订单请及时处理。您有一笔新的订单请及时处理', + time: '2025-06-16 10:29:30' + }) + msgList.value.push({ + title: '您有一笔新的订单请及时处理。', + time: '2025-06-15 12:29:30' + }) + msgList.value.push({ + title: '您有一笔新的订单请及时处理。', + time: '2025-05-15 12:29:30' + }) + msgList.value.push({ + title: '您有一笔新的订单请及时处理。', + time: '2025-01-16 12:29:30' + }) + msgList.value.push({ + title: '您有一笔新的订单请及时处理。', + time: '2024-06-15 12:29:30' + }) + msgList.value.push({ + title: '您有一笔新的订单请及时处理。', + time: '2024-06-15 12:29:30' + }) + msgList.value.push({ + title: '您有一笔新的订单请及时处理。', + time: '2015-06-15 12:29:30' + }) + msgList.value.push({ + title: '您有一笔新的订单请及时处理。', + time: '2025-06-15 12:29:30' + }) } - diff --git a/src/style/app.scss b/src/style/app.scss index c75349d..39107b3 100644 --- a/src/style/app.scss +++ b/src/style/app.scss @@ -89,7 +89,8 @@ a,button,input,textarea{-webkit-tap-highlight-color:rgba(0,0,0,0);box-sizing: bo .pi-tags li {cursor: pointer;display: inline-block;float: left;height:34px;line-height: 34px;position: relative;flex-shrink: 0;} .pi-tags li::after {content: " ";width:1px;height:100%;position: absolute;right:0px;background-image: linear-gradient(#fff, #e6e6e6);} .pi-tags li a {display: inline-block;padding:0 10px;width:100%;height:100%;color: #999;text-decoration:none;display: flex;align-items: center;} -.pi-tags li i {margin-left:10px;border-radius: 3px;width:18px;height:18px;display: flex;align-items: center;justify-content: center;} +.pi-tags li i {border-radius: 3px;width:18px;height:18px;display: flex;align-items: center;justify-content: center;} +.pi-tags li span {margin-right: 5px;margin-left: 5px;} .pi-tags li i:hover {background: rgba(0,0,0,.2);color: #fff;} .pi-tags li:hover {background: #ecf5ff;} .pi-tags li.active {background: #409EFF;}