-
-
-
+ {recommendList.map((item, index) => (
+
+ ))}
-
+
+
-
+
+ {actions.map((action) => (
+
+ onClickActionItem(action)}
+ >
+
+
+
+ ))}
+
+
+
+
+ {courseTimeList.map((item, index) => (
+
+
+ {item.year}年{item.month}月
+
+ {item.data.length} 个视频
+
+ {item.data.map((d: any) => (
+
+ ))}
+
+
+ ))}
+
+
);
diff --git a/apps/web-main/src/view/Course/mock.ts b/apps/web-main/src/view/Course/mock.ts
new file mode 100644
index 0000000..ca45e99
--- /dev/null
+++ b/apps/web-main/src/view/Course/mock.ts
@@ -0,0 +1,83 @@
+import dayjs from "dayjs";
+
+export const recommendListDefault = [
+ {
+ imgUrl:
+ "https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/a8c8cdb109cb051163646151a4a5083b.png~tplv-uwbnlip3yd-webp.webp",
+ title: "这个非常OK啊",
+ desc: "推荐内容推荐内容推荐内容推荐内容推荐内容推荐内容推荐内容",
+ action: "开始学习",
+ },
+ {
+ imgUrl:
+ "https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/e278888093bef8910e829486fb45dd69.png~tplv-uwbnlip3yd-webp.webp",
+ title: "这个非常OK啊",
+ desc: "推荐内容推荐内容推荐内容推荐内容推荐内容推荐内容推荐内容",
+ action: "开始学习",
+ },
+ {
+ imgUrl:
+ "https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/a8c8cdb109cb051163646151a4a5083b.png~tplv-uwbnlip3yd-webp.webp",
+ title: "这个非常OK啊",
+ desc: "推荐内容推荐内容推荐内容推荐内容推荐内容推荐内容推荐内容",
+ action: "开始学习",
+ },
+];
+
+export const courseTimeList = [
+ {
+ title: "这个非常OK啊1",
+ time: "1661990400000",
+ img: "https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/a8c8cdb109cb051163646151a4a5083b.png~tplv-uwbnlip3yd-webp.webp",
+ },
+ {
+ title: "这个非常OK啊2",
+ time: "1630454400000",
+ img: "https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/a8c8cdb109cb051163646151a4a5083b.png~tplv-uwbnlip3yd-webp.webp",
+ },
+ {
+ title: "这个非常OK啊333",
+ time: "1625097600000",
+ img: "https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/a8c8cdb109cb051163646151a4a5083b.png~tplv-uwbnlip3yd-webp.webp",
+ },
+ {
+ title: "这个非常OK啊444",
+ time: "1625184000000",
+ img: "https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/a8c8cdb109cb051163646151a4a5083b.png~tplv-uwbnlip3yd-webp.webp",
+ },
+ {
+ title: "这个非常OK啊3",
+ time: "1598918400000",
+ img: "https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/a8c8cdb109cb051163646151a4a5083b.png~tplv-uwbnlip3yd-webp.webp",
+ },
+];
+
+const process = (before: any[]) => {
+ const after: any = {};
+ // 提取月份,塞入数据
+ before.forEach((item) => {
+ const year = dayjs(+item.time).year();
+ const month = dayjs(+item.time).month() + 1;
+ if (!(year in after)) after[year] = { [month]: [] };
+ if (!(month in after[year])) after[year][month] = [];
+ after[year][month].push(item);
+ });
+ // 年月为key,倒叙排列
+ const compare = (key: string) => (a: any, b: any) => b[key] - a[key];
+ const ymArray = Object.keys(after)
+ .reverse()
+ .map((year) =>
+ Object.keys(after[year]).map((month) => ({
+ year,
+ month,
+ index: +`${year}.${+month > 10 ? month : "0" + month}`,
+ data: after[year][month],
+ }))
+ )
+ .flat()
+ .sort(compare("index"));
+
+ return ymArray;
+};
+
+export const courseTimeListDefault = process(courseTimeList);
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 5cfa169..eb638c2 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -178,10 +178,12 @@ importers:
apps/web-main:
specifiers:
'@arco-design/web-react': 2.45.0
+ '@ricons/fluent': 0.12.0
'@types/react': ^18.0.27
'@types/react-dom': ^18.0.10
'@types/react-router-dom': 5.3.3
'@vitejs/plugin-react': ^3.1.0
+ dayjs: 1.11.7
less: ^4.1.3
react: ^18.2.0
react-dom: ^18.2.0
@@ -191,6 +193,8 @@ importers:
vite-tsconfig-paths: 4.0.5
dependencies:
'@arco-design/web-react': registry.npmmirror.com/@arco-design/web-react/2.45.0_5ndqzdd6t4rivxsukjv3i3ak2q
+ '@ricons/fluent': registry.npmmirror.com/@ricons/fluent/0.12.0
+ dayjs: registry.npmmirror.com/dayjs/1.11.7
less: registry.npmmirror.com/less/4.1.3
react: registry.npmmirror.com/react/18.2.0
react-dom: registry.npmmirror.com/react-dom/18.2.0_react@18.2.0
@@ -3801,6 +3805,12 @@ packages:
engines: {node: '>=14'}
dev: false
+ registry.npmmirror.com/@ricons/fluent/0.12.0:
+ resolution: {integrity: sha512-q+mPtxwTCZBeNmIrnKQxHc08f4OvJOxaR1AiGbpJpTMAzm/b8ZdrL14wm5ArYJq+uDNpLynfBYi3CTWsHjRRgQ==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@ricons/fluent/-/fluent-0.12.0.tgz}
+ name: '@ricons/fluent'
+ version: 0.12.0
+ dev: false
+
registry.npmmirror.com/@rollup/plugin-commonjs/24.0.1_rollup@3.17.2:
resolution: {integrity: sha512-15LsiWRZk4eOGqvrJyu3z3DaBu5BhXIMeWnijSRvd8irrrg9SHpQ1pH+BUK4H6Z9wL9yOxZJMTLU+Au86XHxow==, registry: https://registry.npm.taobao.org/, tarball: https://registry.npmmirror.com/@rollup/plugin-commonjs/-/plugin-commonjs-24.0.1.tgz}
id: registry.npmmirror.com/@rollup/plugin-commonjs/24.0.1