Commit 1ee0ef2d by 胡悦

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

- 在common.js中添加获取活动消息列表和更新状态的API
- 修改LeftSide.vue组件,将studyCenter事件替换为ActivityCenter
- 在serviceDetail页面添加活动消息列表功能及相关处理逻辑
- 更新sprite图片和样式文件,添加活动消息相关图标
1 parent a6770ee2
......@@ -441,5 +441,21 @@ module.exports = {
projectName: 'pad',
...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 @@
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);
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);
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);
......@@ -196,7 +198,7 @@
.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);}
.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);
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);
......@@ -402,6 +404,4 @@
.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);}
.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
background-position: calc(100vmin * (1173 / 768) * -0.6986359761295823) calc(100vmin * (1173 / 768) * -0.5609548167092924);}
\ 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 {
console.log('pageBack')
this.getMessageInfo();
});
uni.$on('studyCenter', () => {
uni.$on('ActivityCenter', () => {
console.log('ActivityCenter')
let { tabs } = this,
index = tabs.findIndex(e => e.name == 'StudyCenter')
index = tabs.findIndex(e => e.name == 'ActivityCenter')
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.getStudyCenterPermission()
this.getMessageInfo()
......
......@@ -101,6 +101,7 @@ export default {
systemList: [],
shortCourseList: [],
longCourseList: [],
activityList: [],
total: 0,
nothing: false,
pageNum: 1,
......@@ -177,6 +178,8 @@ export default {
break
case 4:
this.getCourseList(4)
case 5:
this.getActivityList()
default:
break
}
......@@ -350,14 +353,21 @@ export default {
try {
this.getCourseList(3);
} catch (error) {
console.error('调用 getWarningPage 方法时出错:', error);
console.error('调用 getCourseList 方法时出错:', error);
}
break;
case 4:
try {
this.getCourseList(4);
} catch (error) {
console.error('调用 getWarningPage 方法时出错:', error);
console.error('调用 getCourseList 方法时出错:', error);
}
break;
case 5:
try {
this.getActivityList();
} catch (error) {
console.error('调用 getActivityList 方法时出错:', error);
}
break;
default:
......@@ -439,10 +449,21 @@ export default {
}
});
break
case 5:
console.log('活动消息跳转')
await uni.$api.commonApi.updateActivityMessageStatus({
msgId: item.msgId
})
uni.navigateBack({
delta: 1
})
uni.$emit("ActivityCenter")
break
default:
break
}
},
// 长短课程列表
async getCourseList(moduleType) {
try {
uni.showLoading({
......@@ -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() {
clearTimeout(timer)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!