1.添加alph币种(矿池分配及转账规则页面、费率页面、挖矿教程页面、起付额度限制、最新报块跳转、支付id跳转) 完成
2.api文档页面修改8个接口请求方式为post 3.优化代码币种添加通用币种信息及挖矿教程页面跳转通用 4.m2pool断网重连 60秒内重连 处理中 5.收益计算器显示值修改 取消四舍五入 直接保留10位小数 添加千位符分隔显示 6.coinbus 添加seo相关配置及站点地图 处理中
This commit is contained in:
291
mining-pool/src/views/alerts/index.js
Normal file
291
mining-pool/src/views/alerts/index.js
Normal file
@@ -0,0 +1,291 @@
|
||||
import {getAddNoticeEmail,getCode,getList,getUpdateInfo,deleteEmail} from "../../api/alerts";
|
||||
import {getImageUrl} from "../../utils/publicMethods";
|
||||
export default {
|
||||
data() {
|
||||
return{
|
||||
receiveData:{
|
||||
img:"",
|
||||
maId:"",
|
||||
coin:"",
|
||||
ma:"",
|
||||
},
|
||||
dialogVisible:false,
|
||||
params:{
|
||||
email:"",
|
||||
remark:"",
|
||||
code:"",
|
||||
maId:""
|
||||
},
|
||||
tableData:[
|
||||
{
|
||||
email:"5656",
|
||||
}
|
||||
],
|
||||
alertsLoading:false,
|
||||
|
||||
addMinerLoading:false,
|
||||
btnDisabled: false,
|
||||
btnDisabledClose: false,
|
||||
btnDisabledPassword: false,
|
||||
bthText: "user.obtainVerificationCode",
|
||||
bthTextClose: "user.obtainVerificationCode",
|
||||
bthTextPassword: "user.obtainVerificationCode",
|
||||
time: "",
|
||||
countDownTime: 60,
|
||||
timer: null,
|
||||
countDownTimeClose: 60,
|
||||
timerclose: null,
|
||||
countDownTimePassword: 60,
|
||||
timerPassword: null,
|
||||
listParams:{
|
||||
maId:"",
|
||||
limit:10,
|
||||
page:1,
|
||||
|
||||
},
|
||||
modifyDialogVisible:false,
|
||||
modifyRemark:"",
|
||||
modifyParams:{
|
||||
id:"",
|
||||
remark:"",
|
||||
},
|
||||
deleteLoading:false,
|
||||
userEmail:"",
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
countDownPassword() {
|
||||
const minutes = Math.floor(this.countDownTimePassword / 60);
|
||||
const seconds = this.countDownTimePassword % 60;
|
||||
const m = minutes < 10 ? "0" + minutes : minutes;
|
||||
const s = seconds < 10 ? "0" + seconds : seconds;
|
||||
return `${s}`;
|
||||
// return`${s}`
|
||||
},
|
||||
|
||||
},
|
||||
created() {
|
||||
|
||||
if (window.sessionStorage.getItem("alerts_time")) {
|
||||
this.countDownTimePassword = Number(window.sessionStorage.getItem("alerts_time"));
|
||||
this.startCountDownPassword()
|
||||
this.btnDisabledPassword = true;
|
||||
this.bthTextPassword = `user.again`
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
|
||||
mounted() {
|
||||
let userEmail=localStorage.getItem("userEmail")
|
||||
this.userEmail= JSON.parse(userEmail)
|
||||
window.addEventListener("setItem", () => {
|
||||
let userEmail=localStorage.getItem("userEmail")
|
||||
this.userEmail= JSON.parse(userEmail)
|
||||
});
|
||||
this.params.email = this.userEmail
|
||||
if (this.$route.query) {
|
||||
this.receiveData = this.$route.query;
|
||||
this.listParams.maId = this.receiveData.id
|
||||
this.params.maId = this.receiveData.id
|
||||
}
|
||||
this.fetchList(this.listParams)
|
||||
|
||||
|
||||
},
|
||||
methods:{
|
||||
getImageUrl(path) {
|
||||
return getImageUrl(path);
|
||||
},
|
||||
async fetchAddNoticeEmail(params){
|
||||
this.addMinerLoading = true
|
||||
const data = await getAddNoticeEmail(params)
|
||||
if (data && data.code == 200) {
|
||||
this.$message({
|
||||
type: "success",
|
||||
message:this.$t("alerts.addedSuccessfully"),
|
||||
|
||||
});
|
||||
this.fetchList(this.listParams)
|
||||
|
||||
this.dialogVisible = false
|
||||
|
||||
for (const key in this.params) {
|
||||
|
||||
|
||||
if (key !== "maId") {
|
||||
this.params[key] =""
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
this.addMinerLoading = false
|
||||
|
||||
},
|
||||
async fetchList(params){
|
||||
this.alertsLoading=true
|
||||
const data = await getList(params)
|
||||
if (data && data.code == 200) {
|
||||
this.tableData = data.rows
|
||||
|
||||
}
|
||||
this.alertsLoading=false
|
||||
|
||||
},
|
||||
async fetchCode(params){
|
||||
const data = await getCode(params)
|
||||
if (data && data.code == 200) {
|
||||
this.$message({
|
||||
type: "success",
|
||||
message:this.$t("user.verificationCodeSuccessful"),//this.$t("user.addSuccess")
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
async fetchUpdateInfo(params){
|
||||
this.addMinerLoading = true
|
||||
const data = await getUpdateInfo(params)
|
||||
if (data && data.code == 200) {
|
||||
this.$message({
|
||||
type: "success",
|
||||
message:this.$t("alerts.modifiedSuccessfully"),//this.$t("user.addSuccess")
|
||||
|
||||
});
|
||||
this.modifyDialogVisible = false
|
||||
this.fetchList(this.listParams)
|
||||
}
|
||||
|
||||
this.addMinerLoading = false
|
||||
|
||||
},
|
||||
async fetchDeleteEmail(params){
|
||||
this.deleteLoading = true
|
||||
const data = await deleteEmail(params)
|
||||
if (data && data.code == 200) {
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: this.$t("alerts.deleteSuccessfully"),//this.$t("user.addSuccess")
|
||||
|
||||
});
|
||||
|
||||
this.fetchList(this.listParams)
|
||||
}
|
||||
|
||||
this.deleteLoading = false
|
||||
|
||||
},
|
||||
|
||||
add(){
|
||||
this.dialogVisible =true
|
||||
},
|
||||
confirmAdd(){
|
||||
//邮箱格式验证
|
||||
const emailRegex =/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}$/;
|
||||
this.params.email = this.params.email.trim()
|
||||
let isMailbox = emailRegex.test(this.params.email);
|
||||
|
||||
if (!this.params.email || !isMailbox) {
|
||||
this.$message({
|
||||
message: this.$t(`user.emailVerification`),
|
||||
type: "error",
|
||||
customClass: "messageClass",
|
||||
showClose: true
|
||||
});
|
||||
return
|
||||
}
|
||||
if ( !this.params.code) {
|
||||
this.$message({
|
||||
message: this.$t(`personal.eCode`),
|
||||
type: "error",
|
||||
customClass: "messageClass",
|
||||
showClose: true
|
||||
});
|
||||
return
|
||||
}
|
||||
|
||||
this.fetchAddNoticeEmail(this.params)
|
||||
},
|
||||
modify(item){
|
||||
|
||||
this.modifyParams.id = item.id
|
||||
this.modifyParams.remark = item.remark
|
||||
this.modifyDialogVisible =true
|
||||
},
|
||||
confirmModify(){
|
||||
if (!this.modifyParams.remark) {
|
||||
this.$message({
|
||||
message:this.$t("alerts.modificationReminder"),
|
||||
type: "error",
|
||||
customClass: "messageClass",
|
||||
showClose: true
|
||||
});
|
||||
|
||||
return
|
||||
}
|
||||
this.fetchUpdateInfo( this.modifyParams)
|
||||
},
|
||||
handelDelete(item){
|
||||
this.fetchDeleteEmail({id:item.id})
|
||||
},
|
||||
handelCode() {
|
||||
//邮箱格式验证
|
||||
const emailRegex =/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}$/;
|
||||
this.params.email = this.params.email.trim()
|
||||
let isMailbox = emailRegex.test(this.params.email);
|
||||
|
||||
if (!this.params.email || !isMailbox) {
|
||||
this.$message({
|
||||
message: this.$t(`user.emailVerification`),
|
||||
type: "error",
|
||||
customClass: "messageClass",
|
||||
showClose: true
|
||||
});
|
||||
return
|
||||
}
|
||||
if (this.listParams.maId !== 0 && !this.listParams.maId) {
|
||||
this.$message({
|
||||
message: this.$t("alerts.acquisitionFailed"),
|
||||
type: "error",
|
||||
customClass: "messageClass",
|
||||
showClose: true
|
||||
});
|
||||
return
|
||||
}
|
||||
|
||||
this.fetchCode({email:this.params.email,maId:this.listParams.maId})
|
||||
|
||||
if (window.sessionStorage.getItem("alerts_time") == null) {
|
||||
this.startCountDownPassword()
|
||||
} else {
|
||||
this.countDownTimePassword = Number(window.sessionStorage.getItem("alerts_time"));
|
||||
this.startCountDownPassword()
|
||||
}
|
||||
|
||||
},
|
||||
startCountDownPassword() {
|
||||
this.timerPassword = setInterval(() => {
|
||||
|
||||
if (this.countDownTimePassword <= 1) {
|
||||
//当监测到countDownTime为0时,清除计数器并且移除sessionStorage,然后执行提交试卷逻辑
|
||||
clearInterval(this.timerPassword);
|
||||
sessionStorage.removeItem("alerts_time");
|
||||
|
||||
this.countDownTimePassword = 60
|
||||
this.btnDisabledPassword = false;
|
||||
this.bthTextPassword = `user.obtainVerificationCode`
|
||||
} else if (this.countDownTimePassword > 0) {
|
||||
//每秒让countDownTimePassword -1秒,并设置到sessionStorage中
|
||||
this.countDownTimePassword--;
|
||||
this.btnDisabledPassword = true;
|
||||
this.bthTextPassword = `user.again`
|
||||
window.sessionStorage.setItem("alerts_time", this.countDownTimePassword);
|
||||
}
|
||||
}, 1000);
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user