Commit ea8595de by Jaxon

refactor: 将弹窗配置枚举移至共享模块并优化样式

- 将 equityPage.js 中使用的 dialogOptions 和 noticeSort 从局部枚举文件移动到 utils/enum/serviceCenter.js,实现代码复用
- 删除已迁移的局部枚举文件 packageEquity/pages/TabBar/enum.js
- 调整 .gitignore,移除 IDE 特定目录 .idea 和 .vscode
- 修正 index.sass 中红色标记的颜色值为 #f24724
1 parent 55910426
...@@ -18,8 +18,6 @@ yarn-debug.log* ...@@ -18,8 +18,6 @@ yarn-debug.log*
yarn-error.log* yarn-error.log*
# Editor directories and files # Editor directories and files
.idea
.vscode
*.suo *.suo
*.ntvs* *.ntvs*
*.njsproj *.njsproj
......
import { ServerCenterEnum } from "~/utils/enum/index";
// 弹窗文字
export const dialogOptions = {
// 长课程
[ServerCenterEnum.longCourse]: {
// 首次提醒
1: {
title: "学习提醒",
message: (text) => `您有新的长课程学习任务:${text},请及时查看。`,
confirmButtonText: "去学习",
type: ServerCenterEnum.longCourse,
},
// 进度提醒
2: {
title: "学习提醒",
message: (text) => `您有未完成的学习任务:「${text}」即将到期,抓紧时间完成哦!`,
confirmButtonText: "去学习",
type: ServerCenterEnum.longCourse,
},
},
// 优秀案例
[ServerCenterEnum.case]: {
1: {
title: "学习提醒",
message: (text) => `您有新的优秀案例学习任务:「${text}」,请及时查看。`,
confirmButtonText: "去学习",
type: ServerCenterEnum.case,
},
2: {
title: "学习提醒",
message: (text) => `您有未完成的学习任务:「${text}」即将到期,抓紧时间完成哦!`,
confirmButtonText: "去学习",
type: ServerCenterEnum.case,
},
},
// 企业通知
[ServerCenterEnum.companyNotice]: {
1: {
title: "企业通知",
message: (text) => `您有新的企业通知:「${text}」,请及时查看。`,
confirmButtonText: "去查看",
type: ServerCenterEnum.companyNotice,
},
},
};
export const noticeSort = [ServerCenterEnum.longCourse, ServerCenterEnum.case, ServerCenterEnum.companyNotice];
...@@ -15,8 +15,7 @@ import { ...@@ -15,8 +15,7 @@ import {
import { getBusinessSchoolScene } from "~/store/index"; import { getBusinessSchoolScene } from "~/store/index";
import carLifeApi from "../../carEquityApi"; import carLifeApi from "../../carEquityApi";
import { dialogOptions, noticeSort } from "./enum.js"; import { dialogOptions, noticeSort, ServerCenterEnum } from "~/utils/enum/index";
import { ServerCenterEnum } from "~/utils/enum/index";
import { getCompanyNoticeDetail, getCompanyNoticeList } from "~/api/serviceCenter/index"; import { getCompanyNoticeDetail, getCompanyNoticeList } from "~/api/serviceCenter/index";
const app = getApp(); const app = getApp();
......
...@@ -255,7 +255,7 @@ ...@@ -255,7 +255,7 @@
content: ""; content: "";
width: 12rpx; width: 12rpx;
height: 12rpx; height: 12rpx;
background-color: red; background-color: #f24724;
border-radius: 50%; border-radius: 50%;
position: absolute; position: absolute;
right: -12rpx; right: -12rpx;
......
...@@ -19,3 +19,50 @@ export const ReminderTypeEnum = { ...@@ -19,3 +19,50 @@ export const ReminderTypeEnum = {
FIRST: 1, FIRST: 1,
PROGRESS: 2, PROGRESS: 2,
}; };
// 弹窗文字
export const dialogOptions = {
// 长课程
[ServerCenterEnum.longCourse]: {
// 首次提醒
1: {
title: "学习提醒",
message: (text) => `您有新的长课程学习任务:${text},请及时查看。`,
confirmButtonText: "去学习",
type: ServerCenterEnum.longCourse,
},
// 进度提醒
2: {
title: "学习提醒",
message: (text) => `您有未完成的学习任务:「${text}」即将到期,抓紧时间完成哦!`,
confirmButtonText: "去学习",
type: ServerCenterEnum.longCourse,
},
},
// 优秀案例
[ServerCenterEnum.case]: {
1: {
title: "学习提醒",
message: (text) => `您有新的优秀案例学习任务:「${text}」,请及时查看。`,
confirmButtonText: "去学习",
type: ServerCenterEnum.case,
},
2: {
title: "学习提醒",
message: (text) => `您有未完成的学习任务:「${text}」即将到期,抓紧时间完成哦!`,
confirmButtonText: "去学习",
type: ServerCenterEnum.case,
},
},
// 企业通知
[ServerCenterEnum.companyNotice]: {
1: {
title: "企业通知",
message: (text) => `您有新的企业通知:「${text}」,请及时查看。`,
confirmButtonText: "去查看",
type: ServerCenterEnum.companyNotice,
},
},
};
export const noticeSort = [ServerCenterEnum.longCourse, ServerCenterEnum.case, ServerCenterEnum.companyNotice];
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!