1显示价格

This commit is contained in:
2025-07-26 09:07:49 +08:00
parent 0e2a055fdd
commit cb3857fc52

View File

@ -526,9 +526,14 @@
:loading="loading" :loading="loading"
> >
<div style="text-align: right"> <div style="text-align: right">
<vs-button olor="primary" type="border" @click="getIpList" <div style=" display: flex;align-items: center;scrollbar-gutter: 20px;column-gap: 20px;justify-content: right;">
<span>价格U: {{this.price}}</span> <vs-button olor="primary" type="border" @click="getIpList"
>刷新</vs-button >刷新</vs-button
> >
</div>
<vs-table :data="useList" class="tablex"> <vs-table :data="useList" class="tablex">
<template slot="thead"> <template slot="thead">
<vs-th class="table-cell-center"> IP </vs-th> <vs-th class="table-cell-center"> IP </vs-th>
@ -614,7 +619,10 @@
</vs-select> </vs-select>
</div> </div>
<div style="text-align: right"> <div class="form-item" style="text-align: right;">
价格U: {{this.price}}
</div>
<div class="form-item" style="text-align: right">
<vs-button size="small" @click="handleGetTrafficProxy" <vs-button size="small" @click="handleGetTrafficProxy"
>提取</vs-button >提取</vs-button
> >
@ -801,7 +809,9 @@
showGetSms:false, showGetSms:false,
smsForm:{}, smsForm:{},
checkSmsCodeTimer:null, checkSmsCodeTimer:null,
smsPrice:undefined smsPrice:undefined,
//Ip单价
price:undefined,
}; };
}, },
mounted() { mounted() {
@ -884,6 +894,38 @@
console.log("获取服务错误:",error); console.log("获取服务错误:",error);
}); });
}, },
getPrice(){
this.price=undefined;
let configKey;
switch(this.activeMenu){
case 1:
configKey="ip_deduction_standard";
break;
case 2:
configKey="deduction_standard";
break;
default:
return;
}
fetch(`${requestApi}/configKey/${configKey}`,{
headers: {
Authorization: `Bearer ${this.token}`,
"Content-Type": "application/json",
Accept: "application/json",
}
})
.then((res) => res.json())
.then((response) => {
if (response.code === 200) {
this.price=Number(response.data.configValue);
}
})
.catch((error) => {
console.log(error);
});
},
showLoading(ref) { showLoading(ref) {
// ref.$el.setAttribute("disabled", true); // ref.$el.setAttribute("disabled", true);
this.$vs.loading(); this.$vs.loading();
@ -917,6 +959,7 @@
window.location.href = "/"; window.location.href = "/";
}, },
handleGetProxy() { handleGetProxy() {
this.getPrice();
if (this.activeMenu === 1) { if (this.activeMenu === 1) {
this.showUseProxy = true; this.showUseProxy = true;
this.getIpList(); this.getIpList();