index.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766
  1. <!-- 数据组件页面 -->
  2. <template>
  3. <view class="column flex-1 hb">
  4. <view class="topdata">
  5. <!-- #ifdef MP-WEIXIN -->
  6. <view class="h110"></view>
  7. <!-- #endif -->
  8. <view class="topdata-box" @click="operation">
  9. <view class="justify-between">
  10. <view>数据汇总</view>
  11. <view class="justify-between center">
  12. <text class="fs24 " style="color: #666;">查看详细数据</text>
  13. <u-icon name="arrow-right-double" color="#666666" size="14"></u-icon>
  14. </view>
  15. </view>
  16. <view class="x-bc">
  17. <view class="topdata-item">
  18. <view class="topdata-item-num"><text>{{companyUserUserCount}}</text>人</view>
  19. <view>会员总数</view>
  20. </view>
  21. <view class="topdata-item">
  22. <view class="topdata-item-num"><text>{{companyUserCount}}</text>人</view>
  23. <view>今日新增会员</view>
  24. </view>
  25. </view>
  26. </view>
  27. <view>
  28. <u-collapse ref="pydameinvRef" :value="['show']" :border='false' @change='changelable'>
  29. <!-- #ifdef MP-WEIXIN -->
  30. <u-collapse-item name="show" title="标签统计">
  31. <!-- #endif -->
  32. <!-- #ifndef MP-WEIXIN -->
  33. <u-collapse-item name="show">
  34. <view slot="title">
  35. <text class="bold fs32">标签统计</text>
  36. <text class="fs24 base-color-9 ml12">左滑查看更多</text>
  37. </view>
  38. <!-- #endif -->
  39. <text slot="value" class="statistics-slot-title">{{collapseLable?'展开':'收回'}}</text>
  40. <view slot="right-icon">
  41. <u-icon name="arrow-right" color="#1677ff" size="12"></u-icon>
  42. </view>
  43. <view class="">
  44. <!-- #ifdef MP-WEIXIN -->
  45. <view class="fs24 mb12">左滑查看更多</view>
  46. <!-- #endif -->
  47. <view class=" mb20 morelable">
  48. <view class="base-bg-f5 p20 radius20 boxlable mr40"
  49. v-for="(item,index) in lablelistnum" :key="index"
  50. style="display: inline-block;">
  51. <view class="base-color-3 ">{{item.tagName}}</view>
  52. <view class="base-color mt8">
  53. <text class="fs40 bold">{{item.number}}</text>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. </u-collapse-item>
  59. </u-collapse>
  60. </view>
  61. <view class="searchbox">
  62. <view class="searchbox-bar x-ac">
  63. <view :class="queryParam.type == index ? 'searchbox-item searchbox-active':'searchbox-item'"
  64. v-for="(item,index) in typeOption" :key="index" @click="handleType(index)">{{item.label}}</view>
  65. </view>
  66. <view class="x-ac ss" v-show="queryParam.type == 3">
  67. <view class="calendar-day x-c" @click="showCalendar = true"><u-icon name="calendar" color="#999"
  68. size="20"></u-icon>{{startTime}}</view>
  69. <view class="calendar-day x-c" @click="showCalendar = true"><u-icon name="calendar" color="#999"
  70. size="20"></u-icon>{{endTime}}</view>
  71. </view>
  72. </view>
  73. </view>
  74. <view class="">
  75. <u-calendar :show="showCalendar" :mode="mode" @confirm="confirmCalendar" style="flex: 0; overflow: hidden;"
  76. @close="closeCalendar"></u-calendar>
  77. </view>
  78. <view class="statistics pb120" :style="{height: contentH}">
  79. <u-collapse :border='false' :value='collapseValue' @change="changeCollapse">
  80. <!-- #ifdef MP-WEIXIN -->
  81. <u-collapse-item name="course" title="课程统计">
  82. <!-- #endif -->
  83. <!-- #ifndef MP-WEIXIN -->
  84. <u-collapse-item name="course">
  85. <text slot="title" class="statistics-title">课程统计</text>
  86. <!-- #endif -->
  87. <text slot="value"
  88. class="statistics-slot-title">{{collapseValue.includes('course')?'收回':'展开'}}</text>
  89. <view slot="right-icon">
  90. <u-icon name="arrow-right" color="#1677ff" size="12"></u-icon>
  91. </view>
  92. <view class="collapse-content x-ac">
  93. <view class="collapse-content-item">
  94. <view class="collapse-content-title">观看人数</view>
  95. <view class="collapse-content-num"><text>{{courseCount.courseWatchNum?courseCount.courseWatchNum:'0' }}</text>人
  96. </view>
  97. <view style="color: #1677ff;" v-show="queryParam.type == 0">
  98. 较昨天持平{{compare(courseCount.courseWatchNum,yesterdayVO.courseWatchNum?yesterdayVO.courseWatchNum:'0')}}</view>
  99. <view v-show="queryParam.type == 0">昨天{{yesterdayVO.courseWatchNum?yesterdayVO.courseWatchNum:'0'}}</view>
  100. </view>
  101. <view class="collapse-content-item">
  102. <view class="collapse-content-title">完播人数</view>
  103. <view class="collapse-content-num"><text>{{courseCount.courseCompleteNum || 0}}</text>人
  104. </view>
  105. <view style="color: #1677ff;" v-show="queryParam.type == 0">
  106. 较昨天持平{{compare(courseCount.courseCompleteNum,yesterdayVO.courseCompleteNum)}}
  107. </view>
  108. <view v-show="queryParam.type == 0">昨天{{yesterdayVO.courseCompleteNum || 0}}
  109. </view>
  110. </view>
  111. <view class="collapse-content-item">
  112. <view class="collapse-content-title">完播率</view>
  113. <view class="collapse-content-num"><text>{{courseCount.courseCompleteRate || 0}}</text>%
  114. </view>
  115. <view style="color: #1677ff;" v-show="queryParam.type == 0">
  116. 较昨天持平{{compare(courseCount.courseCompleteRate,yesterdayVO.courseCompleteRate)}}
  117. </view>
  118. <view v-show="queryParam.type == 0">昨天{{yesterdayVO.courseCompleteRate || 0}}</view>
  119. </view>
  120. </view>
  121. </u-collapse-item>
  122. <!-- #ifdef MP-WEIXIN -->
  123. <u-collapse-item name="questions" title="答题统计">
  124. <!-- #endif -->
  125. <!-- #ifndef MP-WEIXIN -->
  126. <u-collapse-item name="questions">
  127. <text slot="title" class="statistics-title">答题统计</text>
  128. <!-- #endif -->
  129. <text slot="value"
  130. class="statistics-slot-title">{{collapseValue.includes('questions')?'收回':'展开'}}</text>
  131. <view slot="right-icon">
  132. <u-icon name="arrow-right" color="#1677ff" size="12"></u-icon>
  133. </view>
  134. <view class="collapse-content x-ac">
  135. <view class="collapse-content-item">
  136. <view class="collapse-content-title">答题人数</view>
  137. <view class="collapse-content-num"><text>{{courseCount.answerNum || 0}}</text>人
  138. </view>
  139. <view style="color: #1677ff;" v-show="queryParam.type == 0">
  140. 较昨天持平{{compare(courseCount.answerNum,yesterdayVO.answerNum)}}</view>
  141. <view v-show="queryParam.type == 0">昨天{{yesterdayVO.answerNum || 0}}</view>
  142. </view>
  143. <view class="collapse-content-item">
  144. <view class="collapse-content-title">正确人数</view>
  145. <view class="collapse-content-num"><text>{{courseCount.answerRightNum || 0}}</text>人
  146. </view>
  147. <view style="color: #1677ff;" v-show="queryParam.type == 0">
  148. 较昨天持平{{compare(courseCount.answerRightNum,yesterdayVO.answerRightNum)}}</view>
  149. <view v-show="queryParam.type == 0">昨天{{yesterdayVO.answerRightNum || 0}}</view>
  150. </view>
  151. <view class="collapse-content-item">
  152. <view class="collapse-content-title">正确率</view>
  153. <view class="collapse-content-num">
  154. <text>{{courseCount.answerRightRate || 0}}</text>%
  155. </view>
  156. <view style="color: #1677ff;" v-show="queryParam.type == 0">
  157. 较昨天持平{{compare(courseCount.answerRightRate,yesterdayVO.answerRightRate)}}</view>
  158. <view v-show="queryParam.type == 0">昨天{{yesterdayVO.answerRightRate || 0}}</view>
  159. </view>
  160. </view>
  161. </u-collapse-item>
  162. <!-- #ifdef MP-WEIXIN -->
  163. <u-collapse-item name="redenvelope" title="红包统计">
  164. <!-- #endif -->
  165. <!-- #ifndef MP-WEIXIN -->
  166. <u-collapse-item name="redenvelope">
  167. <text slot="title" class="statistics-title">红包统计</text>
  168. <!-- #endif -->
  169. <text slot="value"
  170. class="statistics-slot-title">{{collapseValue.includes('redenvelope')?'收回':'展开'}}</text>
  171. <view slot="right-icon">
  172. <u-icon name="arrow-right" color="#1677ff" size="12"></u-icon>
  173. </view>
  174. <view>
  175. <view class="collapse-content x-ac">
  176. <view class="collapse-content-item">
  177. <view class="collapse-content-title">答题红包数</view>
  178. <view class="collapse-content-num">
  179. <text>{{courseCount.redPacketNum || 0}}</text>个
  180. </view>
  181. <view style="color: #1677ff;" v-show="queryParam.type == 0">
  182. 较昨天持平{{compare(courseCount.redPacketNum,yesterdayVO.redPacketNum)}}
  183. </view>
  184. <view v-show="queryParam.type == 0">昨天{{yesterdayVO.redPacketNum || 0}}
  185. </view>
  186. </view>
  187. <view class="collapse-content-item">
  188. <view class="collapse-content-title">答题红包金额</view>
  189. <view class="collapse-content-num">
  190. <text>{{courseCount.redPacketAmount || '0.00'}}</text>元
  191. </view>
  192. <view style="color: #1677ff;" v-show="queryParam.type == 0">
  193. 较昨天持平{{compare(courseCount.redPacketAmount,yesterdayVO.redPacketAmount,1)}}
  194. </view>
  195. <view v-show="queryParam.type == 0">
  196. 昨天{{yesterdayVO.redPacketAmount || '0.00'}}
  197. </view>
  198. </view>
  199. </view>
  200. <!-- <view class="collapse-content x-ac" style="padding: 8px 0;">
  201. <view class="collapse-content-item">
  202. <view class="collapse-content-title">新会员奖励数</view>
  203. <view class="collapse-content-num"><text>{{redPacketCount.newCount || 0}}</text>个</view>
  204. <view style="color: #1677ff;" v-show="queryParam.type == 0">
  205. 较昨天持平{{compare(redPacketCount.newCount,redPacketCount.yesterdayNewCount)}}</view>
  206. <view v-show="queryParam.type == 0">昨天{{redPacketCount.yesterdayNewCount || 0}}</view>
  207. </view>
  208. <view class="collapse-content-item">
  209. <view class="collapse-content-title">新会员奖励金额</view>
  210. <view class="collapse-content-num">
  211. <text>{{redPacketCount.totalAmount || '0.00'}}</text>元
  212. </view>
  213. <view style="color: #1677ff;" v-show="queryParam.type == 0">
  214. 较昨天持平{{compare(redPacketCount.totalAmount,redPacketCount.yesterdayTotalAmount,1)}}
  215. </view>
  216. <view v-show="queryParam.type == 0">昨天{{redPacketCount.yesterdayTotalAmount || '0.00'}}
  217. </view>
  218. </view>
  219. </view> -->
  220. </view>
  221. </u-collapse-item>
  222. <!-- #ifdef MP-WEIXIN -->
  223. <u-collapse-item name="funnel" title="转化漏斗图" v-if="!ratelistState">
  224. <!-- #endif -->
  225. <!-- #ifndef MP-WEIXIN -->
  226. <u-collapse-item name="funnel" v-if="!ratelistState">
  227. <text slot="title" class="statistics-title">转化漏斗图</text>
  228. <!-- #endif -->
  229. <text slot="value"
  230. class="statistics-slot-title">{{collapseValue.includes('funnel')?'收回':'展开'}}</text>
  231. <view slot="right-icon">
  232. <u-icon name="arrow-right" color="#1677ff" size="12"></u-icon>
  233. </view>
  234. <view v-show="!ratelistState">
  235. <funnelChart :getratelist="getrateimg" />
  236. </view>
  237. <view v-show="ratelistState" class="center">暂无数据</view>
  238. </u-collapse-item>
  239. <!-- #ifdef MP-WEIXIN -->
  240. <u-collapse-item name="rank" title="排行榜">
  241. <!-- #endif -->
  242. <!-- #ifndef MP-WEIXIN -->
  243. <u-collapse-item name="rank">
  244. <text slot="title" class="statistics-title">排行榜</text>
  245. <!-- #endif -->
  246. <text slot="value"
  247. class="statistics-slot-title">{{collapseValue.includes('rank')?'收回':'展开'}}</text>
  248. <view slot="right-icon">
  249. <u-icon name="arrow-right" color="#1677ff" size="12"></u-icon>
  250. </view>
  251. <view class="flex-1">
  252. <!-- <view class="mt40">
  253. <view class="justify-between align-center">
  254. <view class="base-color-3 bold fs32">群管排行榜</view>
  255. <view class="justify-start" @click="ordergroup(1)"
  256. v-if="orderGroup=='asc'">
  257. <u-icon name="list-dot" size="20"></u-icon>
  258. <view>按正序(前20名)</view>
  259. </view>
  260. <view class="justify-start" @click="ordergroup(0)" v-else>
  261. <u-icon name="list-dot" size="20"></u-icon>
  262. <view>按倒序(后20名)</view>
  263. </view>
  264. </view>
  265. <view class="centerV">
  266. <u-tabs :list="list1" @click="clickTab" lineColor='#1773ff'
  267. lineWidth='40' activeStyle="font-weight:bold"></u-tabs>
  268. </view>
  269. <view class="justify-start align-center mtb28"
  270. v-for="(item,index) in rankListA" :key="index">
  271. <u-avatar :src="item.avatar" size="40"></u-avatar>
  272. <view class="flex-1 ml20">
  273. <view class="justify-between mb16">
  274. <view class="base-color-3 single-line-ellipsis">
  275. {{item.userName}}
  276. </view>
  277. <view v-if="index==0">{{item.completeRate}}%</view>
  278. <view v-else>{{item.answerRightRate}}%</view>
  279. </view>
  280. <u-line-progress :percentage="item.completeRate"
  281. activeColor='#1773ff' v-if="index==0" />
  282. <u-line-progress :percentage="item.answerRightRate"
  283. activeColor='#1773ff' v-else />
  284. </view>
  285. </view>
  286. <view v-if="rankListA.length==0" class="center mtb32">暂无数据</view>
  287. </view> -->
  288. <view class="mt60 column flex-1">
  289. <view class="justify-between align-center">
  290. <view class="base-color-3 bold fs32">课程排行榜</view>
  291. <view class="justify-start" @click="ordergroupB(1)"
  292. v-if="orderGroupB=='asc'">
  293. <u-icon name="list-dot" size="20"></u-icon>
  294. <view>按正序(前20名)</view>
  295. </view>
  296. <view class="justify-start" @click="ordergroupB(0)" v-else>
  297. <u-icon name="list-dot" size="20"></u-icon>
  298. <view>按倒序(后20名)</view>
  299. </view>
  300. </view>
  301. <view class="centerV">
  302. <u-tabs :list="list1" @click="clickTabB" lineColor='#1773ff'
  303. lineWidth='40' activeStyle="font-weight:bold"></u-tabs>
  304. </view>
  305. <view class="justify-start align-center"
  306. v-for="(item,index) in rankListB" :key="index">
  307. <view class="flex-1 ml20">
  308. <view class="justify-between mb16">
  309. <view class="base-color-3 single-line-ellipsis">
  310. {{item.videoName}}
  311. </view>
  312. <view v-if="index==0">{{item.completeRate}}%</view>
  313. <view v-else>{{item.answerRightRate}}%</view>
  314. </view>
  315. <u-line-progress :percentage="item.completeRate"
  316. activeColor='#1773ff' v-if="index==0" />
  317. <u-line-progress :percentage="item.answerRightRate"
  318. activeColor='#1773ff' v-else />
  319. </view>
  320. </view>
  321. <view v-if="rankListB.length==0" class="center mtb32">暂无数据</view>
  322. </view>
  323. </view>
  324. </u-collapse-item>
  325. </u-collapse>
  326. </view>
  327. <u-loading-page :loading="viewload" iconSize="32" loadingColor="#3c9cff" fontSize="20"
  328. :loading-text="loadingtext"></u-loading-page>
  329. </view>
  330. </template>
  331. <script>
  332. import code from "@/uni_modules/uview-ui/libs/config/props/code"
  333. import funnelChart from "@/components/chart.vue"
  334. import {
  335. getCompanyUserAndUserCount,
  336. getCourseCount,
  337. getcourseRate,
  338. getGroupRanklist,
  339. getCourseRanklist
  340. } from "@/api/courseManage.js"
  341. export default {
  342. components: {
  343. funnelChart,
  344. },
  345. data() {
  346. return {
  347. viewload:true,
  348. loadingtext:'数据加载中...',
  349. list1: [{
  350. name: '按完播率',
  351. }, {
  352. name: '按正确率'
  353. }],
  354. orderGroup: 'asc',
  355. orderGroupB: 'asc',
  356. showCalendar: false,
  357. mode: 'range',
  358. typeOption: [{
  359. label: '今日',
  360. value: 0
  361. }, {
  362. label: '昨日',
  363. value: 1
  364. }, {
  365. label: '本月',
  366. value: 2
  367. }, {
  368. label: '自定义',
  369. value: 3
  370. }],
  371. queryParam: {
  372. type: 0
  373. },
  374. contentH: 0,
  375. contentHs: 0,
  376. collapseValue: ['course', 'questions', 'redenvelope', 'funnel', 'rank'],
  377. user: {},
  378. todayday: uni.$u.timeFormat(new Date(), 'yyyy-mm-dd'),
  379. startTime: '',
  380. endTime: '',
  381. companyUserCount: 0,
  382. companyUserUserCount: 0,
  383. courseCount: {
  384. courseWatchNum: 0
  385. },
  386. collapseLable: false,
  387. lablelistnum: [],
  388. getrateimg: {},
  389. rankListA: [],
  390. rankListB: [],
  391. activeA: 1,
  392. activeB: 1,
  393. yesterdayVO: [],
  394. ratelistState: false
  395. }
  396. },
  397. computed: {
  398. compare() {
  399. return (today, yesterday, type) => {
  400. const num = Number(yesterday || 0) - Number(today || 0)
  401. return type == 1 ? num.toFixed(2) : 0
  402. }
  403. }
  404. },
  405. onShow() {
  406. this.user = uni.getStorageSync("companyUserInfo") ? JSON.parse(uni.getStorageSync("companyUserInfo")) : {}
  407. // this.resetDate()
  408. this.getrateList()
  409. this.getrankCourse()
  410. this.getrankgroup()
  411. this.getUserCount()
  412. },
  413. mounted() {
  414. this.getHeight()
  415. },
  416. methods: {
  417. operation() {
  418. console.log(123)
  419. uni.navigateTo({
  420. url: '/pages/courseManage/operation/index'
  421. })
  422. },
  423. clickTab(item) {
  424. this.activeA = item.index + 1
  425. this.getrankgroup()
  426. console.log(this.activeA)
  427. },
  428. clickTabB(item) {
  429. this.activeB = item.index + 1
  430. this.getrankCourse()
  431. console.log(this.activeA)
  432. },
  433. ordergroup(item) {
  434. if (item == 0) {
  435. this.orderGroup = 'asc'
  436. this.getrankgroup()
  437. } else {
  438. this.orderGroup = 'desc'
  439. this.getrankgroup()
  440. }
  441. },
  442. ordergroupB(item) {
  443. if (item == 0) {
  444. this.orderGroupB = 'asc'
  445. this.getrankCourse()
  446. } else {
  447. this.orderGroupB = 'desc'
  448. this.getrankCourse()
  449. }
  450. },
  451. getrankCourse() {
  452. //获取课程排行
  453. // this.startTime = this.todayday
  454. // this.endTime = this.todayday
  455. // this.resetDate()
  456. const params = {
  457. endTime: this.endTime + ' 23:59:59',
  458. startTime: this.startTime + ' 00:00:00',
  459. order: this.orderGroupB,
  460. type: this.activeB, // 1-按完播率,2-按正确率
  461. }
  462. getCourseRanklist(params).then(res => {
  463. if (res.code == 200) {
  464. this.rankListB = res.data
  465. } else {
  466. uni.showToast({
  467. icon: 'none',
  468. title: res.msg
  469. })
  470. }
  471. })
  472. },
  473. getrankgroup() {
  474. //获取群管排行
  475. this.startTime = this.todayday
  476. this.endTime = this.todayday
  477. // this.resetDate()
  478. const params = {
  479. endTime: this.endTime + ' 23:59:59',
  480. startTime: this.startTime + ' 00:00:00',
  481. order: this.orderGroup,
  482. type: this.activeA, // 1-按完播率,2-按正确率
  483. }
  484. getGroupRanklist(params).then(res => {
  485. if (res.code == 200) {
  486. console.log(res)
  487. this.rankListA = res.data
  488. } else {
  489. uni.showToast({
  490. icon: 'none',
  491. title: res.msg
  492. })
  493. }
  494. })
  495. },
  496. getrateList() {
  497. //获取漏斗图
  498. this.startTime = this.todayday
  499. this.endTime = this.todayday
  500. this.resetDate()
  501. const params = {
  502. endTime: this.endTime + ' 23:59:59',
  503. startTime: this.startTime + ' 00:00:00',
  504. }
  505. getcourseRate(params).then(res => {
  506. if (res.code == 200) {
  507. this.ratelistState = res.data.every(item => item.value === 0);
  508. this.getrateimg = res
  509. console.log('漏斗',this.getrateimg)
  510. } else {
  511. uni.showToast({
  512. icon: 'none',
  513. title: res.msg
  514. })
  515. }
  516. })
  517. },
  518. changelable(e) {
  519. if (e[0].status == 'open') {
  520. console.log(e)
  521. this.collapseLable = false
  522. } else {
  523. this.collapseLable = true
  524. }
  525. },
  526. getHeight() {
  527. const windowHeight = uni.getSystemInfoSync().windowHeight
  528. const query = uni.createSelectorQuery().in(this);
  529. query
  530. .select(".topdata")
  531. .boundingClientRect((data) => {
  532. this.contentH = `calc(${windowHeight}px - ${data.height}px - 0px)`
  533. })
  534. .exec()
  535. },
  536. resetDate() {
  537. if (this.queryParam.type == 0) {
  538. this.startTime = this.todayday
  539. this.endTime = this.todayday
  540. } else if (this.queryParam.type == 1) {
  541. let yesterday = new Date();
  542. yesterday.setDate(yesterday.getDate() - 1);
  543. this.startTime = uni.$u.timeFormat(yesterday, 'yyyy-mm-dd')
  544. this.endTime = uni.$u.timeFormat(yesterday, 'yyyy-mm-dd')
  545. } else if (this.queryParam.type == 2) {
  546. let today = new Date();
  547. let lastDayOfMonth = new Date(today.getFullYear(), today.getMonth() + 1, 0);
  548. this.startTime = uni.$u.timeFormat(this.todayday, 'yyyy-mm') + '-01'
  549. this.endTime = uni.$u.timeFormat(lastDayOfMonth, 'yyyy-mm-dd')
  550. } else if (this.queryParam.type == 3) {
  551. this.startTime = this.todayday
  552. this.endTime = this.todayday
  553. }
  554. this.getCount()
  555. },
  556. handleType(type) {
  557. if (this.queryParam.type == type) {
  558. return
  559. }
  560. this.queryParam.type = type
  561. if (this.queryParam.type == 3) {
  562. this.getHeight()
  563. }
  564. this.resetDate()
  565. this.getrateList()
  566. this.getrankCourse()
  567. this.getrankgroup()
  568. },
  569. changeCollapse(e) {
  570. this.collapseValue = e.filter(item => item.status == 'open').map(it => it.name)
  571. },
  572. closeCalendar() {
  573. this.showCalendar = false
  574. },
  575. confirmCalendar(e) {
  576. this.startTime = e[0]
  577. this.endTime = e[e.length - 1]
  578. this.showCalendar = false
  579. this.getCount()
  580. },
  581. getUserCount() {
  582. getCompanyUserAndUserCount().then(res => {
  583. if (res.code == 200) {
  584. this.companyUserCount = res.data.todayNewUser || 0
  585. this.companyUserUserCount = res.data.userTotal || 0
  586. this.lablelistnum = res.data.tagList
  587. this.$nextTick(() => {
  588. this.viewload=false
  589. this.$refs.pydameinvRef.init()
  590. })
  591. } else {
  592. uni.showToast({
  593. icon: 'none',
  594. title: res.msg,
  595. });
  596. }
  597. })
  598. },
  599. getCount() {
  600. const param = {
  601. endTime: this.endTime + ' 23:59:59',
  602. startTime: this.startTime + ' 00:00:00',
  603. }
  604. this.getCourseCounts(param)
  605. },
  606. getCourseCounts(param) {
  607. getCourseCount(param).then(res => {
  608. if (res.code == 200) {
  609. console.log('课程统计',res)
  610. this.courseCount = res.data
  611. this.yesterdayVO = res.data.yesterdayVO
  612. } else {
  613. uni.showToast({
  614. icon: 'none',
  615. title: res.msg,
  616. });
  617. }
  618. })
  619. },
  620. }
  621. }
  622. </script>
  623. <style scoped lang="scss">
  624. .boxlable {
  625. width: 47%;
  626. }
  627. .morelable {
  628. width: 100%;
  629. overflow-x: auto;
  630. /* 添加横向滚动条 */
  631. white-space: nowrap;
  632. }
  633. .container {
  634. font-family: PingFang SC, PingFang SC;
  635. font-weight: 400;
  636. font-size: 14px;
  637. color: #222222;
  638. }
  639. .calendar-day {
  640. font-family: PingFang SC, PingFang SC;
  641. font-weight: 400;
  642. font-size: 12px;
  643. color: #999;
  644. flex: 1;
  645. margin: 10px 10px 0 10px;
  646. background-color: #f5f5f5;
  647. border-radius: 4px;
  648. }
  649. .topdata {
  650. padding-top: 25px;
  651. background: linear-gradient(to right, rgba(225, 238, 255, 1), rgba(223, 224, 254, 1));
  652. &-box {
  653. padding: 12px;
  654. margin: 0 12px 0 12px;
  655. background-color: rgba(255, 255, 255, 0.5);
  656. border-radius: 8px 8px;
  657. font-family: PingFang SC, PingFang SC;
  658. font-weight: 400;
  659. font-size: 14px;
  660. color: #222222;
  661. }
  662. &-item {
  663. width: 50%;
  664. text-align: center;
  665. padding: 8px;
  666. box-sizing: border-box;
  667. &-num {
  668. color: #1677ff;
  669. text {
  670. font-family: DIN, DIN;
  671. font-weight: bold;
  672. font-size: 25px;
  673. }
  674. }
  675. }
  676. .searchbox {
  677. background-color: #fff;
  678. border-radius: 8rpx 8rpx 0 0;
  679. padding: 15px;
  680. &-item {
  681. height: 23px;
  682. line-height: 23px;
  683. width: 65px;
  684. background: #f5f5f5;
  685. text-align: center;
  686. border-radius: 5px;
  687. font-family: PingFang SC, PingFang SC;
  688. font-weight: 400;
  689. font-size: 12px;
  690. color: #888;
  691. }
  692. &-active {
  693. color: #fff !important;
  694. background-color: #1677ff !important;
  695. }
  696. }
  697. }
  698. .statistics {
  699. background-color: #fff;
  700. overflow-y: auto;
  701. box-sizing: border-box;
  702. &-title {
  703. font-family: PingFang SC, PingFang SC;
  704. font-weight: bold;
  705. font-size: 16px;
  706. color: #222222;
  707. }
  708. &-slot-title {
  709. font-size: 12px;
  710. color: #1677ff;
  711. }
  712. .collapse-content {
  713. margin: 0 -8px -8rpx 0;
  714. &-item {
  715. flex: 1;
  716. padding: 12px;
  717. box-sizing: border-box;
  718. border-radius: 10px;
  719. background: #f5f5f5;
  720. font-family: PingFang SC, PingFang SC;
  721. font-weight: 400;
  722. font-size: 10px;
  723. color: #222222;
  724. margin: 0 8px 8rpx 0;
  725. }
  726. &-title {
  727. font-size: 14px;
  728. margin-bottom: 10px;
  729. }
  730. &-num {
  731. color: #1677ff;
  732. font-size: 10px;
  733. text {
  734. font-family: DIN, DIN;
  735. font-weight: bold;
  736. font-size: 25px;
  737. }
  738. }
  739. }
  740. }
  741. </style>