feat:设备使用记录
This commit is contained in:
24
uview-plus/components/u-box/box.js
Normal file
24
uview-plus/components/u-box/box.js
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* @Author : ly
|
||||
* @Description :
|
||||
* @version : 4.0
|
||||
* @Date : 2026-02-02 23:54:58
|
||||
* @LastAuthor : ly
|
||||
* @lastTime : 2026-02-02 23:54:58
|
||||
* @FilePath : /uview-ultra/components/up-box/box.js
|
||||
*/
|
||||
export default {
|
||||
// box 组件
|
||||
box: {
|
||||
bgColors: ['#EEFCFF', '#FCF8FF', '#FDF8F2'],
|
||||
height: '160px',
|
||||
borderRadius: '6px',
|
||||
gap: '15px',
|
||||
leftIcon: '',
|
||||
leftTitle: '左',
|
||||
rightTopIcon: '',
|
||||
rightTopTitle: '右上',
|
||||
rightBottomIcon: '',
|
||||
rightBottomTitle: '右下'
|
||||
}
|
||||
}
|
||||
@@ -1,27 +1,57 @@
|
||||
import { defineMixin } from '../../libs/vue'
|
||||
import defProps from '../../libs/config/props.js'
|
||||
import { defineMixin } from '../../libs/vue.js'
|
||||
import defProps from './box.js'
|
||||
|
||||
export const propsBox = defineMixin({
|
||||
props: {
|
||||
// 背景色
|
||||
bgColors: {
|
||||
type: [Array],
|
||||
default: ['#EEFCFF', '#FCF8FF', '#FDF8F2']
|
||||
default: () => defProps.box.bgColors
|
||||
},
|
||||
// 高度
|
||||
height: {
|
||||
type: [String],
|
||||
default: "160px"
|
||||
default: () => defProps.box.height
|
||||
},
|
||||
// 圆角
|
||||
borderRadius: {
|
||||
type: [String],
|
||||
default: "6px"
|
||||
default: () => defProps.box.borderRadius
|
||||
},
|
||||
// 间隔
|
||||
gap: {
|
||||
type: [String],
|
||||
default: "15px"
|
||||
default: () => defProps.box.gap
|
||||
},
|
||||
// 左侧图标
|
||||
leftIcon: {
|
||||
type: [String],
|
||||
default: () => defProps.box.leftIcon
|
||||
},
|
||||
// 左侧文案
|
||||
leftTitle: {
|
||||
type: [String],
|
||||
default: () => defProps.box.leftTitle
|
||||
},
|
||||
// 右上图标
|
||||
rightTopIcon: {
|
||||
type: [String],
|
||||
default: () => defProps.box.rightTopIcon
|
||||
},
|
||||
// 右上文案
|
||||
rightTopTitle: {
|
||||
type: [String],
|
||||
default: () => defProps.box.rightTopTitle
|
||||
},
|
||||
// 右下图标
|
||||
rightBottomIcon: {
|
||||
type: [String],
|
||||
default: () => defProps.box.rightBottomIcon
|
||||
},
|
||||
// 右下文案
|
||||
rightBottomTitle: {
|
||||
type: [String],
|
||||
default: () => defProps.box.rightBottomTitle
|
||||
},
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -1,18 +1,33 @@
|
||||
<template>
|
||||
<view class="u-box" :style="[{height: height}, addStyle(customStyle)]">
|
||||
<view class="u-box__left" :style="{borderRadius: borderRadius, backgroundColor: bgColors[0]}">
|
||||
<slot name="left">左</slot>
|
||||
</view>
|
||||
<view class="u-box__gap" :style="{width: gap, height: height}"></view>
|
||||
<view class="u-box__right">
|
||||
<view class="u-box__right-top" :style="{borderRadius: borderRadius, backgroundColor: bgColors[1]}">
|
||||
<slot name="rightTop">右上</slot>
|
||||
</view>
|
||||
<view class="u-box__right-gap" :style="{height: gap}"></view>
|
||||
<view class="u-box__right-bottom" :style="{borderRadius: borderRadius, backgroundColor: bgColors[2]}">
|
||||
<slot name="rightBottom">右下</slot>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-box__left" :style="{borderRadius: borderRadius, backgroundColor: bgColors[0]}">
|
||||
<slot name="left">
|
||||
<view class="flex flex-row items-center justify-center">
|
||||
<u-icon size="36" :name="leftIcon"></u-icon>
|
||||
<text class="ml-2 text-16px">{{leftTitle}}</text>
|
||||
</view>
|
||||
</slot>
|
||||
</view>
|
||||
<view class="u-box__gap" :style="{width: gap, height: height}"></view>
|
||||
<view class="u-box__right">
|
||||
<view class="u-box__right-top" :style="{borderRadius: borderRadius, backgroundColor: bgColors[1]}">
|
||||
<slot name="rightTop">
|
||||
<view class="flex flex-row items-center justify-center">
|
||||
<u-icon size="36" :name="rightTopIcon"></u-icon>
|
||||
<text class="ml-2 text-15px">{{rightTopTitle}}</text>
|
||||
</view>
|
||||
</slot>
|
||||
</view>
|
||||
<view class="u-box__right-gap" :style="{height: gap}"></view>
|
||||
<view class="u-box__right-bottom" :style="{borderRadius: borderRadius, backgroundColor: bgColors[2]}">
|
||||
<slot name="rightBottom">
|
||||
<view class="flex flex-row items-center justify-center">
|
||||
<u-icon size="36" :name="rightBottomIcon"></u-icon>
|
||||
<text class="ml-2 text-15px">{{rightBottomTitle}}</text>
|
||||
</view>
|
||||
</slot>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -51,7 +66,6 @@
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "../../libs/css/components.scss";
|
||||
|
||||
.u-box {
|
||||
/* #ifndef APP-NVUE */
|
||||
|
||||
Reference in New Issue
Block a user