备份更新开发代码

This commit is contained in:
yaoqin 2025-07-29 15:53:40 +08:00
parent 22dad92ef9
commit 4e764d2d17
7 changed files with 208 additions and 73 deletions

View File

@ -27,7 +27,6 @@
<link rel="alternate" hreflang="x-default" href="https://m2pool.com/en">
<!-- Open Graph 标签 - 用于社交媒体分享时的展示效果 -->
<!--分享时显示的标题 -->
<meta property="og:title" content="M2pool - Stable leading high-yield mining pool">

File diff suppressed because one or more lines are too long

View File

@ -6,54 +6,71 @@ export default {
return {
listParams: {
lang: `${this.$i18n.locale}`,
type: 2
childType: 3,
},
navContentParams: {
lang: `${this.$i18n.locale}`,
id: 4
childType:3,//1服务条款、2费率、3API文档 childType
},
navContent: {},
documentLoading: false,
documentContent: '',
documentError: ''
documentError: '',
navList:[],
info: '',
}
},
mounted() {
this.getDocumentsList(this.listParams)
this.getDocumentsInfo(this.navContentParams)
this.fetchProblemDetails(this.navContentParams)
},
methods: {
async getDocumentsList(params) {
try {
const res = await documentsList(params)
console.log(res,"res");
this.navList = res.data
console.log('文档列表:', res)
} catch (error) {
console.error('获取文档列表失败:', error)
}
},
async getDocumentsInfo(params) {
this.documentLoading = true
this.documentError = ''
try {
const res = await findDataInfo(params)
console.log('文档详情:', res)
if (res && res.code === 200 && res.data) {
this.navContent = res.data
// 将Markdown内容转换为HTML
this.documentContent = this.markdownToHtml(res.data.content || '')
} else {
this.documentError = '获取文档失败: ' + (res?.msg || '未知错误')
}
} catch (error) {
console.error('获取文档详情失败:', error)
this.documentError = '获取文档失败: ' + (error.message || '网络错误')
} finally {
this.documentLoading = false
async fetchProblemDetails(params) {
this.setLoading('documentLoading', true);
const res = await findDataInfo(params)
if(res && res.code === 200){
this.info = res.data.content || ""
}
},
this.setLoading('documentLoading', false);
},
// async getDocumentsInfo(params) {
// this.documentLoading = true
// this.documentError = ''
// try {
// const res = await findDataInfo(params)
// console.log('文档详情:', res)
// if (res && res.code === 200 && res.data) {
// this.navContent = res.data
// // 将Markdown内容转换为HTML
// this.documentContent = this.markdownToHtml(res.data.content || '')
// } else {
// this.documentError = '获取文档失败: ' + (res?.msg || '未知错误')
// }
// } catch (error) {
// console.error('获取文档详情失败:', error)
// this.documentError = '获取文档失败: ' + (error.message || '网络错误')
// } finally {
// this.documentLoading = false
// }
// },
/**
* 改进的Markdown转HTML方法

View File

@ -1,17 +1,6 @@
<template>
<div class="rate">
<!-- 动态文档内容渲染区域 -->
<!-- <section class="navContent">
<div v-if="documentLoading" class="loading-container">
<p>正在加载文档...</p>
</div>
<div v-else-if="documentContent" class="document-content" v-html="documentContent"></div>
<div v-else-if="documentError" class="error-container">
<p>{{ documentError }}</p>
</div>
</section>
-->
@ -945,16 +934,30 @@
</section>
<section class="rateBox" v-else>
<section class="leftMenu">
<section class="leftMenu">
<ul>
<li>
<i class="iconfont icon-baogao file"></i
>{{ $t(`apiFile.leftMenu`) }}
</li>
</ul>
</ul>
</section>
<section class="rightText">
<h2>{{ $t(`apiFile.file`) }}</h2>
<section class="rightContent">
<div v-if="documentLoading" class="loading-container">
<span class="loading-text">正在加载内容...</span>
</div>
<div v-else-if="info && info.trim()" class="dynamic-content" v-html="info"></div>
<div v-else class="no-content">
<p>暂无内容</p>
</div>
</section>
<!-- -------------------------------------- -->
<!-- <h2>{{ $t(`apiFile.file`) }}</h2>
<div class="content">
<h3>{{ $t(`apiFile.survey`) }}</h3>
<p>{{ $t(`apiFile.survey1`) }}</p>
@ -1010,11 +1013,11 @@
<p>}</p>
</div>
<p>{{ $t(`apiFile.explain6`) }}</p>
</div>
</div> -->
<!-- 矿池信息 -->
<section class="MiningPool" id="HashRate">
<!-- <section class="MiningPool" id="HashRate">
<h3>{{ $t(`apiFile.miningPoolInformation`) }}</h3>
<!-- HashRate -->
<div class="Pool" >
<p>{{ $t(`apiFile.miningPoolInformation1`) }}</p>
<p class="hash">HashRate</p>
@ -1040,7 +1043,6 @@
</tr>
</table>
</div>
<!-- MinersList -->
<div class="Pool" id="MinersList">
<p class="hash">MinersList</p>
<p>{{ $t(`apiFile.minersNum`) }}</p>
@ -1071,7 +1073,7 @@
</tr>
</table>
</div>
<!-- 矿池总览 -->
<div class="Pool">
<p class="hash">{{ $t(`apiFile.overviewOfMiningPool`) }}</p>
<p class="Interface">Get /oapi/v1/pool/watch</p>
@ -1140,7 +1142,7 @@
</table>
</div>
<!-- 矿池当前矿工数 -->
<div class="Pool">
<p class="hash">{{ $t(`apiFile.currentMiners`) }}</p>
<p class="Interface">Get /oapi/v1/pool/miners_list</p>
@ -1179,7 +1181,7 @@
</table>
</div>
<!-- 矿池实时算力 -->
<div class="Pool">
<p class="hash">{{ $t(`apiFile.realTimePower`) }}</p>
<p class="Interface">Get /oapi/v1/pool/hashrate</p>
@ -1230,7 +1232,7 @@
</table>
</div>
<!-- 矿池总览历史算力 -->
<div class="Pool">
<p class="hash">{{ $t(`apiFile.historyPower`) }}</p>
<p class="Interface">Get /oapi/v1/pool/hashrate_history</p>
@ -1293,12 +1295,12 @@
</table>
</div>
</section>
</section> -->
<!-- 挖矿账号信息 -->
<section class="MiningPool" id="accountHashRate" >
<!-- <section class="MiningPool" id="accountHashRate" >
<h3>{{ $t(`apiFile.miningAccount`) }}</h3>
<!-- HashRate -->
<div class="Pool" >
<p>{{ $t(`apiFile.miningPoolInformation1`) }}</p>
<p class="hash">HashRate</p>
@ -1324,7 +1326,7 @@
</tr>
</table>
</div>
<!-- MinersList -->
<div class="Pool" id="accountList">
<p class="hash">MinersList</p>
<p>{{ $t(`apiFile.minerData`) }}</p>
@ -1355,7 +1357,7 @@
</tr>
</table>
</div>
<!-- MinerInfo -->
<div class="Pool" id="MinerInfo">
<p class="hash">MinerInfo</p>
<p>{{ $t(`apiFile.stateData`) }}</p>
@ -1384,7 +1386,7 @@
</table>
</div>
<!-- 挖矿账号下矿工总览 -->
<div class="Pool">
<p class="hash">{{ $t(`apiFile.overviewOfMiners`) }}</p>
<p class="Interface">Post /oapi/v1/account/watch </p>
@ -1430,7 +1432,7 @@
</table>
</div>
<!-- 挖矿账号下所有矿工 -->
<div class="Pool">
<p class="hash">{{ $t(`apiFile.allMiners`) }}</p>
<p class="Interface">Post /oapi/v1/account/miners_list</p>
@ -1475,7 +1477,7 @@
</table>
</div>
<!-- 挖矿账号实时算力 -->
<div class="Pool">
<p class="hash">{{ $t(`apiFile.realTimeAccount`) }}</p>
<p class="Interface">Post /oapi/v1/account/hashrate_real</p>
@ -1532,7 +1534,7 @@
</table>
</div>
<!-- {{ $t(`apiFile.account24h`) }} -->
<div class="Pool">
<p class="hash">{{ $t(`apiFile.account24h`) }}</p>
<p class="Interface">Post /oapi/v1/account/hashrate_history</p>
@ -1595,7 +1597,7 @@
</table>
</div>
<!-- 挖矿账号最近24h算力30m平均算力 -->
<div class="Pool">
<p class="hash">{{ $t(`apiFile.account24h30m`) }}</p>
<p class="Interface">Post /oapi/v1/account/hashrate_last24h</p>
@ -1646,12 +1648,12 @@
</table>
</div>
</section>
</section> -->
<!-- 矿机信息 -->
<section class="MiningPool" id="minerHashRate" >
<!-- <section class="MiningPool" id="minerHashRate" >
<h3>{{ $t(`apiFile.miningMachineInformation`) }}</h3>
<!-- HashRate -->
<div class="Pool" >
<p>{{ $t(`apiFile.miningPoolInformation1`) }}</p>
<p class="hash">HashRate</p>
@ -1677,7 +1679,7 @@
</tr>
</table>
</div>
<!-- 指定矿机实时算力 -->
<div class="Pool">
<p class="hash">{{ $t(`apiFile.realTimeMiningMachine`) }}</p>
<p class="Interface">Post /oapi/v1/miner/hashrate_real</p>
@ -1739,7 +1741,7 @@
</table>
</div>
<!-- 指定矿机历史24h平均算力 -->
<div class="Pool">
<p class="hash">{{ $t(`apiFile.miningMachineHistory24h`) }}</p>
<p class="Interface">Post /oapi/v1/miner/hashrate_history</p>
@ -1809,7 +1811,7 @@
</table>
</div>
<!-- 指定矿机最近24h算力30m平均算力 -->
<div class="Pool">
<p class="hash">{{ $t(`apiFile.realTimeMiningMachine24h30m`) }}</p>
<p class="Interface">Post /oapi/v1/miner/hashrate_last24h</p>
@ -1868,7 +1870,7 @@
</table>
</div>
</section>
</section> -->
</section>
</section>
@ -2455,6 +2457,42 @@ a{
font-size: 14px;
margin: 0;
}
.dynamic-content {
width: 100%;
margin: 0 auto;
//
:deep(table) {
border-collapse: collapse;
width: 100%;
margin: 16px 0;
}
:deep(th), :deep(td) {
border: 1px solid #d1d5db;
padding: 8px 12px;
text-align: left;
}
:deep(th) {
background: #f3f4f6;
font-weight: bold;
}
:deep(strong), :deep(b) {
font-weight: bold !important;
color: inherit !important;
font-style: normal !important;
}
:deep(em), :deep(i) {
font-style: italic !important;
color: inherit !important;
}
:deep(a) {
color: #007bff !important;
text-decoration: none !important;
&:hover {
text-decoration: underline !important;
}
}
}
/* 加载动画 */
@keyframes pulse {

View File

@ -25,11 +25,10 @@ export default{
this.addParams.type = String(this.addParams.type)
this.addParams.childType = String(this.addParams.childType)
this.typeArray = [this.addParams.type]
// 标记已从后台获取数据,避免被本地存储覆盖
this.hasBackendData = true
// 删除 editor.setHtml 的调用,内容初始化交由 onCreated 统一处理
}
}
}
}

View File

@ -1,3 +1,4 @@
import { findDataInfo ,documentsList} from '../../api/documentManagement'
export default {
data(){
return{
@ -88,7 +89,28 @@ export default {
]
],
DetailsParams:{
lang:this.$i18n.locale,
childType:2,//1服务条款、2费率、3API文档 childType
},
info:"",
rateLoading:false
}
},
mounted(){
this.fetchProblemDetails(this.DetailsParams)
},
methods:{
async fetchProblemDetails(params) {
this.setLoading('rateLoading', true);
const res = await findDataInfo(params)
if(res && res.code === 200){
this.info = res.data.content || ""
}
this.setLoading('rateLoading', false);
},
}
}

View File

@ -63,7 +63,21 @@
</section>
<section class="rightText">
<h2>{{$t(`course.rateRelated`)}}</h2>
<section class="rightContent">
<div v-if="rateLoading" class="loading-container">
<span class="loading-text">正在加载内容...</span>
</div>
<div v-else-if="info && info.trim()" class="dynamic-content" v-html="info"></div>
<div v-else class="no-content">
<p>暂无内容</p>
</div>
</section>
<!-- ----------------------------- -->
<!-- <h2>{{$t(`course.rateRelated`)}}</h2>
<section class="table">
<div class="tableTitle">
<span>{{$t(`course.currency`)}}</span>
@ -76,7 +90,6 @@
<li v-for="item in rateList" :key="item.value">
<span class="coin"><img :src="item.img" alt="coin" loading="lazy"> {{item.label}}</span>
<span>{{item.address}}</span>
<!-- <span v-if="item.value === 'enx'"> {{ $t(`course.timeLimited`) }} 0%</span> -->
<span >{{item.rate}}</span>
<span>{{item.mode}}</span>
<span>{{item.quota}}</span>
@ -84,7 +97,7 @@
</ul>
</section>
</section> -->
</section>
@ -282,6 +295,8 @@ export default {
padding: 10px;
text-align: center;
padding-top:30px;
background: #fff;
padding: 20px;
h2{
text-align: left;
padding-left: 50px;
@ -353,4 +368,42 @@ export default {
}
}
.dynamic-content {
width: 100%;
margin: 0 auto;
//
:deep(table) {
border-collapse: collapse;
width: 100%;
margin: 16px 0;
}
:deep(th), :deep(td) {
border: 1px solid #d1d5db;
padding: 8px 12px;
text-align: left;
}
:deep(th) {
background: #f3f4f6;
font-weight: bold;
}
:deep(strong), :deep(b) {
font-weight: bold !important;
color: inherit !important;
font-style: normal !important;
}
:deep(em), :deep(i) {
font-style: italic !important;
color: inherit !important;
}
:deep(a) {
color: #007bff !important;
text-decoration: none !important;
&:hover {
text-decoration: underline !important;
}
}
}
</style>