diff --git a/src/utils/tools.ts b/src/utils/tools.ts index e55814a..dab25f2 100644 --- a/src/utils/tools.ts +++ b/src/utils/tools.ts @@ -203,8 +203,8 @@ export function CountDown(time: number) { * @returns {string} 格式化后的字符串 */ export function FormatBytes(bytes, options: { decimals?: number, unitBig?: boolean } = {}) { - if (!bytes || isNaN(bytes)) return '0 B'; const { decimals = 2, unitBig = false } = options; + if (!bytes || isNaN(bytes)) return unitBig ? '0 B' : '0 b'; 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 i = Math.floor(Math.log(bytes) / Math.log(k)); diff --git a/src/views/shoppingCart/index.vue b/src/views/shoppingCart/index.vue index 25ce45f..6906c72 100644 --- a/src/views/shoppingCart/index.vue +++ b/src/views/shoppingCart/index.vue @@ -33,6 +33,7 @@ display: flex; align-items: flex-start; > .sc-list { + flex: 1; margin-right: 7.5rem; margin-bottom: 8rem; --sc-list-header-top: var(--content-top); diff --git a/src/views/shoppingCart/order-summary.vue b/src/views/shoppingCart/order-summary.vue index e3ba7b3..b1e4b32 100644 --- a/src/views/shoppingCart/order-summary.vue +++ b/src/views/shoppingCart/order-summary.vue @@ -7,7 +7,7 @@
- + Brands
diff --git a/src/views/shoppingCart/sc-item.vue b/src/views/shoppingCart/sc-item.vue index 9b60251..f661dd6 100644 --- a/src/views/shoppingCart/sc-item.vue +++ b/src/views/shoppingCart/sc-item.vue @@ -25,7 +25,7 @@
${{ info.amount }} HKD
- +
Remove @@ -66,7 +66,7 @@ const onRemove = () => { > .content { flex: 1; 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); &:last-child { @@ -127,12 +127,12 @@ const onRemove = () => { } > .right { align-self: var(--sc-item-right-align-self, end); - display: var(--sc-item-right-display, ''); - flex-direction: var(--sc-item-right-flex-direction, ''); - justify-content: var(--sc-item-right-justify-content, ''); - align-items: var(--sc-item-right-align-items, ''); - height: var(--sc-item-right-height, auto); - margin-top: var(--sc-item-right-margin-top, 0); + display: var(--sc-item-right-display); + flex-direction: var(--sc-item-right-flex-direction); + justify-content: var(--sc-item-right-justify-content); + align-items: var(--sc-item-right-align-items); + height: var(--sc-item-right-height); + margin-top: var(--sc-item-right-margin-top); > .amount { font-family: KaiseiOpti-Bold; font-size: var(--sc-item-amount-font-size, 2.2rem); @@ -162,7 +162,6 @@ const onRemove = () => { } } } - &.is-order-actions-layout { display: grid; grid-template-columns: @@ -185,7 +184,12 @@ const onRemove = () => { white-space: nowrap; } + .c-svg { + width: initial; + height: initial; + } > .download { + grid-column: 4; cursor: pointer; } } diff --git a/src/views/shoppingCart/sc-list.vue b/src/views/shoppingCart/sc-list.vue index c5c8332..204dfc8 100644 --- a/src/views/shoppingCart/sc-list.vue +++ b/src/views/shoppingCart/sc-list.vue @@ -92,7 +92,9 @@ }) 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 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 sortByOptions = ref([ {