这一版本优化了很多
This commit is contained in:
99
unpackage/dist/dev/mp-weixin/uni_modules/uview-plus/components/u-loadmore/props.js
vendored
Normal file
99
unpackage/dist/dev/mp-weixin/uni_modules/uview-plus/components/u-loadmore/props.js
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
"use strict";
|
||||
const uni_modules_uviewPlus_libs_vue = require("../../libs/vue.js");
|
||||
const uni_modules_uviewPlus_libs_config_props = require("../../libs/config/props.js");
|
||||
const props = uni_modules_uviewPlus_libs_vue.defineMixin({
|
||||
props: {
|
||||
// 组件状态,loadmore-加载前的状态,loading-加载中的状态,nomore-没有更多的状态
|
||||
status: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.loadmore.status
|
||||
},
|
||||
// 组件背景色
|
||||
bgColor: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.loadmore.bgColor
|
||||
},
|
||||
// 是否显示加载中的图标
|
||||
icon: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.loadmore.icon
|
||||
},
|
||||
// 字体大小
|
||||
fontSize: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.loadmore.fontSize
|
||||
},
|
||||
// 图标大小
|
||||
iconSize: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.loadmore.iconSize
|
||||
},
|
||||
// 字体颜色
|
||||
color: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.loadmore.color
|
||||
},
|
||||
// 加载中状态的图标,spinner-花朵状图标,circle-圆圈状,semicircle-半圆
|
||||
loadingIcon: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.loadmore.loadingIcon
|
||||
},
|
||||
// 加载前的提示语
|
||||
loadmoreText: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.loadmore.loadmoreText
|
||||
},
|
||||
// 加载中提示语
|
||||
loadingText: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.loadmore.loadingText
|
||||
},
|
||||
// 没有更多的提示语
|
||||
nomoreText: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.loadmore.nomoreText
|
||||
},
|
||||
// 在“没有更多”状态下,是否显示粗点
|
||||
isDot: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.loadmore.isDot
|
||||
},
|
||||
// 加载中图标的颜色
|
||||
iconColor: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.loadmore.iconColor
|
||||
},
|
||||
// 上边距
|
||||
marginTop: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.loadmore.marginTop
|
||||
},
|
||||
// 下边距
|
||||
marginBottom: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.loadmore.marginBottom
|
||||
},
|
||||
// 高度,单位px
|
||||
height: {
|
||||
type: [String, Number],
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.loadmore.height
|
||||
},
|
||||
// 是否显示左边分割线
|
||||
line: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.loadmore.line
|
||||
},
|
||||
// 线条颜色
|
||||
lineColor: {
|
||||
type: String,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.loadmore.lineColor
|
||||
},
|
||||
// 是否虚线,true-虚线,false-实线
|
||||
dashed: {
|
||||
type: Boolean,
|
||||
default: () => uni_modules_uviewPlus_libs_config_props.props.loadmore.dashed
|
||||
}
|
||||
}
|
||||
});
|
||||
exports.props = props;
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uview-plus/components/u-loadmore/props.js.map
|
||||
105
unpackage/dist/dev/mp-weixin/uni_modules/uview-plus/components/u-loadmore/u-loadmore.js
vendored
Normal file
105
unpackage/dist/dev/mp-weixin/uni_modules/uview-plus/components/u-loadmore/u-loadmore.js
vendored
Normal file
@@ -0,0 +1,105 @@
|
||||
"use strict";
|
||||
const uni_modules_uviewPlus_components_uLoadmore_props = require("./props.js");
|
||||
const uni_modules_uviewPlus_libs_mixin_mpMixin = require("../../libs/mixin/mpMixin.js");
|
||||
const uni_modules_uviewPlus_libs_mixin_mixin = require("../../libs/mixin/mixin.js");
|
||||
const uni_modules_uviewPlus_libs_function_index = require("../../libs/function/index.js");
|
||||
const common_vendor = require("../../../../common/vendor.js");
|
||||
const _sfc_main = {
|
||||
name: "u-loadmore",
|
||||
mixins: [uni_modules_uviewPlus_libs_mixin_mpMixin.mpMixin, uni_modules_uviewPlus_libs_mixin_mixin.mixin, uni_modules_uviewPlus_components_uLoadmore_props.props],
|
||||
data() {
|
||||
return {
|
||||
// 粗点
|
||||
dotText: "●"
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
// 加载的文字显示的样式
|
||||
loadTextStyle() {
|
||||
return {
|
||||
color: this.color,
|
||||
fontSize: uni_modules_uviewPlus_libs_function_index.addUnit(this.fontSize),
|
||||
lineHeight: uni_modules_uviewPlus_libs_function_index.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;
|
||||
}
|
||||
},
|
||||
emits: ["loadmore"],
|
||||
methods: {
|
||||
addStyle: uni_modules_uviewPlus_libs_function_index.addStyle,
|
||||
addUnit: uni_modules_uviewPlus_libs_function_index.addUnit,
|
||||
loadMore() {
|
||||
if (this.status == "loadmore")
|
||||
this.$emit("loadmore");
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!Array) {
|
||||
const _easycom_u_line2 = common_vendor.resolveComponent("u-line");
|
||||
const _easycom_u_loading_icon2 = common_vendor.resolveComponent("u-loading-icon");
|
||||
(_easycom_u_line2 + _easycom_u_loading_icon2)();
|
||||
}
|
||||
const _easycom_u_line = () => "../u-line/u-line.js";
|
||||
const _easycom_u_loading_icon = () => "../u-loading-icon/u-loading-icon.js";
|
||||
if (!Math) {
|
||||
(_easycom_u_line + _easycom_u_loading_icon)();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
a: _ctx.line
|
||||
}, _ctx.line ? {
|
||||
b: common_vendor.p({
|
||||
length: "140rpx",
|
||||
color: _ctx.lineColor,
|
||||
hairline: false,
|
||||
dashed: _ctx.dashed
|
||||
})
|
||||
} : {}, {
|
||||
c: _ctx.status === "loading" && _ctx.icon
|
||||
}, _ctx.status === "loading" && _ctx.icon ? {
|
||||
d: common_vendor.p({
|
||||
color: _ctx.iconColor,
|
||||
size: _ctx.iconSize,
|
||||
mode: _ctx.loadingIcon
|
||||
})
|
||||
} : {}, {
|
||||
e: common_vendor.t($options.showText),
|
||||
f: common_vendor.s($options.loadTextStyle),
|
||||
g: common_vendor.n(_ctx.status == "nomore" && _ctx.isDot == true ? "u-loadmore__content__dot-text" : "u-loadmore__content__text"),
|
||||
h: common_vendor.o((...args) => $options.loadMore && $options.loadMore(...args)),
|
||||
i: common_vendor.n(_ctx.status == "loadmore" || _ctx.status == "nomore" ? "u-more" : ""),
|
||||
j: _ctx.line
|
||||
}, _ctx.line ? {
|
||||
k: common_vendor.p({
|
||||
length: "140rpx",
|
||||
color: _ctx.lineColor,
|
||||
hairline: false,
|
||||
dashed: _ctx.dashed
|
||||
})
|
||||
} : {}, {
|
||||
l: common_vendor.s($options.addStyle(_ctx.customStyle)),
|
||||
m: common_vendor.s({
|
||||
backgroundColor: _ctx.bgColor,
|
||||
marginBottom: $options.addUnit(_ctx.marginBottom),
|
||||
marginTop: $options.addUnit(_ctx.marginTop),
|
||||
height: $options.addUnit(_ctx.height)
|
||||
}),
|
||||
n: common_vendor.gei(_ctx, "")
|
||||
});
|
||||
}
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-4ccc1478"]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uview-plus/components/u-loadmore/u-loadmore.js.map
|
||||
7
unpackage/dist/dev/mp-weixin/uni_modules/uview-plus/components/u-loadmore/u-loadmore.json
vendored
Normal file
7
unpackage/dist/dev/mp-weixin/uni_modules/uview-plus/components/u-loadmore/u-loadmore.json
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"u-line": "../u-line/u-line",
|
||||
"u-loading-icon": "../u-loading-icon/u-loading-icon"
|
||||
}
|
||||
}
|
||||
1
unpackage/dist/dev/mp-weixin/uni_modules/uview-plus/components/u-loadmore/u-loadmore.wxml
vendored
Normal file
1
unpackage/dist/dev/mp-weixin/uni_modules/uview-plus/components/u-loadmore/u-loadmore.wxml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<view style="{{l + ';' + m + ';' + virtualHostStyle}}" class="{{['u-loadmore', 'data-v-4ccc1478', virtualHostClass]}}" hidden="{{virtualHostHidden || false}}" id="{{n}}"><u-line wx:if="{{a}}" class="data-v-4ccc1478" virtualHostClass="data-v-4ccc1478" u-i="4ccc1478-0" bind:__l="__l" u-p="{{b}}"></u-line><view class="{{[i, 'u-loadmore__content', 'data-v-4ccc1478']}}"><view wx:if="{{c}}" class="u-loadmore__content__icon-wrap data-v-4ccc1478"><u-loading-icon wx:if="{{d}}" class="data-v-4ccc1478" virtualHostClass="data-v-4ccc1478" u-i="4ccc1478-1" bind:__l="__l" u-p="{{d}}"></u-loading-icon></view><text style="{{f}}" class="{{['u-line-1', 'data-v-4ccc1478', g]}}" bindtap="{{h}}">{{e}}</text></view><u-line wx:if="{{j}}" class="data-v-4ccc1478" virtualHostClass="data-v-4ccc1478" u-i="4ccc1478-2" bind:__l="__l" u-p="{{k}}"></u-line></view>
|
||||
51
unpackage/dist/dev/mp-weixin/uni_modules/uview-plus/components/u-loadmore/u-loadmore.wxss
vendored
Normal file
51
unpackage/dist/dev/mp-weixin/uni_modules/uview-plus/components/u-loadmore/u-loadmore.wxss
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* uni.scss */
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
/* 透明度 */
|
||||
/* 文章场景相关 */
|
||||
.u-loadmore.data-v-4ccc1478 {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex: 1;
|
||||
}
|
||||
.u-loadmore__content.data-v-4ccc1478 {
|
||||
margin: 0 15px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.u-loadmore__content__icon-wrap.data-v-4ccc1478 {
|
||||
margin-right: 8px;
|
||||
}
|
||||
.u-loadmore__content__text.data-v-4ccc1478 {
|
||||
font-size: 14px;
|
||||
color: #606266;
|
||||
}
|
||||
.u-loadmore__content__dot-text.data-v-4ccc1478 {
|
||||
font-size: 15px;
|
||||
color: #909193;
|
||||
}
|
||||
Reference in New Issue
Block a user