|
@@ -2,9 +2,39 @@
|
|
|
import { getImageUrl, returnAppPage } from "@/utils/index.js";
|
|
|
import { useReportStore } from "@/store";
|
|
|
import { storeToRefs } from "pinia";
|
|
|
+import { onUnmounted, ref, watch } from "vue";
|
|
|
+import ShareModal from "@/views/customize/components/ShareModal.vue";
|
|
|
+
|
|
|
const reportStore = useReportStore();
|
|
|
const { isSendToParent, isTeacher } = storeToRefs(reportStore);
|
|
|
const { sendToParent } = reportStore;
|
|
|
+
|
|
|
+const isShow = ref(false);
|
|
|
+const shareShow = ref(false);
|
|
|
+
|
|
|
+watch(isShow, (val) => {
|
|
|
+ if (val) {
|
|
|
+ setTimeout(() => {
|
|
|
+ document.addEventListener("click", handleClick);
|
|
|
+ }, 10);
|
|
|
+ } else {
|
|
|
+ document.removeEventListener("click", handleClick);
|
|
|
+ }
|
|
|
+});
|
|
|
+
|
|
|
+function share() {
|
|
|
+ console.log("share");
|
|
|
+ shareShow.value = true;
|
|
|
+}
|
|
|
+
|
|
|
+function handleClick() {
|
|
|
+ console.log("handleClick");
|
|
|
+ if (isShow.value) isShow.value = false;
|
|
|
+}
|
|
|
+
|
|
|
+onUnmounted(() => {
|
|
|
+ document.removeEventListener("click", handleClick);
|
|
|
+});
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
@@ -13,12 +43,33 @@ const { sendToParent } = reportStore;
|
|
|
<div class="header-back" @click="returnAppPage">
|
|
|
<img :src="getImageUrl('return_button')" alt="" class="header-back-img" />
|
|
|
</div>
|
|
|
- <div v-if="isTeacher" class="header-send" @click="sendToParent">
|
|
|
- <div class="header-send-btn flex-center">
|
|
|
- {{ isSendToParent ? "已发送" : "发送家长" }}
|
|
|
+ <div class="header-send" @click="isShow = true">
|
|
|
+ <img :src="getImageUrl('more')" alt="" class="header-send-more" />
|
|
|
+ </div>
|
|
|
+ <!--<div v-if="isTeacher" class="header-send" @click="sendToParent">-->
|
|
|
+ <!-- <div class="header-send-btn flex-center">-->
|
|
|
+ <!-- {{ isSendToParent ? "已发送" : "发送家长" }}-->
|
|
|
+ <!-- </div>-->
|
|
|
+ <!--</div>-->
|
|
|
+ <!--<div v-else></div>-->
|
|
|
+
|
|
|
+ <div v-if="isShow" class="header-modal">
|
|
|
+ <img
|
|
|
+ :src="getImageUrl('small_triangle')"
|
|
|
+ alt=""
|
|
|
+ class="header-modal-logo"
|
|
|
+ />
|
|
|
+ <div class="header-modal-item flex-center" @click="share">分享</div>
|
|
|
+ <div
|
|
|
+ v-if="!isSendToParent && isTeacher"
|
|
|
+ class="header-modal-item flex-center"
|
|
|
+ @click="sendToParent"
|
|
|
+ >
|
|
|
+ 发送家长
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div v-else></div>
|
|
|
+
|
|
|
+ <ShareModal :show="shareShow" @close="shareShow = false" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -28,6 +79,7 @@ const { sendToParent } = reportStore;
|
|
|
height: 44px;
|
|
|
}
|
|
|
.header {
|
|
|
+ position: relative;
|
|
|
justify-content: space-between;
|
|
|
width: 100%;
|
|
|
|
|
@@ -42,7 +94,13 @@ const { sendToParent } = reportStore;
|
|
|
}
|
|
|
|
|
|
&-send {
|
|
|
- padding: 6px 19px;
|
|
|
+ //padding: 6px 19px;
|
|
|
+ padding: 12px 16px;
|
|
|
+
|
|
|
+ &-more {
|
|
|
+ width: 20px;
|
|
|
+ height: 20px;
|
|
|
+ }
|
|
|
|
|
|
&-btn {
|
|
|
width: 78px;
|
|
@@ -58,5 +116,41 @@ const { sendToParent } = reportStore;
|
|
|
color: #233cd5;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ &-modal {
|
|
|
+ position: absolute;
|
|
|
+ top: 36px;
|
|
|
+ right: 10px;
|
|
|
+ z-index: 20;
|
|
|
+ padding: 5px 0;
|
|
|
+ width: 91px;
|
|
|
+ background: #ffffff;
|
|
|
+ box-shadow: 0 2px 15px 0 rgba(104, 136, 176, 0.2);
|
|
|
+ border-radius: 4px 4px 4px 4px;
|
|
|
+
|
|
|
+ &-logo {
|
|
|
+ position: absolute;
|
|
|
+ top: -6px;
|
|
|
+ right: 8px;
|
|
|
+ width: 14px;
|
|
|
+ height: 6px;
|
|
|
+ }
|
|
|
+
|
|
|
+ &-item {
|
|
|
+ width: 91px;
|
|
|
+ height: 30px;
|
|
|
+ background: #ffffff;
|
|
|
+ font-size: 14px;
|
|
|
+ font-family:
|
|
|
+ PingFang SC-Regular,
|
|
|
+ PingFang SC;
|
|
|
+ font-weight: 400;
|
|
|
+ color: #333333;
|
|
|
+ }
|
|
|
+
|
|
|
+ &-item + &-item {
|
|
|
+ border-top: 1px solid rgba(182, 220, 255, 0.1);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|