Merge branch 'main' of https://gitlab.guxuan.icu/Leo_Ding/GPU_Web
This commit is contained in:
commit
031e967f74
BIN
src/assets/bgImg.png
Normal file
BIN
src/assets/bgImg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.4 MiB |
File diff suppressed because it is too large
Load Diff
@ -1,204 +1,107 @@
|
||||
<template>
|
||||
<div class="instance-create-container">
|
||||
<!-- 警告提示 -->
|
||||
<a-alert class="autodl-tip" message="严禁使用WebUI等算法生成违禁图片、严禁挖矿,一经发现立即封号!" type="warning" show-icon closable />
|
||||
<div class="header">
|
||||
<h1>算力中心</h1>
|
||||
<h2>聚焦高效算力服务,为数字产业、智能应用提供强支撑</h2>
|
||||
</div>
|
||||
|
||||
<!-- 服务器选择 -->
|
||||
<a-card class="card select-server" title="服务器选择">
|
||||
<div class="list-filter">
|
||||
<div class="filter-item">
|
||||
<span class="filter-label">计费方式:</span>
|
||||
<div class="filter-content">
|
||||
<a-radio-group v-model:value="billingType" button-style="solid" @change="handleBillingTypeChange">
|
||||
<a-radio-button v-for="type in billingTypeOptions" :key="type.value" :value="type.value">
|
||||
{{ type.label }}
|
||||
</a-radio-button>
|
||||
</a-radio-group>
|
||||
<div class="instance-create-body">
|
||||
<!-- 筛选区域(保持不变) -->
|
||||
<a-card class="card select-server">
|
||||
<div class="list-filter">
|
||||
<div class="filter-item"> <span class="filter-label">计费方式:</span>
|
||||
<div class="filter-content"> <a-radio-group v-model:value="billingType" button-style="solid"
|
||||
@change="handleBillingTypeChange"> <a-radio-button v-for="type in billingTypeOptions" :key="type.value"
|
||||
:value="type.value"> {{ type.label }} </a-radio-button> </a-radio-group> </div>
|
||||
</div> <!-- 选择地区 -->
|
||||
<div class="filter-item"> <span class="filter-label">选择地区:</span>
|
||||
<div class="filter-content"> <a-radio-group v-model:value="selectedRegion" button-style="solid"
|
||||
@change="handleRegionChange"> <a-radio-button v-for="region in regions" :key="region.value"
|
||||
:value="region.value"> {{ region.label }} <a-tag v-if="region.tag" :color="region.tag.color"
|
||||
class="region-tag">{{ region.tag.text }}</a-tag> </a-radio-button> </a-radio-group> </div>
|
||||
</div> <!-- 专区选择 -->
|
||||
<div class="filter-item" v-if="showZones"> <span class="filter-label">选择专区:</span>
|
||||
<div class="filter-content"> <a-radio-group v-model:value="selectedZone" button-style="solid"
|
||||
@change="handleZoneChange"> <a-radio-button v-for="zone in availableZones" :key="zone.value"
|
||||
:value="zone.value"> {{ zone.label }} </a-radio-button> </a-radio-group> </div>
|
||||
</div> <!-- GPU型号 -->
|
||||
<div class="filter-item"> <span class="filter-label">GPU型号:</span>
|
||||
<div class="filter-content"> <a-checkbox-group v-model:value="selectedGpuModels"
|
||||
@change="handleGpuModelChange"> <a-checkbox value="all"
|
||||
:disabled="selectedGpuModels.length > 0 && selectedGpuModels[0] !== 'all'">全部</a-checkbox> <a-checkbox
|
||||
v-for="model in availableGpuModels" :key="model.value" :value="model.value"
|
||||
:disabled="model.available === 0"> {{ model.label }} <span class="note"> ({{ model.available }}/{{
|
||||
model.total }})</span> </a-checkbox> </a-checkbox-group> </div>
|
||||
</div> <!-- GPU数量 -->
|
||||
<div class="filter-item"> <span class="filter-label">GPU数量:</span>
|
||||
<div class="filter-content"> <a-select :size="'large'" default-value="1" style="width: 200px"
|
||||
@change="handleGpuCountChange"> <a-select-option v-for="count in gpuCountOptions" :key="count"
|
||||
:value="count"> {{ count }} </a-select-option> </a-select> </div>
|
||||
</div>
|
||||
</div>
|
||||
</a-card>
|
||||
|
||||
<!-- 选择地区 -->
|
||||
<div class="filter-item">
|
||||
<span class="filter-label">选择地区:</span>
|
||||
<div class="filter-content">
|
||||
<a-radio-group v-model:value="selectedRegion" button-style="solid" @change="handleRegionChange">
|
||||
<a-radio-button v-for="region in regions" :key="region.value" :value="region.value">
|
||||
{{ region.label }}
|
||||
<a-tag v-if="region.tag" :color="region.tag.color" class="region-tag">{{ region.tag.text }}</a-tag>
|
||||
</a-radio-button>
|
||||
</a-radio-group>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 专区选择 -->
|
||||
<div class="filter-item" v-if="showZones">
|
||||
<span class="filter-label">选择专区:</span>
|
||||
<div class="filter-content">
|
||||
<a-radio-group v-model:value="selectedZone" button-style="solid" @change="handleZoneChange">
|
||||
<a-radio-button v-for="zone in availableZones" :key="zone.value" :value="zone.value">
|
||||
{{ zone.label }}
|
||||
</a-radio-button>
|
||||
</a-radio-group>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- GPU型号 -->
|
||||
<div class="filter-item">
|
||||
<span class="filter-label">GPU型号:</span>
|
||||
<div class="filter-content">
|
||||
<a-checkbox-group v-model:value="selectedGpuModels" @change="handleGpuModelChange">
|
||||
<a-checkbox value="all" :disabled="selectedGpuModels.length > 0 && selectedGpuModels[0] !== 'all'">全部</a-checkbox>
|
||||
<a-checkbox v-for="model in availableGpuModels" :key="model.value" :value="model.value" :disabled="model.available === 0">
|
||||
{{ model.label }}
|
||||
<span class="note"> ({{ model.available }}/{{ model.total }})</span>
|
||||
</a-checkbox>
|
||||
</a-checkbox-group>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- GPU数量 -->
|
||||
<div class="filter-item">
|
||||
<span class="filter-label">GPU数量:</span>
|
||||
<div class="filter-content">
|
||||
<a-radio-group v-model:value="gpuCount" button-style="solid" @change="handleGpuCountChange">
|
||||
<a-radio-button v-for="count in gpuCountOptions" :key="count" :value="count" :disabled="isGpuCountDisabled(count)">
|
||||
{{ count }}
|
||||
</a-radio-button>
|
||||
</a-radio-group>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a-card>
|
||||
|
||||
<!-- 机器列表区域 -->
|
||||
<a-card class="card machine-list" title="机器列表">
|
||||
|
||||
<!-- 新的卡片式布局 -->
|
||||
<div class="machine-card-container">
|
||||
<div
|
||||
v-for="record in paginatedMachineList"
|
||||
:key="record.id"
|
||||
class="machine-card"
|
||||
:class="{ 'selected-card': selectedMachineId === record.id }"
|
||||
@click="handleSelectMachine(record.id)"
|
||||
>
|
||||
<!-- 卡片头部信息 -->
|
||||
<div class="card-header">
|
||||
<div class="location-info">
|
||||
<span>{{ record.region === 'beijingDC2' ? '北京B区' : record.region }}</span>
|
||||
<span class="separator">/</span>
|
||||
<span>{{ record.machineName }}</span>
|
||||
<span class="id-code">
|
||||
| {{ record.id }}
|
||||
<span style="margin-left: 20px;">可租用至:2027-01-01</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="gpu-spec">
|
||||
<div class="gpu-model">{{ record.gpuModel }}</div>
|
||||
<div class="gpu-memory">/ {{ record.gpuMemory }}</div>
|
||||
<div class="availability">
|
||||
空闲/总量 <span style="font-size: 18px;color: #333;">{{ record.freeGpu }}</span> / {{ record.totalGpu }}
|
||||
<!-- 机器列表 -->
|
||||
<a-card class="card machine-list" >
|
||||
<div class="image-card-container">
|
||||
<div v-for="record in paginatedMachineList" :key="record.id" class="image-card"
|
||||
:class="{ selected: selectedMachineId === record.id }" @click="handleSelectMachine(record.id)">
|
||||
<!-- 顶部 -->
|
||||
<div class="image-card-header">
|
||||
<div class="gpu-title">
|
||||
{{ record.gpuModel }} {{ record.gpuMemory }}
|
||||
</div>
|
||||
<div class="gpu-availability">
|
||||
空闲 / 总量
|
||||
<strong style="font-size: 18px;">{{ record.freeGpu }}</strong> / {{ record.totalGpu }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 主要规格信息 -->
|
||||
<div class="card-body">
|
||||
|
||||
|
||||
<div class="specs-grid">
|
||||
<!-- 每GPU分配 -->
|
||||
<div class="spec-column">
|
||||
<div class="spec-title">每GPU分配</div>
|
||||
<div class="spec-item">
|
||||
<div class="spec-label">CPU:</div>
|
||||
<div class="spec-value">{{ record.cpuCores }} 核, {{ record.cpuModel }}</div>
|
||||
</div>
|
||||
<div class="spec-item">
|
||||
<div class="spec-label">内存:</div>
|
||||
<div class="spec-value">{{ record.memory }} GB</div>
|
||||
</div>
|
||||
<!-- 中部信息 -->
|
||||
<div class="image-card-info">
|
||||
<div class="info-item">
|
||||
<span class="info-item-name">CPU</span>
|
||||
<span class="info-item-account">{{ record.cpuCores }} 核</span>
|
||||
</div>
|
||||
|
||||
<!-- 硬盘 -->
|
||||
<div class="spec-column">
|
||||
<div class="spec-title">硬盘</div>
|
||||
<div class="spec-item">
|
||||
<div class="spec-label">系统盘:</div>
|
||||
<div class="spec-value">30 GB</div>
|
||||
</div>
|
||||
<div class="spec-item">
|
||||
<div class="spec-label">数据盘:</div>
|
||||
<div class="spec-value">{{ record.dataDisk }} GB,可扩容 {{ record.expandableDisk }} GB</div>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<span class="info-item-name">内存</span>
|
||||
<span class="info-item-account">{{ record.memory }} GB</span>
|
||||
</div>
|
||||
|
||||
<!-- 其它信息 -->
|
||||
<div class="spec-column">
|
||||
<div class="spec-title">其它</div>
|
||||
<div class="spec-item">
|
||||
<div class="spec-label">GPU驱动:</div>
|
||||
<div class="spec-value">{{ record.driver }}</div>
|
||||
</div>
|
||||
<div class="spec-item">
|
||||
<div class="spec-label">CUDA版本:</div>
|
||||
<div class="spec-value">{{ record.cuda }}</div>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<span class="info-item-name">显存</span>
|
||||
<span class="info-item-account">{{ record.gpuMemory }}</span>
|
||||
</div>
|
||||
|
||||
<!-- 价格信息 -->
|
||||
<div class="price-column">
|
||||
<div class="price-info">
|
||||
<div class="current-price">
|
||||
¥<strong>{{ getPrice(record) }}</strong>/时
|
||||
</div>
|
||||
<div class="original-price">
|
||||
¥{{ getOriginalPrice(record) }}/时
|
||||
</div>
|
||||
<div class="discount-badge">
|
||||
<span class="discount-icon">💰</span>
|
||||
<span class="discount-text">9.5折</span>
|
||||
</div>
|
||||
<div class="member-note">
|
||||
会员最低享9.5折 ¥2.98/时
|
||||
</div>
|
||||
<a-button type="primary" class="rent-button" @click="handleRentMachine(record.id)">
|
||||
{{ record.freeGpu > 0 ? '1卡可租' : '暂不可租' }}
|
||||
</a-button>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<span class="info-item-name">系统盘</span>
|
||||
<span class="info-item-account">30 GB</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 底部价格 -->
|
||||
<div class="image-card-footer">
|
||||
<div class="price">
|
||||
<span class="price-num">{{ getPrice(record) }}</span>
|
||||
<span class="price-unit">元/卡/小时</span>
|
||||
</div>
|
||||
<a-button type="primary" class="buy-btn" :disabled="record.freeGpu === 0"
|
||||
@click.stop="handleRentMachine(record.id)">
|
||||
立即购买
|
||||
</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 分页 -->
|
||||
<div class="pagination-container">
|
||||
<a-pagination
|
||||
v-model:current="currentPage"
|
||||
v-model:pageSize="pageSize"
|
||||
:total="filteredMachineList.length"
|
||||
:show-size-changer="true"
|
||||
:page-size-options="['10', '20', '50', '100']"
|
||||
show-quick-jumper
|
||||
show-total
|
||||
:show-total="total => `共 ${total} 台机器`"
|
||||
@change="handlePageChange"
|
||||
@showSizeChange="handlePageSizeChange"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- 空状态 -->
|
||||
<div v-if="filteredMachineList.length === 0" class="empty-state">
|
||||
<a-empty description="暂无可用机器,请尝试调整筛选条件" />
|
||||
</div>
|
||||
</a-card>
|
||||
<!-- 分页 -->
|
||||
<div class="pagination-container">
|
||||
<a-pagination v-model:current="currentPage" v-model:pageSize="pageSize" :total="filteredMachineList.length"
|
||||
show-size-changer show-quick-jumper />
|
||||
</div>
|
||||
</a-card>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, reactive, watch } from 'vue'
|
||||
import { message } from 'ant-design-vue'
|
||||
@ -431,12 +334,13 @@ const billingTypeOptions = ref([
|
||||
{ value: 'payg', label: '按量计费' },
|
||||
{ value: 'daily', label: '包日' },
|
||||
{ value: 'weekly', label: '包周' },
|
||||
{ value: 'monthly', label: '包月' }
|
||||
{ value: 'monthly', label: '包月' },
|
||||
{ value: 'year', label: '包年' }
|
||||
])
|
||||
|
||||
const regions = ref<RegionOption[]>([
|
||||
{ value: 'beijingDC2', label: '北京B区' },
|
||||
{ value: 'westDC3', label: '西北B区', tag: { color: 'red', text: 'PRO6000' } },
|
||||
{ value: 'westDC3', label: '西北B区' },
|
||||
{ value: 'chongqingDC1', label: '重庆A区' },
|
||||
{ value: 'neimengDC3', label: '内蒙B区' },
|
||||
{ value: 'beijingDC1', label: '北京A区' },
|
||||
@ -628,13 +532,13 @@ const totalPrice = computed(() => {
|
||||
if (!machine) return '0.00'
|
||||
|
||||
let price = machine.basePrice * gpuCount.value
|
||||
|
||||
|
||||
// 硬盘扩容费用
|
||||
if (needExpand.value && expandSize.value > 0) {
|
||||
const diskPricePerGB = 0.1 // 假设每GB 0.1元/周
|
||||
price += diskPricePerGB * expandSize.value
|
||||
}
|
||||
|
||||
|
||||
// 优惠券折扣
|
||||
if (selectedCoupon.value) {
|
||||
const coupon = availableCoupons.value.find(c => c.id === selectedCoupon.value)
|
||||
@ -720,12 +624,12 @@ const couponDiscount = computed(() => {
|
||||
if (!selectedCoupon.value) return '0.00'
|
||||
const coupon = availableCoupons.value.find(c => c.id === selectedCoupon.value)
|
||||
if (!coupon) return '0.00'
|
||||
|
||||
|
||||
let discount = coupon.amount
|
||||
if (billingType.value === 'payg') discount = discount / (7 * 24)
|
||||
else if (billingType.value === 'daily') discount = discount / 7
|
||||
else if (billingType.value === 'monthly') discount = discount * 4
|
||||
|
||||
|
||||
return discount.toFixed(2)
|
||||
})
|
||||
|
||||
@ -747,8 +651,8 @@ const getRowClassName = (record: Machine) => {
|
||||
}
|
||||
|
||||
// 一卡可租
|
||||
const handleRentMachine = (id:string) => {
|
||||
router.push("/layout/create")
|
||||
const handleRentMachine = (id: string) => {
|
||||
router.push("/layout/create")
|
||||
|
||||
}
|
||||
|
||||
@ -864,19 +768,50 @@ if (availableGpuModels.value.length > 0) {
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
<style scoped lang="scss">
|
||||
/* 强制让容器参与文档流并允许增长 */
|
||||
.instance-create-container {
|
||||
display: block;
|
||||
width: 90%;
|
||||
max-width: 1200px;
|
||||
width: 100%;
|
||||
// max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
padding: 24px;
|
||||
background: #fff;
|
||||
/* background: #fff; */
|
||||
box-sizing: border-box;
|
||||
/* 关键:确保它能自然撑高 */
|
||||
min-height: fit-content;
|
||||
height: auto;
|
||||
background: url('@/assets/bgImg.png') no-repeat center / 100% 100%;
|
||||
}
|
||||
|
||||
.header {
|
||||
width: 60%;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
padding: 60px 0 20px 0;
|
||||
|
||||
h1 {
|
||||
font-size: 50px;
|
||||
font-weight: 500;
|
||||
letter-spacing: 0px;
|
||||
line-height: 20px;
|
||||
color: rgba(0, 0, 0, 1);
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 30px;
|
||||
font-weight: 400;
|
||||
letter-spacing: 0px;
|
||||
line-height: 60px;
|
||||
color: rgba(166, 166, 166, 1);
|
||||
vertical-align: top;
|
||||
}
|
||||
}
|
||||
|
||||
.instance-create-body {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.breadcrumb {
|
||||
@ -915,6 +850,8 @@ if (availableGpuModels.value.length > 0) {
|
||||
font-weight: 500;
|
||||
flex-shrink: 0;
|
||||
line-height: 32px;
|
||||
|
||||
color: rgba(128, 128, 128, 1);
|
||||
}
|
||||
|
||||
.filter-content {
|
||||
@ -1333,6 +1270,14 @@ if (availableGpuModels.value.length > 0) {
|
||||
margin-right: 16px;
|
||||
}
|
||||
|
||||
.machine-card-container.two-columns {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
/* 两列布局 */
|
||||
gap: 16px;
|
||||
margin-top: 24px;
|
||||
}
|
||||
|
||||
/* 新增的卡片式布局样式 */
|
||||
.machine-card-container {
|
||||
display: flex;
|
||||
@ -1347,11 +1292,15 @@ if (availableGpuModels.value.length > 0) {
|
||||
background: white;
|
||||
transition: all 0.2s ease;
|
||||
cursor: pointer;
|
||||
box-shadow: 0 2px 8px rgba(0,0,0,0.05);
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
/* 确保卡片高度一致 */
|
||||
}
|
||||
|
||||
.machine-card:hover {
|
||||
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
@ -1361,20 +1310,20 @@ if (availableGpuModels.value.length > 0) {
|
||||
}
|
||||
|
||||
.card-header {
|
||||
padding: 16px 24px;
|
||||
padding: 16px 20px;
|
||||
background: #f8f9fa;
|
||||
border-bottom: 1px solid #e8e8e8;
|
||||
/* display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center; */
|
||||
border-radius: 8px 8px 0 0;
|
||||
}
|
||||
|
||||
.location-info {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.location-info .separator {
|
||||
@ -1392,17 +1341,20 @@ if (availableGpuModels.value.length > 0) {
|
||||
}
|
||||
|
||||
.card-body {
|
||||
padding: 24px;
|
||||
padding: 20px;
|
||||
flex: 1;
|
||||
/* 让card-body填满剩余空间 */
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 24px;
|
||||
}
|
||||
|
||||
.gpu-spec {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-top: 15px;
|
||||
margin-top: 10px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.gpu-model {
|
||||
@ -1428,9 +1380,12 @@ if (availableGpuModels.value.length > 0) {
|
||||
|
||||
.specs-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr;
|
||||
gap: 24px;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
/* 内部也使用两列 */
|
||||
gap: 16px;
|
||||
margin-top: 16px;
|
||||
flex: 1;
|
||||
/* 让规格网格填满空间 */
|
||||
}
|
||||
|
||||
.spec-column {
|
||||
@ -1463,18 +1418,19 @@ if (availableGpuModels.value.length > 0) {
|
||||
}
|
||||
|
||||
.price-column {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-end;
|
||||
gap: 12px;
|
||||
grid-column: span 2;
|
||||
/* 价格信息占据两列的宽度 */
|
||||
margin-top: 12px;
|
||||
padding-top: 16px;
|
||||
border-top: 1px solid #f0f0f0;
|
||||
}
|
||||
|
||||
.price-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-end;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.current-price {
|
||||
@ -1519,35 +1475,143 @@ if (availableGpuModels.value.length > 0) {
|
||||
}
|
||||
|
||||
.rent-button {
|
||||
width: 100px;
|
||||
height: 32px;
|
||||
font-size: 12px;
|
||||
border-radius: 4px;
|
||||
width: 120px;
|
||||
height: 36px;
|
||||
font-size: 14px;
|
||||
border-radius: 6px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.image-card-container {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
gap: 20px;
|
||||
margin-top: 24px;
|
||||
}
|
||||
|
||||
.image-card {
|
||||
background: #fff;
|
||||
border-radius: 10px;
|
||||
padding: 20px;
|
||||
border: 1px solid #eee;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.image-card:hover {
|
||||
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.image-card.selected {
|
||||
border-color: #1890ff;
|
||||
box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.15);
|
||||
}
|
||||
|
||||
/* 顶部 */
|
||||
.image-card-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.gpu-title {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.gpu-availability {
|
||||
font-size: 13px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
/* 中部信息 */
|
||||
.image-card-info {
|
||||
margin-top: 20px;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(1, 1fr);
|
||||
row-gap: 12px;
|
||||
}
|
||||
|
||||
.info-item {
|
||||
display: flex;
|
||||
|
||||
.info-item-name{
|
||||
width: 60px;
|
||||
}
|
||||
|
||||
.info-item-account{
|
||||
padding-left: 10px;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
/* 底部 */
|
||||
.image-card-footer {
|
||||
margin-top: 24px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border-top: 1px solid #eee;
|
||||
padding-top: 15px;
|
||||
}
|
||||
|
||||
.price {
|
||||
color: #f5222d;
|
||||
}
|
||||
|
||||
.price-num {
|
||||
font-size: 22px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.price-unit {
|
||||
font-size: 12px;
|
||||
margin-left: 4px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.buy-btn {
|
||||
width: 100px;
|
||||
height: 36px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
/* 响应式 */
|
||||
@media (max-width: 1200px) {
|
||||
.image-card-container {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* 响应式设计 - 小屏幕适配 */
|
||||
@media (max-width: 768px) {
|
||||
.image-card-container {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.specs-grid {
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
|
||||
.price-column {
|
||||
grid-column: span 2;
|
||||
}
|
||||
|
||||
|
||||
.card-header {
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
padding: 12px 16px;
|
||||
}
|
||||
|
||||
|
||||
.location-info {
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
|
||||
.available-info {
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user