This commit is contained in:
hupeng
2023-10-11 11:27:47 +08:00
commit d0b337c596
659 changed files with 67106 additions and 0 deletions

View File

@ -0,0 +1,7 @@
## 1.0.22023-06-21
1. 优化customStyle属性
## 1.0.12023-05-16
1. 优化组件依赖,修改后无需全局引入,组件导入即可使用
2. 优化部分功能
## 1.0.02023-05-10
uv-load-more 加载更多

View File

@ -0,0 +1,95 @@
export default {
props: {
// 组件状态loadmore-加载前的状态loading-加载中的状态nomore-没有更多的状态
status: {
type: String,
default: 'loadmore'
},
// 组件背景色
bgColor: {
type: String,
default: 'transparent'
},
// 是否显示加载中的图标
icon: {
type: Boolean,
default: true
},
// 字体大小
fontSize: {
type: [String, Number],
default: 14
},
// 图标大小
iconSize: {
type: [String, Number],
default: 16
},
// 字体颜色
color: {
type: String,
default: '#606266'
},
// 加载中状态的图标spinner-花朵状图标circle-圆圈状semicircle-半圆
loadingIcon: {
type: String,
default: 'spinner'
},
// 加载前的提示语
loadmoreText: {
type: String,
default: '加载更多'
},
// 加载中提示语
loadingText: {
type: String,
default: '正在加载...'
},
// 没有更多的提示语
nomoreText: {
type: String,
default: '没有更多了'
},
// 在“没有更多”状态下,是否显示粗点
isDot: {
type: Boolean,
default: false
},
// 加载中图标的颜色
iconColor: {
type: String,
default: '#b7b7b7'
},
// 上边距
marginTop: {
type: [String, Number],
default: 10
},
// 下边距
marginBottom: {
type: [String, Number],
default: 10
},
// 高度单位px
height: {
type: [String, Number],
default: 'auto'
},
// 是否显示左边分割线
line: {
type: Boolean,
default: false
},
// 线条颜色
lineColor: {
type: String,
default: '#E6E8EB'
},
// 是否虚线true-虚线false-实线
dashed: {
type: Boolean,
default: false
},
...uni.$uv?.props?.loadmore
}
}

View File

@ -0,0 +1,152 @@
<template>
<view
class="uv-loadmore"
:style="[{
backgroundColor: bgColor,
marginBottom: $uv.addUnit(marginBottom),
marginTop: $uv.addUnit(marginTop),
height: $uv.addUnit(height),
},
$uv.addStyle(customStyle)]"
>
<uv-line
length="140rpx"
:color="lineColor"
:hairline="false"
:dashed="dashed"
v-if="line"
></uv-line>
<!-- 加载中和没有更多的状态才显示两边的横线 -->
<view
:class="status == 'loadmore' || status == 'nomore' ? 'uv-more' : ''"
class="uv-loadmore__content"
>
<view
class="uv-loadmore__content__icon-wrap"
v-if="status === 'loading' && icon"
>
<uv-loading-icon
:color="iconColor"
:size="iconSize"
:mode="loadingIcon"
></uv-loading-icon>
</view>
<!-- 如果没有更多的状态下显示内容为dot粗点加载特定样式 -->
<text
class="uv-line-1"
:style="[loadTextStyle]"
:class="[(status == 'nomore' && isDot == true) ? 'uv-loadmore__content__dot-text' : 'uv-loadmore__content__text']"
@tap="loadMore"
>{{ showText }}</text>
</view>
<uv-line
length="140rpx"
:color="lineColor"
:hairline="false"
:dashed="dashed"
v-if="line"
></uv-line>
</view>
</template>
<script>
import mpMixin from '@/uni_modules/uv-ui-tools/libs/mixin/mpMixin.js'
import mixin from '@/uni_modules/uv-ui-tools/libs/mixin/mixin.js'
import props from './props.js';
/**
* loadmore 加载更多
* @description 此组件一般用于标识页面底部加载数据时的状态。
* @tutorial https://www.uvui.cn/components/loadMore.html
* @property {String} status 组件状态(默认 'loadmore'
* @property {String} bgColor 组件背景颜色,在页面是非白色时会用到(默认 'transparent'
* @property {Boolean} icon 加载中时是否显示图标(默认 true
* @property {String | Number} fontSize 字体大小(默认 14
* @property {String | Number} iconSize 图标大小(默认 17
* @property {String} color 字体颜色(默认 '#606266'
* @property {String} loadingIcon 加载图标(默认 'circle'
* @property {String} loadmoreText 加载前的提示语(默认 '加载更多'
* @property {String} loadingText 加载中提示语(默认 '正在加载...'
* @property {String} nomoreText 没有更多的提示语(默认 '没有更多了'
* @property {Boolean} isDot 到上一个相邻元素的距离 (默认 false
* @property {String} iconColor 加载中图标的颜色 (默认 '#b7b7b7'
* @property {String} lineColor 线条颜色(默认 #E6E8EB
* @property {String | Number} marginTop 上边距 (默认 10
* @property {String | Number} marginBottom 下边距 (默认 10
* @property {String | Number} height 高度单位px (默认 'auto'
* @property {Boolean} line 是否显示左边分割线 (默认 false
* @property {Boolean} dashed // 是否虚线true-虚线false-实线 (默认 false
* @event {Function} loadmore status为loadmore时点击组件会发出此事件
* @example <uv-loadmore :status="status" icon-type="iconType" load-text="loadText" />
*/
export default {
name: "uv-loadmore",
mixins: [mpMixin, mixin,props],
data() {
return {
// 粗点
dotText: "●"
}
},
computed: {
// 加载的文字显示的样式
loadTextStyle() {
return {
color: this.color,
fontSize: this.$uv.addUnit(this.fontSize),
lineHeight: this.$uv.addUnit(this.fontSize),
backgroundColor: this.bgColor,
}
},
// 显示的提示文字
showText() {
let text = '';
if (this.status == 'loadmore') text = this.loadmoreText
else if (this.status == 'loading') text = this.loadingText
else if (this.status == 'nomore' && this.isDot) text = this.dotText;
else text = this.nomoreText;
return text;
}
},
methods: {
loadMore() {
// 只有在“加载更多”的状态下才发送点击事件,内容不满一屏时无法触发底部上拉事件,所以需要点击来触发
if (this.status == 'loadmore') this.$emit('loadmore');
}
}
}
</script>
<style lang="scss" scoped>
$show-lines: 1;
@import '@/uni_modules/uv-ui-tools/libs/css/variable.scss';
@import '@/uni_modules/uv-ui-tools/libs/css/components.scss';
@import '@/uni_modules/uv-ui-tools/libs/css/color.scss';
.uv-loadmore {
@include flex(row);
align-items: center;
justify-content: center;
flex: 1;
&__content {
margin: 0 15px;
@include flex(row);
align-items: center;
justify-content: center;
&__icon-wrap {
margin-right: 8px;
}
&__text {
font-size: 14px;
color: $uv-content-color;
}
&__dot-text {
font-size: 15px;
color: $uv-tips-color;
}
}
}
</style>

View File

@ -0,0 +1,89 @@
{
"id": "uv-load-more",
"displayName": "uv-load-more 加载更多 全面兼容小程序、nvue、vue2、vue3等多端",
"version": "1.0.2",
"description": "uv-load-more 此组件一般用于标识页面底部加载数据时的状态,共有三种状态:加载前、加载中、加载后。",
"keywords": [
"uv-load-more",
"uvui",
"uv-ui",
"more",
"加载更多"
],
"repository": "",
"engines": {
"HBuilderX": "^3.1.0"
},
"dcloudext": {
"type": "component-vue",
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "插件不采集任何数据",
"permissions": "无"
},
"npmurl": ""
},
"uni_modules": {
"dependencies": [
"uv-ui-tools",
"uv-line",
"uv-loading-icon"
],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"Vue": {
"vue2": "y",
"vue3": "y"
},
"App": {
"app-vue": "y",
"app-nvue": "y"
},
"H5-mobile": {
"Safari": "y",
"Android Browser": "y",
"微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y"
},
"H5-pc": {
"Chrome": "y",
"IE": "y",
"Edge": "y",
"Firefox": "y",
"Safari": "y"
},
"小程序": {
"微信": "y",
"阿里": "y",
"百度": "y",
"字节跳动": "y",
"QQ": "y",
"钉钉": "u",
"快手": "u",
"飞书": "u",
"京东": "u"
},
"快应用": {
"华为": "u",
"联盟": "u"
}
}
}
}
}

View File

@ -0,0 +1,11 @@
## LoadMore 加载更多
> **组件名uv-load-more**
此组件一般用于标识页面底部加载数据时的状态,共有三种状态:加载前、加载中、加载后。
### <a href="https://www.uvui.cn/components/loadMore.html" target="_blank">查看文档</a>
### [完整示例项目下载 | 关注更多组件](https://ext.dcloud.net.cn/plugin?name=uv-ui)
#### 如使用过程中有任何问题或者您对uv-ui有一些好的建议欢迎加入 uv-ui 交流群:<a href="https://ext.dcloud.net.cn/plugin?id=12287" target="_blank">uv-ui</a>、<a href="https://www.uvui.cn/components/addQQGroup.html" target="_blank">官方QQ群</a>