Commit 1ee0ef2d by 胡悦

feat(活动中心): 添加活动消息功能及相关接口

- 在common.js中添加获取活动消息列表和更新状态的API
- 修改LeftSide.vue组件,将studyCenter事件替换为ActivityCenter
- 在serviceDetail页面添加活动消息列表功能及相关处理逻辑
- 更新sprite图片和样式文件,添加活动消息相关图标
1 parent a6770ee2
...@@ -441,5 +441,21 @@ module.exports = { ...@@ -441,5 +441,21 @@ module.exports = {
projectName: 'pad', projectName: 'pad',
...data ...data
}) })
} },
// 活动消息列表
getActivityMessageList(data) {
return http.post({
method: 'dj.pad.api.page.activity.message.list',
projectName: 'pad',
...data
})
},
// 更新活动消息状态
updateActivityMessageStatus(data) {
return http.post({
method: 'dj.pad.api.activity.message.update',
projectName: 'pad',
...data
})
},
} }
...@@ -143,6 +143,8 @@ ...@@ -143,6 +143,8 @@
background-position: calc(100vmin * (1173 / 768) * -0.6547314578005116) calc(100vmin * (1173 / 768) * -0.4083546462063086);} background-position: calc(100vmin * (1173 / 768) * -0.6547314578005116) calc(100vmin * (1173 / 768) * -0.4083546462063086);}
.icon-icon-copy { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323); .icon-icon-copy { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.6986359761295823) calc(100vmin * (1173 / 768) * -0.020034100596760442);} background-position: calc(100vmin * (1173 / 768) * -0.6986359761295823) calc(100vmin * (1173 / 768) * -0.020034100596760442);}
.icon-icon-gold { width: calc(100vmin * (1173 / 768) * 0.030690537084398978); height: calc(100vmin * (1173 / 768) * 0.030690537084398978);
background-position: calc(100vmin * (1173 / 768) * -0.6547314578005116) calc(100vmin * (1173 / 768) * -0.4454390451832907);}
.icon-icon-instructions { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323); .icon-icon-instructions { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.6986359761295823) calc(100vmin * (1173 / 768) * -0.040068201193520885);} background-position: calc(100vmin * (1173 / 768) * -0.6986359761295823) calc(100vmin * (1173 / 768) * -0.040068201193520885);}
.icon-icon-navigation { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323); .icon-icon-navigation { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
...@@ -196,7 +198,7 @@ ...@@ -196,7 +198,7 @@
.icon-medal { width: calc(100vmin * (1173 / 768) * 0.027280477408354646); height: calc(100vmin * (1173 / 768) * 0.027280477408354646); .icon-medal { width: calc(100vmin * (1173 / 768) * 0.027280477408354646); height: calc(100vmin * (1173 / 768) * 0.027280477408354646);
background-position: calc(100vmin * (1173 / 768) * -0.16837169650468883) calc(100vmin * (1173 / 768) * -0.6381074168797954);} background-position: calc(100vmin * (1173 / 768) * -0.16837169650468883) calc(100vmin * (1173 / 768) * -0.6381074168797954);}
.icon-medalNew { width: calc(100vmin * (1173 / 768) * 0.030690537084398978); height: calc(100vmin * (1173 / 768) * 0.030690537084398978); .icon-medalNew { width: calc(100vmin * (1173 / 768) * 0.030690537084398978); height: calc(100vmin * (1173 / 768) * 0.030690537084398978);
background-position: calc(100vmin * (1173 / 768) * -0.6547314578005116) calc(100vmin * (1173 / 768) * -0.4454390451832907);} background-position: calc(100vmin * (1173 / 768) * -0.6547314578005116) calc(100vmin * (1173 / 768) * -0.4825234441602728);}
.icon-my-level { width: calc(100vmin * (1173 / 768) * 0.058823529411764705); height: calc(100vmin * (1173 / 768) * 0.020460358056265986); .icon-my-level { width: calc(100vmin * (1173 / 768) * 0.058823529411764705); height: calc(100vmin * (1173 / 768) * 0.020460358056265986);
background-position: calc(100vmin * (1173 / 768) * -0.49317988064791135) calc(100vmin * (1173 / 768) * -0.4317988064791134);} background-position: calc(100vmin * (1173 / 768) * -0.49317988064791135) calc(100vmin * (1173 / 768) * -0.4317988064791134);}
.icon-my-store { width: calc(100vmin * (1173 / 768) * 0.03410059676044331); height: calc(100vmin * (1173 / 768) * 0.03410059676044331); .icon-my-store { width: calc(100vmin * (1173 / 768) * 0.03410059676044331); height: calc(100vmin * (1173 / 768) * 0.03410059676044331);
...@@ -402,6 +404,4 @@ ...@@ -402,6 +404,4 @@
.icon-yw-icon { width: calc(100vmin * (1173 / 768) * 0.015345268542199489); height: calc(100vmin * (1173 / 768) * 0.015345268542199489); .icon-yw-icon { width: calc(100vmin * (1173 / 768) * 0.015345268542199489); height: calc(100vmin * (1173 / 768) * 0.015345268542199489);
background-position: calc(100vmin * (1173 / 768) * -0.5221653878942881) calc(100vmin * (1173 / 768) * -0.45865302642796246);} background-position: calc(100vmin * (1173 / 768) * -0.5221653878942881) calc(100vmin * (1173 / 768) * -0.45865302642796246);}
.icon-zj-icon { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323); .icon-zj-icon { width: calc(100vmin * (1173 / 768) * 0.013640238704177323); height: calc(100vmin * (1173 / 768) * 0.013640238704177323);
background-position: calc(100vmin * (1173 / 768) * -0.6986359761295823) calc(100vmin * (1173 / 768) * -0.5609548167092924);}
.icon-icon-gold { width: calc(100vmin * (1173 / 768) * 0.030690537084398978); height: calc(100vmin * (1173 / 768) * 0.030690537084398978);
background-position: calc(100vmin * (1173 / 768) * -0.6547314578005116) calc(100vmin * (1173 / 768) * -0.4825234441602728);}
\ No newline at end of file \ No newline at end of file
background-position: calc(100vmin * (1173 / 768) * -0.6986359761295823) calc(100vmin * (1173 / 768) * -0.5609548167092924);}
\ No newline at end of file \ No newline at end of file

2.84 MB | W: | H:

2.84 MB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -178,11 +178,17 @@ export default { ...@@ -178,11 +178,17 @@ export default {
console.log('pageBack') console.log('pageBack')
this.getMessageInfo(); this.getMessageInfo();
}); });
uni.$on('studyCenter', () => { uni.$on('ActivityCenter', () => {
console.log('ActivityCenter')
let { tabs } = this, let { tabs } = this,
index = tabs.findIndex(e => e.name == 'StudyCenter') index = tabs.findIndex(e => e.name == 'ActivityCenter')
this.changeIndex(index, this.tabs[index]) this.changeIndex(index, this.tabs[index])
}); })
// uni.$on('studyCenter', () => {
// let { tabs } = this,
// index = tabs.findIndex(e => e.name == 'StudyCenter')
// this.changeIndex(index, this.tabs[index])
// });
this.getUnreadCount() this.getUnreadCount()
this.getStudyCenterPermission() this.getStudyCenterPermission()
this.getMessageInfo() this.getMessageInfo()
......
...@@ -101,6 +101,7 @@ export default { ...@@ -101,6 +101,7 @@ export default {
systemList: [], systemList: [],
shortCourseList: [], shortCourseList: [],
longCourseList: [], longCourseList: [],
activityList: [],
total: 0, total: 0,
nothing: false, nothing: false,
pageNum: 1, pageNum: 1,
...@@ -177,6 +178,8 @@ export default { ...@@ -177,6 +178,8 @@ export default {
break break
case 4: case 4:
this.getCourseList(4) this.getCourseList(4)
case 5:
this.getActivityList()
default: default:
break break
} }
...@@ -350,14 +353,21 @@ export default { ...@@ -350,14 +353,21 @@ export default {
try { try {
this.getCourseList(3); this.getCourseList(3);
} catch (error) { } catch (error) {
console.error('调用 getWarningPage 方法时出错:', error); console.error('调用 getCourseList 方法时出错:', error);
} }
break; break;
case 4: case 4:
try { try {
this.getCourseList(4); this.getCourseList(4);
} catch (error) { } catch (error) {
console.error('调用 getWarningPage 方法时出错:', error); console.error('调用 getCourseList 方法时出错:', error);
}
break;
case 5:
try {
this.getActivityList();
} catch (error) {
console.error('调用 getActivityList 方法时出错:', error);
} }
break; break;
default: default:
...@@ -439,10 +449,21 @@ export default { ...@@ -439,10 +449,21 @@ export default {
} }
}); });
break break
case 5:
console.log('活动消息跳转')
await uni.$api.commonApi.updateActivityMessageStatus({
msgId: item.msgId
})
uni.navigateBack({
delta: 1
})
uni.$emit("ActivityCenter")
break
default: default:
break break
} }
}, },
// 长短课程列表
async getCourseList(moduleType) { async getCourseList(moduleType) {
try { try {
uni.showLoading({ uni.showLoading({
...@@ -470,6 +491,32 @@ export default { ...@@ -470,6 +491,32 @@ export default {
}); });
} }
}, },
// 活动消息列表
async getActivityList() {
try {
uni.showLoading({
mask: true
})
const { sceneType } = uni.$storage.get("userInfo")
const { pageNum, pageSize } = this
const res = await uni.$api.commonApi.getActivityMessageList({
pageNum, pageSize, businessType: sceneType
})
if (pageNum == 1) {
this.activityList = res.list || []
} else {
this.activityList = this.activityList.concat(res.list || [])
}
uni.hideLoading()
this.total = res.total
this.nothing = res.length ? true : false
} catch (error) {
uni.showToast({
title: error,
icon: "none",
});
}
},
// 置顶,取消置顶 // 置顶,取消置顶
handleStickTop() { handleStickTop() {
clearTimeout(timer) clearTimeout(timer)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!