first commit

This commit is contained in:
2026-08-26 14:25:17 +08:00
commit 06debfd1fc
10595 changed files with 1836924 additions and 0 deletions
@@ -0,0 +1,57 @@
const home = {
template: `
<div>
<van-swipe :autoplay="3000" :height="250">
<van-swipe-item default="https://zhgh.ctbu.edu.cn/home3.png"></van-swipe-item>
<van-swipe-item default="https://zhgh.ctbu.edu.cn/home3.png"></van-swipe-item>
</van-swipe>
<div class="van-bgcolor-white padding20X">
<van-grid :row-num="8/4" icon-size="50" square clickable>
<van-grid-item v-for="item in $store.state.user.h5ModuleMenus"
:key="item.id"
:icon="item.icon"
text="标题">
</van-grid-item>
</van-grid>
</div>
<div class="padding20X paddingX10 van-bgcolor-white van-hairline--top" style="box-shadow: 0 8px 12px #ebedf0">
<div class="bold font-size4 color-111" style="color: #1890ff;border-left: 5px solid #1890ff;padding-left: 5px;">最新活动</div>
<div v-for="item in activityOptions" :key="item.id" class="width100" @click="enter(item)">
<van-text-box
cover="https://img.yzcdn.cn/vant/t-thirt.jpg"
type="2"
:title="item.name"
:content="item.startDate + '至' + item.endDate"
sub-content=""
>
<div slot="tip" class="font-size-2 van-color-text-secondary flex-align">
</div>
</van-text-box>
</div>
</div>
</div>
`,
data() {
return {
activityOptions: []
}
},
methods: {
listActivity() {
this.$axios.post("/platform/h5/listHomeActivity").then((resp) => {
if (resp.code === 0) {
this.activityOptions = resp.data
}
})
},
//点击进入活动
enter(item) {
this.$pjaxReplace(item.h5Url)
}
},
created() {
this.listActivity()
}
}
@@ -0,0 +1,93 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
<style>
.workbenche {
padding: 10px 10px 60px 10px;
}
.module-item {
background-color: #fff;
box-shadow: 0.5px 0.5px #ccc;
border-radius: 5px;
margin-bottom: 10px;
}
.module-header {
position: relative;
display: flex;
flex-direction: row;
align-items: center;
padding: 12px 10px;
font-weight: 400;
}
.workbenche .module-item .module-header .module-header__content {
display: flex;
flex-direction: column;
flex: 1;
font-size: 18px;
font-weight: 700;
color: #1890ff;
}
.module-content .van-grid-item .van-grid-item__icon-wrapper img {
width: 30px;
height: 30px;
}
</style>
<div id="app" v-cloak>
<div>
<!-- <work v-if="homeTabbarActive === 'search'" ref="work"></work>-->
<home v-if="homeTabbarActive === 'home'"></home>
<work v-if="homeTabbarActive === 'work'"></work>
<mine v-if="homeTabbarActive === 'mine'"></mine>
</div>
<div id="page-tarbar" class="page-tarbar">
<van-tabbar v-model="homeTabbarActive" @change="homeTabbarChange">
<van-tabbar-item name="home" icon="wap-home-o">首页</van-tabbar-item>
<van-tabbar-item name="work" icon="gem">工作台</van-tabbar-item>
<van-tabbar-item name="setting" icon="waiting-call">消息</van-tabbar-item>
<van-tabbar-item name="mine" icon="user-o">我的</van-tabbar-item>
</van-tabbar>
</div>
</div>
<script nonce="${cspNonce!}">
<!--#include("home.js"){}#-->
<!--#include("work.js"){}#-->
<!--#include("mine.js"){}#-->
new Vue({
el: "#app",
store,
components: {
home,
work,
mine
},
data() {
return {
homeTabbarActive: "home"
}
},
methods: {
homeTabbarChange(val) {
this.$store.commit("setActiveTarBar", val)
}
},
created() {
if (!this.$store.state.activeTarBar) {
this.$store.commit("setActiveTarBar", "home")
} else {
this.homeTabbarActive = this.$store.state.activeTarBar
}
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,41 @@
const mine = {
template: `
<div class="home-mine">
<van-sticky>
<van-nav-bar title="我的"></van-nav-bar>
</van-sticky>
<van-cell-group class="margin-top10">
<van-person-card
:title="$store.state.user.username"
:sub-title="$store.state.user.userState+'-'+$store.state.user.personType"
tag=""
tag-type=""
:corner="$store.state.user.sex"
:content="[$store.state.user.unit.name, $store.state.user.union.name]"
></van-person-card>
</van-cell-group>
<van-cell-group class="margin-top10">
<van-cell is-link @click="$pjaxReplace('/platform/signature/h5')">个人信息</van-cell>
<van-cell is-link @click="$pjaxReplace('/platform/signature/h5')">我的签名</van-cell>
</van-cell-group>
<van-button plain block class="margin-top20" border-color="transparent" color="#ff5f4e" @click="logout">退出登录</van-button>
</div>
`,
store,
components: {},
data() {
return {}
},
methods: {
logout() {
this.$dialog
.confirm({
title: "温馨提示",
message: "您确认要退出登录吗?"
})
.then(() => {
this.$store.dispatch("logout")
})
}
}
}
@@ -0,0 +1,23 @@
const work = {
template: `
<div class="workbenche">
<div class="module-item" v-for="item in $store.state.user.h5ModuleMenus" :key="item.id">
<div class="module-header">
<div class="module-header__content">{{item.name}}</div>
</div>
<div class="module-content">
<van-grid>
<van-grid-item icon="photo-o" :text="menu.name" v-for="menu in item.menus" :key="menu.id">
<template #icon>
<img src="http://localhost:8080/platform/sys/file/download?id=r0jbec63buj9rpee78tkdrd2qj" />
</template>
<template #text>
<a :href="menu.href" data-pjax>{{menu.name}}</a>
</template>
</van-grid-item>
</van-grid>
</div>
</div>
</div>
`
}
@@ -0,0 +1,8 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Title</title>
</head>
<body></body>
</html>
@@ -0,0 +1,83 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
<div id="app" v-cloak>
<van-sticky>
<van-nav-bar left-text="返回" left-arrow @click-left="$pjaxReplace('/platform/h5/home')" title="我的签名"></van-nav-bar>
</van-sticky>
<div>
<div v-if="!showSignature" class="padding10X paddingX10">
<van-image width="100%" height="200" :src="userSignatureUrl" v-if="userSignatureUrl" style="border: 1px dashed #000">
<template slot="error">获取签名失败</template>
</van-image>
<van-status orient="vertical" :figure="14" title="暂无签名" v-else></van-status>
<div class="margin-top10">
<van-button v-if="!userSignatureUrl" block type="primary" @click="openSignature">去签名</van-button>
<van-button v-else block type="primary" @click="openSignature">修改签名</van-button>
</div>
</div>
<signature v-if="showSignature" @save="saveSignature"></signature>
</div>
</div>
<script nonce="${cspNonce!}">
const vue = new Vue({
el: "#app",
store,
components: {
signature: httpVueLoader("/components/plugins/sysSignature/index.vue?v=" + new Date().getTime())
},
data() {
return {
showSignature: false,
userSignatureUrl: null
}
},
methods: {
getUserSignature() {
this.$axios.post("/platform/sys/userSignature/get").then((res) => {
if (res.code === 0) {
this.userSignatureUrl = res.data.signature
}
})
},
openSignature() {
this.showSignature = true
},
saveSignature(signature) {
console.log(signature)
const file = base64ToFile(signature, "signature.png")
const formData = new FormData()
formData.append("file", file)
axios
.post("/platform/signature/update", formData, {
headers: {
"Content-Type": "multipart/form-data"
}
})
.then((res) => {
return res.data
})
.then((res) => {
if (res.code === 0) {
this.showSignature = false
this.$toast.success(res.msg)
this.getUserSignature()
} else {
this.$toast.fail(res.msg)
}
})
}
},
created() {
this.getUserSignature()
}
})
</script>
<!--#
}
#-->