index.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <template>
  2. <view class="index-content">
  3. <Navbar :hideBtn="true" title="首页" bgColor="#fff" :h5Show="false" :fixed="false"></Navbar>
  4. <view class="index-block">
  5. <view class="index-block-title">运行统计</view>
  6. <u-row gutter="16">
  7. <u-col span="4">
  8. <view class="item-tj item-tj-frist">
  9. <view style="padding: 16rpx; height: 100%; position: relative;">
  10. <view style="display: flex; color: white;">
  11. <u-icon name="photo" color="#fff"></u-icon>
  12. <text>在线人数</text>
  13. </view>
  14. <view style="position: absolute; bottom: 48rpx; right: 16rpx;">
  15. <u-count-to :startVal="0" :endVal="149" :duration="1500" color="#fff" separator=","></u-count-to>
  16. </view>
  17. </view>
  18. </view>
  19. </u-col>
  20. <u-col span="4">
  21. <view class="item-tj item-tj-second">
  22. <view style="padding: 16rpx; height: 100%; position: relative;">
  23. <view style="display: flex; color: white;">
  24. <u-icon name="photo" color="#fff"></u-icon>
  25. <text>今日新增</text>
  26. </view>
  27. <view style="position: absolute; bottom: 48rpx; right: 16rpx;">
  28. <u-count-to :startVal="1" :endVal="2349" :duration="1500" color="#fff" separator=","></u-count-to>
  29. </view>
  30. </view>
  31. </view>
  32. </u-col>
  33. <u-col span="4">
  34. <view class="item-tj item-tj-thrid">
  35. <view style="padding: 16rpx; height: 100%; position: relative;">
  36. <view style="display: flex; color: white;">
  37. <u-icon name="photo" color="#fff"></u-icon>
  38. <text>总人数</text>
  39. </view>
  40. <view style="position: absolute; bottom: 48rpx; right: 16rpx;">
  41. <u-count-to :startVal="1" :endVal="1249350" :duration="1500" color="#fff" separator=","></u-count-to>
  42. </view>
  43. </view>
  44. </view>
  45. </u-col>
  46. </u-row>
  47. </view>
  48. <view class="index-block">
  49. <view class="index-block-title">近7天访问量统计</view>
  50. <view>
  51. <qiun-data-charts type="line" canvasId="finance_a" :canvas2d="isCanvas2d" :resshow="delayload"
  52. :opts="{xAxis:{itemCount:12,disableGrid:true},yAxis:{disableGrid:true,data:[{disabled:true}]}}"
  53. :chartData="historyData" />
  54. </view>
  55. <view class="index-block-title">访问量统计</view>
  56. <view>
  57. <qiun-data-charts type="bar" canvasId="finance_b" :canvas2d="isCanvas2d" :resshow="delayload"
  58. :opts="{xAxis:{disabled: true,disableGrid:true},extra:{bar:{barBorderCircle:true,width:20}},legend:{show:false}}"
  59. :chartData="historyData" />
  60. </view>
  61. </view>
  62. <view class="index-block">
  63. <view class="index-block-title">数据总览</view>
  64. <view class="detail_list">
  65. <view v-for="(item,index) in detail_list" :key="index" class="detail_item">
  66. <view>
  67. <view class="font-middle">{{item.date}}</view>
  68. <view class="font-small">{{item.time}}</view>
  69. </view>
  70. <view class="icon"><li :class="['iconfont',item.type == 'income'?'icon-income':'icon-expend']"></li></view>
  71. <view class="right_content">
  72. <view class="money">{{item.type == 'income'?'+':'-'}}{{item.money}}</view>
  73. <view class="text-gray font-middle">{{item.desc}}</view>
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. </template>
  80. <script>
  81. import Navbar from '@/components/navbar/Navbar'
  82. let _now = new Date();
  83. let now_time = {};
  84. now_time.year = _now.getFullYear()
  85. now_time.month = _now.getMonth() + 1
  86. now_time.day = _now.getDay()
  87. export default {
  88. components: {
  89. Navbar,
  90. },
  91. data () {
  92. return {
  93. isCanvas2d: true,
  94. delayload: false,
  95. historyData: {
  96. "categories": [
  97. "1月",
  98. "2月",
  99. "2月",
  100. "4月",
  101. "5月"
  102. ],
  103. "series": [
  104. {
  105. "name": "收入情况",
  106. "data": [1601,1840.5,1900,1760,1500.85],
  107. "type": "line",
  108. "style": "curve",
  109. "color": "#4ECDB6",
  110. "unit":""
  111. }
  112. ],
  113. "yAxis":[
  114. {"calibration":true,"position":"left","title":"单位/元","titleFontSize":12,"unit":"","tofix":0,"min":0,"disableGrid":true}
  115. ]
  116. },
  117. detail_list:[
  118. {date:now_time.month + "-01",time:"11:01","type":"extend",money:"10.00",desc:"银行卡转出"},
  119. {date:now_time.month + "-01",time:"13:45","type":"income",money:"18.00",desc:"银行卡收入"},
  120. {date:now_time.month + "-02",time:"06:21","type":"extend",money:"123.45",desc:"信用卡转出"},
  121. {date:now_time.month + "-03",time:"07:38","type":"income",money:"23.00",desc:"银行卡收入"},
  122. {date:now_time.month + "-08",time:"16:28","type":"extend",money:"23.56",desc:"信用卡转出"},
  123. {date:now_time.month + "-09",time:"15:25","type":"income",money:"850.12",desc:"银行卡收入"},
  124. {date:now_time.month + "-09",time:"18:52","type":"income",money:"1.88",desc:"银行卡收入"},
  125. {date:now_time.month + "-11",time:"21:12","type":"extend",money:"220.21",desc:"银行卡转出"},
  126. {date:now_time.month + "-12",time:"13:08","type":"income",money:"32.28",desc:"银行卡收入"},
  127. {date:now_time.month + "-12",time:"12:41","type":"extend",money:"122.12",desc:"信用卡转出"},
  128. {date:now_time.month + "-13",time:"17:21","type":"income",money:"10.00",desc:"银行卡收入"},
  129. ]
  130. }
  131. }
  132. }
  133. </script>
  134. <style lang="scss">
  135. .index-content {
  136. background-color: #f3f4f6;
  137. min-height: 100vh;
  138. }
  139. .index-block {
  140. padding: 40rpx;
  141. background-color: #fff;
  142. }
  143. .index-block-title {
  144. font-size: 40rpx;
  145. font-weight: bold;
  146. padding: 0 0 40rpx 0;
  147. }
  148. .item-tj {
  149. width: 100%;
  150. height: 160rpx;
  151. border-radius: 16rpx;
  152. &-frist {
  153. background-color: rgba($color: #2979ff, $alpha: 0.8);
  154. // background-image: url('/static/img/bg/qb.png');
  155. }
  156. &-second {
  157. background-color: rgba($color: #303133, $alpha: 0.8);
  158. // background-image: url('/static/img/bg/qb.png');
  159. }
  160. &-thrid {
  161. background-color: rgba($color: #19be6b, $alpha: 0.8);
  162. // background-image: url('/static/img/bg/qb.png');
  163. }
  164. }
  165. .detail_list{
  166. height: 700rpx;
  167. overflow: auto;
  168. color: #9E9E9E;
  169. .detail_item{
  170. display: flex;
  171. margin: 20rpx 0;
  172. align-items: center;
  173. .icon{
  174. width: 30%;
  175. text-align: center;
  176. li{
  177. font-size: 80rpx;
  178. }
  179. }
  180. .right_content{
  181. width: 50%;
  182. text-align: center;
  183. }
  184. .icon-income{
  185. color:#4AABF9;
  186. }
  187. .icon-expend{
  188. color: #E45521;
  189. }
  190. .money{
  191. color: #000;
  192. }
  193. }
  194. }
  195. </style>