Prechádzať zdrojové kódy

feat:添加果树成功弹窗

wangsisi 1 mesiac pred
rodič
commit
3117054089

+ 150 - 0
components/guardSuccessPopup/guardSuccessPopup.vue

@@ -0,0 +1,150 @@
+<template>
+	<up-popup :show="showPopup" @close="handleClose" mode="center" bgColor="transparent">
+		<view class="success-popup">
+			<view class="success-title">恭喜你,已守护成功!</view>
+			<view class="success-content">
+				<image class="right-star" :src="`${config.BASIC_IMG}img/treePage/star.png`" alt="" />
+				<image class="left-star" :src="`${config.BASIC_IMG}img/treePage/star.png`" alt="" />
+				<view class="card">
+					<image class="img"
+						src="https://birdseye-img-ali-cdn.sysuimars.com/562ba414-9517-4789-98f9-42fdae26cee4/bc27ee0c-8177-47fb-823c-c81d6f8b514c/DJI_202507281100_002_bc27ee0c-8177-47fb-823c-c81d6f8b514c/DJI_20250728110246_0016_Z_code-ws0y1mu3uwb2.jpeg">
+					</image>
+					<!-- <image class="img" v-lazyload="getImageUrl(treeObj.treeImages[0].filename)" alt="" /> -->
+					<!-- <view class="code">{{treeObj.buyList[0].code}}</view> -->
+					<view class="code">LCJGHN-GZCH-LBY1003</view>
+				</view>
+			</view>
+			<view class="button" @click="handleClose">我知道了</view>
+		</view>
+	</up-popup>
+</template>
+
+<script setup>
+	import {
+		ref,
+		watch
+	} from "vue";
+	import config from "@/api/config.js"
+	const resize = "?x-oss-process=image/resize,w_1000";
+
+	const props = defineProps({
+		show: {
+			type: Boolean,
+			defalut: false,
+		},
+		treeObj: {
+			type: Object,
+			defalut: () => {},
+		},
+	});
+
+	const getImageUrl = (filename) => {
+		if (filename.startsWith("https")) {
+			return filename; // 直接使用完整 URL
+		} else {
+			return base_img_url2 + filename + resize; // 拼接基础 URL
+		}
+	};
+
+	const formatDate = (dateStr) => {
+		return dateStr.split(" ")[0].replace(/-/g, ".");
+	};
+
+
+	const showPopup = ref(false);
+
+	const handleClose = () => {
+		showPopup.value = false;
+	};
+
+	watch(
+		() => props.show,
+		() => {
+			showPopup.value = true;
+		}
+	);
+</script>
+
+<style lang="scss" scoped>
+	@import "@/static/style/mixin.scss";
+	.success-popup {
+		width: 90vw;
+		color: #fff;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		flex-direction: column;
+
+		.success-title {
+			font-size: 56rpx;
+			text-align: center;
+			@include ossBg("treePage/ribbon.png");
+			margin-bottom: 42rpx;
+			font-family: "PangMenZhengDao";
+			padding: 14rpx 46rpx 0;
+			line-height: 130rpx;
+		}
+
+		.success-content {
+			width: 88%;
+			border-radius: 40rpx;
+			padding: 14rpx;
+			background: rgba(255, 255, 255, 0.15);
+			box-shadow: 0 0 12rpx 0 rgba(255, 255, 255, 0.63) inset;
+			box-sizing: border-box;
+			backdrop-filter: blur(8rpx);
+			position: relative;
+
+			.right-star {
+				width: 56rpx;
+				height: 54rpx;
+				position: absolute;
+				top: 110rpx;
+				right: -38rpx;
+			}
+
+			.left-star {
+				width: 64rpx;
+				height: 62rpx;
+				position: absolute;
+				top: 280rpx;
+				left: -36rpx;
+			}
+
+			.card {
+				position: relative;
+				color: #000;
+				border-radius: 32rpx;
+
+				.img {
+					border-radius: 32rpx;
+					width: 100%;
+					height: 646rpx;
+					object-fit: cover;
+				}
+
+				.code {
+					position: absolute;
+					top: 0;
+					left: calc(50% - 340rpx / 2);
+					background: rgba(26, 26, 26, 0.5);
+					font-size: 24rpx;
+					color: #fff;
+					padding: 12rpx 30rpx;
+					border-radius: 4rpx 4rpx 20rpx 20rpx;
+				}
+			}
+		}
+
+		.button {
+			font-size: 32rpx;
+			color: #fff;
+			padding: 20rpx 144rpx;
+			border: 2rpx solid #fff;
+			border-radius: 50rpx;
+			text-align: center;
+			margin: 50rpx 0 40rpx;
+			background-image: linear-gradient(120deg, #00d4ff, #008eff);
+		}
+	}
+</style>

+ 14 - 11
components/posterPopup/posterPopup.vue

@@ -45,8 +45,9 @@
 		<view class="footer">
 			<view @click="handleDownload">保存图片</view>
 			<view class="share" @click="handleShare">去分享</view>
-		</view>
-		<up-icon class="close" name="close-circle-fill" size="30" @click="showPopup = false" color="rgba(255, 255, 255, 0.7)"></up-icon>
+		</view>
+		<up-icon class="close" name="close-circle-fill" size="30" @click="showPopup = false"
+			color="rgba(255, 255, 255, 0.7)"></up-icon>
 	</up-popup>
 	<!-- 保存弹窗 -->
 	<!-- <save-photo-popup ref="savePhotoDom" height="480"></save-photo-popup> -->
@@ -94,7 +95,7 @@
 		(newValue) => {
 			// if (newValue && userInfo?.tel && props.showPoster) {
 			// 	getPosterData(props.farmBuyId);
-			// }
+			// }
 			getPosterData()
 		}
 	);
@@ -171,15 +172,17 @@
 	};
 </script>
 
-<style lang="scss" scoped>
+<style lang="scss" scoped>
 	@import "@/static/style/mixin.scss";
+
 	.poster-popup {
 		width: 90vw;
 		box-sizing: border-box;
 		position: relative;
-		padding: 40rpx 30rpx;
-		background: #fff;
-		border-radius: 24rpx;
+		padding: 40rpx 30rpx;
+		background: #fff;
+		border-radius: 24rpx;
+
 		.date-wrap {
 			display: flex;
 			justify-content: space-between;
@@ -252,7 +255,7 @@
 				left: 0;
 				bottom: 0;
 
-				.tag-content {
+				.tag-content {
 					@include ossBg("treePage/tag-bg.png");
 					width: 276rpx;
 					height: 274rpx;
@@ -342,8 +345,8 @@
 		}
 	}
 
-	.close{
-		margin-top: 36rpx;
-		justify-content: center;
+	.close {
+		margin-top: 36rpx;
+		justify-content: center;
 	}
 </style>

+ 7 - 0
pages.json

@@ -87,6 +87,13 @@
 			{
 				"navigationBarTitleText" : "订单详情"
 			}
+		},
+		{
+			"path" : "pages/tabBar/tree/subPages/diary",
+			"style" : 
+			{
+				"navigationBarTitleText" : "我的日记"
+			}
 		}
 	],
 	"globalStyle": {

+ 3 - 0
pages/login/index.vue

@@ -65,6 +65,9 @@
 	      //     that.saveUserInfo(that.data.userInfo)
 	      //   }
 	      // })
+		  uni.navigateTo({
+		  	url: `/pages/tabBar/home/subPages/allGardenMap?enterSelectTree=true`
+		  });
 	    }else{
 	      console.log("用户拒绝了授权");
 	    }

+ 2 - 2
pages/tabBar/mine/mine.vue

@@ -77,9 +77,9 @@ const handlePage = (type) =>{
 	});
 }
 
-const handleItem = () =>{
+const handleItem = (status) =>{
 	uni.navigateTo({
-		url: `/pages/tabBar/mine/subPages/order`
+		url: `/pages/tabBar/mine/subPages/order?status=${status + 1}`
 	});
 }
 </script>

+ 6 - 1
pages/tabBar/mine/subPages/order.vue

@@ -15,7 +15,12 @@
 	import {
 		ref
 	} from "vue"
-	import shopList from "../components/shopList.vue"
+	import shopList from "../components/shopList.vue"
+	import { onLoad } from '@dcloudio/uni-app'
+	
+	onLoad(({status})=>{
+		active.value = Number(status)
+	})
 
 	const searchCallback = (e) => {
 		console.log('搜索', e)

+ 17 - 0
pages/tabBar/tree/subPages/diary.vue

@@ -0,0 +1,17 @@
+<template>
+	<view class="sub-base-container">
+		123
+	</view>
+</template>
+
+<script setup>
+	import config from "@/api/config.js"
+</script>
+
+<style lang="scss" scoped>
+@import "@/static/style/mixin.scss";
+.sub-base-container{
+	background-image: linear-gradient(0deg,#FFFFFF,rgba(33, 153, 248, 0.6));
+	min-height: 484rpx;
+}
+</style>

+ 17 - 4
pages/tabBar/tree/tree.vue

@@ -35,11 +35,15 @@
 		@confirm="handleConfirm"></up-picker>
 	<!-- 编辑树名称 -->
 	<editNamePopup></editNamePopup>
-	<posterPopup :showPoster="showPoster"></posterPopup>
+	<!-- 海报弹窗 -->
+	<posterPopup :showPoster="showPoster"></posterPopup>
+	<!-- 果树成功弹窗 -->
+	<guardSuccessPopup :show="showGuardSuccess"></guardSuccessPopup>
 </template>
 
 <script setup>
-	import config from "@/api/config.js"
+	import config from "@/api/config.js"
+	import { onLoad } from '@dcloudio/uni-app'
 	import memberLevel from "./components/memberLevel.vue"
 	import {
 		ref,
@@ -67,7 +71,8 @@
 			name: "相册",
 		},
 		{
-			name: "日记",
+			name: "日记",
+			path: 'diary'
 		},
 		{
 			name: "海报",
@@ -96,7 +101,15 @@
 			className: 'dynamic',
 			path: 'dynamic'
 		}
-	]
+	]
+	
+	const showGuardSuccess = ref(false)
+	
+	onLoad(({successTree})=>{
+		if(successTree){
+			showGuardSuccess.value = true
+		}
+	})
 	
 	const showPoster = ref(false)
 	const handleToolItem = ({