projectAdmin.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <template>
  2. <view class="project-container">
  3. <view class="project-item">
  4. <view class="project-title">
  5. <view class="title-line"></view>
  6. <view class="title-label">房源管理</view>
  7. </view>
  8. <view class="project-content">
  9. <view class="air-item">
  10. <view class="test-item">
  11. <view class="name">总面积(㎡)</view>
  12. <view class="number">120</view>
  13. </view>
  14. <view class="line"></view>
  15. <view class="test-item">
  16. <view class="name">已租面积(㎡)</view>
  17. <view class="number">120</view>
  18. </view>
  19. <view class="line"></view>
  20. <view class="test-item">
  21. <view class="name">剩余面积(㎡)</view>
  22. <view class="number">120</view>
  23. </view>
  24. </view>
  25. <view class="air-item">
  26. <view class="test-item">
  27. <view class="name">总房源(个)</view>
  28. <view class="number">64</view>
  29. </view>
  30. <view class="line"></view>
  31. <view class="test-item">
  32. <view class="name">已租房源(个)</view>
  33. <view class="number">63</view>
  34. </view>
  35. <view class="line"></view>
  36. <view class="test-item">
  37. <view class="name">剩余房源(个)</view>
  38. <view class="number">1</view>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. <view class="project-item">
  44. <view class="project-title">
  45. <view class="title-line"></view>
  46. <view class="title-label">费用管理</view>
  47. </view>
  48. <view class="project-content">
  49. <view class="bill-subsection">
  50. <uv-subsection :list="list" :current="current" custom-style="height: 60rpx;border-radius: 30rpx;"
  51. custom-item-style="border-radius: 30rpx;" @change="change">
  52. </uv-subsection>
  53. </view>
  54. <view class="bill-charts">
  55. <qiun-data-charts type="pie" :opts="opts" :chartData="chartData" :canvas2d="true"
  56. canvasId="charts1">
  57. </qiun-data-charts>
  58. </view>
  59. </view>
  60. </view>
  61. </view>
  62. </template>
  63. <script>
  64. export default {
  65. data() {
  66. return {
  67. chartData: {},
  68. //您可以通过修改 config-ucharts.js 文件中下标为 ['pie'] 的节点来配置全局默认参数,如都是默认参数,此处可以不传 opts 。实际应用过程中 opts 只需传入与全局默认参数中不一致的【某一个属性】即可实现同类型的图表显示不同的样式,达到页面简洁的需求。
  69. opts: {
  70. color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
  71. "#ea7ccc"
  72. ],
  73. padding: [5, 5, 5, 5],
  74. enableScroll: false,
  75. extra: {
  76. pie: {
  77. activeOpacity: 0.5,
  78. activeRadius: 10,
  79. offsetAngle: 0,
  80. labelWidth: 15,
  81. border: true,
  82. borderWidth: 3,
  83. borderColor: "#FFFFFF"
  84. }
  85. }
  86. },
  87. list: ['房租', '物业', '水电'],
  88. current: 0
  89. }
  90. },
  91. onReady() {
  92. this.getServerData();
  93. },
  94. methods: {
  95. getServerData() {
  96. //模拟从服务器获取数据时的延时
  97. setTimeout(() => {
  98. //模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
  99. let res = {
  100. series: [{
  101. data: [{
  102. "name": "应收",
  103. "value": 50,
  104. "labelShow": false
  105. }, {
  106. "name": "已收",
  107. "value": 30,
  108. "labelShow": false
  109. }, {
  110. "name": "逾期",
  111. "value": 20,
  112. "labelShow": false
  113. }]
  114. }]
  115. };
  116. this.chartData = JSON.parse(JSON.stringify(res));
  117. }, 500);
  118. },
  119. change(index) {
  120. this.current = index;
  121. }
  122. }
  123. }
  124. </script>
  125. <style lang="scss">
  126. .project-container {
  127. padding: 30rpx;
  128. .bill-subsection {
  129. margin-top: 30rpx;
  130. }
  131. .bill-charts {
  132. height: 400rpx;
  133. }
  134. .project-item {
  135. padding: 30rpx;
  136. background: #fff;
  137. margin-bottom: 20rpx;
  138. border-radius: 16rpx;
  139. .project-title {
  140. display: flex;
  141. align-items: center;
  142. }
  143. .title-line {
  144. width: 18rpx;
  145. height: 52rpx;
  146. background: $uni-primary;
  147. border-radius: 18rpx;
  148. }
  149. .title-label {
  150. font-size: 32rpx;
  151. font-weight: bold;
  152. margin-left: 20rpx;
  153. }
  154. .air-item {
  155. display: flex;
  156. align-items: center;
  157. margin-top: 20rpx;
  158. .test-item {
  159. flex: 1;
  160. width: 0;
  161. overflow: hidden;
  162. text-align: center;
  163. position: relative;
  164. }
  165. .name {
  166. font-size: 24rpx;
  167. margin-bottom: 8rpx;
  168. line-height: 36rpx;
  169. color: $uni-secondary-color;
  170. }
  171. .number {
  172. font-size: 18px;
  173. color: $uni-primary;
  174. }
  175. .line {
  176. height: 32rpx;
  177. width: 2rpx;
  178. background: $uni-border-1;
  179. }
  180. }
  181. }
  182. }
  183. </style>