|
@@ -1,10 +1,11 @@
|
|
|
<script setup>
|
|
|
+import { watch, watchEffect } from 'vue'
|
|
|
import AnimatedOverlay from '../../components/dialog/AnimatedOverlay.vue'
|
|
|
import ContentCard from './components/content-card.vue'
|
|
|
import PhoneConfirmDialog from './components/PhoneConfirmDialog.vue'
|
|
|
import PhoneEditDialog from './components/PhoneEditDialog.vue'
|
|
|
import SubMitSuccess from './components/SubMitSuccess.vue'
|
|
|
-import { usePreLeaveInfo } from '@/utils/hooks'
|
|
|
+import { usePhoneCheck, usePreLeaveInfo } from '@/utils/hooks'
|
|
|
|
|
|
const props = defineProps({
|
|
|
source: {
|
|
@@ -33,22 +34,32 @@ const {
|
|
|
configInfo,
|
|
|
} = usePreLeaveInfo({ props })
|
|
|
|
|
|
+const config = {
|
|
|
+ configInfo,
|
|
|
+ props,
|
|
|
+}
|
|
|
+
|
|
|
const {
|
|
|
confirmPhoneDialog,
|
|
|
- confirmContentText,
|
|
|
changePhoneDialog,
|
|
|
successCheckDialog,
|
|
|
dialogEvents,
|
|
|
checkPhonePass,
|
|
|
+ contactMe
|
|
|
} = usePhoneCheck({
|
|
|
configInfo,
|
|
|
props,
|
|
|
- popupVisible: visible,
|
|
|
+ // popupVisible: visible,
|
|
|
})
|
|
|
|
|
|
-const config = {
|
|
|
- configInfo,
|
|
|
- props,
|
|
|
+function contactMeEvent(phone) {
|
|
|
+ configInfo.phone = phone
|
|
|
+ contactMe()
|
|
|
+}
|
|
|
+
|
|
|
+function phoneEditConfirm(phone) {
|
|
|
+ changePhoneDialog.phoneNumber = phone
|
|
|
+ dialogEvents.phoneChangeConfirm()
|
|
|
}
|
|
|
|
|
|
defineExpose({
|
|
@@ -68,19 +79,36 @@ export default {
|
|
|
:class="`pc-leave-dialog-${props.type}`"
|
|
|
:visible="visible"
|
|
|
@update:visible="updateVisible"
|
|
|
- @close="close"
|
|
|
>
|
|
|
- <ContentCard :config="config" />
|
|
|
+ <ContentCard
|
|
|
+ :config="config"
|
|
|
+ @contactMeEvent="contactMeEvent"
|
|
|
+ @close="updateVisible(false)"
|
|
|
+ />
|
|
|
<!-- 确认手机弹窗 -->
|
|
|
<PhoneConfirmDialog
|
|
|
- :confirm-phone-dialog="confirmPhoneDialog"
|
|
|
- :confirm-content-text="confirmContentText"
|
|
|
+ :visible="confirmPhoneDialog.show"
|
|
|
+ :title="confirmPhoneDialog.title"
|
|
|
+ :content-text="confirmPhoneDialog.contentText"
|
|
|
+ :confirm-button-text="confirmPhoneDialog.confirmButtonText"
|
|
|
+ :cancel-button-text="confirmPhoneDialog.cancelButtonText"
|
|
|
+ @confirm="dialogEvents.confirmPhoneConfirm"
|
|
|
+ @cancel="dialogEvents.confirmPhoneCancel"
|
|
|
/>
|
|
|
<!-- 修改手机号弹窗 -->
|
|
|
- <PhoneEditDialog />
|
|
|
+ <PhoneEditDialog
|
|
|
+ :visible="changePhoneDialog.show"
|
|
|
+ :phone="changePhoneDialog.phoneNumber"
|
|
|
+ @confirm="phoneEditConfirm"
|
|
|
+ @cancel="dialogEvents.phoneChangeCancel"
|
|
|
+ />
|
|
|
<!-- 提交成功弹窗 -->
|
|
|
<SubMitSuccess
|
|
|
- :success-check-dialog="successCheckDialog"
|
|
|
+ :visible="successCheckDialog.show"
|
|
|
+ :title="successCheckDialog.title"
|
|
|
+ :content-text="successCheckDialog.contentText"
|
|
|
+ :confirm-button-text="successCheckDialog.confirmButtonText"
|
|
|
+ @confirm="dialogEvents.successConfirm"
|
|
|
/>
|
|
|
</AnimatedOverlay>
|
|
|
</template>
|
|
@@ -91,7 +119,7 @@ export default {
|
|
|
.overlay-content {
|
|
|
margin: 300px auto;
|
|
|
width: 732px;
|
|
|
- background: #fff;
|
|
|
+ // background: #fff;
|
|
|
border-radius: 8px;
|
|
|
}
|
|
|
}
|