<template>
|
<div class="notification-page">
|
|
<section class="notification-header">
|
<div>
|
<i class="icon-edit icon"
|
style="color:#1B365D"
|
@click="showNotification = true"
|
></i>
|
</div>
|
</section>
|
|
<section class="notification-reviews"
|
@click="$router.push('/userReviews')">
|
<div class="reviews-txt">
|
請填寫滿意度調查
|
</div>
|
</section>
|
|
<section class="notification-content">
|
<div class="notification-container">
|
<div
|
v-for="(item,index) in notificationList"
|
:key="index"
|
class="notification-card"
|
@click="readNotification(index)"
|
|
|
>
|
<div class="notification-card__aside">
|
<span
|
v-if="!item.hasRead"
|
class="notification-card__aside-unread-indicator"></span>
|
</div>
|
<div class="notification-card__content">{{ item.content }}</div>
|
<div class="notification-card__time-stamp">{{ item.time }}</div>
|
</div>
|
</div>
|
</section>
|
|
<PopUpFrame :isOpen.sync="showNotification" >
|
<div class="popup-txt">
|
<div>通知</div>
|
<el-radio-group class="pam-radio-group--col" >
|
<el-radio-button class="mt-30" label="全部已讀" @click.native="readNotification"></el-radio-button>
|
<el-radio-button class="mt-30" label="全部刪除" @click.native="deleteNotification"></el-radio-button>
|
</el-radio-group>
|
</div>
|
</PopUpFrame>
|
|
</div>
|
</template>
|
|
<script lang="ts">
|
import { Vue, Component } from 'vue-property-decorator'
|
|
@Component
|
export default class Notification extends Vue{
|
notificationList: NotificationIF[] = [
|
{
|
content:'將於10/30 02:00-14:00進行更新,請留意您的帳...',
|
time:'今天 10:00',
|
hasRead: false,
|
},
|
{
|
content:'將於10/11 02:00-14:00進行更新,請留意您的帳...',
|
time:'今天 10:00',
|
hasRead: false,
|
},
|
{
|
content:'將於9/28 02:00-14:00進行更新,請留意您的帳...',
|
time:'今天 10:00',
|
hasRead: false,
|
},
|
{
|
content:'將於9/28 02:00-14:00進行更新,請留意您的帳...',
|
time:'今天 10:00',
|
hasRead: false,
|
}
|
|
];
|
|
showNotification = false;
|
|
readNotification(index?: number): void {
|
const targetNotification = this.notificationList[index];
|
const readNotifaction = (notification: NotificationIF) => notification.hasRead = true;
|
// 定義 變數 = ( 參數 : 型別 )
|
if (targetNotification) {
|
readNotifaction(targetNotification);
|
this.$router.push('/notification/detail');
|
} else {
|
this.notificationList.forEach((notification) => readNotifaction(notification));
|
}
|
|
}
|
|
deleteNotification(): void {
|
this.notificationList = [];
|
}
|
}
|
|
export interface NotificationIF {
|
content: string;
|
time: string;
|
hasRead: boolean;
|
}
|
|
</script>
|
|
<style lang="scss" scoped>
|
.notification-page{
|
.notification-header{
|
display: flex;
|
justify-content: flex-end;
|
font-size:20px;
|
margin-bottom:20px;
|
.icon{
|
cursor: pointer;
|
display: flex;
|
}
|
|
}
|
.notification-reviews{
|
background-image: url('~/assets/images/satisfaction/notification_mob.svg');
|
height: 60px;
|
border-radius: 10px;
|
display: flex;
|
justify-content: center;
|
margin-bottom: 20px;
|
cursor: pointer;
|
.reviews-txt{
|
font-size: 20px;
|
align-items: center;
|
font-weight: bold;
|
display: flex;
|
color: black;
|
-webkit-text-stroke: .3px #FFFF;
|
|
}
|
}
|
|
.notification-content{
|
|
.notification-container{
|
|
.notification-card {
|
height: 62px;
|
padding-bottom: 11px;
|
display: flex;
|
border-bottom: 1px solid #CCCCCC;
|
padding-top: 10px;
|
.notification-card__aside {
|
width: 30px;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
.notification-card__aside-unread-indicator {
|
width: 10px;
|
height: 10px;
|
background-color: $YELLOW;
|
border-radius: 50%;
|
}
|
}
|
.notification-card__content {
|
font-size: 20px;
|
line-height: 1.5;
|
}
|
.notification-card__time-stamp {
|
display: flex;
|
width: 52px;
|
align-self: center;
|
font-size: 10px;
|
color: #707070;
|
}
|
}
|
}
|
}
|
}
|
.popup-txt{
|
font-size: 20px;
|
display: flex;
|
justify-content: center;
|
flex-direction: column;
|
align-items: center;
|
}
|
|
|
@include desktop{
|
|
.notification-page{
|
.notification-header{
|
display: flex;
|
justify-content: flex-end;
|
font-size:24px;
|
margin-bottom:20px;
|
.icon{
|
cursor: pointer;
|
}
|
|
}
|
.notification-reviews{
|
background-image: url('~/assets/images/satisfaction/notification_web.svg');
|
height: 110px;
|
border-radius: 10px;
|
display: flex;
|
justify-content: center;
|
margin-bottom: 40px;
|
cursor: pointer;
|
.reviews-txt{
|
font-size: 20px;
|
align-items: center;
|
font-weight: bold;
|
display: flex;
|
color: black;
|
-webkit-text-stroke: .3px #FFFF;
|
|
}
|
}
|
|
.notification-content{
|
|
.notification-container{
|
|
.notification-card {
|
height: 60px;
|
padding-bottom: 10px;
|
display: flex;
|
border-bottom: 1px solid #CCCCCC;
|
padding-top: 10px;
|
.notification-card__aside {
|
width: 30px;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
.notification-card__aside-unread-indicator {
|
width: 10px;
|
height: 10px;
|
background-color: $YELLOW;
|
border-radius: 50%;
|
}
|
}
|
.notification-card__content {
|
font-size: 20px;
|
line-height: 1.5;
|
padding-top: 10px;
|
}
|
.notification-card__time-stamp {
|
display: flex;
|
width: 52px;
|
align-self: center;
|
font-size: 10px;
|
color: #707070;
|
justify-content: flex-end;
|
flex: 1;
|
}
|
}
|
}
|
}
|
}
|
|
|
}
|
</style>
|