first commit

This commit is contained in:
Paidax
2024-07-03 17:06:36 +08:00
commit 03faa20548
3627 changed files with 874287 additions and 0 deletions
+384
View File
@@ -0,0 +1,384 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
#app {
background-color: #f6f7f9;
}
.swiper {
height: 200px;
}
.swiper img {
height: 200px;
}
.module {
margin: 10px;
box-shadow: 0 8px 12px #ebedf0;
border-radius: 10px;
}
.van-sidebar-item {
border-top-left-radius: 10px;
border-top-right-radius: 10px;
font-weight: bold;
}
.menu {
display: flex;
flex-wrap: wrap;
row-gap: 10px;
background-color: white;
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
}
.menu_item {
width: calc(100% / 4);
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
padding: 5px 0;
position: relative;
}
.menu_item_img {
width: 46px;
height: 46px;
}
.menu_item_name {
white-space: nowrap;
overflow: hidden;
width: 80%;
text-align: center;
font-size: 12px;
margin-top: 10px;
font-family: "微软雅黑", Helvetica, STHeiTi, sans-serif;
color: grey;
}
.number_text {
font-size: 36px;
color: #409eff;
}
.van-doc-card {
margin: 14px;
padding: 12px 38px;
background-color: #fff;
border-radius: 10px;
box-shadow: 0 8px 12px #ebedf0;
line-height: 36px;
font-size: 13px;
position: relative;
}
.title {
text-align: center;
font-size: 18px;
}
.middle {
background-color: white;
margin: 10px;
padding: 10px;
}
.middle_item {
display: flex;
margin-bottom: 16px;
}
.middle_item:last-of-type {
margin-bottom: 0;
}
.middle_item_pic {
margin-right: 10px;
}
.middle_item_img {
min-width: 100px;
width: 130px;
height: 90px;
border-radius: 10px;
object-fit: revert;
display: block;
}
.middle_item_text {
font-size: 13px;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.middle_item_text>div:nth-of-type(1) {
font-size: 18px;
font-weight: bold;
display: flex;
}
.van-badge {
position: absolute;
right: 16px;
top: 2px;
}
.middle .van-empty {
position: unset;
transform: none;
}
</style>
<div id="app">
<div style="margin-bottom: 60px" v-if="active === 0">
<van-swipe :autoplay="3000" class="swiper">
<van-swipe-item v-for="(image, index) in images" :key="index">
<img :src="image" width="100%"/>
</van-swipe-item>
</van-swipe>
<van-row class="module">
<div class="menu" style="border-radius: 10px">
<div class="menu_item">
<img :src="CREATE_PREVIEW_URL('')" alt="" class="menu_item_img">
<span class="menu_item_name">消息</span>
<van-badge :content="20"></van-badge>
</div>
<div v-for="item in 6" class="menu_item">
<img :src="CREATE_PREVIEW_URL('')" alt="" class="menu_item_img">
<span class="menu_item_name">122</span>
</div>
</div>
</van-row>
<van-row>
<div class="middle" style="border-radius: 10px;">
<template v-if="true">
<div v-for="item in 3" class="middle_item">
<div class="middle_item_pic">
<img :src="CREATE_PREVIEW_URL('FysF8kzAF9aONfw4FSivk2.jpg')" alt="" class="middle_item_img">
</div>
<div class="middle_item_text">
<div><van-icon name="fire" color="red" size="23"></van-icon>春节培训班</div>
<div style="line-height: 23px; color: grey; font-size: 12px">
<div>开始时间:01/05 08:00</div>
<div>结束时间:01/10 08:00</div>
</div>
</div>
</div>
</template>
<div v-else>
<van-empty description="近期暂无活动"></van-empty>
</div>
</div>
</van-row>
</div>
<div v-if="active === 1" style="background-color: #f6f7f9; min-height: 100vh">
<van-notice-bar
left-icon="volume-o" color="#1989fa" background="#ecf9ff"
text="温馨提示:只显示当前年份的待办和已办事项"
></van-notice-bar>
<van-tabs v-model="activeName" @click="initData">
<van-tab title="待办" name="0">
<div style="min-height: 80vh">
<div v-for="o in needItems">
<div v-if="o.count > 0" @click="toUrl(o)" class="van-doc-card">
<div class="title">{{ o.title }}</div>
<div style="display: flex; align-items: center; justify-content: space-between;">
<div>
<div style="color: grey; font-size: 15px">{{ o.name }}</div>
</div>
<div class="number_text">
<span>{{ o.count }}</span>
</div>
</div>
</div>
</div>
<van-empty
style="margin-top: 44px"
v-if="needItems.length === 0"
class="custom-image"
image="https://img01.yzcdn.cn/vant/custom-empty-image.png"
description="暂无待办"
></van-empty>
</div>
</van-tab>
<van-tab title="已办" name="1">
<div style="min-height: 80vh">
<div @click="toHref(o)" class="van-doc-card" v-for="o in completedItems">
<div class="title">{{ o.moduleName }}</div>
<div style="display: flex; align-items: center; justify-content: space-between;">
<div>
<span>{{ o.auditState }}</span>
</div>
<div>
<div style="color: grey; font-size: 15px">{{ o.auditTime }}</div>
</div>
</div>
</div>
<van-empty
style="margin-top: 44px"
v-if="completedItems.length === 0"
class="custom-image"
image="https://img01.yzcdn.cn/vant/custom-empty-image.png"
description="暂无已办"
></van-empty>
</div>
</van-tab>
</van-tabs>
</div>
<div style="margin-bottom: 60px" v-if="active === 2">
<van-row v-for="m in moduleMenus" class="module">
<div class="van-sidebar-item van-sidebar-item--select">
{{m.moduleName}}
</div>
<div class="menu">
<div v-for="m in m.menuList" :key="m.menuId" class="menu_item"
@click="menuClick(m)">
<img :src="CREATE_PREVIEW_URL(m.menuIcon)" alt="" class="menu_item_img">
<span class="menu_item_name">{{m.menuName}}</span>
</div>
</div>
</van-row>
</div>
<!-- <van-tabbar v-model="active" @change="tabbrChange">-->
<!-- <van-tabbar-item icon="home-o">首页</van-tabbar-item>-->
<!-- <van-tabbar-item :dot="needCount" icon="envelop-o">我的办理</van-tabbar-item>-->
<!-- <van-tabbar-item icon="apps-o">工作台</van-tabbar-item>-->
<!-- </van-tabbar>-->
</div>
<script>
const vue = new Vue({
el: '#app',
data() {
return {
images: [
"${AppDomain!}" + 'home1.png',
"${AppDomain!}" + 'home2.png',
"${AppDomain!}" + 'home3.png',
],
moduleMenus: [],
roles: [],
active: 2,
needCount: 0,
needItems: [],
activeName: '0',
completedItems: [],
}
},
methods: {
async getMenus() {
const {data} = await $.post('/platform/sys/appMenu/appMenus')
this.moduleMenus = data
},
menuClick(menu) {
location.href = menu.url
},
tabbrChange(o) {
this.needItems = []
this.initData()
},
toUrl(o) {
location.href = o.mobileHref
},
toHref(o) {
location.href = o.mobileUrl + '?audit=1';
},
/**
* 入学登记待办
* @returns {Promise<void>}
*/
/*async getRxdjAgenda() {
const {data, code} = await $.get("/platform/rxdj/agent/getAgenda")
if (code === 0) {
this.needItems = this.needItems.concat(data.filter(v => v.number > 0))
}
},*/
async getNeedItems() {
const {data, code} = await $.get('/platform/needItems/getNeedItems')
if (code === 0) {
const obj = data.filter(v => {
return v.mobileHref != null && v.count > 0
})
this.needItems = obj
}
},
async getCompletes() {
const {data, code} = await $.get('/platform/sys/completed/getCompletes')
if (code === 0) {
this.completedItems = data;
}
},
/**
* 会员个人核对待办
* @returns {Promise<void>}
*/
async getMemberCheckSelfAgenda() {
const {data, code} = await $.get("/platform/memberSelf/agenda/getAgenda")
if (code === 0) {
this.needItems = this.needItems.concat(data.filter(v => v.count > 0))
}
},
/**
* 福利个人核对待办
* @returns {Promise<void>}
*/
async getWelfareCheckSelfAgenda() {
const {data, code} = await $.get("/platform/welfareSelf/agenda/getAgenda")
if (code === 0) {
this.needItems = this.needItems.concat(data.filter(v => v.count > 0))
}
},
async initData() {
await this.getNeedItems();
await this.getMemberCheckSelfAgenda()
await this.getWelfareCheckSelfAgenda()
await this.getCompletes();
this.needCount = this.needItems.length
},
async setNeedItems() {
const {data, code} = await $.get('/platform/needItems/getNeedItems')
if (code === 0) {
const obj = data.filter(v => {
return v.mobileHref != null && v.count > 0
})
window.localStorage.setItem('needItems', escape(JSON.stringify(obj)))
}
},
},
beforeMount() {
this.setNeedItems();
},
async created() {
await this.getMenus();
this.initData()
}
})
window.addEventListener('pageshow', e => {
if (e.persisted || (window.performance && window.performance.navigation.type === 2)) {
vue.getMenus()
vue.initData()
}
})
</script>
<!--#
}
#-->