list.html 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>资金流水</title>
  6. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  7. <link href="../../css/mui.min.css" rel="stylesheet" />
  8. <style>
  9. .m_box {padding: 10px 10px 25px 15px;box-shadow: 0 1px 6px #dbdbdb;border-radius: 8px;position: relative;overflow: hidden;}
  10. .fm{width: 100%;z-index: 1;}
  11. .mui-content{padding: 0px 15px!important;margin-top: -65px;z-index: 11111;}
  12. .items{padding: 10px;font-size: 12px;margin-top:10px;background-color: white;border-bottom: 1px solid #eeeded;}
  13. .items:last-child{border: 0px;}
  14. .divider{margin-top: 25px;margin-bottom: 25px;}
  15. .qian{float: left;width: 40px;height: 40px;border-radius: 50%;background-color: orange;text-align: center;line-height: 40px;}
  16. .icsf{color: white;}
  17. .ccn{float: left;padding-left: 10px;width: 75%;}
  18. .ccn .stitle{font-size: 14px;width: 100%;color: #6c6c6c;}
  19. .sm7{overflow: hidden;}
  20. .money{float: right;color: orange;font-size: 15px;padding-top: 3px;}
  21. .ccn .time{color: darkgray;}
  22. .save{color:white;padding-top: 12px;}
  23. [v-cloak] {display: none;}
  24. </style>
  25. </head>
  26. <body>
  27. <div id="app" v-cloak>
  28. <header class="mui-bar mui-bar-nav">
  29. <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
  30. <h1 class="mui-title">资金流水</h1>
  31. <span class="save mui-pull-right" @click="save()">请款记录</span>
  32. </header>
  33. <img src="../../images/top.png" class="fm" />
  34. <div class="mui-content">
  35. <div class="m_box">
  36. <div id="main" style="height:220px;"></div>
  37. <div class="divider">
  38. <div class="line" style="width: 30%;"></div>
  39. <div class="text" style="width: 40%;">资金明细</div>
  40. <div class="line" style="width: 30%;"></div>
  41. <div class="clear"></div>
  42. </div>
  43. <div v-if="list.length>0">
  44. <div class="items" v-for="(item,index) in list" @click="preview(item)">
  45. <div class="row">
  46. <div class="sm7">
  47. <div class="qian"><i class="icon icsf">&#xe615;</i></div>
  48. <div class="ccn omit">
  49. <div class="stitle omit">{{item.parttime_title}}</div>
  50. <div class="time">{{item.pay_date}}</div>
  51. </div>
  52. </div>
  53. <div class="sm3">
  54. <div class="money" v-if="item.pay_mode=='收款方'">+{{item.amount}}</div>
  55. <div class="money" v-if="item.pay_mode=='付款方'" style="color: #f44336;">-{{item.amount}}</div>
  56. </div>
  57. <div class="clear"></div>
  58. </div>
  59. </div>
  60. </div>
  61. <div class="no_data" v-else style="padding-top: 50px;">
  62. <i class="icon icon-48">&#xe61a;</i><br />没有数据
  63. </div>
  64. </div>
  65. </div>
  66. </div>
  67. <script src="../../js/mui.min.js"></script>
  68. <script src="../../js/app.js"></script>
  69. <script src="../../js/vue.min.js"></script>
  70. <script src="../../js/echarts.min.js"></script>
  71. <script type="text/javascript">
  72. var vm = new Vue({
  73. el: "#app",
  74. data: {
  75. list: []
  76. },
  77. mounted: function() {
  78. this.getData();
  79. this.initChart();
  80. },
  81. methods: {
  82. //获取数据
  83. getData: function() {
  84. request(urls().finance_list, {userId: getUser().id}, function(res) {
  85. vm.list = res.data;
  86. console.log("asd:"+JSON.stringify(res));
  87. plus.nativeUI.closeWaiting();
  88. })
  89. request(urls().chart_list, {userId: getUser().id}, function(res) {
  90. vm.list = res.data;
  91. console.log("asd:"+JSON.stringify(res));
  92. plus.nativeUI.closeWaiting();
  93. })
  94. },
  95. initChart: function() {
  96. var myChart = echarts.init(document.getElementById('main'));
  97. var option = {
  98. toolbox: {
  99. show: true,
  100. iconStyle: {
  101. borderColor: "#6c6c6c",
  102. },
  103. feature: {
  104. magicType: {
  105. type: ['line', 'bar']
  106. },
  107. }
  108. },
  109. color: ['#4CAF50', '#F44336'],
  110. grid: {
  111. left: '15',
  112. top: '30%',
  113. right: '15',
  114. bottom: '5',
  115. containLabel: true
  116. },
  117. legend: {
  118. data: ['收入', '支出']
  119. },
  120. xAxis: {
  121. data: ['6月', '7月', '8月', '9月', '10月']
  122. },
  123. yAxis: {},
  124. series: [{
  125. name: '收入',
  126. type: 'bar',
  127. data: [300, 200, 320, 1000, 1600],
  128. markPoint: {
  129. label: {
  130. color: 'white', //气泡中字体颜色
  131. },
  132. data: [{
  133. type: 'max',
  134. name: 'Max'
  135. }]
  136. }
  137. },
  138. {
  139. name: '支出',
  140. type: 'bar',
  141. data: [100, 150, 500, 200, 650]
  142. },
  143. ]
  144. };
  145. myChart.setOption(option);
  146. }
  147. }
  148. })
  149. </script>
  150. </body>
  151. </html>