examcomplete.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <template>
  2. <view class="exam-complete">
  3. <u-card padding="32" full :showHead="false">
  4. <view slot="body" style="display: flex;flex-direction: column;align-items: center;justify-content: center;">
  5. <view v-if="examData.qualified" style="width: 100%;">
  6. <view class="view-center">
  7. <image v-if="globalImages" :src="globalImages + 'imgs/tonguo.png'" style="width: 192rpx;height: 192rpx;"></image>
  8. </view>
  9. <view class="view-center" style="margin: 32rpx 0;font-size: 48rpx;line-height: 64rpx;font-weight: 500;color: #1F2937;">恭喜您通过考试</view>
  10. <view class="view-center" style="font-size: 72rpx;line-height: 80rpx;font-weight: 500;color: #1F2937;">{{ examData.score }}分</view>
  11. <view class="view-center" style="margin: 16rpx 0;color: #333333;font-size: 28rpx;line-height: 42rpx;">及格分数: 100分</view>
  12. <u-line-progress :percent="70" :showPercent="false" :height="16"></u-line-progress>
  13. <view class="view-center" style="margin: 16rpx 0;font-size: 28rpx;line-height: 40rpx;color: #999999;">您的成绩超过了{{ examData.exceeding }}%的考生</view>
  14. </view>
  15. <view v-else style="width: 100%;">
  16. <view>
  17. <view class="view-center">
  18. <image v-if="globalImages" :src="globalImages + 'imgs/weitongguo.png'" style="width: 192rpx;height: 192rpx;"></image>
  19. </view>
  20. <view class="view-center" style="margin: 32rpx 0;font-size: 48rpx;line-height: 64rpx;font-weight: 500;color: #1F2937;">您未通过考试</view>
  21. <view class="view-center" style="font-size: 72rpx;line-height: 80rpx;font-weight: 500;color: #1F2937;">{{ examData.score }}分</view>
  22. <view class="view-center" style="margin: 16rpx 0;color: #333333;font-size: 28rpx;line-height: 42rpx;">及格分数: 100分</view>
  23. <u-line-progress :percent="70" :showPercent="false" :height="16"></u-line-progress>
  24. <view class="view-center" style="margin: 16rpx 0;font-size: 28rpx;line-height: 40rpx;color: #999999;">您的成绩超过了{{ examData.exceeding }}%的考生</view>
  25. </view>
  26. </view>
  27. </view>
  28. </u-card>
  29. <u-card padding="32" full :showHead="false">
  30. <view slot="body" style="display: flex;flex-direction: column;">
  31. <view style="color: #1F2937;font-size: 36rpx;line-height: 56rpx;">考试建议</view>
  32. <view style="margin-top: 24rpx;display: flex;align-items: baseline;">
  33. <image v-if="globalImages" :src="globalImages + 'imgs/jianyi.png'" style="width: 17rpx;height: 24rpx;"></image>
  34. <view style="color: #374151;font-size: 28rpx;line-height: 42rpx;margin-left: 16rpx;text-align: left;">您在"乘客服务"部分错误较多,建议复习服务 规范章节</view>
  35. </view>
  36. <view style="margin-top: 24rpx;display: flex;align-items: baseline;">
  37. <image v-if="globalImages" :src="globalImages + 'imgs/jianyi.png'" style="width: 17rpx;height: 24rpx;"></image>
  38. <view style="color: #374151;font-size: 28rpx;line-height: 42rpx;margin-left: 16rpx;text-align: left;">您在"平台规则"部分有2题错误,请关注最新政策 更新</view>
  39. </view>
  40. </view>
  41. </u-card>
  42. <view class="placeholder"></view>
  43. <view class="tabbar_bottom">
  44. <view style="position: relative;width: calc(100% - 64rpx);">
  45. <u-button v-if="examData.qualified" type="primary" style="width: 80%;" @click="jumpTo('/pages/index/index')">开始接单</u-button>
  46. <u-button v-else type="error" :customStyle="{ backgroundColor: '#F56C6C' }" @click="navgo('/my/safety/video')">重新答题</u-button>
  47. <view style="font-size: 24rpx;line-height: 32rpx;text-align: center;color: #999999;margin-top: 16rpx;">通过考试后, 您将获得更多优质订单</view>
  48. </view>
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. import { waitForGlobalImages } from '@/utils/globalImageLoader'
  54. export default {
  55. data() {
  56. return {
  57. globalImages: null,
  58. arr: [],
  59. token: '',
  60. examData: {
  61. score: null,
  62. exceeding: null,
  63. qualified: null,
  64. }
  65. }
  66. },
  67. onLoad(options) {
  68. const params = {
  69. score: Number(options.score),
  70. exceeding: Number(options.exceeding),
  71. qualified: options.qualified === 'true',
  72. }
  73. this.examData = params
  74. waitForGlobalImages().then((path) => {
  75. this.globalImages = path
  76. })
  77. },
  78. onShow() {
  79. this.token = this.$queue.getData('token')
  80. },
  81. methods: {
  82. navgo(e) {
  83. // #ifdef MP-WEIXIN
  84. if (uni.getStorageSync('sendMsg')) {
  85. uni.requestSubscribeMessage({
  86. tmplIds: this.arr,
  87. success(re) {
  88. // console.log(re,'**********')
  89. var datas = JSON.stringify(re);
  90. if (datas.indexOf("accept") != -1) {
  91. console.log(re)
  92. }
  93. },
  94. fail: (res) => {
  95. console.log(res)
  96. }
  97. })
  98. }
  99. // #endif
  100. let that = this
  101. if (that.token) {
  102. uni.navigateTo({
  103. url: e
  104. })
  105. } else {
  106. uni.navigateTo({
  107. url: '/pages/login/login'
  108. })
  109. }
  110. },
  111. jumpTo(e) {
  112. // #ifdef MP-WEIXIN
  113. if (uni.getStorageSync('sendMsg')) {
  114. uni.requestSubscribeMessage({
  115. tmplIds: this.arr,
  116. success(re) {
  117. // console.log(re,'**********')
  118. var datas = JSON.stringify(re);
  119. if (datas.indexOf("accept") != -1) {
  120. console.log(re)
  121. }
  122. },
  123. fail: (res) => {
  124. console.log(res)
  125. }
  126. })
  127. }
  128. // #endif
  129. let that = this
  130. if (that.token) {
  131. uni.switchTab({
  132. url: e
  133. })
  134. } else {
  135. uni.navigateTo({
  136. url: '/pages/login/login'
  137. })
  138. }
  139. },
  140. },
  141. }
  142. </script>
  143. <style lang="scss">
  144. .exam-complete {
  145. width: 100%;
  146. position: relative;
  147. padding: 16rpx 32rpx;
  148. box-sizing: border-box;
  149. .view-center {
  150. display: flex;
  151. justify-content: center;
  152. align-items: center;
  153. }
  154. }
  155. .placeholder {
  156. height: 128rpx;
  157. padding-bottom: 16rpx;
  158. padding-bottom: constant(safe-area-inset-bottom);
  159. padding-bottom: env(safe-area-inset-bottom);
  160. box-sizing: content-box;
  161. }
  162. .tabbar_bottom {
  163. position: fixed;
  164. left: 0;
  165. bottom: 0;
  166. width: 100%;
  167. height: 128rpx;
  168. padding-left: 32rpx;
  169. padding-right: 32rpx;
  170. padding-bottom: 16rpx;
  171. padding-bottom: constant(safe-area-inset-bottom);
  172. padding-bottom: env(safe-area-inset-bottom);
  173. box-sizing: content-box;
  174. z-index: 101;
  175. }
  176. </style>