contractTemplate.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <template>
  2. <uv-popup ref="popupRef" mode="bottom" round="30rpx" closeable>
  3. <view class="contract-template">
  4. <view class="popup-title">预览</view>
  5. <scroll-view class="scroll-view" scroll-y>
  6. <uv-parse :content="content"></uv-parse>
  7. </scroll-view>
  8. </view>
  9. </uv-popup>
  10. </template>
  11. <script setup name="contractTemplate">
  12. import { ref } from "vue";
  13. import { agentGetContractPreview_Api } from "@/api/agencyCenter";
  14. const popupRef = ref(null);
  15. const content = ref("");
  16. const getContractPreview = async (form) => {
  17. uni.showLoading({ title: "加载中", mask: true });
  18. await agentGetContractPreview_Api(form)
  19. .then((res) => {
  20. uni.hideLoading();
  21. if (res.code == 200) {
  22. content.value = res.data || {};
  23. }
  24. })
  25. .catch((err) => {
  26. console.log(err);
  27. // uni.hideLoading();
  28. });
  29. };
  30. const open = async (form) => {
  31. await getContractPreview(form);
  32. popupRef.value.open();
  33. };
  34. defineExpose({
  35. open,
  36. });
  37. </script>
  38. <style scoped lang="scss">
  39. .contract-template {
  40. padding-top: 30rpx;
  41. .popup-title {
  42. padding-bottom: 20rpx;
  43. }
  44. .scroll-view {
  45. height: 70vh;
  46. padding: 0 30rpx;
  47. box-sizing: border-box;
  48. }
  49. }
  50. </style>