Browse Source

智能提醒的bug

feature
dai 3 years ago
parent
commit
b34fdc9c2d
  1. BIN
      src/assets/images/main/clear.png
  2. BIN
      src/assets/images/main/close.png
  3. 6
      src/assets/scss/common.scss
  4. 140
      src/views/main-navbar.vue
  5. 134
      src/views/modules/home/notice.vue

BIN
src/assets/images/main/clear.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1020 B

BIN
src/assets/images/main/close.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 560 B

6
src/assets/scss/common.scss

@ -414,12 +414,12 @@ img {
font-size: 16px;
}
.img-nav {
@include cs;
position: relative;
display: inline-block;
width: 24px;
height: 24px;
vertical-align: middle;
overflow: hidden;
@keyframes flicker {
/* 旋转沿x轴旋转-10度,再绕y轴旋转 */
0% {
@ -430,6 +430,9 @@ img {
opacity: 1;
}
}
.img-wrap {
overflow: hidden;
}
&.z-on {
animation: flicker 0.9s linear infinite;
@ -441,6 +444,7 @@ img {
width: 24px;
height: 24px;
filter: drop-shadow(100px 0px rgba(#000, 0.85));
overflow: hidden;
}
&:hover {

140
src/views/main-navbar.vue

@ -86,16 +86,20 @@
>
<el-menu-item index="3" @click="fullscreenHandle()">
<div class="img-nav">
<img src="~@/assets/images/main/time.png" />
<div class="img-wrap">
<img src="~@/assets/images/main/time.png" />
</div>
</div>
</el-menu-item>
<el-menu-item index="2" @click="toRemindPage">
<el-menu-item index="2" @click="toNoticePage">
<div class="img-nav" :class="{ 'z-on': false }">
<span class="corner-dot" v-if="unreadMsgNum > 0">{{
unreadMsgNum
}}</span>
<img src="~@/assets/images/main/hint.png" />
<div class="img-wrap">
<img src="~@/assets/images/main/hint.png" />
</div>
</div>
</el-menu-item>
@ -136,6 +140,23 @@
></update-password-work>
</nav>
<nav v-else class="aui-navbar main-line"></nav>
<div
class="m-newMsg"
v-if="noticeList.length > 0 && displayedNoticeList"
>
<div class="title">新提醒</div>
<div class="btn-close" @click="displayedNoticeList = false">
<img src="~@/assets/images/main/close.png" />
</div>
<div class="row">
<span class="date">{{ noticeList[0].createdTime }}</span>
<i class="i-new">NEW</i>
</div>
<div class="cnt" @click="toNoticePage">
{{ noticeList[0].content }}
</div>
</div>
</div>
</template>
@ -157,6 +178,10 @@ export default {
customerName: "",
unreadMsgNum: 0,
noticeList: [],
displayedNoticeList: true,
};
},
components: {
@ -182,7 +207,8 @@ export default {
},
},
methods: {
toRemindPage() {
toNoticePage() {
this.displayedNoticeList = false;
this.$router.replace("/main/home-notice");
},
@ -284,15 +310,39 @@ export default {
const { data, code, msg } = await requestGet(url, {});
if (code === 0) {
console.log("列表请求成功!!!!!!!!!!!!!!");
if (data.unreadNum > 0 && this.unreadMsgNum < data.unreadNum) {
this.getNoticeList();
this.displayedNoticeList = true;
}
this.unreadMsgNum = data.unreadNum;
} else {
}
},
//
async getNoticeList() {
const url = "/message/intelligentMessage/page";
let params = {
page: this.pageNo,
limit: this.pageSize,
readFlag: 0,
};
const { data, code, msg } = await requestGet(url, params);
if (code === 0) {
this.noticeList = data.list;
} else {
this.$message.error(msg);
}
},
},
};
</script>
<style lang="scss" scoped>
@import "~@/assets/scss/c/function.scss";
.main-line {
height: 50px;
background: #eeeeee;
@ -303,20 +353,90 @@ export default {
.corner-dot {
position: absolute;
z-index: 100;
display: block;
display: block;
top: -5px;
right: -5px;
right: 2px;
padding: 0 3px;
min-width: 16px;
height: 16px;
line-height: 16px;
transform: translateX(50%);
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #ffffff;
line-height: 16px;
min-width: 16px;
height: 16px;
background: #ff4d4f;
border-radius: 100%;
border-radius: 8px;
border: 1px solid #ffffff;
text-align: center;
}
}
.m-newMsg {
position: fixed;
z-index: 2000;
right: 30px;
box-sizing: border-box;
padding: 16px;
width: 320px;
background: #ffffff;
box-shadow: 0px 6px 16px 0px rgba(0, 0, 0, 0.08),
0px 3px 6px -4px rgba(0, 0, 0, 0.12);
border-radius: 4px;
.title {
margin-bottom: 16px;
height: 22px;
font-size: 16px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: rgba(0, 0, 0, 0.85);
line-height: 22px;
}
.btn-close {
position: absolute;
top: 15px;
right: 10px;
padding: 6px;
img {
width: 16px;
}
}
.row {
display: flex;
align-items: center;
}
.date {
height: 17px;
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.45);
line-height: 17px;
}
.i-new {
margin-left: 8px;
width: 40px;
height: 16px;
background: #eb512f;
border-radius: 2px;
font-size: 12px;
font-family: Arial-BoldItalicMT, Arial;
font-weight: normal;
color: #ffffff;
line-height: 16px;
text-align: center;
}
.cnt {
@include toeM(2);
margin-top: 3px;
padding-bottom: 0;
width: 288px;
height: 44px;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.85);
line-height: 22px;
}
}
</style>

134
src/views/modules/home/notice.vue

@ -2,14 +2,13 @@
<div>
<div class="m-tx">
<div class="wrap">
<div class="tabs">
<el-tabs v-model="type" @tab-click="handleClickTab">
<el-tab-pane label="全部" name="all"></el-tab-pane>
<el-tab-pane label="已读" name="readed"></el-tab-pane>
<el-tab-pane label="未读" name="unreaded"></el-tab-pane>
</el-tabs>
<div class="header">
<div class="title">全部提醒</div>
<div class="btn-clear" @click="read">
<img src="~@/assets/images/main/clear.png" />
全部标记已读
</div>
</div>
<!-- <div class="btn-clear">清除未读</div> -->
<div class="cnt" v-if="noticeData.length > 0">
<div
@click="handleClickNotice(item, index)"
@ -18,13 +17,19 @@
:key="'notice' + item.targetId + index"
v-for="(item, index) in noticeData"
>
<img
class="item-tag"
src="@/assets/images/index/title-icon-zntb.png"
/>
<i class="i-tag" v-if="item.readFlag == 1">已读</i>
<i class="i-tag" v-else>未读</i>
<div class="item-title">
{{ item.content }}
</div>
<div
v-if="item.readFlag != 1"
@click.stop="read(item)"
class="item-btn-clear"
>
<img src="~@/assets/images/main/clear.png" />
标记已读
</div>
<div class="item-date">{{ item.createdTime }}</div>
</div>
</div>
@ -75,7 +80,7 @@ export default {
},
computed: {},
watch: {},
mounted() {
activated() {
this.getList();
},
methods: {
@ -89,21 +94,21 @@ export default {
this.read(item, index);
},
async read(item) {
if (item.readFlag == 1) return;
async read(item, index) {
if (item && item.readFlag == 1) return;
const url = "/message/intelligentMessage/msg/clear";
let params = {
id: item.id,
};
let params = {};
if (item.id) {
params.id = item.id;
}
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
const { noticeData } = this;
noticeData[index].readFlag = 1;
this.noticeData = noticeData;
console.log("消息已读");
this.getList();
} else {
this.$message.error(msg);
}
@ -183,6 +188,7 @@ export default {
}
.item {
position: relative;
display: flex;
align-items: center;
padding: 16px 0 12px;
@ -191,12 +197,31 @@ export default {
border-bottom: none;
}
.item-tag {
&:hover {
.item-title {
color: #0056d6;
}
.item-btn-clear {
display: block;
}
}
.i-tag {
display: block;
margin-right: 15px;
width: 24px;
height: 24px;
width: 40px;
height: 22px;
border-radius: 4px;
border: 1px solid rgba(0, 0, 0, 0.15);
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(0, 0, 0, 0.88);
line-height: 20px;
font-style: normal;
text-align: center;
}
.item-title {
// @include toe;
width: 60%;
@ -207,7 +232,29 @@ export default {
color: rgba(0, 0, 0, 0.85);
line-height: 22px;
}
.item-btn-clear {
position: absolute;
display: none;
top: 50%;
left: 65%;
width: 80px;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #0042a3;
line-height: 16px;
cursor: pointer;
transform: translateY(-50%);
img {
width: 16px;
margin-right: 3px;
}
}
.item-date {
margin-left: 100px;
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
@ -216,21 +263,32 @@ export default {
}
}
}
.btn-clear {
position: absolute;
top: 14px;
right: 15px;
width: 32px;
height: 12px;
width: 75px;
height: 25px;
background: linear-gradient(0deg, #db3b3b 1%, #ff8080 100%);
border-radius: 3px;
font-size: 14px;
font-weight: 500;
color: #ffffff;
line-height: 25px;
text-align: center;
.header {
display: flex;
justify-content: space-between;
padding: 12px 0;
margin-bottom: 10px;
border-bottom: 1px solid #f0f5fa;
.title {
height: 22px;
font-size: 16px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: rgba(0, 0, 0, 0.85);
line-height: 22px;
}
.btn-clear {
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #0042a3;
line-height: 16px;
cursor: pointer;
img {
width: 16px;
margin-right: 3px;
}
}
}
}

Loading…
Cancel
Save