echart-order.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <template>
  2. <view class="echart-content">
  3. <view class="echart-title">
  4. <view class="e-icon e2"><text class="iconfont icon-dingdan"></text></view> <view class="e-name">订单</view>
  5. </view>
  6. <view class="echart-search">
  7. <view class="echart-search-text">
  8. <view class="search-text">所有:<text>¥10000(10个)</text></view>
  9. <view class="search-text">当前范围:<text>¥10000(10个)</text></view>
  10. </view>
  11. <view class="echart-search-date">
  12. <view class="echart-search-date-input">
  13. <picker mode="date" :value="date" :start="startDate" :end="endDate" @change="bindStartDateChange">
  14. <text class="input-text">{{ queryData.startAddTime }}</text>
  15. </picker>
  16. <text class="iconfont icon-riqi"></text>
  17. </view>
  18. <view class="line">-</view>
  19. <view class="echart-search-date-input">
  20. <picker mode="date" :value="date" :start="startDate" :end="endDate" @change="bindEndDateChange">
  21. <text class="input-text">{{ queryData.endAddTime }}</text>
  22. </picker>
  23. <text class="iconfont icon-riqi"></text>
  24. </view>
  25. </view>
  26. <view class="echart-search-time">
  27. <view
  28. class="time-tab"
  29. v-for="(time, index) in timeList"
  30. :class="{ current: current === index }"
  31. :key="index"
  32. @click="handleTimeClick(time.current,index)"
  33. >{{ time.label }}</view
  34. >
  35. </view>
  36. </view>
  37. <view class="echart-mains">
  38. <qiun-data-charts type="pie" :opts="opts" :chartData="chartData" :errorShow="false" />
  39. </view>
  40. </view>
  41. </template>
  42. <script>
  43. import { mapState, mapMutations } from 'vuex'
  44. import chartMixin from './mixins/chart.mixin.js'
  45. export default {
  46. mixins: [chartMixin],
  47. data() {
  48. const currentDate = this.getDate({
  49. format: true
  50. })
  51. return {
  52. chartData: {},
  53. opts: {
  54. timing: 'easeOut',
  55. duration: 1000,
  56. rotate: false,
  57. rotateLock: false,
  58. color: [
  59. '#1890FF',
  60. '#91CB74',
  61. '#FAC858',
  62. '#EE6666',
  63. '#73C0DE',
  64. '#3CA272',
  65. '#FC8452',
  66. '#9A60B4',
  67. '#ea7ccc'
  68. ],
  69. padding: [5, 5, 5, 5],
  70. fontSize: 13,
  71. fontColor: '#666666',
  72. dataLabel: true,
  73. dataPointShape: true,
  74. dataPointShapeType: 'solid',
  75. touchMoveLimit: 60,
  76. enableScroll: false,
  77. enableMarkLine: false,
  78. legend: {
  79. show: false,
  80. position: 'bottom',
  81. lineHeight: 25,
  82. float: 'bottom',
  83. padding: 5,
  84. margin: 5,
  85. backgroundColor: 'rgba(0,0,0,0)',
  86. borderColor: 'rgba(0,0,0,0)',
  87. borderWidth: 0,
  88. fontSize: 13,
  89. fontColor: '#666666',
  90. hiddenColor: '#CECECE',
  91. itemGap: 10
  92. },
  93. title: {
  94. name: '订单总量',
  95. fontSize: 15,
  96. color: '#666666',
  97. offsetX: 0,
  98. offsetY: 0
  99. },
  100. subtitle: {
  101. name: '70%',
  102. fontSize: 25,
  103. color: '#7cb5ec',
  104. offsetX: 0,
  105. offsetY: 0
  106. },
  107. extra: {
  108. ring: {
  109. ringWidth: 30,
  110. activeOpacity: 0.5,
  111. activeRadius: 10,
  112. offsetAngle: 0,
  113. labelWidth: 15,
  114. border: true,
  115. borderWidth: 3,
  116. borderColor: '#FFFFFF',
  117. centerColor: '#FFFFFF',
  118. customRadius: 0,
  119. linearType: 'none'
  120. },
  121. tooltip: {
  122. showBox: true,
  123. showArrow: true,
  124. showCategory: false,
  125. borderWidth: 0,
  126. borderRadius: 0,
  127. borderColor: '#000000',
  128. borderOpacity: 0.7,
  129. bgColor: '#000000',
  130. bgOpacity: 0.7,
  131. gridType: 'solid',
  132. dashLength: 4,
  133. gridColor: '#CCCCCC',
  134. boxPadding: 3,
  135. fontSize: 13,
  136. lineHeight: 20,
  137. fontColor: '#FFFFFF',
  138. legendShow: true,
  139. legendShape: 'auto',
  140. splitLine: true,
  141. horizentalLine: false,
  142. xAxisLabel: false,
  143. yAxisLabel: false,
  144. labelBgColor: '#FFFFFF',
  145. labelBgOpacity: 0.7,
  146. labelFontColor: '#666666'
  147. }
  148. }
  149. }
  150. }
  151. },
  152. created() {
  153. console.log('111111111')
  154. this.getServerData()
  155. },
  156. filters: {},
  157. methods: {
  158. getServerData() {
  159. //模拟从服务器获取数据时的延时
  160. setTimeout(() => {
  161. //模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
  162. let res = {
  163. series: [
  164. {
  165. format: 'pieDemo1',
  166. data: [
  167. { name: '普通', value: 50, per: '63.5%' },
  168. { name: '二手', value: 5, per: '0%' },
  169. { name: '返佣', value: 5, per: '0%' },
  170. { name: '部分退款', value: 2, per: '0%' },
  171. { name: '全部退款', value: 4, per: '36.5%' },
  172. { name: '已关闭', value: 60, per: '0%' }
  173. ]
  174. }
  175. ]
  176. }
  177. this.chartData = JSON.parse(JSON.stringify(res))
  178. }, 500)
  179. }
  180. },
  181. onShow() {}
  182. }
  183. </script>
  184. <style lang="scss"></style>