学员端小程序
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.

61 lines
1.5 KiB

11 months ago
11 months ago
11 months ago
  1. <template>
  2. <view class="pageBgImg ">
  3. <topNavbar title="我的合同"></topNavbar>
  4. <view class="pad">
  5. <view class="card">
  6. <image :src="pdfUrl" mode="widthFix"></image>
  7. <!-- <web-view :src="pdfUrl"></web-view> -->
  8. <!-- <mumu-previewOffce :fileUrl='pdfUrl' v-model='showPreview' @change="change"></mumu-previewOffce> -->
  9. <nodata v-if="!pdfUrl" style="margin-bottom: 40rpx;">暂无合同</nodata>
  10. </view>
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. import { selectContractPdfBase64 } from '@/config/api.js'
  16. import MumuPreviewOffce from '@/uni_modules/mumu-previewOffce/components/mumu-previewOffce/mumu-previewOffce.vue'
  17. export default {
  18. components: {
  19. MumuPreviewOffce
  20. },
  21. data() {
  22. return {
  23. pdfUrl: ''
  24. }
  25. },
  26. onLoad() {
  27. this.selectContractPdfBase64Fn()
  28. const obj = '123'
  29. console.log(this.getType(window))
  30. },
  31. methods: {
  32. async selectContractPdfBase64Fn() {
  33. const {data: res} = await selectContractPdfBase64({studentId: this.studentId})
  34. this.pdfUrl = res
  35. console.log('this.pdfUrl')
  36. console.log(this.pdfUrl)
  37. },
  38. change() {
  39. console.log('你关你关')
  40. },
  41. getType(obj){
  42. let type = typeof obj;
  43. if (type !== "object") { // typeof
  44. return type;
  45. }
  46. // typeof object
  47. return Object.prototype.toString.call(obj).replace(/^\[object (\S+)\]$/,
  48. '$1');
  49. }
  50. }
  51. }
  52. </script>
  53. <style lang="scss" scoped>
  54. .card {
  55. padding: 8rpx;
  56. margin-bottom: 40rpx;
  57. }
  58. </style>