const batchRenewpage = { template: /*html */ `
ID:${item.id}:${item.msg}
`; }) .join(""); this.$notify({ title: lang.cart_tip_text25, message: tips, duration: 0, dangerouslyUseHTMLString: true, }); this.$emit("success"); this.subLoading = false; this.confirmDialog = false; if (this.opType === "crack_pass") { this.isShowRePass = false; } }) .catch((err) => { this.subLoading = false; this.$message.error(err.data.msg); if (err.data.data) { if ( !client_operate_password && err.data.data.operate_password === 1 ) { this.$refs.safeRef.openDialog("handelOp"); return; } else { return this.$message.error(err.data.msg); } } }); }, openDia() { this.promo.promo_code = ""; this.discountInputVal = ""; this.currentDiscount = 0; this.batchHostDiscount = {}; this.isShow = true; this.getRenewList(); }, changeCycles(item) { this.discountInputVal = this.promo.promo_code; this.handelApplyPromoCode(false); item.cur_pirce = this.calcPrice(item); item.promo_code_discount = this.calcPrice(item, true); }, calcPrice(row, bol = false) { let temp = 'price'; if (bol) { temp = 'promo_code_discount'; } return ( row.billing_cycles.filter( (item, index) => index == row.select_cycles )[0]?.[temp] || 0 ); }, getRenewList() { this.loading = true; batchRenewList({ ids: this.idsArr }) .then((res) => { this.dataList = res.data.data.list.map((item) => { item.select_cycles = 0; item.cur_pirce = item.billing_cycles[0].price; item.promo_code_discount = item.billing_cycles[0].promo_code_discount || 0; return item; }); this.loading = false; }) .catch((err) => { this.loading = false; this.$message.error(err.data.msg); }); }, rzClose() { this.isShow = false; }, paySuccess(e) { this.isShow = false; this.$emit("success"); }, // 取消支付回调 payCancel(e) { }, handelRenew() { this.subLoading = true; const billing_cycles = {}; this.dataList.forEach((item) => { billing_cycles[item.id] = item.billing_cycles.filter( (items, index) => index == item.select_cycles )[0].billing_cycle; }); aipBatchRenew({ ids: this.rewIdArr, billing_cycles, customfield: { promo_code: this.promo.promo_code, }, }) .then((res) => { this.subLoading = false; if (res.data.code === "Unpaid") { this.$refs.RennwPayDialog.showPayDialog(res.data.data.id); } else { this.isShow = false; this.$emit("success"); } }) .catch((err) => { this.subLoading = false; this.$message.error(err.data.msg); }); }, }, };