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