1、取消自动续费价格显示
2、增加清除数据 3、默认自动续期开启
This commit is contained in:
		
							
								
								
									
										186
									
								
								cli-traffic.html
									
									
									
									
									
								
							
							
						
						
									
										186
									
								
								cli-traffic.html
									
									
									
									
									
								
							| @ -174,14 +174,8 @@ | |||||||
|                 @click="handleGetProxy" |                 @click="handleGetProxy" | ||||||
|                 >获取代理</vs-button |                 >获取代理</vs-button | ||||||
|               > |               > | ||||||
|               <!-- <vs-button |                | ||||||
|                 color="warning" |               <vs-button color="danger" type="filled" size="small" @click="handleClearProxy">清除数据</vs-button> | ||||||
|                 type="border" |  | ||||||
|                 size="small" |  | ||||||
|                 @click="handleRecharge" |  | ||||||
|               > |  | ||||||
|                 余额充值 |  | ||||||
|               </vs-button> --> |  | ||||||
|               </div> |               </div> | ||||||
|                |                | ||||||
|             </div> |             </div> | ||||||
| @ -224,6 +218,7 @@ | |||||||
|                 @click="handleShowGetSms" |                 @click="handleShowGetSms" | ||||||
|                 >租赁号码</vs-button |                 >租赁号码</vs-button | ||||||
|               > |               > | ||||||
|  |               <vs-button color="danger" type="filled" size="small" @click="handleClearSms">清除数据</vs-button> | ||||||
|               </div> |               </div> | ||||||
|             </div> |             </div> | ||||||
|  |  | ||||||
| @ -233,12 +228,8 @@ | |||||||
|                   <vs-th> ID</vs-th> |                   <vs-th> ID</vs-th> | ||||||
|                   <vs-th> 国家/地区 </vs-th> |                   <vs-th> 国家/地区 </vs-th> | ||||||
|                   <vs-th> 城市 </vs-th> |                   <vs-th> 城市 </vs-th> | ||||||
|                   <!-- <vs-th> 端口 </vs-th> |  | ||||||
|                   <vs-th> 账号 </vs-th> |  | ||||||
|                   <vs-th> 密码 </vs-th> --> |  | ||||||
|                   <vs-th> 状态 </vs-th> |                   <vs-th> 状态 </vs-th> | ||||||
|                   <vs-th> 过期时间 </vs-th> |                   <vs-th> 过期时间 </vs-th> | ||||||
|                   <!-- <vs-th> 自动续费 </vs-th> --> |  | ||||||
|                   <vs-th> 操作 </vs-th> |                   <vs-th> 操作 </vs-th> | ||||||
|                 </template> |                 </template> | ||||||
|  |  | ||||||
| @ -286,21 +277,6 @@ | |||||||
|                       <vs-button color="warning"class="operat-btn"  size="small" @click="handleDeleteProxy(data[indextr])"> |                       <vs-button color="warning"class="operat-btn"  size="small" @click="handleDeleteProxy(data[indextr])"> | ||||||
|                         删除 |                         删除 | ||||||
|                       </vs-button> |                       </vs-button> | ||||||
|                       <!-- <vs-button |  | ||||||
|                         style="margin-left: 10px" |  | ||||||
|                         class="operat-btn"  |  | ||||||
|                         v-if="data[indextr].status === 1" |  | ||||||
|                         size="small" |  | ||||||
|                         color="primary" |  | ||||||
|                         @click="handleResetGenerateProxy(data[indextr])" |  | ||||||
|                         >重置</vs-button |  | ||||||
|                       > --> |  | ||||||
|                       <!-- <vs-button v-if="data[indextr].status === 1" |  | ||||||
|                        color="rgb(187, 138, 200)"  |  | ||||||
|                        class="operat-btn"  |  | ||||||
|                        text-color="warning"  |  | ||||||
|                        size="small"  |  | ||||||
|                        @click="renewal(data[indextr])">续期</vs-button> --> |  | ||||||
|                     </vs-td> |                     </vs-td> | ||||||
|                   </vs-tr> |                   </vs-tr> | ||||||
|                 </template> |                 </template> | ||||||
| @ -535,13 +511,10 @@ | |||||||
|       > |       > | ||||||
|         <div style="text-align: right"> |         <div style="text-align: right"> | ||||||
|           <div style="    display: flex;align-items: center;scrollbar-gutter: 20px;column-gap: 20px;justify-content: right;"> |           <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" |             <span>价格U: {{this.price}}</span> <vs-button olor="primary" type="border" size="small" @click="getIpList" | ||||||
|             >刷新</vs-button |             >刷新</vs-button | ||||||
|           > |           > | ||||||
|           </div> |           </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> | ||||||
| @ -566,6 +539,7 @@ | |||||||
|                 <vs-td :data="data[indextr].id" class="table-cell-center"> |                 <vs-td :data="data[indextr].id" class="table-cell-center"> | ||||||
|                   <vs-button |                   <vs-button | ||||||
|                     color="primary" |                     color="primary" | ||||||
|  |                     size="small" | ||||||
|                     @click="handleUseProxy(data[indextr])" |                     @click="handleUseProxy(data[indextr])" | ||||||
|                     >提取</vs-button |                     >提取</vs-button | ||||||
|                   > |                   > | ||||||
| @ -1276,17 +1250,17 @@ | |||||||
|         }, |         }, | ||||||
|         handleActiveMenu(index) { |         handleActiveMenu(index) { | ||||||
|           this.activeMenu = index; |           this.activeMenu = index; | ||||||
|           console.log('index',index); |            | ||||||
|           switch(index){ |           switch(index){ | ||||||
|             case 1: |             case 1: | ||||||
|             case 2: |             case 2: | ||||||
|               this.query.page=1; |               this.query.page=1; | ||||||
|               this.query.total=0; |               this.query.total=1; | ||||||
|               this.reloadList(); |               this.reloadList(); | ||||||
|               break; |               break; | ||||||
|             case 3: |             case 3: | ||||||
|               this.smsQuery.page=1; |               this.smsQuery.page=1; | ||||||
|               this.smsQuery.total=0; |               this.smsQuery.total=1; | ||||||
|               this.smsForm.type=0; |               this.smsForm.type=0; | ||||||
|               this.smsForm.serviceCode=""; |               this.smsForm.serviceCode=""; | ||||||
|               this.smsForm.period=undefined; |               this.smsForm.period=undefined; | ||||||
| @ -1295,7 +1269,7 @@ | |||||||
|               break; |               break; | ||||||
|             case 4: |             case 4: | ||||||
|               this.smsQuery.page=1; |               this.smsQuery.page=1; | ||||||
|               this.smsQuery.total=0; |               this.smsQuery.total=1; | ||||||
|               this.smsForm.type=1; |               this.smsForm.type=1; | ||||||
|               this.smsForm.serviceCode=""; |               this.smsForm.serviceCode=""; | ||||||
|               this.smsForm.period=undefined; |               this.smsForm.period=undefined; | ||||||
| @ -1309,6 +1283,7 @@ | |||||||
|           this.getMyProxy(); |           this.getMyProxy(); | ||||||
|         }, |         }, | ||||||
|         getMyProxy() { |         getMyProxy() { | ||||||
|  |           console.log("触发getMyProxy"); | ||||||
|           this.showLoading(); |           this.showLoading(); | ||||||
|           let query = { |           let query = { | ||||||
|             type: this.activeMenu, |             type: this.activeMenu, | ||||||
| @ -1336,7 +1311,9 @@ | |||||||
|                   response.data.count / this.query.pageSize |                   response.data.count / this.query.pageSize | ||||||
|                 ); |                 ); | ||||||
|  |  | ||||||
|  |                 if(this.query.total!==total){ | ||||||
|                 this.query.total = total; |                 this.query.total = total; | ||||||
|  |                 } | ||||||
|               } |               } | ||||||
|             }) |             }) | ||||||
|             .catch((error) => { |             .catch((error) => { | ||||||
| @ -1529,13 +1506,11 @@ | |||||||
|         // 切换状态 |         // 切换状态 | ||||||
|         async onSwitchChange(val,row,index){ |         async onSwitchChange(val,row,index){ | ||||||
|             let text = val?'启用':'取消'; |             let text = val?'启用':'取消'; | ||||||
|             let price=await this.getPriceByKey("long_number_renew_deduction_standard") |  | ||||||
|             let tip=val?`费用:${price}U/30天,`:''; |  | ||||||
|  |  | ||||||
|             this.$vs.dialog({ |             this.$vs.dialog({ | ||||||
|                 color:"primary", |                 color:"primary", | ||||||
|                 title:"提示", |                 title:"提示", | ||||||
|                 text: `${tip}确定${text}自动续期吗?`, |                 text: `确定${text}自动续期吗?`, | ||||||
|                 acceptText:"确定", |                 acceptText:"确定", | ||||||
|                 accept:() => this.doSwitchProxyAutoRenewal(row,val) |                 accept:() => this.doSwitchProxyAutoRenewal(row,val) | ||||||
|             }); |             }); | ||||||
| @ -2026,10 +2001,9 @@ | |||||||
|         }, |         }, | ||||||
|         //长效号码续期状态修改 |         //长效号码续期状态修改 | ||||||
|        async handleSmsRenew(val,row,index){ |        async handleSmsRenew(val,row,index){ | ||||||
|           let price=await this.getPriceByKey("long_number_renew_deduction_standard") |  | ||||||
|           const newState=val?1:2; |           const newState=val?1:2; | ||||||
|           const originalState = row.autoRenewal; |           const originalState = row.autoRenewal; | ||||||
|           const title=val?`续费标准 ${price}U/30天, 确定要对[${row.phone}]的短信服务续期吗?`:"确认取消自动续费吗?"; |           const title=val?`确定要对[${row.phone}]的短信服务续期吗?`:"确认取消自动续费吗?"; | ||||||
|           this.$vs.dialog({ |           this.$vs.dialog({ | ||||||
|                 color:"primary", |                 color:"primary", | ||||||
|                 title: `提示`, |                 title: `提示`, | ||||||
| @ -2138,7 +2112,137 @@ | |||||||
|              .finally(() => { |              .finally(() => { | ||||||
|                 this.hiddenLoading(); |                 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(); | ||||||
|  |             }); | ||||||
|  |         }, | ||||||
|       }, |       }, | ||||||
|     }); |     }); | ||||||
|   </script> |   </script> | ||||||
|  | |||||||
| @ -9,6 +9,7 @@ if (window.location.protocol === "file:") { | |||||||
|   // 部署到服务器时自动适配 |   // 部署到服务器时自动适配 | ||||||
|   requestApi = `${window.location.protocol}//${window.location.host}/api/v1`; |   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 kwdValue = new URLSearchParams(window.location.search).get('kwd'); | ||||||
| let invitCode = new URLSearchParams(window.location.search).get('code'); | let invitCode = new URLSearchParams(window.location.search).get('code'); | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user