每周更新

This commit is contained in:
2025-12-19 15:40:53 +08:00
parent 5945ab5588
commit ee5ed42a0d
26 changed files with 1177 additions and 213 deletions

View File

@@ -2,7 +2,7 @@
<div class="account-purchased-machine-config">
<div class="toolbar">
<div class="left-area">
<h2 class="page-title">已购矿机配置</h2>
<h2 class="page-title">已购商品</h2>
</div>
</div>
@@ -15,63 +15,6 @@
:header-cell-style="{ textAlign: 'left' }"
:cell-style="{ textAlign: 'left' }"
>
<el-table-column type="expand" width="46">
<template #default="scope">
<div class="expand-content">
<div class="expand-row" v-if="scope.row.walletAddress">
<div class="expand-label">钱包地址</div>
<div class="expand-value">
<span class="mono-ellipsis" style="font-family: monospace;">{{ scope.row.walletAddress }}</span>
<el-button
type="text"
size="mini"
icon="el-icon-document-copy"
@click="handleCopy(scope.row.walletAddress, '钱包地址')"
class="copy-btn"
>
复制
</el-button>
</div>
</div>
<div class="expand-row" v-if="scope.row.poolUrl">
<div class="expand-label">矿池地址</div>
<div class="expand-value">
<span class="mono-ellipsis">{{ scope.row.poolUrl }}</span>
<el-button
type="text"
size="mini"
icon="el-icon-document-copy"
@click="handleCopy(scope.row.poolUrl, '矿池地址')"
class="copy-btn"
>
复制
</el-button>
</div>
</div>
<div class="expand-row" v-if="scope.row.watchUrl">
<div class="expand-label">挖矿信息页面地址</div>
<div class="expand-value">
<span class="mono-ellipsis">{{ scope.row.watchUrl }}</span>
<el-button
type="text"
size="mini"
icon="el-icon-document-copy"
@click="handleCopy(scope.row.watchUrl, '挖矿信息页面地址')"
class="copy-btn"
>
复制
</el-button>
</div>
</div>
<div v-if="!scope.row.walletAddress && !scope.row.poolUrl && !scope.row.watchUrl" class="expand-empty">
暂无地址信息
</div>
</div>
</template>
</el-table-column>
<!-- <el-table-column prop="id" label="ID" width="80" /> -->
<el-table-column prop="coin" label="币种" width="100">
<template #default="scope">
<span>{{ scope.row.coin || '—' }}</span>
@@ -90,31 +33,53 @@
</template>
</el-table-column>
<el-table-column prop="poolUser" label="矿池用户" min-width="140">
<el-table-column prop="walletAddress" label="钱包地址" min-width="200">
<template #default="scope">
<span>{{ scope.row.poolUser || '—' }}</span>
<div class="address-cell">
<span v-if="scope.row.walletAddress" class="mono-ellipsis" style="font-family: monospace;">{{ scope.row.walletAddress }}</span>
<span v-else></span>
<el-button
v-if="scope.row.walletAddress"
type="text"
size="mini"
icon="el-icon-document-copy"
@click="handleCopy(scope.row.walletAddress, '钱包地址')"
class="copy-btn"
>
复制
</el-button>
</div>
</template>
</el-table-column>
<el-table-column prop="startTime" label="开始时间" min-width="160">
<el-table-column prop="poolUrl" label="矿池地址" min-width="200">
<template #default="scope">
<span>{{ formatDateTime(scope.row.startTime) }}</span>
<div class="address-cell">
<span v-if="scope.row.poolUrl" class="mono-ellipsis">{{ scope.row.poolUrl }}</span>
<span v-else></span>
<el-button
v-if="scope.row.poolUrl"
type="text"
size="mini"
icon="el-icon-document-copy"
@click="handleCopy(scope.row.poolUrl, '矿池地址')"
class="copy-btn"
>
复制
</el-button>
</div>
</template>
</el-table-column>
<el-table-column prop="endTime" label="结束时间" min-width="160">
<el-table-column label="操作" width="120" fixed="right">
<template #default="scope">
<span>{{ formatDateTime(scope.row.endTime) }}</span>
</template>
</el-table-column>
<el-table-column prop="status" label="状态" width="140">
<template #default="scope">
<el-tag :type="getStatusType(scope.row.status)">
{{ getStatusText(scope.row.status) }}
</el-tag>
<el-button
type="text"
size="mini"
@click="handleViewDetail(scope.row)"
>
详情
</el-button>
</template>
</el-table-column>
</el-table>
@@ -182,11 +147,7 @@ export default {
}
} catch (e) {
console.error('获取已购矿机配置失败', e)
this.$message({
message: '获取已购矿机配置失败,请重试',
type: 'error',
showClose: true
})
this.tableData = []
this.total = 0
this.totalPage = 0
@@ -283,6 +244,22 @@ export default {
})
}
},
/**
* 查看详情
* @param {Object} row - 行数据
*/
handleViewDetail(row) {
// 跳转到详情页面传递行数据的ID
const id = row.id || row.productMachineId || row.machineId
if (id) {
this.$router.push({
name: 'purchasedMachineDetail',
params: { id: id }
})
} else {
this.$message.warning('无法获取详情缺少ID信息')
}
},
/**
* 获取状态文本
* @param {number|boolean} status - 状态值
@@ -345,49 +322,21 @@ export default {
margin-top: 12px;
}
/* 展开内容样式 */
.expand-content {
padding: 16px;
background-color: #fafafa;
}
.expand-row {
/* 地址单元格样式 */
.address-cell {
display: flex;
align-items: flex-start;
margin-bottom: 16px;
padding: 12px;
background-color: #fff;
border-radius: 4px;
border: 1px solid #e4e7ed;
}
.expand-row:last-child {
margin-bottom: 0;
}
.expand-label {
min-width: 100px;
font-weight: 600;
color: #606266;
margin-right: 12px;
flex-shrink: 0;
}
.expand-value {
flex: 1;
display: flex;
align-items: flex-start;
align-items: center;
gap: 8px;
flex-wrap: wrap;
}
.expand-value .mono-ellipsis {
.address-cell .mono-ellipsis {
font-family: monospace;
color: #303133;
line-height: 1.5;
word-break: break-all;
flex: 0 1 auto;
margin-right: 8px;
flex: 1;
min-width: 0;
}
.copy-btn {
@@ -400,13 +349,6 @@ export default {
color: #66b1ff;
}
.expand-empty {
padding: 20px;
text-align: center;
color: #909399;
font-size: 14px;
}
/* 钱包地址和URL格式化显示样式 */
.mono-ellipsis {
font-family: monospace;