index.vue 23 KB

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