mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-11-04 20:28:44 +08:00 
			
		
		
		
	使用 uview 重构实际登陆
This commit is contained in:
		@@ -0,0 +1,8 @@
 | 
			
		||||
export default {
 | 
			
		||||
    props: {
 | 
			
		||||
        bgColor: {
 | 
			
		||||
            type: String,
 | 
			
		||||
            default: uni.$u.props.statusBar.bgColor
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,43 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<view
 | 
			
		||||
	    :style="[style]"
 | 
			
		||||
	    class="u-status-bar"
 | 
			
		||||
	>
 | 
			
		||||
		<slot />
 | 
			
		||||
	</view>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
	import props from './props.js';
 | 
			
		||||
	/**
 | 
			
		||||
	 * StatbusBar 状态栏占位
 | 
			
		||||
	 * @description 本组件主要用于状态填充,比如在自定导航栏的时候,它会自动适配一个恰当的状态栏高度。
 | 
			
		||||
	 * @tutorial https://uviewui.com/components/statusBar.html
 | 
			
		||||
	 * @property {String}			bgColor			背景色 (默认 'transparent' )
 | 
			
		||||
	 * @property {String | Object}	customStyle		自定义样式 
 | 
			
		||||
	 * @example <u-status-bar></u-status-bar>
 | 
			
		||||
	 */
 | 
			
		||||
	export default {
 | 
			
		||||
		name: 'u-status-bar',
 | 
			
		||||
		mixins: [uni.$u.mpMixin, uni.$u.mixin, props],
 | 
			
		||||
		data() {
 | 
			
		||||
			return {
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		computed: {
 | 
			
		||||
			style() {
 | 
			
		||||
				const style = {}
 | 
			
		||||
				// 状态栏高度,由于某些安卓和微信开发工具无法识别css的顶部状态栏变量,所以使用js获取的方式
 | 
			
		||||
				style.height = uni.$u.addUnit(uni.$u.sys().statusBarHeight)
 | 
			
		||||
				style.backgroundColor = this.bgColor
 | 
			
		||||
				return uni.$u.deepMerge(style, uni.$u.addStyle(this.customStyle))
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
	.u-status-bar {
 | 
			
		||||
		width: 100%;
 | 
			
		||||
	}
 | 
			
		||||
</style>
 | 
			
		||||
		Reference in New Issue
	
	Block a user