359 lines
12 KiB
HTML
359 lines
12 KiB
HTML
<!--#
|
|
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;
|
|
}
|
|
|
|
.module_title {
|
|
position: relative;
|
|
display: flex;
|
|
flex-direction: row;
|
|
align-items: center;
|
|
padding: 12px 15px;
|
|
font-weight: 400;
|
|
font-size: 14px;
|
|
color: rgb(51, 51, 51);
|
|
background-color: #edf5ed;
|
|
}
|
|
|
|
.module_title::before {
|
|
content: '';
|
|
position: absolute;
|
|
width: 5px;
|
|
background-color: green;
|
|
height: 25px;
|
|
left: 5px;
|
|
top: 50%;
|
|
transform: translateY(-50%);
|
|
}
|
|
|
|
.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;
|
|
}
|
|
|
|
.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;
|
|
}
|
|
|
|
</style>
|
|
|
|
<div id="app">
|
|
|
|
<div v-if="active === 0" 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: 100px" v-if="active === 1">
|
|
<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 v-for="m in moduleMenus" class="module">
|
|
<div class="van-sidebar-item van-sidebar-item--select">
|
|
{{m.moduleName}}
|
|
</div>
|
|
|
|
<!-- v-if="(m.url == '/mobile/member/edit' && ${@shiro.lacksRole('H01')}) || m.url != '/mobile/member/edit'"-->
|
|
<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 :dot="needCount" icon="envelop-o">我的办理</van-tabbar-item>
|
|
<van-tabbar-item icon="home-o">工作台</van-tabbar-item>
|
|
</van-tabbar>
|
|
<!--<div v-for="m in moduleMenus" :key="m.moduleId" class="module">
|
|
<div class="module_title">
|
|
{{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>
|
|
|
|
|
|
</div>-->
|
|
|
|
</div>
|
|
|
|
<script src="https://res.wx.qq.com/open/js/cloudbase/1.1.0/cloud.js"></script>
|
|
|
|
<script>
|
|
var vue = new Vue({
|
|
el: '#app',
|
|
data() {
|
|
return {
|
|
images: [
|
|
"${AppDomain!}" + '/home1.png',
|
|
"${AppDomain!}" + '/home2.png',
|
|
"${AppDomain!}" + '/home3.png',
|
|
],
|
|
moduleMenus: [],
|
|
roles: [],
|
|
active: 1,
|
|
needCount: 0,
|
|
needItems: [],
|
|
activeName: '0',
|
|
completedItems: [],
|
|
}
|
|
},
|
|
methods: {
|
|
async getMenus() {
|
|
const {data} = await $.post('/platform/sys/appMenu/appMenus')
|
|
this.moduleMenus = data
|
|
},
|
|
async menuClick(menu) {
|
|
if (menu.url === '1' || menu.menuName === '健步走') {
|
|
const loginName = "${@shiro.getPrincipalProperty('loginname')}"
|
|
const userName = "${@shiro.getPrincipalProperty('username')}"
|
|
const query = 'loginName=' + encodeURIComponent(loginName) + '&userName=' + encodeURIComponent(userName)
|
|
|
|
let cloud = new window.cloud.Cloud({
|
|
identityless: true, // true表示是未登录模式
|
|
resourceAppid: 'wxf750f43635f770e0', // 小程序AppID
|
|
resourceEnv: 'jsz-2g1aj6un572bcf2a', // 云环境环境ID
|
|
})
|
|
await cloud.init(); // 云函数初始化
|
|
const res = await cloud.callFunction({
|
|
name: 'urllink', //提供UrlScheme服务的云函数名称
|
|
data: {
|
|
path: '/pages/login/login', // 想跳转的小程序路径
|
|
query: query, // 地址栏query参数,可在微信 onLoad: function (options) {}生命周期里options接收这些参数
|
|
} //向这个云函数中传入的自定义参数,注意:path地址前后/不能多加或者少加,query参数里不能有转义字符如果有需要解码
|
|
});
|
|
console.log(res, '云函数返回数据');
|
|
if (res && res.result.errCode === 0) {
|
|
location.href = res.result.urlLink
|
|
} else {
|
|
console.log(res.errMsg);
|
|
}
|
|
} else {
|
|
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>
|
|
|
|
<!--#
|
|
}
|
|
#-->
|