| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403 |
- <?php
- /**
- * Created by PhpStorm.
- * User: Administrator
- * Date: 2021/7/8 0008
- * Time: 10:07
- */
- ?>
- <style>
- @media screen and (max-width: 1370px) {
- #stat_pay {
- min-width: 1131px;
- }
- }
- .order_stat{
- background: #FFF;
- padding: 10px 10px 0;
- margin-bottom: 10px;
- }
- .title{
- font-size: 18px;
- font-weight: bold;
- display: flex;
- align-items: center;
- height: 40px;
- }
- .order_stat > .title > .time{
- font-size: 13px;
- font-weight: 400;
- color: #BFBFBF;
- margin-left: 20px;
- flex: 1;
- }
- .order_stat .stat_details{
- padding: 30px 0;
- display: flex;
- }
- .stat_details .order_module{
- flex: 1;
- background: #F2F2F2;
- margin: 0 5px;
- padding: 20px 25px;
- }
- .order_module{
- display: flex;
- flex-direction: column;
- }
- .order_module:last-child{
- margin-right: 0;
- }
- .order_module:first-child{
- margin-left: 0;
- }
- .price{
- font-size: 22px;
- font-weight: bold;
- flex: 1;
- word-break: break-all;
- }
- .oirder_modul_title{
- font-size: 12px;
- margin-bottom: 10px;
- display: flex;
- align-items: center;
- }
- .oirder_modul_title .text{
- margin-right: 10px;
- }
- .stat_icon{
- font-size: 19px;
- color: #BFBFBF;
- }
- .total{
- display: flex;
- margin-bottom: 10px;
- }
- .pay_total{
- flex: 1;
- flex-basis: 764px;
- background: #FFF;
- padding: 10px 10px 15px;
- }
- .pay_total:last-child{
- margin-left: 12px;
- }
- .el-date-editor .el-range-separator{
- padding: 0;
- }
- .pay_modules{
- margin-top: 20px;
- display: flex;
- flex-wrap: wrap;
- }
- .module{
- /* width: 350px; */
- width: 46%;
- background: #F7F7F7;
- padding: 20px 25px;
- margin-bottom: 15px;
- display: flex;
- }
- .module_two{
- width: 33%;
- background: #F7F7F7;
- padding: 20px 25px;
- margin-bottom: 15px;
- display: flex;
- }
- .module:nth-child(2n){
- margin-left: 30px
- }
- .no_open{
- flex: 1;
- color: #2E8FF4;
- display: flex;
- align-items: center;
- justify-content: flex-end;
- }
- .pay_button{
- display: flex;
- border: 1px solid #2E8FF4;
- border-radius: 4px;
- color: #464646;
- }
- .pay_button div{
- background: #FFF;
- padding: 10px;
- font-size: 14px;
- font-weight: 500;
- width: 80px;
- height: 36px;
- border-radius: 4px;
- text-align: center;
- }
- .pay_button .pay_button_sel{
- background: #2E8FF4;
- color: #FFF;
- border-radius: 0;
- }
- .pay_img{
- width: 56px;
- height: 56px;
- margin-right: 20px;
- }
- .assets{
- color: #848484;
- }
- .data_chart{
- background: #FFF;
- padding: 10px 10px 15px;
- width: 100%;
- position: relative;
- /* display: flex; */
- }
- .data_chart_time{
- position: absolute;
- top: 10px;
- right: 50px;
- display: flex;
- font-size: 16px;
- }
- .sel_time{
- margin-right: 20px;
- padding-bottom: 5px;
- }
- .sel_time:hover{
- cursor:pointer
- }
- .sel_color{
- border-bottom: 2px solid #5ED9A9;
- }
- .stat_chart{
- height:500px;
- /* width: 82rem; */
- width: 90%;
- }
- </style>
- <div id="stat_pay" v-cloak>
- <div class="order_stat">
- <div class="title">
- <div>订单概况</div>
- </div>
- <div class="stat_details">
- <div class="order_module" v-for="(item,index) in orderTotalArr" :key="item.type">
- <div class="oirder_modul_title">
- <div class="text">{{item.name}}</div>
- <el-tooltip class="item" effect="dark" v-if="item.prompt" :content="item.prompt" placement="bottom">
- <i class="el-icon-question stat_icon"></i>
- </el-tooltip>
- </div>
- <div class="price">
- {{item.value}}
- </div>
- </div>
- </div>
- </div>
- <div class="data_chart">
- <div ref="stat_chart" style="background: #FFF;" class="stat_chart"></div>
- <div class="data_chart_time">
- </div>
- </div>
- </div>
- <script>
- new Vue({
- el: '#stat_pay',
- data(){
- return {
- update_order_time: '',
- order_time: [],
- buttonType: 1,
- user_total: null,
- order_total: null,
- //订单概况
- orderTotalArr: [],
- chartTimeType: 0,
- currencyInfo: [],
- // chartTimeArr: [],
- paid_amount_arr: [],
- settle_income_arr: [],
- chart_time_arr: [],
- }
- },
- created(){
- this.getData();
- this.getChart();
- this.$nextTick(v => {
- this.statChart();
- })
- },
- methods:{
- getData(){
- let that = this;
- that.currencyInfo = [];
- let date = {
- r: 'store/client/finance/index'
- }
- if(this.order_time){
- date.order_time = this.order_time;
- }
- request({
- params: date,
- method: 'get',
- }).then(res => {
- if (res.data.code == 0) {
- that.update_order_time = res.data.data.update_time;
- that.order_time = res.data.data.date;
- that.orderTotalArr = res.data.data.order_total_arr;
- that.chart_time_arr = res.data.data.chart_time_arr;
- that.settle_income_arr = res.data.data.settle_income_arr;
- }
- }).catch(e => {
- });
- },
- upButton(type){
- if(this.butbuttonType == type){
- return;
- }
- this.buttonType = type;
- this.memberAssets = [];
- if(type == 2){
- this.memberAssets.push(...this.currencyInfo);
- }else{
- //this.memberAssets.push(...this.accountInfo);
- }
- },
- //图表
- getChart(type = 1){
- if(this.chartTimeType == type){
- return;
- }
- this.chartTimeType = type;
- let that = this;
- that.chartTimeArr = [];
- that.paid_amount_arr = [];
- that.settle_income_arr = [];
- request({
- params: {
- r: 'store/client/finance/index',
- date_type: this.chartTimeType
- },
- method: 'get',
- }).then(res => {
- if(res.data.code == 0){
- that.update_order_time = res.data.data.update_time;
- that.order_time = res.data.data.date;
- that.orderTotalArr = res.data.data.order_total_arr;
- this.chartTimeArr = res.data.data.chart_time_arr;
- that.settle_income_arr = res.data.data.settle_income_arr;
- that.$nextTick(v => {
- that.statChart();
- })
- }
- })
- },
- statChart(){
- let echartStat = echarts.init(this.$refs.stat_chart);
- let option = {
- title: {
- text: '营收趋势'
- },
- tooltip: {
- trigger: 'axis'
- },
- legend: {
- x:'center', //可设定图例在左、右、居中
- y:'bottom', //可设定图例在上、下、居中
- data: ['店铺收入']
- },
- grid: {
- left: '1%',
- right: '4%',
- bottom: '8%',
- containLabel: true
- },
- xAxis: {
- type: 'category',
- boundaryGap: true, // false 不留白
- data: this.chartTimeArr
- },
- yAxis: {
- type: 'value',
- // name:'收支趋势'
- },
- series: [
- {
- name: '店铺收入',
- type: 'line',
- stack: '总量',
- itemStyle : {
- normal : {
- color:'#5ED9A9',
- lineStyle:{
- color:'#5ED9A9'
- }
- }
- },
- data: this.settle_income_arr
- }
- ]
- };
- echartStat.setOption(option)
- setTimeout(function (){
- window.onresize = function () {
- echartStat.resize();
- }
- },200)
- },
- updateOrderTime(v){
- this.order_time = v;
- this.getData();
- },
- toFormatDate: function (date) {
- let y = date.getFullYear();
- let MM = date.getMonth() + 1;
- MM = MM < 10 ? ('0' + MM) : MM;
- let d = date.getDate();
- d = d < 10 ? ('0' + d) : d;
- return y + '-' + MM + '-' + d;
- }
- }
- })
- </script>
|