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,73 @@
"use strict";
const common_vendor = require("../../../../../../common/vendor.js");
if (!Math) {
TnIcon();
}
const TnIcon = () => "../../icon/src/icon.js";
const __default__ = {
options: {
// 在微信小程序中将组件节点渲染为虚拟节点,更加接近Vue组件的表现(不会出现shadow节点下再去创建元素)
virtualHost: true
}
};
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
...__default__,
__name: "lazy-load",
props: common_vendor.lazyLoadProps,
emits: common_vendor.lazyLoadEmits,
setup(__props) {
const props = __props;
const {
componentId,
imageStatus,
showImage,
handleImageLoadedSuccess,
handleImageLoadedFailed
} = common_vendor.useLazyLoad(props);
const { ns, lazyLoadStyle } = common_vendor.useLazyLoadCustomStyle(props);
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.unref(imageStatus) === "loading"
}, common_vendor.unref(imageStatus) === "loading" ? {
b: common_vendor.p({
name: "loading"
}),
c: common_vendor.n(common_vendor.unref(ns).e("loading__icon")),
d: common_vendor.n(common_vendor.unref(ns).e("loading")),
e: common_vendor.n(common_vendor.unref(ns).e("container"))
} : {}, {
f: common_vendor.unref(showImage) && common_vendor.unref(imageStatus) !== "error"
}, common_vendor.unref(showImage) && common_vendor.unref(imageStatus) !== "error" ? {
g: common_vendor.n(common_vendor.unref(ns).e("image")),
h: common_vendor.n(common_vendor.unref(ns).is("animation", common_vendor.unref(imageStatus) === "loaded" && _ctx.transition)),
i: common_vendor.n(common_vendor.unref(ns).is("no-animation", common_vendor.unref(imageStatus) === "loaded" && !_ctx.transition)),
j: _ctx.src,
k: _ctx.mode,
l: common_vendor.o(
//@ts-ignore
(...args) => common_vendor.unref(handleImageLoadedSuccess) && common_vendor.unref(handleImageLoadedSuccess)(...args)
),
m: common_vendor.o(
//@ts-ignore
(...args) => common_vendor.unref(handleImageLoadedFailed) && common_vendor.unref(handleImageLoadedFailed)(...args)
),
n: common_vendor.n(common_vendor.unref(ns).e("container"))
} : {}, {
o: common_vendor.unref(imageStatus) === "error"
}, common_vendor.unref(imageStatus) === "error" ? {
p: common_vendor.p({
name: "image-fill"
}),
q: common_vendor.n(common_vendor.unref(ns).e("error")),
r: common_vendor.n(common_vendor.unref(ns).e("container"))
} : {}, {
s: common_vendor.unref(componentId),
t: common_vendor.n(common_vendor.unref(ns).b()),
v: common_vendor.n(common_vendor.unref(ns).is("show-image", common_vendor.unref(showImage) && common_vendor.unref(imageStatus) === "loaded")),
w: common_vendor.s(common_vendor.unref(lazyLoadStyle))
});
};
}
});
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-b259162f"]]);
wx.createComponent(Component);
@@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"tn-icon": "../../icon/src/icon"
}
}
@@ -0,0 +1 @@
<view id="{{s}}" class="{{['data-v-b259162f', t, v, virtualHostClass]}}" style="{{w + ';' + virtualHostStyle}}"><view wx:if="{{a}}" class="{{['data-v-b259162f', e]}}"><block wx:if="{{$slots.loading}}"><slot name="loading"></slot></block><block wx:else><view class="{{['data-v-b259162f', d]}}"><view class="{{['data-v-b259162f', c]}}"><tn-icon wx:if="{{b}}" class="data-v-b259162f" virtualHostClass="data-v-b259162f" u-i="b259162f-0" bind:__l="__l" u-p="{{b}}"/></view></view></block></view><view wx:if="{{f}}" class="{{['data-v-b259162f', n]}}"><image class="{{['data-v-b259162f', g, h, i]}}" src="{{j}}" mode="{{k}}" bindload="{{l}}" binderror="{{m}}"/></view><view wx:if="{{o}}" class="{{['data-v-b259162f', r]}}"><block wx:if="{{$slots.error}}"><slot name="error"></slot></block><block wx:else><view class="{{['data-v-b259162f', q]}}"><tn-icon wx:if="{{p}}" class="data-v-b259162f" virtualHostClass="data-v-b259162f" u-i="b259162f-1" bind:__l="__l" u-p="{{p}}"/></view></block></view></view>
@@ -0,0 +1,105 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
.tn-lazy-load.data-v-b259162f {
position: relative;
width: 100%;
height: 100%;
border-radius: inherit;
min-height: 1rpx;
background-color: var(--tn-color-gray-light);
color: var(--tn-color-gray);
/* 正常显示图片 start */
/* 正常显示图片 end */
/* 内容容器 start */
/* 内容容器 end */
/* 正在加载 start */
/* 正在加载 end */
/* 图片加载失败 start */
/* 图片加载失败 end */
/* 图片 start */
/* 图片 end */
}
.tn-lazy-load.is-show-image.data-v-b259162f {
background-color: transparent;
color: transparent;
}
.tn-lazy-load__container.data-v-b259162f {
width: 100%;
height: 100%;
border-radius: inherit;
}
.tn-lazy-load__loading.data-v-b259162f {
width: 100%;
height: 100%;
border-radius: inherit;
display: flex;
align-items: center;
justify-content: center;
}
.tn-lazy-load__loading__icon.data-v-b259162f {
font-size: 90rpx;
animation: loading-icon-animation-b259162f 3s linear infinite;
}
.tn-lazy-load__error.data-v-b259162f {
width: 100%;
height: 100%;
border-radius: inherit;
display: flex;
align-items: center;
justify-content: center;
font-size: 100rpx;
}
.tn-lazy-load__image.data-v-b259162f {
display: block;
width: 100%;
height: 100%;
border-radius: inherit;
opacity: 0;
/* 没有动画效果 */
/* 有加载动画 */
}
.tn-lazy-load__image.is-no-animation.data-v-b259162f {
opacity: 1;
}
.tn-lazy-load__image.is-animation.data-v-b259162f {
animation: show-image-animation-b259162f 0.25s ease both;
}
@keyframes loading-icon-animation-b259162f {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
@keyframes show-image-animation-b259162f {
from {
opacity: 0;
}
to {
opacity: 1;
}
}