feat: order跳转卖家主页

This commit is contained in:
2026-05-27 11:29:37 +08:00
parent c263f1cffc
commit dfe8099945
2 changed files with 119 additions and 99 deletions

View File

@@ -10,8 +10,8 @@ const props = defineProps({
default: 'aaa'
},
price: {
type: String,
default: '111'
type: [String, Number],
default: ''
},
download: {
type: Boolean,
@@ -47,13 +47,21 @@ const {} = toRefs(data)
<div class="name">
{{ props.name }}
</div>
<div class="price" :class="{ 'is-download': download }" v-if="props.showPrice && props.price">
<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>
<SvgIcon
:name="download ? 'download' : 'add'"
size="26"
color="#232323"
></SvgIcon>
</div>
</div>
</div>

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>
@@ -93,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'
@@ -131,6 +134,7 @@
formatUpdatetime: string
}
const ROUTER = useRouter()
const { t, locale } = useI18n({ useScope: 'global' })
const statusOptions = computed<StatusOption[]>(() => [
@@ -292,6 +296,10 @@
}
}
const handleRouteBrand = (order: OrderRecord) => {
ROUTER.push(`/brand/${order.sellerId}`)
}
onMounted(() => {
fetchAllOrders()
})
@@ -397,6 +405,10 @@
}
.brand {
column-gap: 1rem;
.text {
text-decoration: underline;
cursor: pointer;
}
}
}