2025-01-02 14:28:03 +08:00
|
|
|
<template>
|
2025-04-03 11:12:42 +08:00
|
|
|
<page-meta :page-font-size="fontValue+'px'" :root-font-size="fontValue+'px'"></page-meta>
|
2025-05-12 09:22:02 +08:00
|
|
|
<view class="index_main" :style="{ minHeight: screenH + 'px' }">
|
|
|
|
|
<!-- <Navbar title="皖送e餐" :showRightText="false" :isBack="false" :showBack="false"/> -->
|
|
|
|
|
<view style="height: 50px;width: 100%;text-align: center;line-height: 50px;background: #FFF;font-weight: 600;font-size: 32rpx;margin-bottom: 20rpx;">皖送e餐</view>
|
2025-01-03 10:20:58 +08:00
|
|
|
<view class="back-top"></view>
|
|
|
|
|
<!-- 轮播图 -->
|
|
|
|
|
<view class="swiper_nav">
|
|
|
|
|
<swiper autoplay :duration="1000">
|
|
|
|
|
<swiper-item v-for="(item, index) in swiperImg" :key="index">
|
2025-04-03 11:12:42 +08:00
|
|
|
<image :src="item" style="width: 100%; height: 100%" @click="jumpPage(index)"></image>
|
2025-01-03 10:20:58 +08:00
|
|
|
</swiper-item>
|
|
|
|
|
</swiper>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 皖送e餐 志愿者服务 -->
|
|
|
|
|
<view class="main_menu">
|
|
|
|
|
<view class="main_menu_item" v-for="(item, index) in firstMenus" :key="index" @click="handleItem(index)">
|
2025-04-03 11:12:42 +08:00
|
|
|
<image :src="item.icon" style="width: 120rpx;height: 120rpx;margin-bottom: 20rpx;"></image>
|
2025-01-03 10:20:58 +08:00
|
|
|
<view class="main_menu_name">{{ item.name }}</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
2025-04-03 11:12:42 +08:00
|
|
|
<!-- <view style="width: 92%;margin: 40rpx auto;">
|
|
|
|
|
<image src="../static/images/system/banner2.png" style="width: 100%;height: 300rpx;"></image>
|
|
|
|
|
</view>
|
|
|
|
|
<view style="width: 92%;margin: 00rpx auto;">
|
|
|
|
|
<image src="../static/images/system/banner1.png" style="width: 100%;height: 300rpx;"></image>
|
|
|
|
|
</view> -->
|
2025-01-02 14:28:03 +08:00
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
2025-04-22 13:05:32 +08:00
|
|
|
<script>
|
2025-06-10 10:54:00 +08:00
|
|
|
import { getInfoNewAPI } from '@/api/login'
|
2025-01-02 14:28:03 +08:00
|
|
|
export default {
|
|
|
|
|
data() {
|
2025-01-03 10:20:58 +08:00
|
|
|
return {
|
2025-06-10 10:54:00 +08:00
|
|
|
fontValue:uni.getStorageSync('fontSize') || 8,
|
2025-01-03 10:20:58 +08:00
|
|
|
screenH: '',
|
2025-04-03 11:12:42 +08:00
|
|
|
swiperImg: [require('../static/images/system/top.png'),require('../static/images/system/top1.png'),require('../static/images/system/top2.png')],
|
2025-01-03 10:20:58 +08:00
|
|
|
firstMenus: [
|
|
|
|
|
{
|
|
|
|
|
name: '就餐服务',
|
2025-04-03 11:12:42 +08:00
|
|
|
icon: require('../static/images/system/canteen.png')
|
2025-04-27 15:58:51 +08:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '共享驿站',
|
|
|
|
|
icon: require('../static/images/system/station.png')
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '志愿者服务',
|
|
|
|
|
icon: require('../static/images/system/server.png')
|
2025-01-03 10:20:58 +08:00
|
|
|
}
|
2025-06-10 10:54:00 +08:00
|
|
|
],
|
|
|
|
|
userInfo:{}
|
2025-01-03 10:20:58 +08:00
|
|
|
}
|
2025-01-02 14:28:03 +08:00
|
|
|
},
|
2025-06-10 10:54:00 +08:00
|
|
|
onShow() {
|
|
|
|
|
this.getUserInfo()
|
|
|
|
|
},
|
2025-01-03 10:20:58 +08:00
|
|
|
mounted() {
|
|
|
|
|
uni.getSystemInfo({
|
|
|
|
|
success: res => {
|
|
|
|
|
this.screenH = res.windowHeight
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
2025-06-10 10:54:00 +08:00
|
|
|
//获取用户信息
|
|
|
|
|
getUserInfo(){
|
|
|
|
|
getInfoNewAPI({'custId':uni.getStorageSync('custId'),"sourceType":7}).then(result => {
|
|
|
|
|
this.userInfo = result.data
|
|
|
|
|
console.log(this.userInfo)
|
|
|
|
|
})
|
|
|
|
|
},
|
2025-01-03 10:20:58 +08:00
|
|
|
handleItem(index) {
|
2025-03-14 15:15:54 +08:00
|
|
|
console.log(index)
|
2025-04-03 11:12:42 +08:00
|
|
|
if (index === 0) {
|
2025-06-10 10:54:00 +08:00
|
|
|
console.log(this.userInfo.custNum.indexOf("@yjst_sbd"))
|
|
|
|
|
if(this.userInfo.custNum.indexOf("@yjst_yj")>-1||(this.userInfo.orgId=='378921748080365568'&&this.userInfo.custNum.indexOf("@yjst_sbd")==-1)){
|
|
|
|
|
uni.navigateTo({ url: '/pages/yjCanteen' });
|
|
|
|
|
}else{
|
|
|
|
|
this.$router.push({ path: '/pages/index' })
|
|
|
|
|
}
|
2025-04-03 11:12:42 +08:00
|
|
|
} else if (index === 1) {
|
|
|
|
|
this.$router.push({ path: '/pages/post/index' })
|
|
|
|
|
} else if (index === 2) {
|
2025-01-10 15:49:19 +08:00
|
|
|
|
2025-04-03 11:12:42 +08:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
jumpPage(index) {
|
|
|
|
|
console.log(index)
|
|
|
|
|
if (index === 0) {
|
2025-06-10 10:54:00 +08:00
|
|
|
console.log(this.userInfo.custNum.indexOf("yjst_sbd"))
|
|
|
|
|
if(this.userInfo.custNum.indexOf("@yjst_yj")>-1||(this.userInfo.orgId=='378921748080365568'&&this.userInfo.custNum.indexOf("@yjst_sbd")==-1)){
|
|
|
|
|
uni.navigateTo({ url: '/pages/yjCanteen' });
|
|
|
|
|
}else{
|
|
|
|
|
this.$router.push({ path: '/pages/index' })
|
|
|
|
|
}
|
2025-04-03 11:12:42 +08:00
|
|
|
} else if (index === 1) {
|
|
|
|
|
this.$router.push({ path: '/pages/post/index' })
|
|
|
|
|
} else if (index === 2) {
|
|
|
|
|
this.$router.push({ path: '/pages/index' })
|
|
|
|
|
}
|
2025-01-03 10:20:58 +08:00
|
|
|
}
|
2025-04-03 11:12:42 +08:00
|
|
|
},
|
|
|
|
|
onUnload() {
|
2025-03-24 15:46:35 +08:00
|
|
|
// uni.showModal({
|
|
|
|
|
// title: "提示",
|
|
|
|
|
// content: "是否确认退出,您可以继续留在该页面,或者重新登录?",
|
|
|
|
|
// success: function (res) {
|
|
|
|
|
// if (res.confirm) {
|
|
|
|
|
// uni.redirectTo({ url: `/pages/login` });
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
},
|
|
|
|
|
// onBackPress(e) {
|
|
|
|
|
// console.log(e)
|
|
|
|
|
// //e.from === 'backbutton' 说明如果点击的是物理返回键或导航栏的返回键就进行以下操作
|
|
|
|
|
// if (e.from === 'backbutton') {
|
|
|
|
|
// //返回值为true 时,表示不执行默认的返回(默认返回上一页),执行自定义的返回
|
|
|
|
|
// uni.showModal({
|
|
|
|
|
// title: "提示",
|
|
|
|
|
// content: "是否确认退出,您可以继续留在该页面,或者重新登录?",
|
|
|
|
|
// success: function (res) {
|
|
|
|
|
// if (res.confirm) {
|
|
|
|
|
// uni.redirectTo({ url: `/pages/login` });
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
// //如果要限制必须写成true
|
|
|
|
|
// return true;
|
|
|
|
|
// }
|
|
|
|
|
// },
|
2025-01-02 14:28:03 +08:00
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
|
page {
|
|
|
|
|
min-height: 100vh;
|
2025-01-03 10:20:58 +08:00
|
|
|
background-image: url('../static/images/system/bg.png');
|
|
|
|
|
}
|
2025-01-10 15:49:19 +08:00
|
|
|
|
2025-01-03 10:20:58 +08:00
|
|
|
.index_main {
|
|
|
|
|
/* background: #f2f6fa; */
|
|
|
|
|
overflow: auto;
|
2025-05-12 09:22:02 +08:00
|
|
|
padding: 0;
|
2025-01-03 10:20:58 +08:00
|
|
|
box-sizing: border-box;
|
|
|
|
|
}
|
2025-01-10 15:49:19 +08:00
|
|
|
|
2025-01-03 10:20:58 +08:00
|
|
|
.back-top {
|
|
|
|
|
position: fixed;
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 578rpx;
|
|
|
|
|
/* background: linear-gradient(180deg, #d2eaff 0%, rgba(208, 233, 254, 0) 100%); */
|
|
|
|
|
top: 0;
|
|
|
|
|
left: 0;
|
|
|
|
|
}
|
2025-01-10 15:49:19 +08:00
|
|
|
|
2025-01-03 10:20:58 +08:00
|
|
|
.swiper_nav {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 300rpx;
|
|
|
|
|
/* background: #ffffff; */
|
|
|
|
|
border-radius: 20rpx;
|
|
|
|
|
padding: 0 24rpx;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
}
|
2025-01-10 15:49:19 +08:00
|
|
|
|
2025-01-03 10:20:58 +08:00
|
|
|
.main_menu {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
margin-top: 24px;
|
|
|
|
|
padding: 0 12rpx;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
}
|
2025-01-10 15:49:19 +08:00
|
|
|
|
2025-01-03 10:20:58 +08:00
|
|
|
.main_menu_item {
|
|
|
|
|
z-index: 99;
|
|
|
|
|
margin: 0 12rpx;
|
|
|
|
|
padding: 28rpx 0;
|
|
|
|
|
flex: 1;
|
2025-04-03 11:12:42 +08:00
|
|
|
height: auto;
|
2025-01-03 10:20:58 +08:00
|
|
|
background: #ffffff;
|
|
|
|
|
border-radius: 20rpx;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
2025-01-10 15:49:19 +08:00
|
|
|
|
2025-01-03 10:20:58 +08:00
|
|
|
.main_menu_name {
|
|
|
|
|
font-family: PingFang SC, PingFang SC;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
font-size: 30rpx;
|
|
|
|
|
color: #0e1a24;
|
|
|
|
|
font-style: normal;
|
|
|
|
|
text-transform: none;
|
|
|
|
|
}
|
2025-01-10 15:49:19 +08:00
|
|
|
|
2025-01-03 10:20:58 +08:00
|
|
|
image {
|
|
|
|
|
display: flex;
|
|
|
|
|
width: 88rpx;
|
|
|
|
|
height: 88rpx;
|
|
|
|
|
border-radius: 34rpx;
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-01-10 15:49:19 +08:00
|
|
|
|
2025-01-03 10:20:58 +08:00
|
|
|
.yiz_menu {
|
|
|
|
|
width: calc(100% - 48rpx);
|
|
|
|
|
min-height: 480rpx;
|
|
|
|
|
background: #ffffff;
|
|
|
|
|
border-radius: 20rpx;
|
|
|
|
|
margin-top: 24rpx;
|
|
|
|
|
margin-left: 24rpx;
|
|
|
|
|
}
|
2025-01-10 15:49:19 +08:00
|
|
|
|
2025-01-03 10:20:58 +08:00
|
|
|
.yiz_menu_tle {
|
|
|
|
|
font-family: PingFang SC, PingFang SC;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
font-size: 32rpx;
|
|
|
|
|
color: #0e1a24;
|
|
|
|
|
font-style: normal;
|
|
|
|
|
text-transform: none;
|
|
|
|
|
padding: 28rpx 28rpx 0 28rpx;
|
2025-01-02 14:28:03 +08:00
|
|
|
}
|
2025-01-10 15:49:19 +08:00
|
|
|
|
2025-01-03 10:20:58 +08:00
|
|
|
.yiz_menu_nav {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
flex-wrap: wrap;
|
2025-01-10 15:49:19 +08:00
|
|
|
|
2025-01-03 10:20:58 +08:00
|
|
|
.yiz_menu_nav_item {
|
|
|
|
|
width: calc(100% / 4);
|
|
|
|
|
margin-top: 48rpx;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
align-items: center;
|
2025-01-10 15:49:19 +08:00
|
|
|
|
2025-01-03 10:20:58 +08:00
|
|
|
image {
|
|
|
|
|
display: block;
|
|
|
|
|
width: 88rpx;
|
|
|
|
|
height: 88rpx;
|
|
|
|
|
border-radius: 34rpx;
|
|
|
|
|
}
|
2025-01-10 15:49:19 +08:00
|
|
|
|
2025-01-03 10:20:58 +08:00
|
|
|
.yiz_menu_name {
|
|
|
|
|
font-family: PingFang SC, PingFang SC;
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
color: #0e1a24;
|
|
|
|
|
font-style: normal;
|
|
|
|
|
text-transform: none;
|
|
|
|
|
margin-top: 20rpx;
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-01-02 14:28:03 +08:00
|
|
|
}
|
|
|
|
|
</style>
|