index.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760
  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 || 0}}</text>人
  96. </view>
  97. <view style="color: #1677ff;" v-show="queryParam.type == 0">
  98. 较昨天持平{{compare(courseCount.courseWatchNum,yesterdayVO.courseWatchNum)}}</view>
  99. <view v-show="queryParam.type == 0">昨天{{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. </view>
  328. </template>
  329. <script>
  330. import code from "@/uni_modules/uview-ui/libs/config/props/code"
  331. import funnelChart from "@/components/chart.vue"
  332. import {
  333. getCompanyUserAndUserCount,
  334. getCourseCount,
  335. getcourseRate,
  336. getGroupRanklist,
  337. getCourseRanklist
  338. } from "@/api/courseManage.js"
  339. export default {
  340. components: {
  341. funnelChart,
  342. },
  343. data() {
  344. return {
  345. list1: [{
  346. name: '按完播率',
  347. }, {
  348. name: '按正确率'
  349. }],
  350. orderGroup: 'asc',
  351. orderGroupB: 'asc',
  352. showCalendar: false,
  353. mode: 'range',
  354. typeOption: [{
  355. label: '今日',
  356. value: 0
  357. }, {
  358. label: '昨日',
  359. value: 1
  360. }, {
  361. label: '本月',
  362. value: 2
  363. }, {
  364. label: '自定义',
  365. value: 3
  366. }],
  367. queryParam: {
  368. type: 0
  369. },
  370. contentH: 0,
  371. contentHs: 0,
  372. collapseValue: ['course', 'questions', 'redenvelope', 'funnel', 'rank'],
  373. user: {},
  374. todayday: uni.$u.timeFormat(new Date(), 'yyyy-mm-dd'),
  375. startTime: '',
  376. endTime: '',
  377. companyUserCount: 0,
  378. companyUserUserCount: 0,
  379. courseCount: {
  380. courseWatchNum: 0
  381. },
  382. collapseLable: false,
  383. lablelistnum: [],
  384. getrateimg: {},
  385. rankListA: [],
  386. rankListB: [],
  387. activeA: 0,
  388. activeB: 0,
  389. yesterdayVO: [],
  390. ratelistState: false
  391. }
  392. },
  393. computed: {
  394. compare() {
  395. return (today, yesterday, type) => {
  396. const num = Number(yesterday || 0) - Number(today || 0)
  397. return type == 1 ? num.toFixed(2) : 0
  398. }
  399. }
  400. },
  401. onShow() {
  402. this.user = uni.getStorageSync("companyUserInfo") ? JSON.parse(uni.getStorageSync("companyUserInfo")) : {}
  403. // this.resetDate()
  404. this.getrateList()
  405. this.getrankCourse()
  406. this.getrankgroup()
  407. this.getUserCount()
  408. },
  409. mounted() {
  410. this.getHeight()
  411. },
  412. methods: {
  413. operation() {
  414. console.log(123)
  415. uni.navigateTo({
  416. url: '/pages/courseManage/operation/index'
  417. })
  418. },
  419. clickTab(item) {
  420. this.activeA = item.index + 1
  421. this.getrankgroup()
  422. console.log(this.activeA)
  423. },
  424. clickTabB(item) {
  425. this.activeB = item.index + 1
  426. this.getrankCourse()
  427. console.log(this.activeA)
  428. },
  429. ordergroup(item) {
  430. if (item == 0) {
  431. this.orderGroup = 'asc'
  432. this.getrankgroup()
  433. } else {
  434. this.orderGroup = 'desc'
  435. this.getrankgroup()
  436. }
  437. },
  438. ordergroupB(item) {
  439. if (item == 0) {
  440. this.orderGroupB = 'asc'
  441. this.getrankCourse()
  442. } else {
  443. this.orderGroupB = 'desc'
  444. this.getrankCourse()
  445. }
  446. },
  447. getrankCourse() {
  448. //获取课程排行
  449. this.startTime = this.todayday
  450. this.endTime = this.todayday
  451. // this.resetDate()
  452. const params = {
  453. endTime: this.endTime + ' 23:59:59',
  454. startTime: this.startTime + ' 00:00:00',
  455. order: this.orderGroupB,
  456. type: this.activeB, // 1-按完播率,2-按正确率
  457. }
  458. getCourseRanklist(params).then(res => {
  459. if (res.code == 200) {
  460. this.rankListB = res.data
  461. } else {
  462. uni.showToast({
  463. icon: 'none',
  464. title: res.msg
  465. })
  466. }
  467. })
  468. },
  469. getrankgroup() {
  470. //获取群管排行
  471. this.startTime = this.todayday
  472. this.endTime = this.todayday
  473. // this.resetDate()
  474. const params = {
  475. endTime: this.endTime + ' 23:59:59',
  476. startTime: this.startTime + ' 00:00:00',
  477. order: this.orderGroup,
  478. type: this.activeA, // 1-按完播率,2-按正确率
  479. }
  480. getGroupRanklist(params).then(res => {
  481. if (res.code == 200) {
  482. console.log(res)
  483. this.rankListA = res.data
  484. } else {
  485. uni.showToast({
  486. icon: 'none',
  487. title: res.msg
  488. })
  489. }
  490. })
  491. },
  492. getrateList() {
  493. //获取漏斗图
  494. this.startTime = this.todayday
  495. this.endTime = this.todayday
  496. this.resetDate()
  497. const params = {
  498. endTime: this.endTime + ' 23:59:59',
  499. startTime: this.startTime + ' 00:00:00',
  500. }
  501. getcourseRate(params).then(res => {
  502. if (res.code == 200) {
  503. this.ratelistState = res.data.every(item => item.value === 0);
  504. this.getrateimg = res
  505. // console.log('漏斗',allZero)
  506. } else {
  507. uni.showToast({
  508. icon: 'none',
  509. title: res.msg
  510. })
  511. }
  512. })
  513. },
  514. changelable(e) {
  515. if (e[0].status == 'open') {
  516. console.log(e)
  517. this.collapseLable = false
  518. } else {
  519. this.collapseLable = true
  520. }
  521. },
  522. getHeight() {
  523. const windowHeight = uni.getSystemInfoSync().windowHeight
  524. const query = uni.createSelectorQuery().in(this);
  525. query
  526. .select(".topdata")
  527. .boundingClientRect((data) => {
  528. this.contentH = `calc(${windowHeight}px - ${data.height}px - 0px)`
  529. })
  530. .exec()
  531. },
  532. resetDate() {
  533. if (this.queryParam.type == 0) {
  534. this.startTime = this.todayday
  535. this.endTime = this.todayday
  536. } else if (this.queryParam.type == 1) {
  537. let yesterday = new Date();
  538. yesterday.setDate(yesterday.getDate() - 1);
  539. this.startTime = uni.$u.timeFormat(yesterday, 'yyyy-mm-dd')
  540. this.endTime = uni.$u.timeFormat(yesterday, 'yyyy-mm-dd')
  541. } else if (this.queryParam.type == 2) {
  542. let today = new Date();
  543. let lastDayOfMonth = new Date(today.getFullYear(), today.getMonth() + 1, 0);
  544. this.startTime = uni.$u.timeFormat(this.todayday, 'yyyy-mm') + '-01'
  545. this.endTime = uni.$u.timeFormat(lastDayOfMonth, 'yyyy-mm-dd')
  546. } else if (this.queryParam.type == 3) {
  547. this.startTime = this.todayday
  548. this.endTime = this.todayday
  549. }
  550. this.getCount()
  551. },
  552. handleType(type) {
  553. if (this.queryParam.type == type) {
  554. return
  555. }
  556. this.queryParam.type = type
  557. if (this.queryParam.type == 3) {
  558. this.getHeight()
  559. }
  560. this.resetDate()
  561. this.getrateList()
  562. this.getrankCourse()
  563. this.getrankgroup()
  564. },
  565. changeCollapse(e) {
  566. this.collapseValue = e.filter(item => item.status == 'open').map(it => it.name)
  567. },
  568. closeCalendar() {
  569. this.showCalendar = false
  570. },
  571. confirmCalendar(e) {
  572. this.startTime = e[0]
  573. this.endTime = e[e.length - 1]
  574. this.showCalendar = false
  575. this.getCount()
  576. },
  577. getUserCount() {
  578. getCompanyUserAndUserCount().then(res => {
  579. if (res.code == 200) {
  580. this.companyUserCount = res.data.todayNewUser || 0
  581. this.companyUserUserCount = res.data.userTotal || 0
  582. this.lablelistnum = res.data.tagList
  583. this.$nextTick(() => {
  584. this.$refs.pydameinvRef.init()
  585. })
  586. } else {
  587. uni.showToast({
  588. icon: 'none',
  589. title: res.msg,
  590. });
  591. }
  592. })
  593. },
  594. getCount() {
  595. const param = {
  596. endTime: this.endTime + ' 23:59:59',
  597. startTime: this.startTime + ' 00:00:00',
  598. }
  599. this.getCourseCount(param)
  600. },
  601. getCourseCount(param) {
  602. getCourseCount(param).then(res => {
  603. if (res.code == 200) {
  604. console.log(res)
  605. this.courseCount = res.data
  606. this.yesterdayVO = res.data.yesterdayVO
  607. } else {
  608. uni.showToast({
  609. icon: 'none',
  610. title: res.msg,
  611. });
  612. }
  613. })
  614. },
  615. }
  616. }
  617. </script>
  618. <style scoped lang="scss">
  619. .boxlable {
  620. width: 47%;
  621. }
  622. .morelable {
  623. width: 100%;
  624. overflow-x: auto;
  625. /* 添加横向滚动条 */
  626. white-space: nowrap;
  627. }
  628. .container {
  629. font-family: PingFang SC, PingFang SC;
  630. font-weight: 400;
  631. font-size: 14px;
  632. color: #222222;
  633. }
  634. .calendar-day {
  635. font-family: PingFang SC, PingFang SC;
  636. font-weight: 400;
  637. font-size: 12px;
  638. color: #999;
  639. flex: 1;
  640. margin: 10px 10px 0 10px;
  641. background-color: #f5f5f5;
  642. border-radius: 4px;
  643. }
  644. .topdata {
  645. padding-top: 25px;
  646. background: linear-gradient(to right, rgba(225, 238, 255, 1), rgba(223, 224, 254, 1));
  647. &-box {
  648. padding: 12px;
  649. margin: 0 12px 0 12px;
  650. background-color: rgba(255, 255, 255, 0.5);
  651. border-radius: 8px 8px;
  652. font-family: PingFang SC, PingFang SC;
  653. font-weight: 400;
  654. font-size: 14px;
  655. color: #222222;
  656. }
  657. &-item {
  658. width: 50%;
  659. text-align: center;
  660. padding: 8px;
  661. box-sizing: border-box;
  662. &-num {
  663. color: #1677ff;
  664. text {
  665. font-family: DIN, DIN;
  666. font-weight: bold;
  667. font-size: 25px;
  668. }
  669. }
  670. }
  671. .searchbox {
  672. background-color: #fff;
  673. border-radius: 8rpx 8rpx 0 0;
  674. padding: 15px;
  675. &-item {
  676. height: 23px;
  677. line-height: 23px;
  678. width: 65px;
  679. background: #f5f5f5;
  680. text-align: center;
  681. border-radius: 5px;
  682. font-family: PingFang SC, PingFang SC;
  683. font-weight: 400;
  684. font-size: 12px;
  685. color: #888;
  686. }
  687. &-active {
  688. color: #fff !important;
  689. background-color: #1677ff !important;
  690. }
  691. }
  692. }
  693. .statistics {
  694. background-color: #fff;
  695. overflow-y: auto;
  696. box-sizing: border-box;
  697. &-title {
  698. font-family: PingFang SC, PingFang SC;
  699. font-weight: bold;
  700. font-size: 16px;
  701. color: #222222;
  702. }
  703. &-slot-title {
  704. font-size: 12px;
  705. color: #1677ff;
  706. }
  707. .collapse-content {
  708. margin: 0 -8px -8rpx 0;
  709. &-item {
  710. flex: 1;
  711. padding: 12px;
  712. box-sizing: border-box;
  713. border-radius: 10px;
  714. background: #f5f5f5;
  715. font-family: PingFang SC, PingFang SC;
  716. font-weight: 400;
  717. font-size: 10px;
  718. color: #222222;
  719. margin: 0 8px 8rpx 0;
  720. }
  721. &-title {
  722. font-size: 14px;
  723. margin-bottom: 10px;
  724. }
  725. &-num {
  726. color: #1677ff;
  727. font-size: 10px;
  728. text {
  729. font-family: DIN, DIN;
  730. font-weight: bold;
  731. font-size: 25px;
  732. }
  733. }
  734. }
  735. }
  736. </style>