Merge branch 'main' of ssh://18.167.251.121:10002/aidlab/Aida_Purchaser_Front

This commit is contained in:
2026-05-22 11:39:21 +08:00
13 changed files with 299 additions and 138 deletions

View File

@@ -2,6 +2,4 @@
export const SCART_STATUS = {
/** 正常 */
NORMAL: 1,
/** 下架 */
DISABLED: 0,
}

View File

@@ -34,6 +34,9 @@
<script setup lang="ts">
import { computed, ref } from 'vue'
import { FormatBytes, FormatDate } from '@/utils/tools'
import { useRouter } from 'vue-router'
import { CreateOrder } from '@/api/shoppingCart'
const router = useRouter()
const props = defineProps({
list: {
type: Array,
@@ -57,7 +60,12 @@
})
const totalAmount = computed(() => props.list.reduce((pre, cur) => pre + cur.amount, 0).toFixed(2))
const handleCheckout = () => {
console.log('购买:', props.list)
const ids = props.list.map((v: any) => v.listingId)
if (ids.length === 0) return
console.log('购买:', ids)
CreateOrder(ids, true).then((res) => {
router.go(0)
})
}
</script>

View File

@@ -7,7 +7,6 @@
}"
>
<slot name="checkbox" />
{{ info.status }}
<img :src="info.cover" />
<div class="content">
<div class="title">{{ info.title }}</div>

View File

@@ -51,12 +51,12 @@
:show-date="!isMini"
:show-remove="!isView"
@remove="handleRemoveClick"
:disabled="v.status === SCART_STATUS.DISABLED"
:disabled="v.status !== SCART_STATUS.NORMAL"
>
<template #checkbox v-if="!isMini">
<el-checkbox
disabled
v-if="v.status === SCART_STATUS.DISABLED"
v-if="v.status !== SCART_STATUS.NORMAL"
style="opacity: 0; pointer-events: none"
/>
<el-checkbox v-else v-model="v.checked" @change="handleSelectedChange" />
@@ -141,10 +141,12 @@
cartId: v.cartId, //购物车ID
listingId: v.listingId, //资产ID
title: v.title, //标题
brand: v.shopName, //店铺名称
cover: v.cover, //封面
amount: v.price, //价格
status: v.status, //状态
date: v.addTime, //添加时间
tags: v.productCategory, //标签
checked: false
}
arr.push(obj)