Преглед на файлове

feat:修改弹窗重叠问题

wangsisi преди 3 седмици
родител
ревизия
bd3bb7b972
променени са 3 файла, в които са добавени 15 реда и са изтрити 16 реда
  1. 5 7
      components/guardSuccessPopup/guardSuccessPopup.vue
  2. 7 7
      pages/tabBar/tree/components/blessingsPopup.vue
  3. 3 2
      pages/tabBar/tree/tree.vue

+ 5 - 7
components/guardSuccessPopup/guardSuccessPopup.vue

@@ -42,29 +42,27 @@
 		}
 	};
 
-	const formatDate = (dateStr) => {
-		return dateStr.split(" ")[0].replace(/-/g, ".");
-	};
-
-
 	const showPopup = ref(false);
 
 	const handleClose = () => {
 		showPopup.value = false;
+		emit('closedGuardSuccessPopup')
 	};
 
 	const treeObj = ref({})
 
 	watch(
 		() => props.show,
-		() => {
+		() => {
 			showPopup.value = true
 			treeObj.value = {
 				...props.treeData.treeImages[0],
 				code: props.treeData.buyList[0].code
-			}
+			}
 		}
 	);
+
+	const emit = defineEmits(['closedGuardSuccessPopup'])
 </script>
 
 <style lang="scss" scoped>

+ 7 - 7
pages/tabBar/tree/components/blessingsPopup.vue

@@ -93,6 +93,7 @@
 
 	const handleCancelSucess = () => {
 		sucessPopup.value = false;
+		emit('clockinCallback')
 	};
 
 	const getRandomPick = () => {
@@ -121,17 +122,16 @@
 			farmBuyId: props.farmBuyId,
 			clockinType: props.clockinType,
 			msg: message.value,
-		};
-		if(props.clockinType!=4){
+		};
+		if(props.clockinType!=4){
 			TREE.clockin(params).then((res) => {
 				if (res.code === 0) {
 					handleCancel();
 					sucessPopup.value = true;
-					emit('clockinCallback')
 				}
 			});
-		}else{
-			sucessPopup.value = true;
+		}else{
+			sucessPopup.value = true;
 		}
 	};
 
@@ -264,7 +264,7 @@
 	}
 
 	.sucess-popup {
-		width: 100vw;
+		width: 100vw;
 		min-height: 100vh;
 
 		.image {
@@ -282,7 +282,7 @@
 
 			.img {
 				width: 81%;
-				height: 410rpx;
+				height: 410rpx;
 			}
 		}
 

+ 3 - 2
pages/tabBar/tree/tree.vue

@@ -86,7 +86,7 @@
 			@download-poster="handleDownloadPoster"
 		></posterPopup>
 		<!-- 果树成功弹窗 -->
-		<guardSuccessPopup :show="showGuardSuccess" :treeData="treeData"></guardSuccessPopup>
+		<guardSuccessPopup :show="showGuardSuccess" :treeData="treeData" @closedGuardSuccessPopup="featchIsLookedGuide"></guardSuccessPopup>
 		<!-- 果树相册弹窗 -->
 		<tree-album-popup :show="showAlbum" :farmBuyId="farmBuyId" :sampleId="sampleId"></tree-album-popup>
 		<!-- 等级升级成功弹窗 -->
@@ -198,7 +198,6 @@
 	const userInfo = ref({})
 
 	onLoad(() => {
-		featchIsLookedGuide()
 		featchCategoryList()
 	})
 	
@@ -268,6 +267,8 @@
 				if (data?.val == 0) {
 					showGuardSuccess.value = !showGuardSuccess.value
 					treeSetSessionStore()
+				}else{
+					featchIsLookedGuide()
 				}
 			}
 		}))