Commit 6ce4d8c1 by 胡悦

feat(消息模块): 添加活动中心消息类型支持

- 新增活动中心消息类型(5)及相关图标配置
- 在ServiceList组件中添加out类型样式支持
- 完善活动消息的状态更新和列表获取逻辑
- 更新消息列表的样式和布局处理
1 parent 1ee0ef2d

2.84 MB | W: | H:

2.87 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 :messageList="messageList" :topListProp="topList" @handleClick="handleClick" />
<ServiceList type="out" :messageList="messageList" :topListProp="topList" @handleClick="handleClick" />
</view>
</template>
<script>
......
<template>
<scroll-view scroll-y class="service-list">
<view class="message-index-box">
<view :class="['message-index-box', type == 'out' ? 'message-out' : '']">
<view class="message-list" v-if="getTopList.length > 0">
<view :class="['message-item', moduleType == i.moduleType ? 'active' : '']" v-for="(i, ind) in getTopList"
:key="ind" @click.stop="handleClick(i)">
......@@ -67,7 +67,11 @@ export default {
messageList: {
type: Array,
default: () => []
}
},
type: {
type: String,
default: ''
},
},
data() {
return {
......@@ -193,6 +197,10 @@ export default {
.message-index-box {
margin: 0 toRpx(32);
height: 100%;
&.message-out {
padding-bottom: toRpx(40);
box-sizing: content-box;
}
.message-group {
.message-date {
......
......@@ -3,7 +3,8 @@ const moduleTypeEnum = {
1: '优秀话术',
2: '违规话术',
3: '短课程学习',
4: '长课程学习'
4: '长课程学习',
5: '活动中心'
}
const moduleIconEnum = {
......@@ -11,7 +12,8 @@ const moduleIconEnum = {
1: 'notice-script',
2: 'notice-violate',
3: 'notice-study',
4: 'notice-study'
4: 'notice-study',
5: 'active-msg'
}
const moduleContentEnum = {
......
......@@ -29,7 +29,8 @@
(moduleType == 1 && item.status == 0) ||
(moduleType == 2 && item.status == 0) ||
(moduleType == 3 && item.status == 0) ||
(moduleType == 4 && item.status == 0)
(moduleType == 4 && item.status == 0) ||
(moduleType == 5 && item.status == 0)
)"
></view>
<template v-if="moduleType == 3 || moduleType == 4">
......@@ -62,6 +63,9 @@
<template v-else-if="moduleType == 0">
<view class="service-item-text">提醒内容:{{ item.title }}</view>
</template>
<template v-else-if="moduleType == 5">
<view class="service-item-text">提醒内容:{{ item.content }}</view>
</template>
</view>
<template v-if="nothing">
<view class="end-text">-已经到底了-</view>
......@@ -127,6 +131,8 @@ export default {
return this.shortCourseList
case 4:
return this.longCourseList
case 5:
return this.activityList
default:
return []
}
......@@ -451,9 +457,11 @@ export default {
break
case 5:
console.log('活动消息跳转')
if (item.status == 0) {
await uni.$api.commonApi.updateActivityMessageStatus({
msgId: item.msgId
})
}
uni.navigateBack({
delta: 1
})
......@@ -502,6 +510,9 @@ export default {
const res = await uni.$api.commonApi.getActivityMessageList({
pageNum, pageSize, businessType: sceneType
})
res.list?.length && res.list.map(e => {
e.time = e.createTime
})
if (pageNum == 1) {
this.activityList = res.list || []
} else {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!