feat:登录注册完成
This commit is contained in:
96
src/pages/device/components/device-header/index.vue
Normal file
96
src/pages/device/components/device-header/index.vue
Normal file
@@ -0,0 +1,96 @@
|
||||
<template>
|
||||
<view class="device-header" :style="{ paddingTop: headerPaddingTop + 'px' }">
|
||||
<view class="device-header__bar">
|
||||
<view class="device-header__home" @tap="$emit('home')">
|
||||
<image
|
||||
class="device-header__home-icon"
|
||||
:src="staticAssets.iconHomeSelector"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
<text class="device-header__home-text">{{ homeName }}</text>
|
||||
<image
|
||||
class="device-header__arrow"
|
||||
:src="staticAssets.iconHomeArrow"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
</view>
|
||||
<view class="device-header__notify-wrap" @tap="$emit('notify')">
|
||||
<image
|
||||
class="device-header__notify-icon"
|
||||
:src="staticAssets.iconNotify"
|
||||
mode="aspectFit"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { staticAssets } from '@/utils/static-assets'
|
||||
|
||||
defineProps<{
|
||||
homeName: string
|
||||
}>()
|
||||
|
||||
defineEmits<{
|
||||
home: []
|
||||
notify: []
|
||||
}>()
|
||||
|
||||
const sys = uni.getSystemInfoSync()
|
||||
const statusBarHeight = sys.statusBarHeight ?? 0
|
||||
/** 状态栏下再留一段间距;H5 无状态栏时用固定上内边距 */
|
||||
const headerPaddingTop =
|
||||
statusBarHeight > 0
|
||||
? statusBarHeight + uni.upx2px(24)
|
||||
: uni.upx2px(48)
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.device-header {
|
||||
padding-left: 32rpx;
|
||||
padding-right: 32rpx;
|
||||
padding-bottom: 16rpx;
|
||||
}
|
||||
|
||||
.device-header__bar {
|
||||
height: 88rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.device-header__home {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12rpx;
|
||||
padding: 12rpx 28rpx 12rpx 20rpx;
|
||||
background: #EFFBF4;
|
||||
border-radius: 40rpx;
|
||||
border: 1px solid #C9EFD9;
|
||||
}
|
||||
|
||||
.device-header__home-icon {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.device-header__home-text {
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
color: #1fa85c;
|
||||
}
|
||||
|
||||
.device-header__arrow {
|
||||
width: 18rpx;
|
||||
height: 18rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.device-header__notify-icon {
|
||||
width: 72rpx;
|
||||
height: 72rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user