first commit

This commit is contained in:
那些花儿
2025-11-05 09:27:20 +08:00
commit 375eb81203
4587 changed files with 880312 additions and 0 deletions
@@ -0,0 +1,321 @@
const entry = {
template: /*language=HTML*/ `
<div class="entry-wrapper">
<div class="entry-title">
<span>常用入口</span>
</div>
<div class="entry-container">
<!-- 左侧分类导航 -->
<div class="sidebar">
<div class="category" :class="{active: activeCategory === 'serv'}"
@click="setActiveCategory('serv')">
<i class="fa fa-star"></i>
<span>推荐服务</span>
</div>
<div class="category" :class="{active: activeCategory === 'app'}" @click="setActiveCategory('app')">
<i class="fa fa-fire"></i>
<span>推荐应用</span>
</div>
<div class="category" :class="{active: activeCategory === 'fav'}"
@click="setActiveCategory('fav')">
<i class="fa fa-heart"></i>
<span>收藏服务</span>
</div>
</div>
<!-- 右侧服务卡片区域 -->
<div class="content">
<div class="services-grid">
<div class="service-card" v-for="(service, index) in currentServices" :key="index"
@click="openService(service)">
<div class="service-icon">
<img :src="service.picIcon">
</div>
<div class="service-info">
<h4 class="service-name">{{ service.name }}</h4>
</div>
</div>
</div>
</div>
</div>
</div>
`,
data() {
return {
activeCategory: 'serv',
hasMore: true,
entries: {
serv: [],
app: [],
fav: []
},
}
},
computed: {
currentServices() {
return this.entries[this.activeCategory] || [];
}
},
created() {
this.getRecommendService()
this.getRecommendApp()
this.getFavorite()
},
methods: {
setActiveCategory(category) {
this.activeCategory = category;
},
// 查询推荐服务
async getRecommendService() {
this.$axios.post('/platform/home/listRecommendService', {platform: "PC"}).then(res => {
if (res.code === 0) {
this.entries.serv = res.data
}
})
},
// 获取推荐应用
async getRecommendApp() {
this.$axios.post('/platform/home/listRecommendApp', {platform: "PC"}).then(res => {
if (res.code === 0) {
this.entries.app = res.data
}
})
},
// 获取我的收藏
async getFavorite() {
this.$axios.post('/platform/home/listFavorite', {platform: "PC"}).then(res => {
if (res.code === 0) {
this.entries.fav = res.data
}
})
},
// 点击服务
openService(service) {
if(this.activeCategory === 'serv'){
if(!service.href) this.$message.error('无效的链接地址')
window.open(service.href)
return
}
if(this.activeCategory === 'app'){
// 储存到缓存
window.sessionStorage.setItem("zhgh_sub_app", JSON.stringify(service))
// 新标签页打开
window.open("/platform/v4/subApp?appId=" + service.id, "_blank")
return
}
if(this.activeCategory === 'fav'){
if(!service.href) this.$message.error('无效的链接地址')
window.open(service.href)
return
if(!service.parentId){
// 储存到缓存
window.sessionStorage.setItem("zhgh_sub_app", JSON.stringify(app))
// 新标签页打开
window.open("/platform/v4/subApp?appId=" + app.id, "_blank")
}
}
}
},
style: /*language=CSS*/ `
.entry-wrapper {
width: 100%;
background-image: url(https://www.ncu.edu.cn/images/bbg1.jpg);
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}
.entry-title {
font-size: 30px;
color: #000000;
display: block;
font-weight: bold;
position: relative;
text-align: center;
padding: 40px 0;
}
/deep/ .entry-title span::before {
content: '';
width: 24px;
height: 11px;
background: url(https://www.ncu.edu.cn/images/titl.svg) no-repeat center;
background-size: 24px 11px;
display: inline-block;
margin-right: 0;
vertical-align: middle;
}
/deep/ .entry-title span::after {
content: '';
width: 24px;
height: 11px;
background: url(https://www.ncu.edu.cn/images/titr.svg) no-repeat center;
background-size: 24px 11px;
display: inline-block;
margin-left: 0;
vertical-align: middle;
}
.entry-container {
width: 80%;
max-width: 80%;
margin: 0 auto;
padding: 20px;
display: flex;
gap: 30px;
overflow: hidden;
}
.sidebar {
width: 200px;
flex-shrink: 0;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.category {
display: flex;
align-items: center;
padding: 12px 16px;
margin-bottom: 2px;
cursor: pointer;
transition: background-color 0.2s ease;
border-left: 3px solid transparent;
}
.category:hover {
}
.category.active {
color: var(--color-primary);
}
.category i {
font-size: 14px;
margin-right: 10px;
width: 16px;
text-align: center;
}
.category span {
font-size: 18px;
font-weight: 700;
}
.content {
flex: 1;
height: 164px;
}
.services-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
gap: 20px;
grid-template-rows: repeat(2, 1fr);
overflow: hidden;
}
.service-card {
padding: 12px;
height: 72px;
cursor: pointer;
transition: background-color 0.2s ease;
border: none;
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAYEAAAB4CAYAAAAUs05BAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAANrSURBVHgB7dzNapNZAMfh0zbNYGgosYql4wiCFEEZXLiYG3DrdryPuQbvpXMB7t24m4UOCiKuEtCKsaVNiTRaXhshLvyoSd/Yzf95oORA827PLycn5yxsdZ/crKql+6WG1uLy0d3Lm29Pes+jfm+1N9w/VwD4qXtXbmyf9P/Hu29Wng/6K6WOqnq6WACI1ZgM1pqt0Z31qztlBoMPh0sPXr+8OMsztzsbe9fanfcFgG9sdZ+tz/L+6+0LB7c6lw5meWZ7OGg+7HfPj8dWAgDBRAAgmAgABBMBgGAiABBMBACCiQBAsIV5nBiehXMCAD826zmBWpwYBsi2UFXV5vHrP6WGycnhae4QAuD0JncGneak8He8sBIACCYCAMEa//b+bx5vDJ/dRgQAtY2/EprDVdJ9KwGAYLWukgbgbI03g+tuCLtKGoDPRAAgmAgABBMBgGAiABBMBACCiQBAMBEACCYCAMFEACCYCAAEEwGAYCIAEEwEAIKJAEAwEQAIJgIAwUQAIJgIAAQTAYBgIgAQTAQAgokAQDARAAgmAgDBRAAgmAgABBMBgGAiABBMBACCiQBAMBEACCYCAMFEACCYCAAEEwGAYCIAEEwEAIKJAEAwEQAIJgIAwUQAIJgIAAQTAYBgIgAQTAQAgokAQDARAAgmAgDBRAAgmAgABBMBgGAiABBMBACCiQBAMBEACCYCAMFEACCYCAAEEwGAYCIAEEwEAIKJAEAwEQAIJgIAwUQAIJgIAAQTAYBgIgAQTAQAgokAQDARAAgmAgDBRAAgmAgABBMBgGAiABBMBACCiQBAMBEACCYCAMFEACCYCAAEEwGAYCIAEKwxGbwbDZtb3WfrpYbW4vLR3cubbwsAv8Tj3Tcrzwf9lTInVgIAwRp///Hn6Ph1u9Qw+HC49OD1y4sFgDNxvX3h4Fbn0kGpZ8dKACCYCAAEW9jqPrlZVUv3yymtNVujv9Y29qb9Ouh2Z2PvWrvzvgDwjWl+oLM/OlwefBw1fm+1682lVfXUSgAg2JefiI4/0d9Zv7oz7YPbw0HzYb97fjxuL/92dO/KjRM3lx/1e6u94f65AsBPnTSnTubfWeftr58fj60EAIKJAEAwEQAIJgIAwUQAIJgIAAQTAYBgc71Kehr/7b5aHf8VAGqZx7xtJQAQ7BOP4saDQA2PwQAAAABJRU5ErkJggg==) no-repeat;
background-size: 100% 100%;
display: flex;
align-items: center;
gap: 12px;
}
.service-card:hover {
}
.service-icon {
width: 32px;
height: 32px;
flex-shrink: 0;
}
.service-icon img {
width: 100%;
height: 100%;
border-radius: 4px;
object-fit: cover;
}
.service-info {
flex: 1;
min-width: 0;
overflow: hidden;
}
.service-name {
font-size: 14px;
font-weight: 400;
color: #333;
margin: 0;
line-height: 1.4;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/* 响应式设计 */
@media (max-width: 768px) {
.entry-container {
flex-direction: column;
gap: 20px;
}
.sidebar {
width: 100%;
display: flex;
overflow-x: auto;
gap: 0;
border-bottom: 1px solid #e8e8e8;
padding-bottom: 0;
}
.category {
flex-shrink: 0;
margin-bottom: 0;
white-space: nowrap;
border-left: none;
border-bottom: 3px solid transparent;
}
.category.active {
border-left: none;
border-bottom-color: #1890ff;
}
.services-grid {
grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
}
@media (max-width: 480px) {
.services-grid {
grid-template-columns: 1fr 1fr;
}
.service-card {
padding: 12px;
}
}
`
}