This commit is contained in:
李志鹏
2026-04-24 09:38:24 +08:00
parent 71cfef996d
commit 42c2817c2f
5 changed files with 13 additions and 10 deletions

View File

@@ -203,8 +203,8 @@ export function CountDown(time: number) {
* @returns {string} 格式化后的字符串 * @returns {string} 格式化后的字符串
*/ */
export function FormatBytes(bytes, options: { decimals?: number, unitBig?: boolean } = {}) { export function FormatBytes(bytes, options: { decimals?: number, unitBig?: boolean } = {}) {
if (!bytes || isNaN(bytes)) return '0 B';
const { decimals = 2, unitBig = false } = options; const { decimals = 2, unitBig = false } = options;
if (!bytes || isNaN(bytes)) return unitBig ? '0 B' : '0 b';
const k = 1024; const k = 1024;
const sizes = unitBig ? ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'] : ['b', 'kb', 'mb', 'gb', 'tb', 'pb', 'eb', 'zb', 'yb']; const sizes = unitBig ? ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'] : ['b', 'kb', 'mb', 'gb', 'tb', 'pb', 'eb', 'zb', 'yb'];
const i = Math.floor(Math.log(bytes) / Math.log(k)); const i = Math.floor(Math.log(bytes) / Math.log(k));

View File

@@ -33,6 +33,7 @@
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
> .sc-list { > .sc-list {
flex: 1;
margin-right: 7.5rem; margin-right: 7.5rem;
margin-bottom: 8rem; margin-bottom: 8rem;
--sc-list-header-top: var(--content-top); --sc-list-header-top: var(--content-top);

View File

@@ -7,7 +7,7 @@
</div> </div>
<div class="hr"></div> <div class="hr"></div>
<div class="brands-header"> <div class="brands-header">
<span class="icon"><svg-icon name="order-shop" size="18" /></span> <span class="icon"><svg-icon name="order-shop" size="24" /></span>
<span class="text">Brands</span> <span class="text">Brands</span>
</div> </div>
<div class="brands-item" v-for="v in brandsList" :key="v.brand"> <div class="brands-item" v-for="v in brandsList" :key="v.brand">

View File

@@ -64,7 +64,7 @@
> .content { > .content {
flex: 1; flex: 1;
margin: var(--sc-item-content-margin, 0 4rem); margin: var(--sc-item-content-margin, 0 4rem);
align-self: var(--sc-item-content-align-self, auto); align-self: var(--sc-item-content-align-self);
> * { > * {
margin-bottom: var(--sc-item-margin-bottom, 1.6rem); margin-bottom: var(--sc-item-margin-bottom, 1.6rem);
&:last-child { &:last-child {
@@ -125,12 +125,12 @@
} }
> .right { > .right {
align-self: var(--sc-item-right-align-self, end); align-self: var(--sc-item-right-align-self, end);
display: var(--sc-item-right-display, ''); display: var(--sc-item-right-display);
flex-direction: var(--sc-item-right-flex-direction, ''); flex-direction: var(--sc-item-right-flex-direction);
justify-content: var(--sc-item-right-justify-content, ''); justify-content: var(--sc-item-right-justify-content);
align-items: var(--sc-item-right-align-items, ''); align-items: var(--sc-item-right-align-items);
height: var(--sc-item-right-height, auto); height: var(--sc-item-right-height);
margin-top: var(--sc-item-right-margin-top, 0); margin-top: var(--sc-item-right-margin-top);
> .amount { > .amount {
font-family: KaiseiOpti-Bold; font-family: KaiseiOpti-Bold;
font-size: var(--sc-item-amount-font-size, 2.2rem); font-size: var(--sc-item-amount-font-size, 2.2rem);

View File

@@ -92,7 +92,9 @@
}) })
const allAmount = computed(() => list.value.reduce((pre, cur) => pre + cur.amount, 0).toFixed(2)) const allAmount = computed(() => list.value.reduce((pre, cur) => pre + cur.amount, 0).toFixed(2))
const selectedCount = computed(() => list.value.filter((v) => v.checked).length) const selectedCount = computed(() => list.value.filter((v) => v.checked).length)
const allSelected = computed(() => list.value.every((v) => v.checked)) const allSelected = computed(() =>
list.value.length === 0 ? false : list.value.every((v) => v.checked)
)
const sortBy = ref('') const sortBy = ref('')
const sortByOptions = ref([ const sortByOptions = ref([
{ {