tab_exam.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. <template>
  2. <view class="page_view">
  3. <!-- 统计 -->
  4. <view class="bg1">
  5. <view class="circle_line1"></view>
  6. <view class="circle_line2"></view>
  7. <view class="circle_line3"></view>
  8. <top-info :timeStamp="timeStamp"></top-info>
  9. <scroll-view class="scroll_view" scroll-x="true" :scroll-with-animation="true" scroll-left="0">
  10. <view class="view_box">
  11. <view class="scroll_view_item" v-for="(item,index) in cardList" :key="index"
  12. @click="navGradeList(index)">
  13. <view class="card_info">
  14. <view :class="item.icon"></view>
  15. <view class="title">{{item.title}}</view>
  16. </view>
  17. <view class="chart_box">
  18. <qiun-data-charts :type="item.type" :chartData="item.data" />
  19. </view>
  20. </view>
  21. </view>
  22. </scroll-view>
  23. </view>
  24. <!-- 统计卡片 -->
  25. <view class="card_view">
  26. <view class="total_card">
  27. <view class="flex_cloumn" style="justify-content: space-around;margin: 20rpx 0 20rpx 20rpx;">
  28. <view class="flex_baseline">
  29. <text class="_title">今日评测</text>
  30. <text class="_title" style="margin-left: 20rpx;">{{examData.length}}</text>
  31. <text class="_unit">例</text>
  32. </view>
  33. <view class="flex_baseline">
  34. <text class="_subtitle">已完成</text>
  35. <text class="_subtitle" style="margin-left: 20rpx;">{{finishData.length}}</text>
  36. <text class="_unit">例</text>
  37. </view>
  38. <view class="flex_baseline">
  39. <text class="_subtitle">完成情况</text>
  40. <text class="_subtitle" style="margin-left: 20rpx;font-weight: bold;">{{performance}}</text>
  41. </view>
  42. </view>
  43. <view class="image" :style="{backgroundImage:`url(${image})`}"></view>
  44. </view>
  45. <!-- 列表卡片 -->
  46. <view class="card_item" style="width: 100%;">
  47. <view class="card_title">
  48. <view class="front_tag"></view>
  49. <view class="title">今日评测</view>
  50. <view class="flex_row" style="margin: 0 0 0 auto;" @click="navExamList">
  51. <view class="t-icon t-icon-fenlei"></view>
  52. <view class="title" style="color: #4169E1;margin-left: 10rpx;">评测列表</view>
  53. </view>
  54. </view>
  55. <view class="class_list">
  56. <view class="class_item" :style="{borderImage: item.examInfo.progress === 'finish'?none:'linear-gradient(to right, #ff8caf, #FFF) 1'}" v-for="(item,index) in examData" :key="index" @click="navExamData(index)">
  57. <view class="flex_row" style="margin: 0 20rpx;">
  58. <view class="t-icon t-icon-examicon" style="width: 60rpx; height: 60rpx;"></view>
  59. <view class="flex_cloumn" style="height:92rpx;justify-content: space-between;">
  60. <view class="flex_row" style="margin-left: 20rpx;">
  61. <view class="class_item_title">{{item.examInfo.name}}</view>
  62. </view>
  63. <view class="flex_row">
  64. <view class="tag_fill">
  65. <view class="tag_text">{{item.examInfo.subjects[0].name}}</view>
  66. </view>
  67. <view class="tag_fill">
  68. <view class="tag_text">{{item.examInfo.examType.name}}</view>
  69. </view>
  70. <view class="tag_fill"
  71. :style="{backgroundColor: item.examInfo.progress === 'finish'? '#23b46c':'#ff5959'}">
  72. <view class="tag_text">{{item.examInfo.progress === 'finish' ? '已完成' : '进行中'}}
  73. </view>
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. <view class="flex_cloumn" style="margin: 15rpx 0 10rpx 20rpx;">
  82. <view class="title" style="font-size: 32rpx;">评测练习</view>
  83. <view class="bottom_tag"></view>
  84. </view>
  85. <view class="flex_row" style="width: 70%;"></view>
  86. </view>
  87. <scroll-view class="scroll_view_bottom" scroll-x="true" :scroll-with-animation="true" scroll-left="0">
  88. <view class="_item"></view>
  89. <view class="_item"></view>
  90. <view class="_item"></view>
  91. <view class="_item"></view>
  92. <view class="_item"></view>
  93. </scroll-view>
  94. </view>
  95. </template>
  96. <script>
  97. import {
  98. mapState
  99. } from 'vuex'
  100. export default {
  101. computed: {
  102. ...mapState('m_chart', ['examChartData']),
  103. ...mapState('m_children', ['examData'])
  104. },
  105. data() {
  106. return {
  107. cardList: [{
  108. icon: 't-icon t-icon-zoushi',
  109. title: '总成绩走势',
  110. type: 'mini-area',
  111. data: ''
  112. }, {
  113. icon: 't-icon t-icon-shuju',
  114. title: '单次考试分析',
  115. type: 'mini-column',
  116. data: ''
  117. }, {
  118. icon: 't-icon t-icon-jiangzhang',
  119. title: '排行占比分析',
  120. type: 'mini-area',
  121. data: ''
  122. }, {
  123. icon: 't-icon t-icon-yingyong',
  124. title: '优劣科目分析',
  125. type: 'mini-rose',
  126. data: ''
  127. }, {
  128. icon: 't-icon t-icon-yunwei',
  129. title: '考试能力分析',
  130. type: 'mini-column',
  131. data: ''
  132. }],
  133. image: 'https://ouch-cdn2.icons8.com/yFl5NWU3aVehLBlQf9ctvnZPqtm5U0hqM3IzWvFDCaQ/rs:fit:912:912/czM6Ly9pY29uczgu/b3VjaC1wcm9kLmFz/c2V0cy9wbmcvNzY5/LzY1ZTQxZmZjLTg1/YWQtNDYyMi1hYzU0/LWQ3NDEzZmY2NGI1/YS5wbmc.png',
  134. //完成情况
  135. performance: '',
  136. //完成数据
  137. finishData: '',
  138. timeStamp: ''
  139. };
  140. },
  141. onLoad() {
  142. this.init()
  143. },
  144. //刷新页面
  145. onPullDownRefresh() {
  146. this.init()
  147. setTimeout(function() {
  148. uni.stopPullDownRefresh();
  149. }, 1000);
  150. },
  151. methods: {
  152. //初始化
  153. init() {
  154. this.timeStamp = (new Date()).format("hh:mm")
  155. this.$initExam()
  156. this.getChartData()
  157. this.getPerformance()
  158. },
  159. //初始化cardList数据
  160. getChartData() {
  161. this.cardList[0].data = this.examChartData.totalChartData[0]
  162. this.cardList[1].data = this.examChartData.singleChartData[0]
  163. this.cardList[2].data = this.examChartData.rankingChartData[0]
  164. this.cardList[3].data = this.examChartData.subjectChartData[0]
  165. this.cardList[4].data = this.examChartData.levelChartData[0]
  166. },
  167. //获得评判信息
  168. getPerformance() {
  169. if(this.examData.length != 0){
  170. this.finishData = this.examData.filter(x => x.examInfo.progress === 'finish')
  171. this.performance = this.finishData.length / this.examData.length >= 0.4 ?
  172. (this.finishData.length / this.examData.length >= 0.7 ? '优秀' : '良好') : '较差'
  173. }else{
  174. this.finishData = []
  175. this.performance = '无评测'
  176. }
  177. },
  178. //导航
  179. navGradeList(index) {
  180. if (index === 0) {
  181. uni.navigateTo({
  182. url: '/subpkg/gradelist/total'
  183. })
  184. }
  185. if (index === 1) {
  186. uni.navigateTo({
  187. url: '/subpkg/gradelist/single'
  188. })
  189. }
  190. if (index === 2) {
  191. uni.navigateTo({
  192. url: '/subpkg/gradelist/ranking'
  193. })
  194. }
  195. if (index === 3) {
  196. uni.navigateTo({
  197. url: '/subpkg/gradelist/subject'
  198. })
  199. }
  200. if (index === 4) {
  201. uni.navigateTo({
  202. url: '/subpkg/gradelist/level'
  203. })
  204. }
  205. },
  206. navExamList() {
  207. let value = this.performance
  208. uni.navigateTo({
  209. url: `/subpkg/datalist/examlist?value=${value}`
  210. })
  211. },
  212. navExamData(index){
  213. uni.navigateTo({
  214. url: `/subpkg/datalist/examdata?index=${index}`
  215. })
  216. }
  217. }
  218. }
  219. </script>
  220. <style lang="scss">
  221. @import '@/pages/style/tab_pages.scss';
  222. .bg1 {
  223. background-color: $color-pink;
  224. }
  225. .tag_fill {
  226. background-color: $color-pink;
  227. margin-left: 20rpx;
  228. }
  229. .circle_line1 {
  230. background-image: linear-gradient(to right, #ff8caf, #ff8caf), linear-gradient(90deg, #FFF -50%, rgba(255, 255, 255, 0.0));
  231. }
  232. .circle_line2 {
  233. background-image: linear-gradient(to right, #ff8caf, #ff8caf), linear-gradient(180deg, #FFF -50%, rgba(255, 255, 255, 0.0));
  234. }
  235. .circle_line3 {
  236. background-image: linear-gradient(to right, #ff8caf, #ff8caf), linear-gradient(0deg, #FFF -50%, rgba(255, 255, 255, 0.0));
  237. }
  238. </style>