2025/2/8第一次更新

This commit is contained in:
爱吃咸鱼小猫咪
2025-02-08 18:50:38 +08:00
commit d7af560866
26519 changed files with 5046029 additions and 0 deletions
@@ -0,0 +1,111 @@
"use strict";
const common_vendor = require("../../../common/vendor.js");
const _sfc_main = {
name: "fui-progress",
emits: ["activeend"],
props: {
percent: {
type: [Number, String],
default: 0
},
height: {
type: [Number, String],
default: 8
},
radius: {
type: [Number, String],
default: 8
},
showInfo: {
type: Boolean,
default: false
},
//右侧百分比字体大小 rpx
size: {
type: [Number, String],
default: 28
},
//右侧百分比颜色
color: {
type: String,
default: "#333"
},
//右侧百分比宽度
percentWidth: {
type: [Number, String],
default: 96
},
//未选择的进度条的颜色
background: {
type: String,
default: "#CCCCCC"
},
//已选进度条颜色,可渐变
activeColor: {
type: String,
default: ""
},
//进度增加1%所需毫秒数
duration: {
type: [Number, String],
default: 15
}
},
watch: {
percent(val) {
this.darwProgress();
}
},
mounted() {
this.$nextTick(() => {
this.darwProgress();
});
},
computed: {
getActiveColor() {
let color = this.activeColor;
return color;
}
},
data() {
return {
percentage: 0,
translateX: "-100%",
time: 0
};
},
methods: {
darwProgress() {
let percent = Number(this.percent);
percent = percent > 100 ? 100 : percent;
this.time = Number(this.duration) * Math.abs(percent - this.percentage) / 1e3;
if (percent < this.percentage && this.percentage - percent > 30) {
this.time = this.time / 2;
}
this.percentage = percent;
this.translateX = 100 - percent + "%";
setTimeout(() => {
this.$emit("activeend", {});
}, this.time);
}
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: !$props.activeColor ? 1 : "",
b: $options.getActiveColor,
c: `translate3d(-${$data.translateX},0,0)`,
d: `${$data.time}s`,
e: $props.height + "rpx",
f: $props.radius + "rpx",
g: $props.background,
h: $props.showInfo
}, $props.showInfo ? {
i: common_vendor.t($data.percentage),
j: $props.percentWidth + "rpx",
k: $props.size + "rpx",
l: $props.color
} : {});
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-c4450786"]]);
wx.createComponent(Component);
@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}
@@ -0,0 +1 @@
<view class="{{['fui-progress__wrap', 'data-v-c4450786', virtualHostClass]}}" style="{{virtualHostStyle}}"><view class="fui-progress__bar-bg data-v-c4450786" style="{{'height:' + e + ';' + ('border-radius:' + f) + ';' + ('background:' + g)}}"><view class="{{['fui-progress__bar', 'data-v-c4450786', a && 'fui-progress__active-color']}}" style="{{'background:' + b + ';' + ('transform:' + c) + ';' + ('transition-duration:' + d)}}"></view></view><text wx:if="{{h}}" class="fui-progress__percent data-v-c4450786" style="{{'width:' + j + ';' + ('font-size:' + k) + ';' + ('color:' + l)}}">{{i}}% </text></view>
@@ -0,0 +1,53 @@
.fui-progress__wrap.data-v-c4450786 {
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
}
/* nvue android 端 overflow: hidden 无效,目前uni-app官方尚未修复此问题*/
.fui-progress__bar-bg.data-v-c4450786 {
width: 100%;
transform: translateZ(0);
flex: 1;
position: relative;
overflow: hidden;
}
.fui-progress__bar.data-v-c4450786 {
width: 100%;
z-index: 2;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
transform: translate3d(-100%, 0, 0);
transition-delay: 0s;
transition-property: transform;
transition-timing-function: linear;
transition-duration: 0s;
}
.fui-progress__percent.data-v-c4450786 {
text-align: center;
display: block;
flex-shrink: 0;
}
.fui-progress__active-color.data-v-c4450786 {
background: var(--fui-color-primary, #465CFF) !important;
}