index.vue 2.81 KB
<template>
  <div style="background-color: white;height:100%; overflow:auto;">
    <div class="client-index-page">
      <div class="cloud-bg"></div>
    </div>

    <div class="entry-wrapper">
      <p style="color: #B8B8B8; margin: 1rem; margin-bottom: 0;">请选择您的身份</p>
      <div class="control">
        <div class="plain">
          <my-button type="plain" @on-click="goVisit">访客</my-button>
        </div>
        <div class="primary">
          <my-button type="primary" @on-click="goSchool">我有所属幼儿园</my-button>
        </div>
      </div>
    </div>
  </div>
  
  <!-- <div class="van-safe-area-bottom"></div> -->
</template>

<script setup>
import MyButton from '@/components/MyButton/index.vue'

import $ from 'jquery';
import { useRoute, useRouter } from 'vue-router'
import { Toast } from 'vant';
import { nextTick, onMounted } from 'vue'
const $route = useRoute();
const $router = useRouter();

const goVisit = () => { // 跳转爱心书籍页面
  $router.push({
    path: '/client/chooseBook'
  });
}
const goSchool = () => { // 跳转选择幼儿园页面
  $router.push({
    path: '/client/chooseSchool'
  });
}

onMounted (() => {
  // 进入项目自动打开导航栏
  // window.history.pushState({}, "title", "#");
  // 背景颜色全屏
  // $('.client-index-page').height($(document).height() - $('.entry-wrapper').outerHeight());
  $('.client-index-page').height($(document).height());
  // $('.client-index-page').width($(document).width());
})
</script>

<script>
import mixin from 'common/mixin'
import { mainStore } from '@/store'
import { storeToRefs } from 'pinia'
export default {
  mixins: [mixin.init],
  data () {
    return {
    }
  },
  mounted () {
  },
  methods: {
    
  }
}
</script>

<style lang="less" scoped>
  // .client-index-page {
  //   // 背景图 宽度100% 高度自适应
  //   background-image: url('@images/yindao@2x-1.png');
  //   background-repeat: no-repeat;
  //   width: 100%;
  //   height: 100%;
  //   background-size: 100% auto;
  //   position: relative;
  //   .cloud-bg {
  //     background-image: url('@images/bg-white@2x.png');
  //     background-repeat: no-repeat;
  //     width: 100%;
  //     height: 10rem;
  //     background-size: 100% auto;
  //     position: absolute;
  //     bottom: 12rem;
  //   }
  // }
  .client-index-page {
    // 背景图 宽度100% 高度控制
    background-image: url('@images/yindao@2x.png');
    background-repeat: no-repeat;
    width: 100%;
    background-size: 100% 85%;
    position: relative;
  }
  
  .entry-wrapper {
    position: absolute;
    bottom: 0;
    width: 100%;
    // background-color: #FFF;
    .control {
      margin: 1rem;
      margin-top: 0.5rem;
      overflow: auto;
      .plain {
        width: 30%; float: left;
      }
      .primary {
        width: 70%; float: left;
      }
    }
  }
</style>