AboutModal.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. "use strict";
  2. const common_vendor = require("../../../../common/vendor.js");
  3. const teacherUrl = "https://software.nju.edu.cn//qinliu/index.html";
  4. const _sfc_main = {
  5. __name: "AboutModal",
  6. props: {
  7. visible: {
  8. type: Boolean,
  9. default: false
  10. }
  11. },
  12. emits: ["update:visible", "close"],
  13. setup(__props, { emit: __emit }) {
  14. const props = __props;
  15. const emit = __emit;
  16. const showModal = common_vendor.ref(false);
  17. common_vendor.watch(() => props.visible, async (newVal) => {
  18. if (newVal) {
  19. await common_vendor.nextTick$1();
  20. setTimeout(() => {
  21. showModal.value = true;
  22. }, 50);
  23. } else {
  24. showModal.value = false;
  25. }
  26. });
  27. const closeModal = () => {
  28. showModal.value = false;
  29. setTimeout(() => {
  30. emit("update:visible", false);
  31. emit("close");
  32. }, 300);
  33. };
  34. const copyTeacherLink = () => {
  35. common_vendor.index.setClipboardData({
  36. data: teacherUrl,
  37. success: () => {
  38. common_vendor.index.showToast({
  39. title: "已复制到剪贴板,请到浏览器中打开",
  40. icon: "success",
  41. duration: 2e3
  42. });
  43. },
  44. fail: () => {
  45. common_vendor.index.showToast({
  46. title: "复制失败",
  47. icon: "none"
  48. });
  49. }
  50. });
  51. };
  52. return (_ctx, _cache) => {
  53. return common_vendor.e({
  54. a: __props.visible
  55. }, __props.visible ? {
  56. b: common_vendor.o(closeModal),
  57. c: common_vendor.o(copyTeacherLink),
  58. d: showModal.value ? 1 : "",
  59. e: common_vendor.o(() => {
  60. }),
  61. f: showModal.value ? 1 : "",
  62. g: common_vendor.o(closeModal)
  63. } : {});
  64. };
  65. }
  66. };
  67. const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-8dc3a124"]]);
  68. wx.createComponent(Component);
  69. //# sourceMappingURL=../../../../../.sourcemap/mp-weixin/pages/components/About/AboutModal/AboutModal.js.map