diff --git a/pages/about/bonusSet/bonusList.vue b/pages/about/bonusSet/bonusList.vue index 7af1c1d..792eb77 100644 --- a/pages/about/bonusSet/bonusList.vue +++ b/pages/about/bonusSet/bonusList.vue @@ -2,30 +2,63 @@ - - + + - 面值:{{amount}} - 最高中奖金额:20万 + 面值:{{item.price}} + 最高中奖金额:{{item.max_awards_amount}} - + diff --git a/pages/about/bonusSet/bonusSet.vue b/pages/about/bonusSet/bonusSet.vue index 783c460..bffb0bd 100644 --- a/pages/about/bonusSet/bonusSet.vue +++ b/pages/about/bonusSet/bonusSet.vue @@ -3,10 +3,10 @@ - + - 中奖金额:{{item.zj}}元 - 中奖率:{{item.gl}}% + 中奖金额:{{item.amount_str}} + 中奖率:{{item.probability}}% 编辑 @@ -21,14 +21,14 @@ 奖金金额: - + 中奖率: - + % @@ -43,14 +43,15 @@ diff --git a/pages/about/serviceSet/serviceSet.vue b/pages/about/serviceSet/serviceSet.vue index a4d0454..e37d4cc 100644 --- a/pages/about/serviceSet/serviceSet.vue +++ b/pages/about/serviceSet/serviceSet.vue @@ -8,11 +8,11 @@ 客服名: - 钱多多 + {{item.name}} 微信号码: - 18655554444 + {{item.wx_number}} @@ -27,11 +27,11 @@ 客服名称: - + 微信号码: - + @@ -45,31 +45,43 @@ @@ -114,6 +161,7 @@ border-radius: 10px; font-size: 14px; box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.11); + margin-bottom: 20px; .item_top{ height: 50%; diff --git a/pages/home/home.vue b/pages/home/home.vue index 0a2a0b0..5e8859a 100644 --- a/pages/home/home.vue +++ b/pages/home/home.vue @@ -45,11 +45,11 @@ - 待办(更新于:2023/08/30 19:00) + 待办(更新于:{{needInfo.update_time}}) - 待下分额度 - 10000.00 + {{needInfo.down_scores_quota.title}} + {{needInfo.down_scores_quota.quota}} @@ -64,16 +64,16 @@ 代理人数 - 1200 + {{userStatistics.agent.num}} - 20% + {{userStatistics.agent.rate}} 用户人数 - 120000 + {{userStatistics.user.num}} - 80% + {{userStatistics.user.rate}} @@ -83,13 +83,13 @@ 上下分数据 - 上分统计 - 下分数据 + 上分统计 + 下分数据 - {{ chartIndex==0?'上分总数':'下分总数' }}:{{ chartIndex==0?'1200':'12000' }} + {{ chartIndex==1?'上分总数':'下分总数' }}:{{ UpDownSta.sum_value }} @@ -110,13 +110,43 @@ bannerList: [], goodsList: [], recordsList: [1,2,3,4,5,6], - chartIndex: 0, + chartIndex: 1,//1上分2下分 myChart: null, pieChart: null, innerAudioContext: null, isPlay: false, nomore: false, - page: 1 + page: 1, + needInfo: { + update_time: '2023/08/30 19:00', + down_scores_quota: { + title: '待下分额度', + quota: '10010.00' + } + }, + userStatistics: { + agent: { + num: '7', + rate: '36.84%' + }, + user: { + num: '12', + rate: '63.16%' + }, + sum: { + num: "19人" //总人数 + } + }, + UpDownSta: { + "histogram": [ + {"date": "09", //月份 + "value": "20.00" //数据 + }, + ], //柱状图 + "sum_value": "20.00" ,//总数据, + xData: ['1月', '2月', '3月', '4月', '5月'], + data: [155, 250, 360, 100, 180, 204] + } } }, computed: { @@ -130,9 +160,16 @@ }, created() { this.userType = uni.getStorageSync('userType'); - this.getRotationChart(); - this.getZoneList(); + if(this.userType=='user'){ + this.getZoneList(); + this.getRotationChart(); + } + if(this.userType=='background'){ + this.getNeedSta(); + this.getUserSta(); + this.getUpDownSta(); + } }, mounted() { if(this.userType=='user'){ @@ -180,12 +217,16 @@ }, changeChartIndex(type){ this.chartIndex = type; - this.myChart.clear(); - this.renderChart(); + this.getUpDownSta(type); + setTimeout(()=>{ + this.myChart.clear(); + this.renderChart(); + }, 200) }, renderChart(){ - let yMax = 450; + let yMax = ([...this.UpDownSta.data].sort())[this.UpDownSta.data.length-1]; let interval = yMax / 5; + // yMax = interval*6; let option = { color: ['#5087EC','#74C0C8'], // title: { @@ -202,7 +243,7 @@ }, tooltip: {}, xAxis: { - data: ['1月', '2月', '3月', '4月', '5月'], + data: this.UpDownSta.xData, }, yAxis: [{ @@ -220,12 +261,13 @@ name: '', type: 'bar', barMaxWidth: 30, - data: [155, 250, 360, 100, 180, 204] + data: this.UpDownSta.data }, { name: '', type: 'line', - data: [175, 180, 410, 208, 195, 330], + // data: [175, 180, 410, 208, 195, 330], + data: this.UpDownSta.data, yAxisIndex: 1 } ] @@ -262,8 +304,8 @@ show: false }, data: [ - { value: 1200, name: 'Search Engine' }, - { value: 12000, name: 'Direct' } + { value: this.userStatistics.agent.num, name: 'Search Engine' }, + { value: this.userStatistics.user.num, name: 'Direct' } ] } ] @@ -306,7 +348,33 @@ this.nomore = true; } }) - }, + }, + /*总后台待办*/ + getNeedSta(){ + API.request('/adminStatistics/needStatistics', {}, res=>{ + this.needInfo = res.data; + }) + }, + /*总后台用户统计*/ + getUserSta(){ + API.request('/adminStatistics/userStatistics', {}, res=>{ + this.userStatistics = res.data; + }) + }, + /*总后台上下分统计数据*/ + getUpDownSta(type=1){ + API.request('/adminStatistics/upAndDownStatistics', {type: type}, res=>{ + this.UpDownSta = res.data; + this.UpDownSta.xData = this.UpDownSta.histogram.map(item=>{ + return item.date; + }) + this.UpDownSta.data = this.UpDownSta.histogram.map(item=>{ + return item.value; + }) + }) + } + + }, onReachBottom() { if(!this.nomore){ diff --git a/pages/list/agent.vue b/pages/list/agent.vue index 6f03b18..5f7c8a0 100644 --- a/pages/list/agent.vue +++ b/pages/list/agent.vue @@ -39,11 +39,12 @@ ID: - + 电话: - + 密码: @@ -117,7 +118,7 @@ API.request('/adminTeam/agentList', { limit: 10,title: this.account,page: this.page }, res=>{ - if(res.data.length<10){ + if(res.data.list.length<10){ this.noMore = true; } if(this.page>1){ @@ -156,7 +157,6 @@ }, cancel(){ this.showEdit = false; - this.editInfo = this.originInfo; }, // 提交代理新增编辑 confirm(){ @@ -172,21 +172,38 @@ icon: 'none' }) } - API.request('/adminAgentTeam/editUser', { - aid: this.editInfo.id, - password: this.editInfo.password - }, res=>{ - uni.showToast({ - title: res.msg + if(this.editType=='add'){ + API.request('/adminAgentTeam/addAgent', { + phone: this.editInfo.phone, + password: this.editInfo.password + }, res=>{ + uni.showToast({ + title: res.msg + }) + this.account = ''; + this.search(); }) - this.account = ''; - this.search(); - }) + }else if(this.editType=='edit'){ + API.request('/adminAgentTeam/editUser', { + aid: this.editInfo.id, + password: this.editInfo.password + }, res=>{ + uni.showToast({ + title: res.msg + }) + this.account = ''; + this.search(); + }) + } + + this.showEdit = false; + }, add(){ this.title = "新增代理"; this.editType = "add"; this.showEdit = true; + this.editInfo = this.originInfo; }, // 打开上分下分弹窗 modifyScore(type, val, i){ @@ -425,6 +442,9 @@ flex: 1; text-align: center; } + .disabled /deep/ .uni-input-input{ + background: #ebebeb !important; + } input{ width: 430rpx; height: 80rpx; diff --git a/pages/list/user.vue b/pages/list/user.vue index c1a6931..bf587c6 100644 --- a/pages/list/user.vue +++ b/pages/list/user.vue @@ -40,11 +40,12 @@ ID: - + 电话: - + 密码: @@ -117,7 +118,7 @@ API.request('/adminTeam/userList', { limit: 10,title: this.account,page: this.page }, res=>{ - if(res.data.length<10){ + if(res.data.list.length<10){ this.noMore = true; } if(this.page>1){ @@ -156,7 +157,6 @@ }, cancel(){ this.showEdit = false; - this.editInfo = this.originInfo; }, // 提交用户新增编辑 confirm(){ @@ -188,6 +188,7 @@ this.title = "新增用户"; this.editType = "add"; this.showEdit = true; + this.editInfo = this.originInfo; }, // 打开上分下分弹窗 modifyScore(type, val, i){ @@ -426,6 +427,9 @@ flex: 1; text-align: center; } + .disabled /deep/ .uni-input-input{ + background: #ebebeb !important; + } input{ width: 430rpx; height: 80rpx; @@ -468,6 +472,7 @@ border-radius: 5px; border: 1px solid #ededed; text-align: center; + input{ height: 80rpx; font-size: 14px; diff --git a/pages/recordsList/recordsList.vue b/pages/recordsList/recordsList.vue index 2f2ea36..eb53adf 100644 --- a/pages/recordsList/recordsList.vue +++ b/pages/recordsList/recordsList.vue @@ -3,10 +3,13 @@ - 记录事项名称 + 消费、中奖记录 + ID:{{item.id}}({{item.type}}) + 余额 + 可提余额 - + - - + {{item.amount1}} @@ -187,10 +190,60 @@ }) }, getUP(){ - + API.request('/adminUser/upScoresList', { + page: this.page,limit:10 + }, res=>{ + let list = res.list.map(item=>{ + return { + amount1: item.balance, + amount2: item.residue_amount, + time: item.create_time, + id: item.relation_id, + type: item.relation_type + } + }); + if(page===1){ + list.length>0 ? this.noMore=false : false; + this.recordsList = list; + }else{ + if(res.list.length==0){ + uni.showToast({ + title: '没有更多了', + icon: 'none' + }) + this.noMore = true; + } + this.recordsList = this.recordsList.concat(list) + } + }) }, getDOWN(){ - + API.request('/adminUser/downScoresList', { + page: this.page,limit:10 + }, res=>{ + let list = res.list.map(item=>{ + return { + amount1: item.withdrawal_amount, + amount2: item.withdrawal_balance, + time: item.create_time, + id: item.relation_id, + type: item.relation_type + } + }); + if(page===1){ + list.length>0 ? this.noMore=false : false; + this.recordsList = list; + }else{ + if(res.list.length==0){ + uni.showToast({ + title: '没有更多了', + icon: 'none' + }) + this.noMore = true; + } + this.recordsList = this.recordsList.concat(list) + } + }) }, }, diff --git a/pages/ucenter/ucenter.vue b/pages/ucenter/ucenter.vue index b38b5e6..941da16 100644 --- a/pages/ucenter/ucenter.vue +++ b/pages/ucenter/ucenter.vue @@ -323,7 +323,12 @@ showBadge: this.appVersion.hasNew }) //#endif - this.getUserInfo(); + if(uni.getStorageSync('userType')=='background'){ + this.getAdminUserInfo(); + }else{ + this.getUserInfo(); + } + }, onShow() { this.userType = uni.getStorageSync('userType'); @@ -560,6 +565,11 @@ API.request('/user/userInfo', {}, res=>{ this.userInfo = res.data.userInfo; }) + }, + getAdminUserInfo(){ + API.request('/adminUser/userInfo', {}, res=>{ + this.userInfo = res.data.data; + }) } }