statistics.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526
  1. <template>
  2. <view class="container">
  3. <image class="topbg" src="https://sg-mmyy-oss.yjfzy.com/sgs/image/20241102/e07b38daf749cb02e9f5ce69c57b44ea.png" mode="scaleToFill"></image>
  4. <view class="container-body">
  5. <view class="coursebox">
  6. <view class="coursebox-info">
  7. <view class="status">进行中</view>
  8. <!-- <view class="status" style="background-color: #ff4746;">已结束</view> -->
  9. <view class="coursebox-name">
  10. <text class="more-t">7.明医有话说-杜老师给您讲讲抑郁杜老师给您讲讲抑郁</text>
  11. <view class="btn_icon">ID
  12. <image src="@/static/images/copy_icon.png" mode="aspectFill"></image>
  13. </view>
  14. </view>
  15. <!-- <view class="coursebox-name">7.明医有话说-杜老师给您讲讲抑郁杜老师给您讲讲抑郁</view> -->
  16. <view style="margin-top: 5px;">明医有话说-七天先导课(长期有效,自行选择)简约课程</view>
  17. <view class="coursebox-time x-start">
  18. <view class="coursebox-time-item" style="margin-right: 14px;">
  19. <view>直播时间</view>
  20. <view class="coursebox-time-t">2024-08-20 00:00:00-2029-09-30 23:59:59</view>
  21. </view>
  22. <view class="coursebox-time-item duration">
  23. <view>课程时长</view>
  24. <view class="coursebox-time-t">12分18秒</view>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. <view class="statistics">
  30. <u-tabs :list="list1" :current='current' :scrollable="false" :lineWidth="40" lineColor="#1677ff" :activeStyle="activeStyle" :inactiveStyle="inactiveStyle" @click="clickTab"></u-tabs>
  31. <u-collapse :border='false' :value='collapseValue' @change="changeCollapse" v-if="current == 0">
  32. <u-collapse-item name="live">
  33. <view slot="title" class="statistics-title">直播数据<text class="statistics-title-tip">2分钟自动更新</text></view>
  34. <text slot="value" class="statistics-slot-title">{{collapseValue.includes('live')?'收回':'展开'}}</text>
  35. <text slot="right-icon">
  36. <u-icon name="arrow-right" color="#1677ff" size="12"></u-icon>
  37. </text>
  38. <view class="collapse-content x-ac">
  39. <view class="collapse-content-item">
  40. <view class="collapse-content-title">观看人数</view>
  41. <view class="collapse-content-num"><text>0</text>人</view>
  42. </view>
  43. <view class="collapse-content-item">
  44. <view class="collapse-content-title">完播人数</view>
  45. <view class="collapse-content-num"><text>0</text>人</view>
  46. </view>
  47. <view class="collapse-content-item">
  48. <view class="collapse-content-title">完播率</view>
  49. <view class="collapse-content-num"><text>0</text>%</view>
  50. </view>
  51. </view>
  52. </u-collapse-item>
  53. <u-collapse-item name="questions">
  54. <text slot="title" class="statistics-title">答题数据<text class="statistics-title-tip">2分钟自动更新</text></text>
  55. <text slot="value" class="statistics-slot-title">{{collapseValue.includes('questions')?'收回':'展开'}}</text>
  56. <text slot="right-icon">
  57. <u-icon name="arrow-right" color="#1677ff" size="12"></u-icon>
  58. </text>
  59. <view class="collapse-content">
  60. <view class="x-ac">
  61. <view class="collapse-content-item">
  62. <view class="collapse-content-title">答题人数</view>
  63. <view class="collapse-content-num"><text>0</text>人</view>
  64. </view>
  65. <view class="collapse-content-item">
  66. <view class="collapse-content-title">正确人数</view>
  67. <view class="collapse-content-num"><text>0</text>人</view>
  68. </view>
  69. <view class="collapse-content-item">
  70. <view class="collapse-content-title">答题红包数</view>
  71. <view class="collapse-content-num"><text>0</text>个</view>
  72. </view>
  73. </view>
  74. <view class="redenvelope x-bc">
  75. <view class="x-f">
  76. <image src="@/static/images/redenvelope.png" mode="aspectFill"></image>
  77. <text>答题红包金额</text>
  78. </view>
  79. <view class="collapse-content-num"><text>0.00</text>元</view>
  80. </view>
  81. </view>
  82. </u-collapse-item>
  83. <u-collapse-item name="funnelplot">
  84. <text slot="title" class="statistics-title">转化漏斗图<text class="statistics-title-tip">2分钟自动更新</text></text>
  85. <text slot="value" class="statistics-slot-title">{{collapseValue.includes('funnelplot')?'收回':'展开'}}</text>
  86. <text slot="right-icon">
  87. <u-icon name="arrow-right" color="#1677ff" size="12"></u-icon>
  88. </text>
  89. <view>
  90. ddd
  91. </view>
  92. </u-collapse-item>
  93. </u-collapse>
  94. </view>
  95. <!-- 参与记录 -->
  96. <view>
  97. <view class="participate-search">
  98. <view class="x-bc">
  99. <u-search placeholder="会员ID、昵称、姓名、手机" v-model="keyword" :showAction="false" height="30px"></u-search>
  100. <u-button type="primary" class="refresh" color='#1677ff' size="small" :disabled="disabled" text="刷新"></u-button>
  101. </view>
  102. <view class="x-bc">
  103. <u-tabs :list="list2" :current='currentType' :lineWidth="40" lineColor="#1677ff" :activeStyle="activeStyle" :inactiveStyle="inactiveStyle" @click="clickTypeTab"></u-tabs>
  104. <view class="participate-order x-f">
  105. <image src="@/static/images/order_icon2.png" mode="aspectFill" v-if="searchTypeIndex == 3"></image>
  106. <image src="@/static/images/order_icon.png" mode="aspectFill" v-else></image>
  107. <picker @change="bindPickerChange" :value="searchTypeIndex" :range="typeArray">
  108. {{typeoption[searchTypeIndex]}}
  109. </picker>
  110. </view>
  111. </view>
  112. </view>
  113. <!-- <mescroll-body top="88rpx" bottom="0" ref="mescrollRef" @init="mescrollInit" :down="downOption" :up="upOption" @down="downCallback" @up="upCallback"> -->
  114. <view class="list">
  115. <view class="list-item">
  116. <view class="list-item-head x-bc">
  117. <view class="x-f" style="flex: 1;overflow: hidden;">
  118. <u-avatar src='http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg'></u-avatar>
  119. <view class="list-item-head-l">
  120. <view style="flex: 1;overflow: hidden;display: flex;">
  121. <text class="list-item-name one-t">7.明医有话说-杜老师给您讲讲抑郁杜老师给您讲讲抑郁</text>
  122. <image class="list-item-copy" src="@/static/images/copy_icon.png" mode="aspectFill"></image>
  123. </view>
  124. <view class="list-item-re">注册时间:2022-12-12</view>
  125. </view>
  126. </view>
  127. <image class="phone" src="@/static/logo.png" mode="aspectFill"></image>
  128. </view>
  129. <view class="list-item-desc">
  130. <view class="taglist">
  131. <view>测试</view>
  132. </view>
  133. <view style="margin-top: 5px;">
  134. <text class="label">观看次数</text><text class="value-num">1</text>
  135. <text class="label">完播次数</text><text class="value-num">2</text>
  136. <text class="label">累计时长</text><text class="value-num">04分50秒</text>
  137. </view>
  138. <view style="margin-top: 5px;"><text class="label">红包领取状态</text><text class="value-num">1</text></view>
  139. <view style="margin-top: 5px;"><text class="label">观看时间</text><text class="value-num">2023-12-01 12:33</text></view>
  140. </view>
  141. <view class="list-item-footer x-f">
  142. <view class="list-item-footer-btn x-f">改姓名</view>
  143. <view class="list-item-footer-btn x-f">改备注</view>
  144. <view class="list-item-footer-btn footer-tagbtn x-f">改标签</view>
  145. </view>
  146. </view>
  147. </view>
  148. <!-- </mescroll-body> -->
  149. </view>
  150. </view>
  151. </view>
  152. </template>
  153. <script>
  154. export default{
  155. data() {
  156. return {
  157. list1: [{
  158. name: '课程数据',
  159. }, {
  160. name: '参与记录',
  161. }, {
  162. name: '活动节目'
  163. }],
  164. current: 1,
  165. list2: [{
  166. name: '答题正确',
  167. }, {
  168. name: '仅播完',
  169. }, {
  170. name: '未完播'
  171. }, {
  172. name: '未播放'
  173. }],
  174. currentType: 0,
  175. activeStyle:{
  176. color: '#1677ff',
  177. fontSize: '14px',
  178. fontWeight: 'bold'
  179. },
  180. inactiveStyle:{
  181. fontSize: '14px'
  182. },
  183. collapseValue:['live','questions','funnelplot'],
  184. keyword: '',
  185. disabled: false,
  186. searchTypeIndex: 0,
  187. typeArray: ['按看课时间从晚到早', '按完播时间从晚到早', '按观看次数从多到少', '按注册时间从晚到早','按会员姓名0-9-A-Z'],
  188. typeoption: ['看课时间', '完播时间', '观看次数', '注册时间','会员姓名'],
  189. mescroll:null,
  190. downOption: {
  191. auto:false//不要自动加载
  192. },
  193. upOption: {
  194. onScroll:false,
  195. use: true, // 是否启用上拉加载; 默认true
  196. page: {
  197. num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
  198. size: 10 // 每页数据的数量,默认10
  199. },
  200. noMoreSize: 10, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
  201. textNoMore:"已经到底了",
  202. empty: {
  203. icon:'/static/images/empty.png',
  204. tip: '暂无数据'
  205. }
  206. },
  207. dataList: []
  208. }
  209. },
  210. onLoad() {
  211. uni.setNavigationBarTitle({
  212. title: '数据统计'
  213. });
  214. },
  215. methods: {
  216. clickTab(e) {
  217. this.current = e.index
  218. },
  219. clickTypeTab(e) {
  220. this.currentType = e.index
  221. },
  222. bindPickerChange(e) {
  223. console.log('picker发送选择改变,携带值为', e.detail.value)
  224. this.searchTypeIndex = e.detail.value
  225. },
  226. changeCollapse(e) {
  227. this.collapseValue = e.filter(item=>item.status == 'open').map(it=>it.name)
  228. },
  229. mescrollInit(mescroll) {
  230. this.mescroll = mescroll;
  231. },
  232. /*下拉刷新的回调 */
  233. downCallback(mescroll) {
  234. mescroll.resetUpScroll()
  235. },
  236. upCallback(page) {
  237. // //联网加载数据
  238. // var that = this;
  239. // var data={
  240. // customerName:this.searchKey,
  241. // pageNum: page.num,
  242. // pageSize: page.size
  243. // };
  244. // uni.showLoading({
  245. // title:"加载中..."
  246. // })
  247. // getMyCustomerList(data).then(res => {
  248. // uni.hideLoading()
  249. // if(res.code==200){
  250. // //设置列表数据
  251. // if (page.num == 1) {
  252. // that.dataList = res.data.list;
  253. // } else {
  254. // that.dataList = that.dataList.concat(res.data.list);
  255. // }
  256. // that.mescroll.endBySize(res.data.list.length, res.data.total);
  257. // }else{
  258. // uni.showToast({
  259. // icon:'none',
  260. // title: "请求失败",
  261. // });
  262. // that.dataList = null;
  263. // that.mescroll.endErr();
  264. // }
  265. // });
  266. },
  267. }
  268. }
  269. </script>
  270. <style lang="scss" scoped>
  271. .container {
  272. position: relative;
  273. z-index: 2;
  274. font-family: PingFang SC, PingFang SC;
  275. font-weight: 400;
  276. font-size: 14px;
  277. color: #222;
  278. .topbg {
  279. position: absolute;
  280. z-index: -1;
  281. top: 0;
  282. left: 0;
  283. width: 100%;
  284. height: 210px;
  285. }
  286. &-body {
  287. }
  288. .coursebox {
  289. padding: 120px 50rpx 20px 50rpx;
  290. font-family: PingFang SC, PingFang SC;
  291. font-weight: 400;
  292. font-size: 14px;
  293. color: #999;
  294. .status {
  295. position: absolute;
  296. top: 0;
  297. right: 0;
  298. z-index: 2;
  299. height: 30px;
  300. padding: 0 8px;
  301. box-sizing: border-box;
  302. line-height: 30px;
  303. border-radius: 0 12px 0 12px;
  304. text-align: center;
  305. color: #fff;
  306. background-color: #08ce36;
  307. }
  308. &-info {
  309. padding: 12px;
  310. background-color: rgba(255,255,255,0.88);
  311. border-radius: 12px;
  312. overflow: hidden;
  313. position: relative;
  314. }
  315. &-name {
  316. color: #222;
  317. font-weight: bold;
  318. font-size: 16px;
  319. padding-right: 50px;
  320. .more-t {
  321. flex: 1;
  322. font-size: 14px;
  323. color: #222;
  324. display: inline;
  325. }
  326. }
  327. &-time-item {
  328. flex: 1;
  329. margin-top: 5px;
  330. }
  331. &-time-t {
  332. color: #222;
  333. font-weight: bold;
  334. margin-top: 5px;
  335. font-size: 12px;
  336. }
  337. .duration {
  338. position: relative;
  339. padding-left: 14px;
  340. &::after {
  341. content: "";
  342. height: 30px;
  343. width: 1px;
  344. background-color: #f5f5f5;
  345. position: absolute;
  346. left: 0;
  347. top: 5px;
  348. }
  349. }
  350. }
  351. }
  352. .statistics {
  353. background-color: #fff;
  354. &-title {
  355. font-family: PingFang SC, PingFang SC;
  356. font-weight: bold;
  357. font-size: 16px;
  358. color: #222222;
  359. }
  360. &-title-tip {
  361. font-weight: 400;
  362. font-size: 11px;
  363. color: #999;
  364. padding-left: 10px;
  365. }
  366. &-slot-title {
  367. font-size: 12px;
  368. color: #1677ff;
  369. }
  370. .collapse-content {
  371. margin: 0 -8px -8rpx 0;
  372. &-item {
  373. flex: 1;
  374. padding: 12px;
  375. box-sizing: border-box;
  376. border-radius: 10px;
  377. background: #f5f5f5;
  378. font-family: PingFang SC, PingFang SC;
  379. font-weight: 400;
  380. font-size: 10px;
  381. color: #222222;
  382. margin: 0 8px 8rpx 0;
  383. }
  384. &-title {
  385. font-size: 14px;
  386. margin-bottom: 10px;
  387. }
  388. &-num {
  389. color: #1677ff;
  390. font-size: 10px;
  391. text {
  392. font-family: DIN, DIN;
  393. font-weight: bold;
  394. font-size: 25px;
  395. }
  396. }
  397. }
  398. .redenvelope {
  399. background-color: #f5f5f5;
  400. margin-right: 8px;
  401. margin-top: 4px;
  402. padding: 15px;
  403. box-sizing: border-box;
  404. border-radius: 10px;
  405. color: #222222;
  406. image {
  407. width: 50px;
  408. height: 50px;
  409. margin-right: 10px;
  410. }
  411. }
  412. }
  413. .participate-search {
  414. background-color: #fff;
  415. padding: 10px 15px;
  416. .refresh {
  417. height: 26px;
  418. min-width: 40px;
  419. width: 40px;
  420. padding: 0;
  421. display: inline-flex;
  422. margin-left: 15px;
  423. border-radius: 5px;
  424. overflow: hidden;
  425. }
  426. }
  427. .participate-order {
  428. font-size: 12px;
  429. image {
  430. width: 15px;
  431. height: 15px;
  432. }
  433. }
  434. .btn_icon {
  435. font-weight: 400;
  436. font-size: 14px;
  437. color: #1677ff;
  438. display: inline-flex;
  439. align-items: center;
  440. margin-left: 5px;
  441. image {
  442. width: 20px;
  443. height: 20px;
  444. }
  445. }
  446. .list {
  447. padding: 20px 10px;
  448. }
  449. .list-item{
  450. padding: 10px;
  451. margin-bottom: 10px;
  452. background-color: #fff;
  453. border-radius: 12px;
  454. &-head {
  455. .phone {
  456. flex-shrink: 0;
  457. width: 30px;
  458. height: 30px;
  459. }
  460. &-l {
  461. flex: 1;
  462. overflow: hidden;
  463. margin-left: 10px;
  464. margin-right: 10px;
  465. }
  466. }
  467. &-copy {
  468. width: 20px;
  469. height: 20px;
  470. }
  471. &-re {
  472. font-size: 10px;
  473. margin-top: 5px;
  474. }
  475. &-desc {
  476. padding: 5px;
  477. color: #999;
  478. font-size: 12px;
  479. }
  480. .label {
  481. margin-right: 4px;
  482. }
  483. .value-num {
  484. margin-right: 18px;
  485. color: #222;
  486. font-weight: bold;
  487. }
  488. .taglist {
  489. display: flex;
  490. align-items: center;
  491. flex-wrap: wrap;
  492. color: #555;
  493. padding-top: 5px;
  494. view {
  495. margin: 0 5px 5px 0;
  496. }
  497. }
  498. &-footer {
  499. justify-content: flex-end;
  500. padding: 6px 0;
  501. .footer-tagbtn {
  502. color: #1677ff;
  503. background-color: #e7f2fe;
  504. border: 1px solid #c9e1fb;
  505. }
  506. &-btn {
  507. height: 26px;
  508. padding: 0 10px;
  509. margin-left: 10px;
  510. background-color: #f5f5f5;
  511. border-radius: 25px;
  512. font-weight: 400;
  513. font-size: 10px;
  514. line-height: 26px;
  515. border: 1px solid #f5f5f5;
  516. box-sizing: border-box;
  517. }
  518. }
  519. }
  520. </style>