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,141 @@
"use strict";
const common_vendor = require("../../../../common/vendor.js");
const useGraphicCardCustomStyle = (props) => {
const ns = common_vendor.useNamespace("graphic-card");
const [tagBgColorClass, tagBgColorStyle] = common_vendor.useComponentColor(
common_vendor.toRef(props, "tagBgColor"),
"bg"
);
const [tagTextColorClass, tagTextColorStyle] = common_vendor.useComponentColor(
common_vendor.toRef(props, "tagTextColor"),
"text"
);
const [hotColorClass, hotColorStyle] = common_vendor.useComponentColor(
common_vendor.toRef(props, "hotColor"),
"text"
);
const [activeHotColorClass, activeHotColorStyle] = common_vendor.useComponentColor(
common_vendor.toRef(props, "activeHotColor"),
"text"
);
const [commentColorClass, commentColorStyle] = common_vendor.useComponentColor(
common_vendor.toRef(props, "commentColor"),
"text"
);
const [activeCommentColorClass, activeCommentColorStyle] = common_vendor.useComponentColor(
common_vendor.toRef(props, "activeCommentColor"),
"text"
);
const [likeColorClass, likeColorStyle] = common_vendor.useComponentColor(
common_vendor.toRef(props, "likeColor"),
"text"
);
const [activeLikeColorClass, activeLikeColorStyle] = common_vendor.useComponentColor(
common_vendor.toRef(props, "activeLikeColor"),
"text"
);
const tagClass = common_vendor.computed(() => {
const cls = [];
if (tagBgColorClass.value)
cls.push(tagBgColorClass.value);
if (tagTextColorClass.value)
cls.push(tagTextColorClass.value);
return cls.join(" ");
});
const tagStyle = common_vendor.computed(() => {
const style = {};
if (!tagBgColorClass.value) {
style.backgroundColor = tagBgColorStyle.value || "var(--tn-color-gray-disabled)";
}
if (tagTextColorStyle.value) {
style.color = tagTextColorStyle.value;
} else if (!tagTextColorClass.value && !tagBgColorClass.value) {
style.color = "var(--tn-text-color-primary)";
}
return style;
});
const hotClass = common_vendor.computed(() => {
const cls = [ns.e("hot")];
if (props.activeHot) {
if (activeHotColorClass.value)
cls.push(activeHotColorClass.value);
} else {
if (hotColorClass.value)
cls.push(hotColorClass.value);
}
return cls.join(" ");
});
const hotStyle = common_vendor.computed(() => {
const style = {};
if (props.activeHot) {
if (!activeHotColorClass.value) {
style.color = activeHotColorStyle.value || "var(--tn-color-primary)";
}
} else {
if (!hotColorClass.value) {
style.color = hotColorStyle.value || "var(--tn-color-gray)";
}
}
return style;
});
const commentClass = common_vendor.computed(() => {
const cls = [ns.e("comment")];
if (props.activeComment) {
if (activeCommentColorClass.value)
cls.push(activeCommentColorClass.value);
} else {
if (commentColorClass.value)
cls.push(commentColorClass.value);
}
return cls.join(" ");
});
const commentStyle = common_vendor.computed(() => {
const style = {};
if (props.activeComment) {
if (!activeCommentColorClass.value) {
style.color = activeCommentColorStyle.value || "var(--tn-color-primary)";
}
} else {
if (!commentColorClass.value) {
style.color = commentColorStyle.value || "var(--tn-color-gray)";
}
}
return style;
});
const likeClass = common_vendor.computed(() => {
const cls = [ns.e("like")];
if (props.activeLike) {
if (activeLikeColorClass.value)
cls.push(activeLikeColorClass.value);
} else {
if (likeColorClass.value)
cls.push(likeColorClass.value);
}
return cls.join(" ");
});
const likeStyle = common_vendor.computed(() => {
const style = {};
if (props.activeLike) {
if (!activeLikeColorClass.value) {
style.color = activeLikeColorStyle.value || "var(--tn-color-red)";
}
} else {
if (!likeColorClass.value) {
style.color = likeColorStyle.value || "var(--tn-color-gray)";
}
}
return style;
});
return {
ns,
tagClass,
tagStyle,
hotClass,
hotStyle,
commentClass,
commentStyle,
likeClass,
likeStyle
};
};
exports.useGraphicCardCustomStyle = useGraphicCardCustomStyle;
@@ -0,0 +1,2 @@
"use strict";
require("../../../../common/vendor.js");
@@ -0,0 +1,56 @@
"use strict";
const common_vendor = require("../../../../common/vendor.js");
const useGraphicCard = (props, emits) => {
const viewUserAvatars = common_vendor.ref([]);
const viewUserCount = common_vendor.ref(0);
if (props.showViewUser) {
viewUserAvatars.value = props.viewUserAvatars.slice(
0,
props.maxViewUserAvatarCount
);
viewUserCount.value = props.viewUserAvatars.length;
}
const imageCount = common_vendor.computed(
() => {
var _a;
return common_vendor.isEmptyVariableInDefault((_a = props == null ? void 0 : props.images) == null ? void 0 : _a.length, 0);
}
);
const previewImageHandle = (index) => {
common_vendor.index.previewImage({
urls: props.images,
current: index
});
};
const cardClickEvent = () => {
emits("click");
};
const handleAvatarClick = () => {
emits("avatar-view-click");
};
const handleMoreClick = () => {
emits("more-click");
};
const handleHotClick = () => {
emits("hot-click");
};
const handleCommentClick = () => {
emits("comment-click");
};
const handleLikeClick = () => {
emits("like-click");
};
return {
viewUserAvatars,
viewUserCount,
imageCount,
previewImageHandle,
cardClickEvent,
handleAvatarClick,
handleMoreClick,
handleHotClick,
handleCommentClick,
handleLikeClick
};
};
exports.useGraphicCard = useGraphicCard;