This commit is contained in:
李志鹏
2026-05-27 13:06:28 +08:00
7 changed files with 149 additions and 108 deletions

View File

@@ -1,104 +1,112 @@
<script setup lang="ts">
import { ref, onMounted, onUnmounted, reactive, toRefs } from 'vue'
const props = defineProps({
url: {
type: String,
default: ''
},
name: {
type: String,
default: 'aaa'
},
price: {
type: [String, Number],
default: '111'
},
download: {
type: Boolean,
default: false
},
showPrice: {
type: Boolean,
default: true
}
})
const emit = defineEmits(['addShopping', 'openDetail', 'download'])
let data = reactive({})
const addShopping = () => {
if (props.download) {
emit('download')
} else {
emit('addShopping')
}
}
const openDetail = () => {
emit('openDetail')
}
onMounted(() => {})
onUnmounted(() => {})
defineExpose({})
const {} = toRefs(data)
import { ref, onMounted, onUnmounted, reactive, toRefs } from 'vue'
const props = defineProps({
url: {
type: String,
default: ''
},
name: {
type: String,
default: 'aaa'
},
price: {
type: [String, Number],
default: ''
},
download: {
type: Boolean,
default: false
},
showPrice: {
type: Boolean,
default: true
}
})
const emit = defineEmits(['addShopping', 'openDetail', 'download'])
let data = reactive({})
const addShopping = () => {
if (props.download) {
emit('download')
} else {
emit('addShopping')
}
}
const openDetail = () => {
emit('openDetail')
}
onMounted(() => {})
onUnmounted(() => {})
defineExpose({})
const {} = toRefs(data)
</script>
<template>
<div class="commodity-item" :class="{ 'is-download': download }">
<img :src="props.url" alt="" @click="openDetail" />
<div class="detail">
<div class="text">
<div class="name">
{{ props.name }}
</div>
<div class="price" :class="{ 'is-download': download }" v-if="props.showPrice && props.price">
{{ props.price }}
</div>
</div>
<div class="btn" @click="addShopping">
<div class="text">
<SvgIcon :name="download ? 'download' : 'add'" size="26" color="#232323"></SvgIcon>
</div>
</div>
</div>
</div>
<div class="commodity-item" :class="{ 'is-download': download }">
<img :src="props.url" alt="" @click="openDetail" />
<div class="detail">
<div class="text">
<div class="name">
{{ props.name }}
</div>
<div
class="price"
:class="{ 'is-download': download }"
v-if="props.showPrice && props.price"
>
{{ props.price }}
</div>
</div>
<div class="btn" @click="addShopping">
<div class="text">
<SvgIcon
:name="download ? 'download' : 'add'"
size="26"
color="#232323"
></SvgIcon>
</div>
</div>
</div>
</div>
</template>
<style lang="less" scoped>
.commodity-item {
width: var(--commodity-width, 100%);
&.is-download{
img{
cursor: initial;
}
}
> img {
width: 100%;
cursor: pointer;
height: var(--commodity-height, auto);
margin-bottom: var(--commodity-marginBottom, 1rem);
}
> .detail {
display: flex;
justify-content: space-between;
align-items: center;
> .text {
color: #232323;
> .name {
font-family: 'KaiseiOpti-Regular';
font-weight: 400;
font-size: var(--commodity-name-fontSize, 1.6rem);
line-height: var(--commodity-name-lineHeight, 2.3rem);
margin-bottom: var(--commodity-name-marginBottom, 0rem);
}
> .price {
font-family: 'KaiseiOpti-Regular';
font-weight: 400;
font-size: var(--commodity-price-fontSize, 1.4rem);
line-height: var(--commodity-price-lineHeight, 2.3rem);
&.is-download {
color: #979797;
}
}
}
}
.btn {
cursor: pointer;
}
}
.commodity-item {
width: var(--commodity-width, 100%);
&.is-download {
img {
cursor: initial;
}
}
> img {
width: 100%;
cursor: pointer;
height: var(--commodity-height, auto);
margin-bottom: var(--commodity-marginBottom, 1rem);
}
> .detail {
display: flex;
justify-content: space-between;
align-items: center;
> .text {
color: #232323;
> .name {
font-family: 'KaiseiOpti-Regular';
font-weight: 400;
font-size: var(--commodity-name-fontSize, 1.6rem);
line-height: var(--commodity-name-lineHeight, 2.3rem);
margin-bottom: var(--commodity-name-marginBottom, 0rem);
}
> .price {
font-family: 'KaiseiOpti-Regular';
font-weight: 400;
font-size: var(--commodity-price-fontSize, 1.4rem);
line-height: var(--commodity-price-lineHeight, 2.3rem);
&.is-download {
color: #979797;
}
}
}
}
.btn {
cursor: pointer;
}
}
</style>

View File

@@ -345,4 +345,9 @@ export default {
Offices: "Offices",
JoinWithUs: "Join with Us",
},
addShoppingCart:{
title: 'Added to your Shopping Cart',
statement: 'Digital Assets Only. No physical product included.',
button: 'Set Shopping Cart',
}
}

View File

@@ -345,4 +345,9 @@ export default {
Offices: "办公室",
JoinWithUs: "加入我们",
},
addShoppingCart:{
title: "已添加到您的购物车",
statement: "仅限数字资产。不包含实体产品。",
button: "去购物车"
}
}

View File

@@ -195,13 +195,14 @@ defineExpose({})
.digitalItemDetail{
width: 100%;
height: 100%;
overflow-y: auto;
position: relative;
display: flex;
flex-direction: column;
.center{
flex: 1;
// flex: 1;
display: flex;
overflow: hidden;
// overflow: hidden;
.img-list{
flex: 1;
display: grid;
@@ -211,6 +212,7 @@ defineExpose({})
// --row-width: 29.3rem;
overflow-y: auto;
position: relative;
border-right: 0.5px solid #585858;
&::-webkit-scrollbar{
display: none;
}
@@ -268,12 +270,15 @@ defineExpose({})
}
}
.img-detail{
border-left: 0.5px solid #585858;
padding-left: 3.2rem;
width: 57rem;
display: flex;
flex-direction: column;
overflow-y: auto;
height: calc(var(--app-view-height) - var(--footer-height));
position: sticky;
top: 0;
// height: 100%;
&::-webkit-scrollbar{
display: none;
}
@@ -305,7 +310,6 @@ defineExpose({})
font-size: 3rem;
line-height: 120%;
margin-bottom: 1rem;
cursor: pointer;
}
.img-price{
font-family: KaiseiOpti-Bold;
@@ -338,6 +342,7 @@ defineExpose({})
font-size: 1.8rem;
line-height: 100%;
margin-bottom: .8rem;
cursor: pointer;
}
.release-time{
font-family: KaiseiOpti-Regular;

View File

@@ -45,7 +45,7 @@ const {} = toRefs(data);
<el-drawer v-model="isShoppingShow" width="50rem" class="addShoppingDrawer" :close-on-click-modal="false" title="I am the title" :with-header="false">
<div class="addShoppingInfo">
<div class="header">
<div class="title">Added to your Shopping Cart</div>
<div class="title">{{ $t('addShoppingCart.title') }}</div>
<span class="close" @click="shoppingClose"
><svg-icon name="close" size="13"
/></span>
@@ -76,11 +76,11 @@ const {} = toRefs(data);
<div class="icon">
<SvgIcon name="statement" size="16.6" />
</div>
Digital Assets Only. No physical product included.
{{ $t('addShoppingCart.statement') }}
</div>
</div>
<div class="button" @click="goShopping">
SeE Shopping Cart
{{ $t('addShoppingCart.button') }}
</div>
</div>
<!-- <sc-list is-mini style="flex: 0.6;" @close="shoppingClose"/> -->

View File

@@ -33,7 +33,7 @@
</div>
<div class="amount" v-show="!disabled">${{ info.amount }}<span> HKD</span></div>
<SvgIcon
v-if="orderActionsLayout"
v-if="showDownload"
class="download"
name="download"
size="32"
@@ -59,6 +59,7 @@
showRemove: { type: Boolean, default: true },
orderActionsLayout: { type: Boolean, default: false },
showBrand: { type: Boolean, default: true },
isOrder: { type: Boolean, default: false },
info: {
type: Object as () => {
status: number
@@ -77,6 +78,10 @@
const onRemove = () => {
emit('remove', props.info)
}
const showDownload = computed(() => {
return props.isOrder ? props.info.status === 1 : props.orderActionsLayout
})
const handleBrandClick = () => {
router.push({
name: 'brandDetail',

View File

@@ -30,7 +30,9 @@
<span class="icon">
<svg-icon name="order-shop" size="24" />
</span>
<span class="text">{{ order.shopName }}</span>
<span class="text" @click="handleRouteBrand(order)">
{{ order.shopName }}
</span>
</div>
<p class="order-card__date">{{ order.formatUpdatetime }}</p>
</div>
@@ -80,6 +82,7 @@
:show-date="false"
:show-remove="false"
:show-brand="false"
is-order
order-actions-layout
/>
</div>
@@ -92,6 +95,7 @@
<script setup lang="ts">
import { computed, onMounted, ref, shallowRef } from 'vue'
import { useI18n } from 'vue-i18n'
import { useRouter } from 'vue-router'
import { fetchMyOrders } from '@/api/user'
import ScItem from '@/views/shoppingCart/sc-item.vue'
import Empty from './Empty.vue'
@@ -130,6 +134,7 @@
formatUpdatetime: string
}
const ROUTER = useRouter()
const { t, locale } = useI18n({ useScope: 'global' })
const statusOptions = computed<StatusOption[]>(() => [
@@ -183,7 +188,7 @@
}
const getOrderStatus = (order: OrderRecord) => {
return getOrderStatusValue(order.items[0]?.status)
return getOrderStatusValue(order.status)
}
const formatOrderUpdateTime = (dateStr: string) => {
@@ -291,6 +296,10 @@
}
}
const handleRouteBrand = (order: OrderRecord) => {
ROUTER.push(`/brand/${order.sellerId}`)
}
onMounted(() => {
fetchAllOrders()
})
@@ -396,6 +405,10 @@
}
.brand {
column-gap: 1rem;
.text {
text-decoration: underline;
cursor: pointer;
}
}
}