风险测评小程序前端代码仓库
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.

123 lines
2.7 KiB

  1. <template>
  2. <view class="card">
  3. <view class="flex card-header">
  4. <!-- todo: 缺切图 -->
  5. <image class="icon" src="@/static/image/icon.png" mode="widthFix"></image>
  6. <view>{{ unfinishCount ? `您还有${unfinishCount}道题未完成` : '您已完成测评,还未获取报告' }}</view>
  7. </view>
  8. <view class="card-content">
  9. <view class="row">
  10. <view class="row-label">答题时间</view>
  11. <view class="row-content">{{ $dayjs(data.createTime).format('YYYY-MM-DD HH:mm') }}</view>
  12. </view>
  13. </view>
  14. <view class="flex card-footer">
  15. <button class="btn" @click="onRestart">重新测评</button>
  16. <button v-if="unfinishCount" class="btn btn-primary" @click="onContinue">继续答题</button>
  17. <button v-else class="btn btn-primary" @click="onCreateReport">获取报告</button>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. export default {
  23. props: {
  24. data: {
  25. type: Object,
  26. default() {
  27. return {}
  28. }
  29. }
  30. },
  31. computed: {
  32. unfinishCount() {
  33. const { allNum, finishNum } = this.data
  34. return allNum - finishNum
  35. },
  36. },
  37. methods: {
  38. onRestart() {
  39. // todo: fetch by this.data.paperId
  40. // let id
  41. // uni.navigateTo({
  42. // url: `/pages_order/test/answer?id=${id}`
  43. // })
  44. uni.navigateTo({
  45. url: `/pages_order/test/start`
  46. })
  47. },
  48. onContinue() {
  49. uni.navigateTo({
  50. url: `/pages_order/test/answer?examId=${this.data.id}`,
  51. })
  52. },
  53. onCreateReport() {
  54. // todo: check
  55. uni.navigateTo({
  56. url: `/pages_order/report/pay?batchNo=${this.data.batchNo}`
  57. })
  58. },
  59. },
  60. }
  61. </script>
  62. <style scoped lang="scss">
  63. .card {
  64. position: relative;
  65. padding: 17rpx 0 22rpx 0;
  66. color: #000000;
  67. background: #FFFFFF;
  68. border-radius: 15rpx;
  69. overflow: hidden;
  70. &-header {
  71. justify-content: flex-start;
  72. column-gap: 24rpx;
  73. padding: 0 26rpx;
  74. font-size: 30rpx;
  75. .icon {
  76. width: 48rpx;
  77. height: auto;
  78. }
  79. }
  80. &-content {
  81. padding-left: 94rpx;
  82. }
  83. &-footer {
  84. padding: 22rpx 35rpx 0 35rpx;
  85. column-gap: 25rpx;
  86. }
  87. }
  88. .row {
  89. margin-top: 12rpx;
  90. display: flex;
  91. align-items: center;
  92. justify-content: flex-start;
  93. column-gap: 26rpx;
  94. font-size: 28rpx;
  95. color: #999999;
  96. }
  97. .btn {
  98. flex: 1;
  99. padding: 17rpx 0;
  100. box-sizing: border-box;
  101. font-family: PingFang SC;
  102. font-size: 22rpx;
  103. line-height: 1.4;
  104. color: #014FA2;
  105. border: 3rpx solid #014FA2;
  106. border-radius: 35rpx;
  107. &-primary {
  108. color: #FFFFFF;
  109. background: #014FA2;
  110. }
  111. }
  112. </style>