Commit 4f1beab4 by 李伟康

Merge branch 'SAAS+V4.55.0' of http://192.168.3.233:8090/glsx/gl_tape into SAAS+V4.55.0

2 parents 00c104c4 41e911f6
No preview for this file type

2.34 MB | W: | H:

2.42 MB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
<template>
<view>
<ServiceList @handleClick="handleClick" />
</view>
</template>
<script>
import ServiceList from '../../../../pages/common/serviceDetail/components/ServiceList.vue';
export default {
name: 'MessageIndex',
components: {
ServiceList
},
data() {
return {
}
},
methods: {
handleClick(item) {
const { moduleType } = item
uni.navigateTo({
url: `/pages/common/serviceDetail/index?moduleType=${moduleType}`
})
}
}
}
</script>
<style scoped lang="scss">
</style>
\ No newline at end of file
......@@ -47,6 +47,7 @@
<view class="content-right box-class">
<view class="common-title">服务中心</view>
<view class="content-box">
<MessageIndex />
</view>
</view>
</view>
......@@ -171,9 +172,10 @@ import merge from '@/mixin/record/merge.js'
import MessageDetail from './components/Message/MessageDetail.vue'
import StudyCenter from './components/StudyCenter.vue'
import SwiperComponent from '../SwiperComponent.vue'
import MessageIndex from './components/Message/index.vue'
export default {
mixins: [recorder, uploader, timeout, versionCheck, merge],
components: { ReceptionCenter, StudyCenter, SceneMarket, LeftSide, Point, dayPoint, rulePoint, Course, Ranking, LevelPoint, Calendar, Promotion, History, LevelMedal, MessageDetail, SwiperComponent },
components: { ReceptionCenter, StudyCenter, SceneMarket, LeftSide, Point, dayPoint, rulePoint, Course, Ranking, LevelPoint, Calendar, Promotion, History, LevelMedal, MessageDetail, SwiperComponent, MessageIndex },
props: {
id: [String, Number],
finishDoneText: String,
......@@ -364,7 +366,7 @@ export default {
previewHandler (name, off = false) {
this.previewOff = off
this.$emit(name)
},
}
}
}
</script>
......
......@@ -159,6 +159,12 @@
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/common/serviceDetail/index",
"style": {
"navigationStyle": "custom"
}
}
],
"globalStyle": {
......
<template>
<view class="message-index-box">
<view class="message-list">
<view :class="['message-item', moduleType == i.moduleType ? 'active' : '']" v-for="(i, ind) in getTopList" :key="ind" @click.stop="handleClick(i)">
<view class="message-item-icon">
<view :class="['sprite-icon', `icon-${moduleIconEnum[i.moduleType]}`]"></view>
<view class="message-item-icon-num" v-if="i.count > 0">{{ i.count > 99 ? 99 : i.count }}</view>
</view>
<view class="message-item-content">
<view class="message-item-title">{{ moduleTypeEnum[i.moduleType] }}</view>
<view class="message-item-desc">{{ moduleContentEnum[i.moduleType] ? moduleContentEnum[i.moduleType] : i.title }}</view>
</view>
<view class="message-item-time-box">
<view class="message-item-time">{{ formatTime(i.createdTime) }}</view>
<view class="sprite-icon icon-stick-top"></view>
</view>
</view>
</view>
<template v-if="getList.length > 0">
<view class="message-group" v-for="(item, index) in getList" :key="index">
<view class="message-date">{{ item.date }}</view>
<view class="message-list">
<view :class="['message-item', moduleType == i.moduleType ? 'active' : '']" v-for="(i, ind) in item.msgList" :key="ind" @click.stop="handleClick(i)">
<view class="message-item-icon">
<view :class="['sprite-icon', `icon-${moduleIconEnum[i.moduleType]}`]"></view>
<view class="message-item-icon-num" v-if="i.count > 0">{{ i.count > 99 ? 99 : i.count }}</view>
</view>
<view class="message-item-content">
<view class="message-item-title">{{ moduleTypeEnum[i.moduleType] }}</view>
<view class="message-item-desc">{{ moduleContentEnum[i.moduleType] ? moduleContentEnum[i.moduleType] : i.title }}</view>
</view>
<view class="message-item-time">{{ formatTime(i.createdTime) }}</view>
</view>
</view>
</view>
</template>
<template v-else>
<view class="message-empty">
<image
class="message-empty-img"
src="../../../../assets//images/home/notice-nothing.webp"
mode="scaleToFill"
/>
<view class="message-empty-text">暂无消息</view>
</view>
</template>
</view>
</template>
<script>
import dayjs from 'dayjs';
import { moduleTypeEnum, moduleIconEnum, moduleContentEnum } from './contant.js';
export default {
name: 'MessageIndex',
props: {
moduleType: {
type: [Number, String, null],
default: null
}
},
data() {
return {
moduleTypeEnum,
moduleIconEnum,
moduleContentEnum,
topList: [1],
msgList: [
{
moduleType: 3,
title: '请在06-dfasd',
createdTime: new Date().getTime(),
count: null,
strdate: '2025-06-11'
},
{
moduleType: 4,
title: '请在06-csaf ',
createdTime: new Date().getTime(),
count: 698,
strdate: '2025-06-11'
},
{
moduleType: 0,
title: '#这是通知标题##这是通知标题##这是通知标题##这是通知标题##这是通知标题#',
createdTime: new Date().getTime(),
count: 6,
strdate: '2025-06-11'
},
{
moduleType: 2,
title: 'dfs',
createdTime: new Date().getTime(),
count: 99,
strdate: '2025-06-12'
},
{
moduleType: 1,
title: 'df ',
createdTime: new Date().getTime(),
count: 99,
strdate: '2025-06-12'
}
]
}
},
computed: {
getTopList() {
if (!this.topList) return [];
return this.msgList.filter(item => this.topList.includes(item.moduleType));
},
getList() {
// 过滤掉topList中包含moduleType的对象
const filteredList = this.msgList.filter(item => {
if (!this.topList) return true;
return !this.topList.includes(item.moduleType);
});
// 根据date进行分组
const groupedByDate = {};
filteredList.forEach(item => {
if (!groupedByDate[item.strdate]) {
groupedByDate[item.strdate] = [];
}
groupedByDate[item.strdate].push(item);
});
// 转换为数组格式,并按date降序排列
return Object.keys(groupedByDate)
.sort((a, b) => b.localeCompare(a)) // 日期大的在前面
.map(date => ({
date,
msgList: groupedByDate[date]
}));
}
},
methods: {
formatTime(time) {
return dayjs(time).format('HH:mm');
},
handleClick(item) {
this.$emit('handleClick', item)
// uni.navigateTo({
// url: `/pages/common/serviceDetail/index?moduleType=${moduleType}`
// })
}
}
}
</script>
<style scoped lang="scss">
.message-index-box {
margin: 0 toRpx(32);
height: 100%;
.message-group {
.message-date {
color: #999999;
font-size: toRpx(24);
margin-bottom: toRpx(20);
text-align: center;
}
}
.message-list {
margin-bottom: toRpx(20);
.message-item {
position: relative;
display: flex;
align-items: center;
background: #ffffff;
border-radius: toRpx(24);
padding: toRpx(24);
&.active {
background: #4673ff1a;
}
&:not(:last-child) {
margin-bottom: toRpx(20);
}
.message-item-icon {
position: relative;
margin-right: toRpx(24);
&-num {
position: absolute;
top: toRpx(-6);
right: toRpx(-6);
height: toRpx(24);
line-height: toRpx(24);
padding: 0 toRpx(6);
color: #ffffff;
font-size: toRpx(20);
background: #FF4D4F;
border-radius: toRpx(50);
}
}
.message-item-content {
.message-item-title {
color: #333333;
font-size: toRpx(30);
}
.message-item-desc {
color: #999999;
font-size: toRpx(24);
margin-top: toRpx(8);
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
word-break: break-all;
}
}
.message-item-time {
color: #999999;
font-size: toRpx(24);
margin-left: auto;
}
.message-item-time-box {
display: flex;
flex-direction: column;
align-items: center;
margin-left: auto;
.icon-stick-top {
margin-top: toRpx(4);
}
}
}
}
}
.message-empty {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding-top: toRpx(144);
&-img {
width: toRpx(496);
height: toRpx(208);
}
&-text {
color: #999999;
font-size: toRpx(20);
}
}
</style>
\ No newline at end of file
const moduleTypeEnum = {
0: '企业通知',
1: '优秀话术',
2: '违规话术',
3: '短课程学习',
4: '长课程学习'
}
const moduleIconEnum = {
0: 'notice-system',
1: 'notice-script',
2: 'notice-violate',
3: 'notice-study',
4: 'notice-study'
}
const moduleContentEnum = {
1: '叮咚!快来查看优秀话术,提升接待技巧吧',
2: '话术违规预警'
}
export { moduleTypeEnum, moduleIconEnum, moduleContentEnum }
\ No newline at end of file
......@@ -40,5 +40,6 @@ export const STORAGE_OBJECTKEY = {
leadPage: 'leadPage',
recordTrackList: 'recordTrackList',
beisenToken: 'beisenToken',
messagePopShownDate: 'messagePopShownDate'
messagePopShownDate: 'messagePopShownDate',
noticeTopList: 'noticeTopList'
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!