233 lines
		
	
	
		
			5.5 KiB
		
	
	
	
		
			Vue
		
	
	
	
			
		
		
	
	
			233 lines
		
	
	
		
			5.5 KiB
		
	
	
	
		
			Vue
		
	
	
	
<template>
 | 
						|
	<page-meta :page-font-size="fontValue+'px'" :root-font-size="fontValue+'px'"></page-meta>
 | 
						|
  <view class="index_main" :style="{ minHeight: screenH + 'px' }">
 | 
						|
    <view class="back-top"></view>
 | 
						|
    <!-- 轮播图 -->
 | 
						|
    <view class="swiper_nav">
 | 
						|
      <swiper autoplay :duration="1000">
 | 
						|
        <swiper-item v-for="(item, index) in swiperImg" :key="index">
 | 
						|
          <image :src="item" style="width: 100%; height: 100%" @click="jumpPage(index)"></image>
 | 
						|
        </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)">
 | 
						|
        <image :src="item.icon" style="width: 120rpx;height: 120rpx;margin-bottom: 20rpx;"></image>
 | 
						|
        <view class="main_menu_name">{{ item.name }}</view>
 | 
						|
      </view>
 | 
						|
    </view>
 | 
						|
	<!-- <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> -->
 | 
						|
  </view>
 | 
						|
</template>
 | 
						|
 | 
						|
<script>
 | 
						|
export default {
 | 
						|
  data() {
 | 
						|
    return {
 | 
						|
		fontValue:uni.getStorageSync('fontSize') || 8,
 | 
						|
      screenH: '',
 | 
						|
      swiperImg: [require('../static/images/system/top.png'),require('../static/images/system/top1.png'),require('../static/images/system/top2.png')],
 | 
						|
      firstMenus: [
 | 
						|
        {
 | 
						|
          name: '就餐服务',
 | 
						|
          icon: require('../static/images/system/canteen.png')
 | 
						|
        },
 | 
						|
        {
 | 
						|
          name: '共享驿站',
 | 
						|
          icon: require('../static/images/system/station.png')
 | 
						|
        },
 | 
						|
        {
 | 
						|
          name: '志愿者服务',
 | 
						|
          icon: require('../static/images/system/server.png')
 | 
						|
        }
 | 
						|
      ]
 | 
						|
    }
 | 
						|
  },
 | 
						|
  mounted() {
 | 
						|
    uni.getSystemInfo({
 | 
						|
      success: res => {
 | 
						|
        this.screenH = res.windowHeight
 | 
						|
      }
 | 
						|
    })
 | 
						|
  },
 | 
						|
  methods: {
 | 
						|
    handleItem(index) {
 | 
						|
		console.log(index)
 | 
						|
		if (index === 0) {
 | 
						|
			this.$router.push({ path: '/pages/index' })
 | 
						|
		} else if (index === 1) {
 | 
						|
			this.$router.push({ path: '/pages/post/index' }) 
 | 
						|
		} else if (index === 2) {
 | 
						|
 | 
						|
		}
 | 
						|
    },
 | 
						|
	jumpPage(index) {
 | 
						|
		console.log(index)
 | 
						|
		if (index === 0) {
 | 
						|
			this.$router.push({ path: '/pages/index' })
 | 
						|
		} else if (index === 1) {
 | 
						|
			this.$router.push({ path: '/pages/post/index' }) 
 | 
						|
		} else if (index === 2) {
 | 
						|
			this.$router.push({ path: '/pages/index' })
 | 
						|
		}
 | 
						|
    }
 | 
						|
  },
 | 
						|
  onUnload() { 
 | 
						|
		// 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;
 | 
						|
	// 	}
 | 
						|
	// },
 | 
						|
}
 | 
						|
</script>
 | 
						|
 | 
						|
<style lang="scss">
 | 
						|
page {
 | 
						|
  min-height: 100vh;
 | 
						|
  background-image: url('../static/images/system/bg.png');
 | 
						|
}
 | 
						|
 | 
						|
.index_main {
 | 
						|
  /* background: #f2f6fa; */
 | 
						|
  overflow: auto;
 | 
						|
  padding: 24rpx 0;
 | 
						|
  box-sizing: border-box;
 | 
						|
}
 | 
						|
 | 
						|
.back-top {
 | 
						|
  position: fixed;
 | 
						|
  width: 100%;
 | 
						|
  height: 578rpx;
 | 
						|
  /* background: linear-gradient(180deg, #d2eaff 0%, rgba(208, 233, 254, 0) 100%); */
 | 
						|
  top: 0;
 | 
						|
  left: 0;
 | 
						|
}
 | 
						|
 | 
						|
.swiper_nav {
 | 
						|
  width: 100%;
 | 
						|
  height: 300rpx;
 | 
						|
  /* background: #ffffff; */
 | 
						|
  border-radius: 20rpx;
 | 
						|
  padding: 0 24rpx;
 | 
						|
  box-sizing: border-box;
 | 
						|
}
 | 
						|
 | 
						|
.main_menu {
 | 
						|
  display: flex;
 | 
						|
  justify-content: space-between;
 | 
						|
  margin-top: 24px;
 | 
						|
  padding: 0 12rpx;
 | 
						|
  box-sizing: border-box;
 | 
						|
}
 | 
						|
 | 
						|
.main_menu_item {
 | 
						|
  z-index: 99;
 | 
						|
  margin: 0 12rpx;
 | 
						|
  padding: 28rpx 0;
 | 
						|
  flex: 1;
 | 
						|
  height: auto;
 | 
						|
  background: #ffffff;
 | 
						|
  border-radius: 20rpx;
 | 
						|
  display: flex;
 | 
						|
  flex-direction: column;
 | 
						|
  align-items: center;
 | 
						|
  justify-content: space-between;
 | 
						|
 | 
						|
  .main_menu_name {
 | 
						|
    font-family: PingFang SC, PingFang SC;
 | 
						|
    font-weight: bold;
 | 
						|
    font-size: 30rpx;
 | 
						|
    color: #0e1a24;
 | 
						|
    font-style: normal;
 | 
						|
    text-transform: none;
 | 
						|
  }
 | 
						|
 | 
						|
  image {
 | 
						|
    display: flex;
 | 
						|
    width: 88rpx;
 | 
						|
    height: 88rpx;
 | 
						|
    border-radius: 34rpx;
 | 
						|
  }
 | 
						|
}
 | 
						|
 | 
						|
.yiz_menu {
 | 
						|
  width: calc(100% - 48rpx);
 | 
						|
  min-height: 480rpx;
 | 
						|
  background: #ffffff;
 | 
						|
  border-radius: 20rpx;
 | 
						|
  margin-top: 24rpx;
 | 
						|
  margin-left: 24rpx;
 | 
						|
}
 | 
						|
 | 
						|
.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;
 | 
						|
}
 | 
						|
 | 
						|
.yiz_menu_nav {
 | 
						|
  display: flex;
 | 
						|
  align-items: center;
 | 
						|
  flex-wrap: wrap;
 | 
						|
 | 
						|
  .yiz_menu_nav_item {
 | 
						|
    width: calc(100% / 4);
 | 
						|
    margin-top: 48rpx;
 | 
						|
    display: flex;
 | 
						|
    flex-direction: column;
 | 
						|
    justify-content: center;
 | 
						|
    align-items: center;
 | 
						|
 | 
						|
    image {
 | 
						|
      display: block;
 | 
						|
      width: 88rpx;
 | 
						|
      height: 88rpx;
 | 
						|
      border-radius: 34rpx;
 | 
						|
    }
 | 
						|
 | 
						|
    .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;
 | 
						|
    }
 | 
						|
  }
 | 
						|
}
 | 
						|
</style>
 |