取消enx活动图片 费率改为1%

This commit is contained in:
2025-04-22 14:26:41 +08:00
parent 4d436c725e
commit 368d0a8a10
45 changed files with 2581 additions and 234 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -3,10 +3,10 @@
<section v-if="$isMobile">
<div class="imgTop">
<!-- <img src="../../assets/mobile/home/home.png" alt="mining" loading="lazy" /> -->
<img src="../../assets/mobile/home/home.png" alt="mining" loading="lazy" />
<!--
<img v-if="lang == 'zh'" src="../../assets/img/enx推广.png" alt="mining" loading="lazy"/>
<img v-else src="../../assets/img/enx英文推广.png" alt="mining" loading="lazy"/>
<img v-else src="../../assets/img/enx英文推广.png" alt="mining" loading="lazy"/> -->
</div>
@@ -329,13 +329,12 @@
</section>
<div class="content" v-else v-loading="minerChartLoading">
<div class="bgBox">
<!--
<img v-if="lang == 'zh'" class="bgBoxImg2Img" src="../../assets/img/enx推广.png" alt="mining" loading="lazy"/>
<img v-else class="bgBoxImg2Img" src="../../assets/img/enx英文推广.png" alt="mining" loading="lazy"/>
<!-- <img class="bgBoxImg" src="../../assets/img/enx推广.png" style="width: 100%;height: 100%;" alt="mining" loading="lazy"/> -->
<img v-else class="bgBoxImg2Img" src="../../assets/img/enx英文推广.png" alt="mining" loading="lazy"/> -->
<img class="bgImg" src="../../assets/img/home.png" alt="mining" loading="lazy"/>
</div>
<el-row>
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
@@ -785,6 +784,7 @@ export default {
p{
width: 100% ;
background: transparent ;
padding-left: 8px;
}
i{
@@ -1295,16 +1295,44 @@ export default {
@media screen and (min-width:800px) and (max-width: 1279px) {
.imgTop {
width: 100%;
// padding-left: 10%;
text-align: center;
padding-left: 20%;
text-align: left;
img {
width: 100%;
width: auto ;
height:300px;
}
}
#chart {
height: 400px !important;
}
.describeBox2{
width: 100%;
font-size: 0.9rem;
padding: 8px;
margin: 0 auto;
p{
width: 100% ;
background: transparent ;
padding-left: 8px;
}
i{
color: #5721e4;
margin-right: 5px;
}
.describeTitle{
color: #5721e4;
font-weight: 600;
font-size: 0.95rem;
}
.view{
color: #5721e4;
margin-left: 5px;
}
}
.moveCurrencyBox {
@@ -2046,7 +2074,7 @@ export default {
.bgBox {
// background: gold;
width: 100%;
// height: 380px;
height: 300px;
box-sizing: border-box;
// background-position: 50% 28%;
// background-size: cover;
@@ -2059,12 +2087,20 @@ export default {
// background-position: 13.2vw 0 ;
// background-repeat: no-repeat;
// margin-top: 50px;
margin: 30px 0px;
// margin: 30px 0px;
text-align: center;
text-align: left;
.bgImg{
height: 100%;
width: auto ;
position: absolute;
left: 25vw;
top: 0;
}
.bgBoxImg {
height: 100%;
width: auto;
position: absolute;
left: 23%;
transition: all 0.3s linear;

View File

@@ -69,7 +69,7 @@ export default {
value:"enx",
label:"Entropyx(Enx)",
img:`${this.$baseApi}img/enx.svg`,
rate:"0",
rate:"1%",
address:"",
mode:"PPLNS+PROPDIF",
quota:"5000",

View File

@@ -12,8 +12,8 @@
<template slot="title">
<div class="collapseTitle">
<span ><img :src="item.img" alt="coin" loading="lazy"> {{item.label}}</span>
<span v-if="item.value === 'enx'"> {{ $t(`course.timeLimited`) }} 0%</span>
<span v-else>{{item.rate}}</span>
<!-- <span v-if="item.value === 'enx'"> {{ $t(`course.timeLimited`) }} 0%</span> -->
<span >{{item.rate}}</span>
</div>
</template>
<section class="contentBox2">
@@ -76,8 +76,8 @@
<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 v-else>{{item.rate}}</span>
<!-- <span v-if="item.value === 'enx'"> {{ $t(`course.timeLimited`) }} 0%</span> -->
<span >{{item.rate}}</span>
<span>{{item.mode}}</span>
<span>{{item.quota}}</span>
</li>

View File

@@ -1,153 +1,397 @@
<template>
<div style="width: 1300px; height: 600px">
<div id="chart" style="width: 100%; height: 100%; min-width: 500px"></div>
<div>
<h1>{{ msg }}</h1>
<!-- 用户ID输入部分 -->
<div class="user-input-container">
<div class="input-group" :class="{ 'disabled': isConnected }">
<input
v-model="email"
placeholder="请输入您的用户邮箱"
:disabled="isConnected"
/>
<input
v-model="targetEmail"
placeholder="请输入目标用户邮箱"
:disabled="isConnected"
@keyup.enter="!isConnected && !isConnecting && connectWebSocket()"
/>
</div>
<div class="button-group">
<button
@click="connectWebSocket"
:disabled="isConnected || isConnecting || !email || !targetEmail"
:class="{ 'disabled': isConnected || isConnecting || !email || !targetEmail }"
>
{{ isConnecting ? '连接中...' : '连接' }}
</button>
<button
v-if="isConnected"
@click="disconnectWebSocket"
class="disconnect-btn"
>
断开连接
</button>
</div>
</div>
<div v-if="connectionError" class="error-message">
{{ connectionError }}
</div>
<div v-if="isConnected">
<!-- WebSocket 聊天部分 -->
<div class="chat-container">
<div class="message-list" ref="messageList">
<div v-for="(msg, index) in receivedMessages" :key="index" class="message"
:class="{ 'error-message': msg.error }">
<div v-if="typeof msg === 'string'">{{ msg }}</div>
<div v-else>
<div class="message-header">
<span class="message-sender">{{ msg.sender || 'Unknown' }}</span>
<span class="message-time">{{ formatTime(msg.timestamp) }}</span>
</div>
<div class="message-content">{{ msg.content }}</div>
</div>
</div>
</div>
<div class="input-container">
<textarea
v-model="message"
@keyup.enter="sendMessage"
placeholder="输入消息..."
rows="3"
></textarea>
<button @click="sendMessage" :disabled="!message.trim()">
发送
</button>
</div>
</div>
</div>
</div>
</template>
<script>
import * as echarts from "echarts";
export default {
data() {
return {
countDownTime: 60,
timer: null,
};
},
<script setup>
import { ref, onMounted, onUnmounted, nextTick, watch } from 'vue'
import { Stomp } from '@stomp/stompjs'
mounted() {
let base = +new Date(1968, 9, 3);
let oneDay = 24 * 3600 * 1000;
let date = [];
let data = [Math.random() * 300];
for (let i = 1; i < 20000; i++) {
var now = new Date((base += oneDay));
date.push([now.getFullYear(), now.getMonth() + 1, now.getDate()].join("/"));
data.push(Math.round((Math.random() - 0.5) * 20 + data[i - 1]));
const props = defineProps({
msg: {
type: String,
required: true
}
})
const message = ref('')
const receivedMessages = ref([])
const email = ref('')
const targetEmail = ref('')
const isConnected = ref(false)
const isConnecting = ref(false)
const connectionError = ref('')
const messageList = ref(null)
// 创建一个响应式的 stompClient
const stompClient = ref(null)
// 添加连接时间变量
const connectTime = ref(null)
// 自动滚动到底部
const scrollToBottom = async () => {
await nextTick()
if (messageList.value) {
messageList.value.scrollTop = messageList.value.scrollHeight
}
}
// 监听消息列表变化,自动滚动
watch(receivedMessages, () => {
scrollToBottom()
})
// 格式化时间
const formatTime = (timestamp) => {
if (!timestamp) return ''
try {
const date = new Date(timestamp)
return date.toLocaleTimeString()
} catch (e) {
return ''
}
}
// 连接WebSocket
const connectWebSocket = () => {
if (!email.value || !targetEmail.value) {
connectionError.value = '请输入用户邮箱和目标用户邮箱'
return
}
connectionError.value = ''
isConnecting.value = true
connectTime.value = new Date() // 记录连接时间
try {
stompClient.value = Stomp.client('ws://localhost:8101/chat/ws')
stompClient.value.heartbeat.outgoing = 20000
stompClient.value.heartbeat.incoming = 0
const connectHeaders = {
'email': email.value,
'type': 2 //0 游客 1 登录用户 2 客服
}
// 添加 10 个空数据在前后
for (let i = 0; i < 100; i++) {
date.unshift(null);
data.unshift(null);
}
for (let i = 0; i < 100; i++) {
date.push(null);
data.push(null);
}
var option = {
tooltip: {
trigger: "axis",
position: function (pt) {
return [pt[0], "10%"];
},
stompClient.value.connect(
connectHeaders,
function(frame) {
console.log('连接成功: ' + frame)
console.log('连接时间:', connectTime.value?.toLocaleString())
isConnected.value = true
isConnecting.value = false
// 添加系统消息
receivedMessages.value.push({
sender: 'System',
content: '已连接到聊天服务器',
timestamp: new Date().toISOString(),
system: true
})
// 订阅自己管道的消息
stompClient.value.subscribe(`/user/queue/${email.value}`, function(message) {
console.log('收到消息:', message.body)
try {
const parsedMessage = JSON.parse(message.body)
receivedMessages.value.push(parsedMessage)
} catch (error) {
console.error('消息解析失败:', error)
receivedMessages.value.push({
sender: 'System',
content: `消息格式错误: ${message.body}`,
timestamp: new Date().toISOString(),
error: true
})
}
})
},
title: {
left: "center",
text: "Large Area Chart",
},
toolbox: {
feature: {
dataZoom: {
yAxisIndex: "none",
},
restore: {},
saveAsImage: {},
},
},
xAxis: {
type: "category",
// boundaryGap: [0.5, 0.5],
data: date,
},
yAxis: [
{
type: "value",
boundaryGap: [0, "100%"],
axisLine: {
show: true, // 显示 Y 轴线条
},
},
{
position: "right",
type: "value",
boundaryGap: [0, "100%"],
},
],
dataZoom: [
{
type: "inside",
start: 0,
end: 10,
},
{
start: 0,
end: 10,
},
],
series: [
{
name: "Fake Data",
type: "line",
symbol: "none",
sampling: "lttb",
itemStyle: {
color: "rgb(255, 70, 131)",
},
data: data,
},
],
};
this.myChart = echarts.init(document.getElementById("chart"));
this.myChart.setOption(option);
window.addEventListener(
"resize", () => {
if (this.myChart) this.myChart.resize();
function(error) {
console.error('连接失败:', error)
isConnected.value = false
isConnecting.value = false
connectionError.value = `连接失败: ${error.headers?.message || error.message || '未知错误'}`
}
);
},
methods: {
//初始化图表
inCharts() {
if (this.myChart == null) {
this.myChart = echarts.init(document.getElementById("chart"));
)
} catch (error) {
console.error('初始化WebSocket客户端失败:', error)
isConnected.value = false
isConnecting.value = false
connectionError.value = `初始化失败: ${error.message || '未知错误'}`
}
}
// 添加断开连接方法
const disconnectWebSocket = () => {
if (stompClient.value?.connected) {
stompClient.value.disconnect(() => {
const disconnectTime = new Date()
const duration = connectTime.value ?
Math.floor((disconnectTime.getTime() - connectTime.value.getTime()) / 1000) : 0
console.log('断开连接时间:', disconnectTime.toLocaleString())
console.log(`连接持续时间: ${Math.floor(duration / 60)}${duration % 60}`)
isConnected.value = false
receivedMessages.value = []
connectTime.value = null
// 添加提示
connectionError.value = '已断开连接'
setTimeout(() => {
connectionError.value = ''
}, 3000)
})
}
}
// 发送消息方法
const sendMessage = () => {
if (!message.value.trim()) return
if (stompClient.value?.connected) {
try {
const messageObj = {
email: targetEmail.value,
content: message.value.trim()
}
stompClient.value.send(
`/point/send/message`,
{},
JSON.stringify(messageObj)
)
// 添加自己发送的消息到显示列表
receivedMessages.value.push({
sender: email.value,
content: message.value.trim(),
timestamp: new Date().toISOString(),
isSelf: true
})
message.value = ''
} catch (error) {
console.error('发送消息失败:', error)
receivedMessages.value.push({
sender: 'System',
content: `发送失败: ${error.message || '未知错误'}`,
timestamp: new Date().toISOString(),
error: true
})
}
} else {
connectionError.value = '连接已断开,请重新连接'
isConnected.value = false
}
}
this.option.series[0].name = this.$t(`home.computingPower`);
this.option.series[1].name = this.$t(`home.currencyPrice`);
// 组件卸载时断开连接
onUnmounted(() => {
if (stompClient.value?.connected) {
stompClient.value.disconnect()
}
})
</script>
this.myChart.setOption(this.option);
// 回调函数,在渲染完成后执行
this.myChart.on("finished", () => {
// 在这里执行显示给用户的操作
// console.log('图表渲染完成,显示给用户');
this.minerChartLoading = false;
});
// window.addEventListener("resize", () => {
// if (this.myChart) this.myChart.resize();
// });
<style scoped>
.read-the-docs {
color: #888;
}
window.addEventListener(
"resize",
throttle(() => {
if (this.myChart) this.myChart.resize();
}, 200)
);
},
startCountDown() {
this.timer = setInterval(() => {
if (this.countDownTime <= 0) {
//当监测到countDownTime为0时,清除计数器并且移除sessionStorage,然后执行提交试卷逻辑
clearInterval(this.timer);
sessionStorage.removeItem("exam_time");
alert("提交试卷");
} else if (this.countDownTime > 0) {
//每秒让countDownTime -1秒,并设置到sessionStorage中
this.countDownTime--;
window.sessionStorage.setItem("exam_time", this.countDownTime);
}
}, 1000);
},
},
};
</script>
.user-input-container {
max-width: 400px;
margin: 20px auto;
}
.input-group {
display: flex;
gap: 10px;
margin-bottom: 10px;
}
.chat-container {
max-width: 600px;
margin: 20px auto;
padding: 20px;
border: 1px solid #ddd;
border-radius: 8px;
box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.message-list {
height: 300px;
overflow-y: auto;
border: 1px solid #eee;
padding: 10px;
margin-bottom: 10px;
border-radius: 4px;
}
.message {
margin: 8px 0;
padding: 10px;
background-color: #f5f5f5;
border-radius: 8px;
max-width: 80%;
}
.message-header {
display: flex;
justify-content: space-between;
font-size: 0.8em;
margin-bottom: 4px;
}
.message-sender {
font-weight: bold;
color: #333;
}
.message-time {
color: #999;
}
.message-content {
word-break: break-word;
}
.message[class*="isSelf"] {
background-color: #dcf8c6;
margin-left: auto;
}
.error-message {
background-color: #ffebee;
color: #d32f2f;
padding: 8px;
border-radius: 4px;
margin: 10px 0;
text-align: center;
}
.input-container {
display: flex;
gap: 10px;
}
input, textarea {
flex: 1;
padding: 10px;
border: 1px solid #ddd;
border-radius: 4px;
font-family: inherit;
resize: none;
}
button {
padding: 8px 16px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
}
button:hover:not(:disabled) {
background-color: #45a049;
}
button:disabled {
opacity: 0.6;
cursor: not-allowed;
}
.button-group {
display: flex;
gap: 10px;
}
.disabled {
opacity: 0.6;
cursor: not-allowed;
}
.disconnect-btn {
background-color: #dc3545;
}
.disconnect-btn:hover {
background-color: #c82333;
}
input:disabled, textarea:disabled {
background-color: #f5f5f5;
cursor: not-allowed;
}
</style>

View File

@@ -105,9 +105,9 @@ export default {
console.log(res,"文件返回");
this.ruleForm.files = res.data.data.id
if (this.ruleForm.files) {//成功拿到返回ID
this.fetchSubmitWork(this.ruleForm)
}
// if (this.ruleForm.files) {//成功拿到返回ID
// this.fetchSubmitWork(this.ruleForm)
// }
})
} else {