index.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Administrator
  5. * Date: 2021/7/8 0008
  6. * Time: 10:07
  7. */
  8. ?>
  9. <style>
  10. @media screen and (max-width: 1370px) {
  11. #stat_pay {
  12. min-width: 1131px;
  13. }
  14. }
  15. .order_stat{
  16. background: #FFF;
  17. padding: 10px 10px 0;
  18. margin-bottom: 10px;
  19. }
  20. .title{
  21. font-size: 18px;
  22. font-weight: bold;
  23. display: flex;
  24. align-items: center;
  25. height: 40px;
  26. }
  27. .order_stat > .title > .time{
  28. font-size: 13px;
  29. font-weight: 400;
  30. color: #BFBFBF;
  31. margin-left: 20px;
  32. flex: 1;
  33. }
  34. .order_stat .stat_details{
  35. padding: 30px 0;
  36. display: flex;
  37. }
  38. .stat_details .order_module{
  39. flex: 1;
  40. background: #F2F2F2;
  41. margin: 0 5px;
  42. padding: 20px 25px;
  43. }
  44. .order_module{
  45. display: flex;
  46. flex-direction: column;
  47. }
  48. .order_module:last-child{
  49. margin-right: 0;
  50. }
  51. .order_module:first-child{
  52. margin-left: 0;
  53. }
  54. .price{
  55. font-size: 22px;
  56. font-weight: bold;
  57. flex: 1;
  58. word-break: break-all;
  59. }
  60. .oirder_modul_title{
  61. font-size: 12px;
  62. margin-bottom: 10px;
  63. display: flex;
  64. align-items: center;
  65. }
  66. .oirder_modul_title .text{
  67. margin-right: 10px;
  68. }
  69. .stat_icon{
  70. font-size: 19px;
  71. color: #BFBFBF;
  72. }
  73. .total{
  74. display: flex;
  75. margin-bottom: 10px;
  76. }
  77. .pay_total{
  78. flex: 1;
  79. flex-basis: 764px;
  80. background: #FFF;
  81. padding: 10px 10px 15px;
  82. }
  83. .pay_total:last-child{
  84. margin-left: 12px;
  85. }
  86. .el-date-editor .el-range-separator{
  87. padding: 0;
  88. }
  89. .pay_modules{
  90. margin-top: 20px;
  91. display: flex;
  92. flex-wrap: wrap;
  93. }
  94. .module{
  95. /* width: 350px; */
  96. width: 46%;
  97. background: #F7F7F7;
  98. padding: 20px 25px;
  99. margin-bottom: 15px;
  100. display: flex;
  101. }
  102. .module_two{
  103. width: 33%;
  104. background: #F7F7F7;
  105. padding: 20px 25px;
  106. margin-bottom: 15px;
  107. display: flex;
  108. }
  109. .module:nth-child(2n){
  110. margin-left: 30px
  111. }
  112. .no_open{
  113. flex: 1;
  114. color: #2E8FF4;
  115. display: flex;
  116. align-items: center;
  117. justify-content: flex-end;
  118. }
  119. .pay_button{
  120. display: flex;
  121. border: 1px solid #2E8FF4;
  122. border-radius: 4px;
  123. color: #464646;
  124. }
  125. .pay_button div{
  126. background: #FFF;
  127. padding: 10px;
  128. font-size: 14px;
  129. font-weight: 500;
  130. width: 80px;
  131. height: 36px;
  132. border-radius: 4px;
  133. text-align: center;
  134. }
  135. .pay_button .pay_button_sel{
  136. background: #2E8FF4;
  137. color: #FFF;
  138. border-radius: 0;
  139. }
  140. .pay_img{
  141. width: 56px;
  142. height: 56px;
  143. margin-right: 20px;
  144. }
  145. .assets{
  146. color: #848484;
  147. }
  148. .data_chart{
  149. background: #FFF;
  150. padding: 10px 10px 15px;
  151. width: 100%;
  152. position: relative;
  153. /* display: flex; */
  154. }
  155. .data_chart_time{
  156. position: absolute;
  157. top: 10px;
  158. right: 50px;
  159. display: flex;
  160. font-size: 16px;
  161. }
  162. .sel_time{
  163. margin-right: 20px;
  164. padding-bottom: 5px;
  165. }
  166. .sel_time:hover{
  167. cursor:pointer
  168. }
  169. .sel_color{
  170. border-bottom: 2px solid #5ED9A9;
  171. }
  172. .stat_chart{
  173. height:500px;
  174. /* width: 82rem; */
  175. width: 90%;
  176. }
  177. </style>
  178. <div id="stat_pay" v-cloak>
  179. <div class="order_stat">
  180. <div class="title">
  181. <div>订单概况</div>
  182. </div>
  183. <div class="stat_details">
  184. <div class="order_module" v-for="(item,index) in orderTotalArr" :key="item.type">
  185. <div class="oirder_modul_title">
  186. <div class="text">{{item.name}}</div>
  187. <el-tooltip class="item" effect="dark" v-if="item.prompt" :content="item.prompt" placement="bottom">
  188. <i class="el-icon-question stat_icon"></i>
  189. </el-tooltip>
  190. </div>
  191. <div class="price">
  192. {{item.value}}
  193. </div>
  194. </div>
  195. </div>
  196. </div>
  197. <div class="data_chart">
  198. <div ref="stat_chart" style="background: #FFF;" class="stat_chart"></div>
  199. <div class="data_chart_time">
  200. </div>
  201. </div>
  202. </div>
  203. <script>
  204. new Vue({
  205. el: '#stat_pay',
  206. data(){
  207. return {
  208. update_order_time: '',
  209. order_time: [],
  210. buttonType: 1,
  211. user_total: null,
  212. order_total: null,
  213. //订单概况
  214. orderTotalArr: [],
  215. chartTimeType: 0,
  216. currencyInfo: [],
  217. // chartTimeArr: [],
  218. paid_amount_arr: [],
  219. settle_income_arr: [],
  220. chart_time_arr: [],
  221. }
  222. },
  223. created(){
  224. this.getData();
  225. this.getChart();
  226. this.$nextTick(v => {
  227. this.statChart();
  228. })
  229. },
  230. methods:{
  231. getData(){
  232. let that = this;
  233. that.currencyInfo = [];
  234. let date = {
  235. r: 'store/client/finance/index'
  236. }
  237. if(this.order_time){
  238. date.order_time = this.order_time;
  239. }
  240. request({
  241. params: date,
  242. method: 'get',
  243. }).then(res => {
  244. if (res.data.code == 0) {
  245. that.update_order_time = res.data.data.update_time;
  246. that.order_time = res.data.data.date;
  247. that.orderTotalArr = res.data.data.order_total_arr;
  248. that.chart_time_arr = res.data.data.chart_time_arr;
  249. that.settle_income_arr = res.data.data.settle_income_arr;
  250. }
  251. }).catch(e => {
  252. });
  253. },
  254. upButton(type){
  255. if(this.butbuttonType == type){
  256. return;
  257. }
  258. this.buttonType = type;
  259. this.memberAssets = [];
  260. if(type == 2){
  261. this.memberAssets.push(...this.currencyInfo);
  262. }else{
  263. //this.memberAssets.push(...this.accountInfo);
  264. }
  265. },
  266. //图表
  267. getChart(type = 1){
  268. if(this.chartTimeType == type){
  269. return;
  270. }
  271. this.chartTimeType = type;
  272. let that = this;
  273. that.chartTimeArr = [];
  274. that.paid_amount_arr = [];
  275. that.settle_income_arr = [];
  276. request({
  277. params: {
  278. r: 'store/client/finance/index',
  279. date_type: this.chartTimeType
  280. },
  281. method: 'get',
  282. }).then(res => {
  283. if(res.data.code == 0){
  284. that.update_order_time = res.data.data.update_time;
  285. that.order_time = res.data.data.date;
  286. that.orderTotalArr = res.data.data.order_total_arr;
  287. this.chartTimeArr = res.data.data.chart_time_arr;
  288. that.settle_income_arr = res.data.data.settle_income_arr;
  289. that.$nextTick(v => {
  290. that.statChart();
  291. })
  292. }
  293. })
  294. },
  295. statChart(){
  296. let echartStat = echarts.init(this.$refs.stat_chart);
  297. let option = {
  298. title: {
  299. text: '营收趋势'
  300. },
  301. tooltip: {
  302. trigger: 'axis'
  303. },
  304. legend: {
  305. x:'center', //可设定图例在左、右、居中
  306. y:'bottom', //可设定图例在上、下、居中
  307. data: ['店铺收入']
  308. },
  309. grid: {
  310. left: '1%',
  311. right: '4%',
  312. bottom: '8%',
  313. containLabel: true
  314. },
  315. xAxis: {
  316. type: 'category',
  317. boundaryGap: true, // false 不留白
  318. data: this.chartTimeArr
  319. },
  320. yAxis: {
  321. type: 'value',
  322. // name:'收支趋势'
  323. },
  324. series: [
  325. {
  326. name: '店铺收入',
  327. type: 'line',
  328. stack: '总量',
  329. itemStyle : {
  330. normal : {
  331. color:'#5ED9A9',
  332. lineStyle:{
  333. color:'#5ED9A9'
  334. }
  335. }
  336. },
  337. data: this.settle_income_arr
  338. }
  339. ]
  340. };
  341. echartStat.setOption(option)
  342. setTimeout(function (){
  343. window.onresize = function () {
  344. echartStat.resize();
  345. }
  346. },200)
  347. },
  348. updateOrderTime(v){
  349. this.order_time = v;
  350. this.getData();
  351. },
  352. toFormatDate: function (date) {
  353. let y = date.getFullYear();
  354. let MM = date.getMonth() + 1;
  355. MM = MM < 10 ? ('0' + MM) : MM;
  356. let d = date.getDate();
  357. d = d < 10 ? ('0' + d) : d;
  358. return y + '-' + MM + '-' + d;
  359. }
  360. }
  361. })
  362. </script>