operationDataPersonal.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. <template>
  2. <view style="padding-bottom: 30rpx;">
  3. <!-- 图表统计 -->
  4. <view class="echart-box">
  5. <view class="echart-box-header ddflex">
  6. <view class="echart-box-title">运营情况</view>
  7. </view>
  8. <view class="sssb-box ddflex">
  9. <view class="sssb-item fflex">
  10. <view class="sssb-data sssb-color">867.00</view>
  11. <view class="sssb-label">营业总额</view>
  12. </view>
  13. <view class="sssb-line"></view>
  14. <view class="sssb-item fflex">
  15. <view class="sssb-data sssb-color">1915.00</view>
  16. <view class="sssb-label">累计退款</view>
  17. </view>
  18. </view>
  19. <view class="sssb-box ddflex">
  20. <view class="sssb-item fflex">
  21. <view class="sssb-label">收益总额</view>
  22. <view class="sssb-data sssb-color">1915.00</view>
  23. </view>
  24. <view class="sssb-line"></view>
  25. <view class="sssb-item fflex">
  26. <view class="sssb-label">可分账金额</view>
  27. <view class="sssb-data sssb-color">1915.00</view>
  28. </view>
  29. </view>
  30. <view style="margin-top: 30rpx;height:500rpx">
  31. <view class="echart-title">近一周营业额度(元)图表数据</view>
  32. <l-echart ref="chart2" @finished="init"></l-echart>
  33. </view>
  34. <view style="margin-top: 30rpx;height:500rpx">
  35. <view class="echart-title">近一周收益额度(元)</view>
  36. <l-echart ref="chart3" @finished="init"></l-echart>
  37. </view>
  38. </view>
  39. </view>
  40. </template>
  41. <script>
  42. const app = getApp();
  43. const req = require("../../utils/request.js");
  44. import LEchart from '../../components/l-echart/l-echart.vue';
  45. import * as echarts from '../../utils/echarts.min.js'
  46. export default {
  47. components: {
  48. LEchart
  49. },
  50. props: {},
  51. data() {
  52. return {
  53. systems: {},
  54. isTop: 0,
  55. pxToRpxScale: 0,
  56. rpxTopxScale: 0,
  57. // 近一周营业额度(元)图表数据
  58. option2: {
  59. tooltip: {
  60. trigger: 'axis',
  61. axisPointer: {
  62. type: 'shadow'
  63. },
  64. confine: true
  65. },
  66. grid: {
  67. left: 0,
  68. right: 8,
  69. bottom: 20,
  70. top: 30,
  71. containLabel: true
  72. },
  73. xAxis: [{
  74. type: 'category',
  75. data: [],
  76. axisLine: {
  77. lineStyle: {
  78. color: '#999999'
  79. }
  80. },
  81. axisLabel: {
  82. color: '#666666',
  83. // interval: 0,
  84. }
  85. }],
  86. yAxis: [{
  87. type: 'value',
  88. axisTick: {
  89. show: false
  90. },
  91. axisLine: {
  92. lineStyle: {
  93. color: '#999999'
  94. }
  95. },
  96. axisLabel: {
  97. color: '#666666'
  98. }
  99. }],
  100. series: [{
  101. name: '订单',
  102. type: 'bar',
  103. label: {
  104. normal: {
  105. show: true,
  106. position: 'top',
  107. color: '#FF770F',
  108. formatter: '¥{c}',
  109. },
  110. },
  111. data: [285, 200, 285, 300, 285, 285, 320],
  112. barWidth: 15,
  113. itemStyle: {
  114. // 颜色
  115. color: '#FF770F',
  116. // 给bar设置倒角
  117. barBorderRadius: [0, 0, 0, 0]
  118. }
  119. }]
  120. },
  121. // 近一周收益额度(元)
  122. option3: {
  123. tooltip: {
  124. trigger: 'axis',
  125. axisPointer: {
  126. type: 'shadow'
  127. },
  128. confine: true
  129. },
  130. grid: {
  131. left: 0,
  132. right: 8,
  133. bottom: 20,
  134. top: 30,
  135. containLabel: true
  136. },
  137. xAxis: [{
  138. type: 'category',
  139. data: [],
  140. axisLine: {
  141. lineStyle: {
  142. color: '#999999'
  143. }
  144. },
  145. axisLabel: {
  146. color: '#666666',
  147. // interval: 0,
  148. }
  149. }],
  150. yAxis: [{
  151. type: 'value',
  152. axisTick: {
  153. show: false
  154. },
  155. axisLine: {
  156. lineStyle: {
  157. color: '#999999'
  158. }
  159. },
  160. axisLabel: {
  161. color: '#666666'
  162. }
  163. }],
  164. series: [{
  165. name: '订单',
  166. type: 'bar',
  167. label: {
  168. normal: {
  169. show: true,
  170. position: 'top',
  171. color: '#FF770F',
  172. formatter: '¥{c}',
  173. },
  174. },
  175. data: [285, 200, 285, 300, 285, 285, 320],
  176. barWidth: 15,
  177. itemStyle: {
  178. // 颜色
  179. color: '#FF770F',
  180. // 给bar设置倒角
  181. barBorderRadius: [0, 0, 0, 0]
  182. }
  183. }]
  184. }
  185. }
  186. },
  187. onLoad(options) {
  188. },
  189. onShow() {
  190. },
  191. methods: {
  192. jumpUrl(url) {
  193. if (req.isLogins(true)) {
  194. uni.navigateTo({
  195. url: url
  196. })
  197. }
  198. },
  199. init() {
  200. if (this.$refs.chart2) {
  201. this.$refs.chart2.init(echarts, async chart => {
  202. // let echartData = await this.getEchartData()
  203. this.option2.xAxis[0].data = ['04-04', '04-05', '04-06', '04-07', '04-08', '04-09',
  204. '04-10'
  205. ]
  206. this.option2.yAxis[0].axisLabel.fontSize = 13 * this.rpxTopxScale
  207. this.option2.xAxis[0].axisLabel.fontSize = 13 * this.rpxTopxScale
  208. this.option2.series[0].data = [300, 270, 340, 344, 300, 320, 310]
  209. this.option2.series[0].label.normal.fontSize = 13 * this.rpxTopxScale
  210. chart.setOption(this.option2);
  211. });
  212. }
  213. if (this.$refs.chart3) {
  214. this.$refs.chart3.init(echarts, async chart => {
  215. // let echartData = await this.getEchartData()
  216. this.option3.xAxis[0].data = ['04-04', '04-05', '04-06', '04-07', '04-08', '04-09',
  217. '04-10'
  218. ]
  219. this.option3.yAxis[0].axisLabel.fontSize = 13 * this.rpxTopxScale
  220. this.option3.xAxis[0].axisLabel.fontSize = 13 * this.rpxTopxScale
  221. this.option3.series[0].data = [300, 270, 340, 344, 300, 320, 310]
  222. this.option3.series[0].label.normal.fontSize = 13 * this.rpxTopxScale
  223. chart.setOption(this.option3);
  224. });
  225. }
  226. }
  227. },
  228. mounted() {
  229. const systemInfo = uni.getSystemInfoSync();
  230. // px转换到rpx的比例
  231. let pxToRpxScale = 750 / systemInfo.windowWidth;
  232. this.pxToRpxScale = pxToRpxScale
  233. this.rpxTopxScale = systemInfo.windowWidth / 750
  234. let systems = {
  235. ktxStatusHeight: systemInfo.statusBarHeight * pxToRpxScale, // 状态栏的高度
  236. navigationHeight: 44 * pxToRpxScale // 导航栏的高度
  237. };
  238. systems.barHeight = systems.ktxStatusHeight + systems.navigationHeight;
  239. this.systems = systems;
  240. },
  241. onPageScroll: function(e) {
  242. if (e.scrollTop > this.systems.barHeight) {
  243. this.isTop = 1;
  244. } else {
  245. this.isTop = 0;
  246. }
  247. }
  248. }
  249. </script>
  250. <style>
  251. @import "./operationDataPersonal.css";
  252. </style>