卖家端申请接口。人口

This commit is contained in:
李志鹏
2026-04-24 16:57:13 +08:00
parent 071930f257
commit e4fc51c574
9 changed files with 149 additions and 62 deletions

View File

@@ -42,8 +42,8 @@
<div class="item">
<div class="images">
<img
v-for="(v, i) in v.item.slice(0, maxItemNum)"
:key="i"
v-for="v in v.item.slice(0, maxItemNum)"
:key="v.id"
:src="v.url"
/>
<span v-if="v.item.length > maxItemNum"
@@ -51,7 +51,7 @@
>
</div>
<div class="titles">
<div v-for="(v, i) in v.item.slice(0, maxItemNum)" :key="i">
<div v-for="v in v.item.slice(0, maxItemNum)" :key="v.id">
{{ v.title }}
</div>
<span v-if="v.item.length > maxItemNum">...</span>
@@ -65,6 +65,7 @@
</div>
</div>
</div>
<div class="null" v-show="list.length === 0 && !loading && finish">no data</div>
<div class="placeholder" ref="placeholderRef" v-show="!loading"></div>
<div class="footer" :class="{ null: list.length === 0 }" v-if="!finish">
<a-spin :delay="0.5" v-show="loading" />
@@ -74,22 +75,28 @@
</template>
<script setup>
import { ref, onMounted, onBeforeUnmount } from "vue"
const totals = ref([
import { ref, onMounted, onBeforeUnmount, computed } from "vue"
import { Https } from "@/tool/https"
const totals_obj = ref({
totalRevenue: "--",
totalPurchases: "--",
totalViews: "--"
})
const totals = computed(() => [
{
icon: "seller-qiandaizi",
title: "Total Revenue",
value: "HK$ 54,32.00"
value: `HK$ ${totals_obj.value.totalRevenue}`
},
{
icon: "seller-gouwudai",
title: "Total Purchases",
value: "128"
value: totals_obj.value.totalPurchases
},
{
icon: "seller-eye",
title: "Total Views",
value: "4,982"
value: totals_obj.value.totalViews
}
])
const maxItemNum = ref(2)
@@ -112,38 +119,41 @@
page: page.value,
size: size.value
}
if (nameOrId.value) data.nameOrId = nameOrId.value
console.log(data)
setTimeout(() => {
for (let i = 0; i < size.value; i++) {
let { date, time, dateTime } = formatTimestamp(new Date(2026, 4, 20, 13, 14).getTime())
list.value.push({
orderId: "SP" + Math.random().toString().substring(2, 10),
price: "HK$ " + (Math.random() * 500).toFixed(2),
username: "@liuyuchen",
date: date,
time: time,
item: [
{
url: "http://118.31.39.42:3000/falls/o-1.png",
title: "North Outfit Set"
},
{
url: "http://118.31.39.42:3000/falls/o-2.png",
title: "Heritage Layered Set"
},
{},
{}
]
})
}
total.value = 30
if (nameOrId.value) data.keyword = nameOrId.value
Https.axiosGet(Https.httpUrls.getSellerOrderList, { params: data }).then((res) => {
res.content?.forEach((v) => {
const obj = {
orderId: v.orderId,
items: v.items.map((item) => ({
id: item.productId,
url: item.thumbnailUrl,
title: item.productName
})),
price: "HK$ " + v.price,
username: v.buyerUsername,
date: v.date,
time: v.date
}
list.value.push(obj)
})
total.value = res.total
page.value++
finish.value = page.value > total.value / 10
finish.value = page.value > total.value / size.value
loading.value = false
}, 1000)
})
}
const getSummary = () => {
Https.axiosGet(Https.httpUrls.getSellerOrderSummary).then((res) => {
totals_obj.value.totalRevenue = res.totalRevenue
totals_obj.value.totalPurchases = res.totalPurchases
totals_obj.value.totalViews = res.totalViews
})
}
getSummary()
getList(true)
const placeholderRef = ref(null)
const observer = new IntersectionObserver(
(entries) => {
@@ -348,6 +358,11 @@
}
}
}
> .null {
margin-top: 10rem;
text-align: center;
color: #999;
}
> .footer {
min-height: 10rem;
display: flex;