From 096b346d546e6632c64bb8a96d2eaa0565cc1a98 Mon Sep 17 00:00:00 2001
From: hucan <951870319@qq.com>
Date: Tue, 29 Jul 2025 18:15:29 +0800
Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=8F=96=E6=B6=88=E8=87=AA=E5=8A=A8?=
 =?UTF-8?q?=E7=BB=AD=E8=B4=B9=E4=BB=B7=E6=A0=BC=E6=98=BE=E7=A4=BA=202?=
 =?UTF-8?q?=E3=80=81=E5=A2=9E=E5=8A=A0=E6=B8=85=E9=99=A4=E6=95=B0=E6=8D=AE?=
 =?UTF-8?q?=203=E3=80=81=E9=BB=98=E8=AE=A4=E8=87=AA=E5=8A=A8=E7=BB=AD?=
 =?UTF-8?q?=E6=9C=9F=E5=BC=80=E5=90=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
 cli-traffic.html    | 186 ++++++++++++++++++++++++++++++++++----------
 static/js/common.js |   1 +
 2 files changed, 146 insertions(+), 41 deletions(-)
diff --git a/cli-traffic.html b/cli-traffic.html
index 73a8849..ec86c0d 100644
--- a/cli-traffic.html
+++ b/cli-traffic.html
@@ -174,14 +174,8 @@
                 @click="handleGetProxy"
                 >获取代理
-              
+              
+              清除数据
               
               
             
@@ -224,6 +218,7 @@
                 @click="handleShowGetSms"
                 >租赁号码
+              清除数据
               
             
 
@@ -233,12 +228,8 @@
                    ID
                    国家/地区 
                    城市 
-                  
                    状态 
                    过期时间 
-                  
                    操作 
                 
 
@@ -286,21 +277,6 @@
                       
                         删除
                       
-                      
-                      
                     
                   
                 
@@ -535,13 +511,10 @@
       >
         
           
-            价格U: {{this.price}} 价格U: {{this.price}} 刷新
           
-          
-
-          
           
             
                IP 
@@ -566,6 +539,7 @@
                 
                   提取
@@ -1276,17 +1250,17 @@
         },
         handleActiveMenu(index) {
           this.activeMenu = index;
-          console.log('index',index);
+          
           switch(index){
             case 1:
             case 2:
               this.query.page=1;
-              this.query.total=0;
+              this.query.total=1;
               this.reloadList();
               break;
             case 3:
               this.smsQuery.page=1;
-              this.smsQuery.total=0;
+              this.smsQuery.total=1;
               this.smsForm.type=0;
               this.smsForm.serviceCode="";
               this.smsForm.period=undefined;
@@ -1295,7 +1269,7 @@
               break;
             case 4:
               this.smsQuery.page=1;
-              this.smsQuery.total=0;
+              this.smsQuery.total=1;
               this.smsForm.type=1;
               this.smsForm.serviceCode="";
               this.smsForm.period=undefined;
@@ -1309,6 +1283,7 @@
           this.getMyProxy();
         },
         getMyProxy() {
+          console.log("触发getMyProxy");
           this.showLoading();
           let query = {
             type: this.activeMenu,
@@ -1336,7 +1311,9 @@
                   response.data.count / this.query.pageSize
                 );
 
+                if(this.query.total!==total){
                 this.query.total = total;
+                }
               }
             })
             .catch((error) => {
@@ -1529,13 +1506,11 @@
         // 切换状态
         async onSwitchChange(val,row,index){
             let text = val?'启用':'取消';
-            let price=await this.getPriceByKey("long_number_renew_deduction_standard")
-            let tip=val?`费用:${price}U/30天,`:'';
 
             this.$vs.dialog({
                 color:"primary",
                 title:"提示",
-                text: `${tip}确定${text}自动续期吗?`,
+                text: `确定${text}自动续期吗?`,
                 acceptText:"确定",
                 accept:() => this.doSwitchProxyAutoRenewal(row,val)
             });
@@ -2026,10 +2001,9 @@
         },
         //长效号码续期状态修改
        async handleSmsRenew(val,row,index){
-          let price=await this.getPriceByKey("long_number_renew_deduction_standard")
           const newState=val?1:2;
           const originalState = row.autoRenewal;
-          const title=val?`续费标准 ${price}U/30天, 确定要对[${row.phone}]的短信服务续期吗?`:"确认取消自动续费吗?";
+          const title=val?`确定要对[${row.phone}]的短信服务续期吗?`:"确认取消自动续费吗?";
           this.$vs.dialog({
                 color:"primary",
                 title: `提示`,
@@ -2138,7 +2112,137 @@
              .finally(() => {
                 this.hiddenLoading();
              })
-        }
+        },
+        //清理代理
+        handleClearProxy(){
+          let type,typeName;
+          switch(this.activeMenu){
+            case 1:
+              type=1;
+              typeName="长效ip";
+              break;
+            case 2:
+              type=2;
+              typeName="短效ip";
+              break;
+            default:
+                break;
+          }
+
+          this.$vs.dialog({
+            color:"primary",
+            title:"提示",
+            text:`确认清理${typeName}数据吗?`,
+            acceptText:"确定",
+            accept:()=>this.doCleanProxy(type)
+          })
+        },
+        doCleanProxy(type){
+          this.showLoading();
+          let data = JSON.stringify({
+            type:type});
+
+          fetch(requestApi + "/member-proxy/clean", {
+            headers: {
+              Authorization: `Bearer ${this.token}`,
+              "Content-Type": "application/json",
+              Accept: "application/json",
+            },
+            method: "DELETE",
+            body: data,
+          })
+           .then((res) => res.json())
+           .then((response) => {
+              if (response.code === 200) {
+                this.$vs.notify({
+                  title: "提示",
+                  color: "success",
+                  text: "清理成功",
+                  position: "top-right",
+                });
+
+                this.getMyProxy();
+              } else {
+                this.$vs.notify({
+                  title: "提示",
+                  color: "danger",
+                  text: response.msg,
+                  position: "top-right",
+                });
+              }
+            })
+           .catch((error) => {
+              console.log(error);
+            })
+           .finally(() => {
+              this.hiddenLoading();
+            });
+        },
+        //清理短信
+        handleClearSms(){
+          let type,typeName;
+          switch(this.activeMenu){
+            case 4:
+              type=1;
+              typeName="长效号码";
+              break;
+            case 3:
+              type=0;
+              typeName="短效号码";
+              break;
+            default:
+                break;
+          }
+
+          this.$vs.dialog({
+            color:"primary",
+            title:"提示",
+            text:`确认清理${typeName}数据吗?`,
+            acceptText:"确定",
+            accept:()=>this.doCleanSms(type)
+          })
+        },
+        doCleanSms(type){
+          this.showLoading();
+          let data = JSON.stringify({
+            type:type});
+
+          fetch(requestApi + "/sms-phone/clean", {
+            headers: {
+              Authorization: `Bearer ${this.token}`,
+              "Content-Type": "application/json",
+              Accept: "application/json",
+            },
+            method: "DELETE",
+            body: data,
+          })
+           .then((res) => res.json())
+           .then((response) => {
+              if (response.code === 200) {
+                this.$vs.notify({
+                  title: "提示",
+                  color: "success",
+                  text: "清理成功",
+                  position: "top-right",
+                });
+
+                this.getSmsList();
+              } else {
+                this.$vs.notify({
+                  title: "提示",
+                  color: "danger",
+                  text: response.msg,
+                  position: "top-right",
+                });
+              }
+            })
+           .catch((error) => {
+              console.log(error);
+            })
+           .finally(() => {
+              this.hiddenLoading();
+            });
+        },
       },
     });
   
diff --git a/static/js/common.js b/static/js/common.js
index 6629952..10e8ef6 100644
--- a/static/js/common.js
+++ b/static/js/common.js
@@ -9,6 +9,7 @@ if (window.location.protocol === "file:") {
   // 部署到服务器时自动适配
   requestApi = `${window.location.protocol}//${window.location.host}/api/v1`;
 }
+// requestApi="https://proxy.apiapl.com/api/v1"
 
 let kwdValue = new URLSearchParams(window.location.search).get('kwd');
 let invitCode = new URLSearchParams(window.location.search).get('code');