certificateDetail.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <template>
  2. <view v-if="itemData" style="width: 100vw;height: 100vh;overflow: auto;">
  3. <view class="cer-img">
  4. <image src="https://minio.citupro.com/dev/static/bgc.jpg" mode="scaleToFill" style="width: 100%;height: 100%;"></image>
  5. <view class="cer-introduce">
  6. 兹有
  7. <span class="cer-text">{{ itemData?.student?.schoolName }}</span>
  8. <span class="cer-text">{{ itemData?.student?.majorName }}</span>
  9. 专业<span class="cer-text">{{ itemData?.person?.name }}</span>
  10. 同学于<span class="cer-text">{{ itemData?.startTime ? timesTampChange(itemData?.startTime, 'Y-M-D') : '' }}</span>
  11. 至<span class="cer-text">{{ itemData?.endTime ? timesTampChange(itemData?.endTime, 'Y-M-D') : '' }}</span>
  12. 在<span class="cer-text">{{ formatName(itemData?.enterprise?.anotherName || itemData?.enterprise?.name) }}</span>
  13. 实习。
  14. </view>
  15. <view class="cer-comment">{{ itemData?.evaluate }}</view>
  16. <view class="cer-prove">特此证明。</view>
  17. <view class="cer-end">
  18. <view>{{ itemData?.createTime ? timesTampChange(itemData?.createTime, 'Y-M-D') : '' }}</view>
  19. </view>
  20. </view>
  21. <view class="bottom-sticky">
  22. <view style="display: flex;justify-content: space-evenly;align-itens: center;width: 100%;margin: 20rpx 0;">
  23. <!-- <view @click="shareClick" style="display: flex;justify-content: center;flex-direction: column;align-items: center;">
  24. <uni-icons type="redo-filled" size="24" color="#00B760"/>
  25. <span style="color:#00B760;font-weight:bold;">分享</span>
  26. </view> -->
  27. <button v-if="itemData?.certificate" type="primary" size="default" class="buttons" @click="viewReport(itemData)">查看附件</button>
  28. <button v-else type="primary" size="default" class="buttons" style="background-color:grey;">查看附件</button>
  29. </view>
  30. </view>
  31. </view>
  32. </template>
  33. <script setup>
  34. import { ref } from 'vue'
  35. import { preview } from '@/utils/preview'
  36. import { onLoad } from '@dcloudio/uni-app'
  37. import { timesTampChange } from '@/utils/date'
  38. import { formatName } from '@/utils/getText'
  39. const itemData = ref(null)
  40. onLoad((options) => {
  41. if (options.itemData) itemData.value = JSON.parse(options.itemData)
  42. })
  43. const viewReport = (item) => {
  44. if (!item.certificate) {
  45. uni.showToast({
  46. title: '加载失败,请稍后重试',
  47. icon: 'none',
  48. duration: 2000
  49. })
  50. return
  51. }
  52. preview(item.certificate)
  53. }
  54. // 分享按钮点击事件
  55. // const shareClick = () => {
  56. // }
  57. </script>
  58. <style lang="less" scoped>
  59. .cer-img{
  60. width: 100vw;
  61. height: 89.5vh;
  62. position: relative;
  63. font-weight: 600;
  64. }
  65. .cer-introduce{
  66. width: 70%;
  67. position: absolute;
  68. top: 51%;
  69. left: 50%;
  70. transform: translate(-50%,-50%);
  71. text-indent: 2em;
  72. font-weight: 500;
  73. }
  74. .cer-text{
  75. text-decoration: underline;
  76. margin: 0 3px;
  77. font-weight: 700;
  78. }
  79. .cer-comment{
  80. width: 70%;
  81. position: absolute;
  82. top: 68%;
  83. left: 50%;
  84. transform: translate(-50%,-50%);
  85. text-indent: 2em;
  86. display: -webkit-box;
  87. -webkit-box-orient: vertical;
  88. -webkit-line-clamp: 3;
  89. overflow: hidden;
  90. text-overflow: ellipsis;
  91. font-weight: 500;
  92. }
  93. .cer-prove{
  94. width: 70%;
  95. position: absolute;
  96. top: 82%;
  97. left: 50%;
  98. transform: translate(-50%,-50%);
  99. text-indent: 2em;
  100. font-weight: 500;
  101. }
  102. .cer-end{
  103. position: absolute;
  104. top: 87%;
  105. right: 16%;
  106. font-weight: 500;
  107. }
  108. button::after{
  109. border:none;
  110. }
  111. .pop-btn-wrapper{
  112. position: relative;
  113. margin-top: 15vh;
  114. .pop-confirm{
  115. background-color: #fff;
  116. color: #4b9afd;
  117. font-size: 21px;
  118. width: 45vw;
  119. position: absolute;
  120. bottom: 0;
  121. left: 0;
  122. }
  123. .pop-cancel{
  124. background-color: #fff;
  125. font-size: 21px;
  126. width: 45vw;
  127. position: absolute;
  128. bottom: 0;
  129. right: 0;
  130. }
  131. }
  132. .buttons{
  133. width: 70vw;
  134. height: 44px;
  135. border-radius: 25px;
  136. background-color: #00B760;
  137. margin: 0;
  138. }
  139. .share-pop {
  140. width: 100%;
  141. // height:300rpx;
  142. display: flex;
  143. justify-content: center;
  144. .f-straight {
  145. margin: 40rpx;
  146. background: unset;
  147. &::after{
  148. border:none !important;
  149. }
  150. }
  151. .share-round {
  152. border-radius:50%;
  153. height:100rpx;
  154. width:100rpx;
  155. display: flex;
  156. align-items: center;
  157. justify-content: center;
  158. }
  159. .share-round-1 {
  160. background-color:#22a039;
  161. }
  162. .share-round-2 {
  163. background-color:#3693cd;
  164. }
  165. }
  166. </style>