diff --git a/src/assets/site/recharge_bonus.png b/src/assets/site/recharge_bonus.png new file mode 100644 index 0000000..aa29937 Binary files /dev/null and b/src/assets/site/recharge_bonus.png differ diff --git a/src/views/agent/recharge.vue b/src/views/agent/recharge.vue index daa9732..7e77b97 100644 --- a/src/views/agent/recharge.vue +++ b/src/views/agent/recharge.vue @@ -1,5 +1,5 @@ @@ -52,9 +124,15 @@ import GuipRadio from "@/components/GuipRadio.vue"; +import GuipInput from "@/components/GuipInput.vue"; +import GuipButton from "@/components/GuipButton.vue"; +import GuipTable from "@/components/GuipTable.vue"; export default { components: { + GuipTable, + GuipButton, + GuipInput, GuipRadio }, @@ -69,48 +147,75 @@ export default { totalType:'1', tableLoading:false, + walletType: '', walletList:[], + prompt:'', + prompt_link:'', + bonus:[], + buy_price_type: '', + buy_price_types: {}, + buy_price_link: '', + buy_price_links: {}, + links_desc: '', + + ordernum:'', - siteNum: 1, tableKey: '', - monthList:[], - monthTotal:[], - payList:[], - nameList:[], - topList:[], - - domain_type: 1, - domain_types: {1: "平台免费域名", 2: "我自己有域名"}, + tableList:[], + currentPage: 1, //当前页 + pageSize: 20, //每页的容量 + total: 0, //列表总数 + total_money: 0, //列表总数 + + confirmBtnStyle: { + 'background':'#FF4D4F', + 'color':'#FFFFFF', + 'border':'1px solid #FF4D4F', + 'border-radius':'4px', + 'width': '88px', + 'height': '33px', + 'font-size': '12px', + } } }, mounted() { this.$nextTick(()=>{ this.totalType = this.total_type; - this.handleClick() }) }, methods: { - handleClickDetail(id){ - if(this.totalType == 2) this.$router.push(`/agent/statisticalDetails?uid=${id}&total_type=${this.totalType}&date=${this.date}`) - if(this.totalType == 3) this.$router.push(`/agent/statisticalDetails?chktype=${id}&total_type=${this.totalType}&date=${this.date}`) + walletClick(type){ + this.walletType = type + this.walletList.forEach(item => { + if(item.type === type){ + this.prompt = item.prompt + this.prompt_link = item.prompt_link + this.bonus = item.bonus + + item.links.forEach((v,idx) => { + this.buy_price_types[idx] = v.face_val+'元' + this.buy_price_links[idx] = v.url + }) + + this.buy_price_type = '0' + this.buy_price_link = this.buy_price_links[this.buy_price_type] + this.links_desc = item.links_desc + } + }) }, - handleClicksiteRank(id){ - this.$router.push(`/agent/siteRank?id=${id}&total_type=${this.totalType}&date=`+this.date) + jumpLink(link){ + window.open(link, '_blank'); }, - handleClickserviceRank(id){ - this.$router.push(`/agent/serviceRank?id=${id}&total_type=${this.totalType}&date=`+this.date) + buyLinkClick(){ + this.buy_price_link = this.buy_price_links[this.buy_price_type]; }, handleClick(){ - this.monthList = [] - this.payList = [] - this.monthTotal = [] - this.nameList = [] - this.topList = [] + this.tableList = [] this.tableKey = Math.random(); if(this.totalType == 1) this.getRechargeData() - if(this.totalType == 2) this.getSiteStats() + if(this.totalType == 2) this.getRechargeList() if(this.totalType == 3) this.getChktypeStats() }, getRechargeData() { @@ -118,7 +223,7 @@ export default { this.$http('POST', '/agentnew/ajax_get_recharge_data', {date: this.date}).then(response => { this.$nextTick(() => { this.walletList = response.data - console.log(response) + if(this.walletType == '') this.walletClick(response.data[0].type) }) }).catch(error => { console.error(error, 'error') @@ -127,17 +232,20 @@ export default { console.error('数据加载失败:', error) } }, - getSiteStats() { + getRechargeList() { this.tableLoading = true try { - this.$http('POST', '/agentnew/ajax_get_site_stats', {date: this.date}).then(response => { + this.$http('POST', '/agentnew/ajax_get_recharge_list', { + type: this.walletType, + cur_page: this.currentPage, + page_size: this.pageSize + }).then(response => { this.tableLoading = false this.$nextTick(() => { - this.monthList = response.data.list - this.payList = response.data.pay_list - this.monthTotal = response.data.total - this.nameList = response.data.name_list - this.topList = response.data.top_list + this.tableList = response.data.list + this.total = response.data.total + this.total_money = response.data.total_money + console.log(this.total_money) }) }).catch(error => { console.error(error, 'error') @@ -154,11 +262,7 @@ export default { this.$http('POST', '/agentnew/ajax_get_chktype_stats', {date: this.date}).then(response => { this.tableLoading = false this.$nextTick(() => { - this.monthList = response.data.list - this.payList = response.data.pay_list - this.monthTotal = response.data.total - this.nameList = response.data.name_list - this.topList = response.data.top_list + this.tableList = response.data.list }) }).catch(error => { console.error(error, 'error') @@ -169,24 +273,62 @@ export default { this.tableLoading = false } }, + doRecharge(){ + try { + this.$http('POST', '/agentnew/ajax_do_recharge', {orderId: this.ordernum,type: this.walletType}).then(response => { + if (response.status) { + this.$message.success('充值成功'); + return true; + } + this.$message.error(response.info); + }).catch(error => { + console.error(error, 'error') + }) + } catch (error) { + console.error('数据加载失败:', error) + } + }, + handleSizeChange(val) { + this.pageSize = val + this.getRechargeList() + }, + handleCurrentChange(val) { + this.currentPage = val + this.getRechargeList() + }, } }