| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397 |
- <template>
- <view class="container">
- <!-- 自定义导航栏区域 -->
- <view class="tab" :style="{ height: customBarH * 2 + 'rpx', paddingTop: statusBarH * 2 + 'rpx' }" v-show="!showHeader">
- <img class="tab_img" src="../../static/images/people.png" @click="goPage('/pages/myCenter/myCenter')" />
- 万载三中
- </view>
- <!-- 页面下拉时显示的导航栏 -->
- <view class="tab2" :style="{ height: customBarH * 2 + 'rpx', paddingTop: statusBarH * 2 + 'rpx' }" v-show="showHeader">万载三中</view>
- <!-- 顶部图片区域 -->
- <view class="header">
- <img class="header_img" src="../../static/images/header.png" />
- <!-- 学校图标区域 -->
- <img class="header_icon" src="../../static/images/header-icon.png" />
- <!-- 学校名称区域 -->
- <view class="header_school">万载三中</view>
- <!-- 学生姓名区域 -->
- <view class="header_name">张三</view>
- <!-- 学生年级区域 -->
- <view class="header_grade">初二</view>
- <!-- 二维码区域 -->
- <view class="header_code">
- <uv-qrcode ref="qrcodeRef" size="82rpx" :value="QRCodeUrl" :options="options" @click="handleClickCode"></uv-qrcode>
- </view>
- </view>
- <!-- 详细信息区域 -->
- <view class="body">
- <!-- 个人信息区域 -->
- <view class="body_header">
- <img class="info_bg" src="../../static/images/info-bg.png" />
- <img class="info_img" src="../../static/images/user-photo.png" />
- <view class="info_name">王佳明</view>
- <view class="info_detail" @click="goPage('/pages/myMsg/myMsg')">个人信息></view>
- <view class="info_change" @click="goPage('/pages/change/change')">切换 ></view>
- <!-- 关联区域 -->
- <view class="info_bind">
- <img @click="goPage('/pages/bind/bind')" class="bind_img" src="../../static/images/bind.png" />
- <text @click="goPage('/pages/bind/bind')">关联小孩</text>
- </view>
- </view>
- <!-- 应用列表区域 -->
- <view class="body_list">
- <!-- 每一个应用区域 -->
- <view class="list_box" v-for="item in list" :key="item.id" @click="goPage(item.path)">
- <img class="box_img" :src="item.url" />
- {{ item.title }}
- </view>
- </view>
- </view>
- </view>
- </template>
- <script setup>
- import { ref } from 'vue'
- import { onLoad, onPageScroll, onPullDownRefresh } from '@dcloudio/uni-app'
- onLoad(() => {
- // 获取系统信息
- uni.getSystemInfo({
- success: (e) => {
- // 获取状态栏高度
- statusBarH.value = e.statusBarHeight
- // // 获取菜单按钮栏高度
- let custom = uni.getMenuButtonBoundingClientRect()
- customBarH.value = custom.height
- }
- })
- })
- onPullDownRefresh(() => {
- qrcodeRef.value.remake()
- setTimeout(() => {
- uni.stopPullDownRefresh()
- }, 1500)
- })
- onPageScroll((e) => {
- if (e.scrollTop > 70) {
- showHeader.value = true
- } else {
- showHeader.value = false
- }
- })
- // 顶部导航栏显示隐藏控制
- const showHeader = ref(false)
- // 状态栏高度
- const statusBarH = ref(0)
- // 胶囊按钮栏高度
- const customBarH = ref(0)
- // 二维码元素引用标记
- const qrcodeRef = ref(null)
- // 应用列表数据
- const list = ref([
- // {
- // id: 1,
- // title: '考勤管理',
- // url: '../../static/images/icon.png'
- // },
- // {
- // id: 2,
- // title: '课表查询',
- // url: '../../static/images/icon.png',
- // path: ''
- // },
- {
- id: 3,
- title: '学生轨迹',
- url: '../../static/images/icon.png',
- path: '/pages/track/track'
- },
- // {
- // id: 4,
- // title: '打卡接龙',
- // url: '../../static/images/icon.png'
- // },
- // {
- // id: 5,
- // title: '人脸采集',
- // url: '../../static/images/icon.png'
- // },
- // {
- // id: 6,
- // title: '智慧教学',
- // url: '../../static/images/icon.png'
- // },
- {
- id: 7,
- title: '消息通知',
- url: '../../static/images/icon.png',
- path: '/pages/msgWarn/msgWarn'
- },
- {
- id: 8,
- title: '访客预约',
- url: '../../static/images/icon.png',
- path: '/pagesReservation/reservation/reservation'
- },
- // {
- // id: 9,
- // title: '课后作业',
- // url: '../../static/images/icon.png'
- // },
- // {
- // id: 10,
- // title: '留言',
- // url: '../../static/images/icon.png'
- // },
- {
- id: 11,
- title: '通讯录',
- url: '../../static/images/icon.png',
- path: '/pages/addressBook/addressBook'
- }
- ])
- // 二维码信息
- const QRCodeUrl = ref('123')
- // 二维码自定义样式
- const options = {
- typeNumber: 4,
- foregroundImageBorderRadius: 5,
- foregroundImageSrc: '/static/images/school-logo.png'
- }
- // 跳转页面函数
- const goPage = (url) => {
- if (url === '/pagesReservation/reservation/reservation') {
- uni.setStorageSync('Tab-activeIndex', 0)
- }
- uni.navigateTo({
- url
- })
- }
- // 点击二维码时的回调
- const handleClickCode = () => {
- uni.navigateTo({
- url: `/pages/quickMark/quickMark?value=${QRCodeUrl.value}`
- })
- }
- </script>
- <style lang="scss" scoped>
- .container {
- display: flex;
- flex-direction: column;
- padding: 0 20rpx;
- min-height: 100vh;
- background-color: #f1f6fe;
- // 自定义导航栏区域样式
- .tab {
- position: relative;
- display: flex;
- justify-content: center;
- align-items: center;
- font-size: 34rpx;
- .tab_img {
- position: absolute;
- top: v-bind(statusBarH);
- left: 0;
- width: 62rpx;
- height: 62rpx;
- }
- }
- .tab2 {
- z-index: 999;
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- padding: 0 20rpx;
- font-size: 34rpx;
- text-align: center;
- background-color: #fff;
- }
- // 顶部图片区域样式
- .header {
- position: relative;
- margin-top: 35rpx;
- width: 710rpx;
- height: 369rpx;
- color: #fff;
- font-size: 36rpx;
- border-radius: 10rpx;
- background-color: deepskyblue;
- .header_img {
- width: 100%;
- height: 100%;
- }
- .header_icon {
- position: absolute;
- top: 25rpx;
- left: 25rpx;
- width: 47rpx;
- height: 47rpx;
- border-radius: 50%;
- }
- .header_school {
- position: absolute;
- top: 18rpx;
- left: 81rpx;
- font-size: 40rpx;
- }
- .header_name {
- position: absolute;
- top: 243rpx;
- right: 145rpx;
- }
- .header_grade {
- position: absolute;
- top: 292rpx;
- right: 145rpx;
- }
- .header_code {
- position: absolute;
- top: 245rpx;
- right: 28rpx;
- display: flex;
- justify-content: center;
- align-items: center;
- width: 98rpx;
- height: 98rpx;
- border-radius: 10rpx;
- background-color: #fff;
- }
- }
- // 详细信息区域样式
- .body {
- margin-top: 20rpx;
- .body_header {
- position: relative;
- width: 710rpx;
- height: 128rpx;
- .info_bg {
- position: absolute;
- z-index: 1;
- width: 100%;
- height: 100%;
- pointer-events: none;
- }
- .info_img {
- position: absolute;
- top: 20rpx;
- left: 20rpx;
- z-index: 1;
- width: 90rpx;
- height: 90rpx;
- border-radius: 50%;
- }
- .info_name {
- position: absolute;
- top: 15rpx;
- left: 132rpx;
- z-index: 1;
- font-size: 32rpx;
- font-weight: bold;
- }
- .info_detail {
- position: absolute;
- top: 64rpx;
- left: 132rpx;
- z-index: 1;
- width: 136rpx;
- height: 46rpx;
- line-height: 46rpx;
- text-align: center;
- font-size: 24rpx;
- color: #0061ff;
- border-radius: 5rpx;
- background-color: #ebf2ff;
- }
- .info_change {
- position: absolute;
- top: 48rpx;
- left: 393rpx;
- z-index: 1;
- font-size: 24rpx;
- color: #a6a6a6;
- }
- .info_bind {
- position: absolute;
- top: 20rpx;
- right: 0;
- display: flex;
- justify-content: flex-end;
- align-items: center;
- padding-right: 25rpx;
- width: 300rpx;
- height: 102rpx;
- font-size: 28rpx;
- color: #0061ff;
- background-color: #e8f1ff;
- .bind_img {
- margin-right: 5rpx;
- width: 42rpx;
- height: 42rpx;
- }
- }
- }
- .body_list {
- padding: 30rpx 30rpx;
- display: grid;
- grid-template-columns: repeat(3, 1fr);
- grid-auto-rows: 240rpx;
- background-color: #fff;
- gap: 20rpx 10rpx;
- .list_box {
- display: flex;
- flex-direction: column;
- justify-content: space-evenly;
- align-items: center;
- font-size: 28rpx;
- .box_img {
- width: 120rpx;
- height: 120rpx;
- border-radius: 32rpx;
- }
- }
- }
- }
- }
- </style>
|