funnel.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template>
  2. <!-- 对应页面:支付统计-转换漏斗分析 -->
  3. <view class="fix-top-window">
  4. <view class="uni-header">
  5. <uni-stat-breadcrumb class="uni-stat-breadcrumb-on-phone" />
  6. </view>
  7. <view class="uni-container">
  8. <view class="uni-stat--x flex p-1015">
  9. <view class="uni-stat--app-select">
  10. <uni-data-select collection="opendb-app-list" field="appid as value, name as text" orderby="text asc" :def-item="1" label="应用选择" v-model="query.appid" :clear="false" />
  11. <uni-data-select collection="opendb-app-versions" :where="versionQuery" class="ml-m" field="_id as value, version as text, uni_platform as label, create_date as date" format="{label} - {text}" orderby="date desc" label="版本选择" v-model="query.version_id" />
  12. </view>
  13. </view>
  14. <view class="uni-stat--x">
  15. <uni-stat-tabs label="平台选择" type="boldLine" mode="platform" v-model="query.platform_id" @change="platformChange" />
  16. <uni-data-select ref="version-select" v-if="query.platform_id && query.platform_id.indexOf('==') === -1" collection="uni-stat-app-channels" :where="channelQuery" class="p-channel" field="_id as value, channel_name as text" orderby="text asc" label="渠道/场景值选择" v-model="query.channel_id" />
  17. </view>
  18. <!-- 漏斗分析 -->
  19. <funnelChart :query="query"></funnelChart>
  20. <!-- 转化率趋势图 -->
  21. <trendChart :query="query"></trendChart>
  22. </view>
  23. <!-- #ifndef H5 -->
  24. <fix-window />
  25. <!-- #endif -->
  26. </view>
  27. </template>
  28. <script>
  29. import {
  30. mapfields,
  31. stringifyQuery,
  32. stringifyField,
  33. stringifyGroupField,
  34. getTimeOfSomeDayAgo,
  35. division,
  36. format,
  37. formatDate,
  38. parseDateTime,
  39. getFieldTotal,
  40. debounce
  41. } from '@/js_sdk/uni-stat/util.js'
  42. import timeUtil from "@/js_sdk/uni-stat/timeUtil.js"
  43. import funnelChart from "./components/funnelChart"
  44. import trendChart from "./components/trendChart"
  45. export default {
  46. components:{
  47. funnelChart,
  48. trendChart,
  49. },
  50. data() {
  51. return {
  52. tableName: 'uni-stat-pay-result',
  53. query: {
  54. dimension: 'hour',
  55. appid: '',
  56. platform_id: '',
  57. uni_platform: '',
  58. version_id: '',
  59. start_time: [],
  60. },
  61. loading: false,
  62. }
  63. },
  64. onLoad(option) {
  65. const {
  66. appid
  67. } = option
  68. if (appid) {
  69. this.query.appid = appid
  70. }
  71. },
  72. created() {
  73. },
  74. methods: {
  75. // 监听 - 平台更改
  76. platformChange(id, index, name, item) {
  77. this.query.version_id = 0;
  78. this.query.uni_platform = item.code;
  79. },
  80. },
  81. watch: {
  82. },
  83. computed: {
  84. versionQuery() {
  85. const {
  86. appid,
  87. uni_platform
  88. } = this.query
  89. const query = stringifyQuery({
  90. appid,
  91. uni_platform
  92. })
  93. return query
  94. },
  95. channelQuery() {
  96. const {
  97. appid,
  98. platform_id,
  99. } = this.query
  100. const query = stringifyQuery({
  101. appid,
  102. platform_id
  103. })
  104. return query
  105. },
  106. },
  107. }
  108. </script>