|
@@ -1,10 +1,29 @@
|
|
|
<template>
|
|
|
- <div>
|
|
|
- <div @click="getLogout">退出</div>
|
|
|
- <div style="display: flex; justify-content: space-around;">
|
|
|
- <div v-for="(item, index) in list1" :key="index" @click="getJump(item.url, item.name)">{{ item.name }}</div>
|
|
|
- <div v-for="(item, index) in list2" :key="index" @click="getJump(item.url, item.name)">{{ item.name }}</div>
|
|
|
+ <div class="home">
|
|
|
+ <div class="logo"><img src="@/assets/images/logo.png" /></div>
|
|
|
+ <div class="menu">
|
|
|
+ <div class="left">
|
|
|
+ <div class="li" @click="getJump('/train', '自助锻炼')"><img src="@/assets/images/home/train.png" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="right">
|
|
|
+ <div class="right-top">
|
|
|
+ <div class="li" @click="getJump('/test', '测试')"><img src="@/assets/images/home/test.png" />
|
|
|
+ </div>
|
|
|
+ <div class="li" @click="getJump('/ranking', '排行榜')"><img src="@/assets/images/home/ranking.png" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="right-bottom">
|
|
|
+ <div class="li" @click="getJump('/competition', '竞赛')"><img src="@/assets/images/home/competition.png" />
|
|
|
+ </div>
|
|
|
+ <div class="li" @click="getJump('/course', '课程')"><img src="@/assets/images/home/course.png" />
|
|
|
+ </div>
|
|
|
+ <div class="li" @click="getJump('/set', '设置')"><img src="@/assets/images/home/set.png" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
+
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -12,55 +31,6 @@
|
|
|
const { proxy } = getCurrentInstance() as any;
|
|
|
const router = useRouter();
|
|
|
|
|
|
-const list1 = [{
|
|
|
- name: "自助锻炼",
|
|
|
- en: "TRAINING",
|
|
|
- icon: "../../static/images/home/train.png",
|
|
|
- url: "/train",
|
|
|
-}];
|
|
|
-
|
|
|
-const list2 = [
|
|
|
- {
|
|
|
- name: "测试",
|
|
|
- en: "TEST",
|
|
|
- icon: "../../static/images/home/test.png",
|
|
|
- url: "/test",
|
|
|
- }, {
|
|
|
- name: "竞赛",
|
|
|
- en: "PE",
|
|
|
- icon: "../../static/images/home/pe.png",
|
|
|
- url: "/competition",
|
|
|
- },
|
|
|
- {
|
|
|
- name: "排行榜",
|
|
|
- en: "RANKING",
|
|
|
- icon: "../../static/images/home/ranking.png",
|
|
|
- url: "/ranking",
|
|
|
- },
|
|
|
- {
|
|
|
- name: "课程",
|
|
|
- en: "COURSE",
|
|
|
- icon: "../../static/images/home/course.png",
|
|
|
- url: "/course",
|
|
|
- }
|
|
|
-];
|
|
|
-
|
|
|
-// 退出
|
|
|
-const getLogout = () => {
|
|
|
- proxy?.$modal.confirm("确定退出吗?").then(() => {
|
|
|
- proxy?.$modal.loading();
|
|
|
- let params = {};
|
|
|
- proxy?.$http.common.logout(params).then((res: any) => {
|
|
|
- });
|
|
|
- }).finally(() => {
|
|
|
- proxy?.$modal?.closeLoading()
|
|
|
- //清空缓存
|
|
|
- localStorage.clear();
|
|
|
- //跳转
|
|
|
- router.push({ path: '/login' });
|
|
|
- });
|
|
|
-};
|
|
|
-
|
|
|
//跳转
|
|
|
const getJump = (url: string, name: string) => {
|
|
|
if (url == undefined || !url) {
|
|
@@ -75,4 +45,96 @@ onMounted(() => {
|
|
|
})
|
|
|
</script>
|
|
|
|
|
|
-<style scoped></style>
|
|
|
+<style lang="scss" scoped>
|
|
|
+$waiPadding: 6.51rem;
|
|
|
+
|
|
|
+.home {
|
|
|
+ width: 100vw;
|
|
|
+ height: 100vh;
|
|
|
+}
|
|
|
+
|
|
|
+.logo {
|
|
|
+ img {
|
|
|
+ width: 14.563rem;
|
|
|
+ }
|
|
|
+
|
|
|
+ position: absolute;
|
|
|
+ left: $waiPadding;
|
|
|
+ top: 5.19rem;
|
|
|
+}
|
|
|
+
|
|
|
+.menu {
|
|
|
+ width: calc(100% - ($waiPadding * 2));
|
|
|
+ padding-top: 10rem;
|
|
|
+ margin: 0 auto;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ line-height: 0;
|
|
|
+
|
|
|
+ .li {
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+
|
|
|
+ img {
|
|
|
+ width: 100%;
|
|
|
+ transition: all 0.5s;
|
|
|
+
|
|
|
+ &:hover {
|
|
|
+ transform: scale(1.06);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .left {
|
|
|
+ width: 32.6%;
|
|
|
+
|
|
|
+ .li {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .right {
|
|
|
+ width: calc(100% - 32.6%);
|
|
|
+ $myPadding: 1.22rem;
|
|
|
+
|
|
|
+ .right-top {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ padding-left: $myPadding;
|
|
|
+ margin-bottom: $myPadding;
|
|
|
+
|
|
|
+ .li {
|
|
|
+ width: calc(50% - $myPadding /2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .right-bottom {
|
|
|
+
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ padding-left: $myPadding;
|
|
|
+
|
|
|
+ .li:nth-child(1) {
|
|
|
+ width: calc(50% - $myPadding /2);
|
|
|
+ }
|
|
|
+
|
|
|
+ .li:nth-child(2),
|
|
|
+ .li:nth-child(3) {
|
|
|
+ width: calc((50% - $myPadding /2)/2 - $myPadding /2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+@media screen and (max-width: 1450px) {
|
|
|
+ $waiPadding: 13rem;
|
|
|
+
|
|
|
+ .logo {
|
|
|
+ left: $waiPadding;
|
|
|
+ }
|
|
|
+
|
|
|
+ .menu {
|
|
|
+ width: calc(100% - ($waiPadding * 2));
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|