空状态需要处理,需要添加分享页面

This commit is contained in:
cbb
2025-12-26 17:42:07 +08:00
parent bb02cb22c0
commit dfc5888fa9
64 changed files with 11036 additions and 109 deletions

View File

@@ -0,0 +1,21 @@
<script setup>
const props = defineProps({
name: {
type: String,
default: '空状态'
}
})
</script>
<template>
<view class="cb-empty">
<image
src="/static/images/public/empty-icon.png"
mode="scaleToFill"
class="left-img"
></image>
<text class="bottom-name">{{ props.name }}</text>
</view>
</template>
<style lang="scss" scoped></style>

View File

@@ -0,0 +1,18 @@
<script setup>
const props = defineProps({
/** 距离顶部高度 */
top: {
type: Number,
default: 32
}
})
</script>
<template>
<uni-load-more
:style="{ 'margin-top': `${props.top}rpx` }"
status="loading"
></uni-load-more>
</template>
<style lang="scss" scoped></style>

View File

@@ -0,0 +1,50 @@
<template>
<view v-if="loading" class="cb-skeleton">
<slot name="skeleton">
<view v-for="i in rows" :key="i" class="skeleton-line"></view>
</slot>
</view>
<slot v-else />
</template>
<script setup>
defineProps({
loading: {
type: Boolean,
default: true
},
rows: {
type: Number,
default: 3
}
})
</script>
<style scoped>
.cb-skeleton {
padding: 16rpx;
}
.skeleton-line {
height: 32rpx;
background: linear-gradient(
90deg,
#f0f0f0 25%,
#e0e0e0 50%,
#f0f0f0 75%
);
background-size: 200% 100%;
border-radius: 8rpx;
margin-bottom: 16rpx;
animation: loading 1.5s infinite;
}
@keyframes loading {
0% {
background-position: 200% 0;
}
100% {
background-position: -200% 0;
}
}
</style>

View File

@@ -9,14 +9,22 @@
/** 是否带背景 */
isTopBg: { type: Boolean, default: false },
/** 是否有占位符 */
isPlaceholder: { type: Boolean, default: false }
isPlaceholder: { type: Boolean, default: false },
/** 是否自定义返回事件 */
isCustomBack: { type: Boolean, default: false }
})
const emits = defineEmits(['onBack'])
// 判断是否传入了名为 "back" 的插槽
const hasBackSlot = !!slots.back
const onBack = () => {
navigateBack()
if (props.isCustomBack) {
emits('onBack')
} else {
navigateBack()
}
}
</script>