You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

228 lines
5.3 KiB

8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
  1. <template>
  2. <view class="teachingDataBg" >
  3. <topNavbar title=" "></topNavbar>
  4. <view class="topText">
  5. <view class="h3">专属您的</view>
  6. <view class="h4">教学数据</view>
  7. </view>
  8. <view class="pad" id="app">
  9. <view class="card">
  10. <view class="top_row">
  11. <view class="topItem">
  12. <view class="lab">历史服务学员</view>
  13. <view class="val">{{info.historyStudentTotal}}</view>
  14. </view>
  15. <view class="topItem">
  16. <view class="lab">结业人数</view>
  17. <view class="val">{{info.finishStudentTotal}}</view>
  18. </view>
  19. <view class="topItem">
  20. <view class="lab">服务中人数</view>
  21. <view class="val">{{info.inServiceStudentTotal}}</view>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. <view class="title">
  27. <view class="txt">结业率高达</view>
  28. <view class="num">{{info.finishRate}}</view>
  29. </view>
  30. <view class="ul">
  31. <view class="li" v-if="info.finishSubjectOneTime">
  32. <view class="lab">科目一平均通过时间</view>
  33. <view class="val">{{info.finishSubjectOneTime}}</view>
  34. </view>
  35. <view class="li">
  36. <view class="lab">科目二平均通过时间</view>
  37. <view class="val">{{info.finishSubjectTowTime ||'暂无'}}</view>
  38. </view>
  39. <view class="li">
  40. <view class="lab">科目三平均通过时间</view>
  41. <view class="val">{{info.finishSubjectThreeTime || '暂无'}}</view>
  42. </view>
  43. <view class="li" v-if="info.finishSubjectFourTime">
  44. <view class="lab">科目四平均通过时间</view>
  45. <view class="val">{{info.finishSubjectFourTime}}</view>
  46. </view>
  47. </view>
  48. <view class="title">
  49. <view class="txt">平均拿证时间</view>
  50. <view class="num">{{info.averageFinishTime || '暂无'}}</view>
  51. </view>
  52. <!-- <view class="btnBorder" @click="shareClick">立即分享</view>
  53. <canvas canvas-id="canvas" style="width: 300px; height: 300px;opacity: 0;" class="canvas">3333</canvas>
  54. <view class="img" style="width: 300px; height: 300px;">
  55. <image :src="shareImageUrl" mode=""></image>
  56. </view> -->
  57. </view>
  58. </template>
  59. <script>
  60. import { getDrivingLearningData } from '@/config/api.js'
  61. export default {
  62. data() {
  63. return {
  64. shareImageUrl: '',
  65. info: {}
  66. }
  67. },
  68. mounted() {
  69. this.getDrivingLearningDataFn()
  70. this.$nextTick(()=>{
  71. setTimeout(()=>{
  72. this.getCanvas()
  73. },2000)
  74. })
  75. },
  76. methods: {
  77. async getDrivingLearningDataFn() {
  78. const {data: res} = await getDrivingLearningData()
  79. this.info = res || {}
  80. },
  81. shareClick() {
  82. },
  83. getCanvas() {
  84. let _this = this
  85. // 获取 Canvas 组件实例
  86. const canvas = uni.createCanvasContext('canvas', this);
  87. // 绘制需要的内容
  88. canvas.setFontSize(20);
  89. canvas.fillText('Hello, Canvas!', 50, 50);
  90. // 绘制完成后执行截屏操作
  91. canvas.draw(true, () => {
  92. uni.canvasToTempFilePath({
  93. canvasId: 'canvas',
  94. fileType: 'png',
  95. success: (res) => {
  96. console.log('截屏成功', res.tempFilePath);
  97. _this.shareImageUrl = res.tempFilePath
  98. // uni.previewImage({
  99. // urls: [res.tempFilePath]
  100. // })
  101. uni.showShareMenu({
  102. withShareTicket: true,
  103. success: () => {
  104. uni.showShareImageMenu({
  105. path: _this.shareImageUrl,
  106. success: (res) => {
  107. console.log('分享成功', res)
  108. },
  109. fail: (error) => {
  110. console.log('分享失败', error)
  111. }
  112. })
  113. }
  114. })
  115. },
  116. fail: (err) => {
  117. console.log('截屏失败', err);
  118. }
  119. }, this);
  120. });
  121. }
  122. }
  123. }
  124. </script>
  125. <style lang="scss" scoped>
  126. .teachingDataBg {
  127. width: 100%;
  128. background: url('../../../static/images/bigImg/teachdata.png') #f6f6f6 no-repeat;
  129. background-size: 100% 544rpx;
  130. min-height: 100vh;
  131. font-size: 28rpx;
  132. padding-bottom: 40rpx;
  133. .topText {
  134. padding: 56rpx 34rpx 84rpx 34rpx;
  135. color: #fff;
  136. font-weight: 600;
  137. .h3 {
  138. font-size: 42rpx;
  139. }
  140. .h4 {
  141. font-size: 64rpx;
  142. }
  143. }
  144. .card {
  145. .top_row {
  146. display: flex;
  147. height: 214rpx;
  148. margin-bottom: 14rpx;
  149. .topItem {
  150. flex: 1;
  151. text-align: center;
  152. .lab {
  153. font-size: 28rpx;
  154. color: #333;
  155. margin: 48rpx 0 24rpx 0;
  156. }
  157. .val {
  158. color: $themC;
  159. font-size: 40rpx;
  160. font-weight: 500;
  161. }
  162. }
  163. }
  164. }
  165. .title {
  166. display: flex;
  167. align-items: center;
  168. width: 100%;
  169. height: 98rpx;
  170. background: linear-gradient(188deg, #F6F6F6 0%, #80C1F6 100%, #80C1F6 100%);
  171. margin-bottom: 40rpx;
  172. color: #FFFFFF;
  173. .txt {
  174. font-weight: 500;
  175. line-height: 56px;
  176. text-shadow: 0px 4px 6px #1274D6;
  177. font-size: 40rpx;
  178. margin: 0 40rpx 0 28rpx;
  179. font-weight: 500;
  180. }
  181. .num {
  182. font-size: 72rpx;
  183. text-shadow: 0px 4px 8px #084787;
  184. }
  185. }
  186. .ul {
  187. display: flex;
  188. flex-wrap: wrap;
  189. justify-content: space-between;
  190. padding: 0 28rpx;
  191. .li {
  192. width: 49%;
  193. text-align: center;
  194. margin-bottom: 20rpx;
  195. background: #fff;
  196. border-radius: 16rpx;
  197. height: 196rpx;
  198. .lab {
  199. font-size: 28rpx;
  200. margin: 36rpx 0 26rpx 0;
  201. }
  202. .val {
  203. font-size: 40rpx;
  204. color: $themC;
  205. }
  206. }
  207. }
  208. .btnBorder {
  209. width: 396rpx;
  210. margin: 79rpx auto;
  211. }
  212. }
  213. </style>