فهرست منبع

Merge branch 'master' of http://www.sysuimars.cn:3000/feiniao/feiniao-youwei-uniapp

lxf 3 هفته پیش
والد
کامیت
2aa0106b3f
2فایلهای تغییر یافته به همراه22 افزوده شده و 25 حذف شده
  1. 16 13
      components/posterPopup/posterPopup.vue
  2. 6 12
      pages/tabBar/tree/tree.vue

+ 16 - 13
components/posterPopup/posterPopup.vue

@@ -44,7 +44,8 @@
 		</view>
 		<view class="footer">
 			<view class="btn" @click="handleDownload">保存图片</view>
-			<view class="share btn" @click="handleShare">去分享</view>
+			<!-- <view class="share btn" @click="handleShare">去分享</view> -->
+			<button class="share btn" open-type="share">去分享</button>
 		</view>
 		<view class="close">
 			<up-icon name="close-circle-fill" size="30" @click="showPopup = false"
@@ -61,7 +62,10 @@
 		watch
 	} from "vue";
 	// import savePhotoPopup from "@/components/common/savePhotoPopup.vue";
-	import TREE from '@/api/tree.js'
+	import TREE from '@/api/tree.js'
+	import {
+		onShareAppMessage
+	} from '@dcloudio/uni-app'
 	import config from "@/api/config.js"
 	const resize = "?x-oss-process=image/resize,w_1000";
 
@@ -100,15 +104,13 @@
 		}
 	);
 
-	const handleShare = () => {
-		const params = {
-			sampleId: props.sampleId,
-			farmBuyId: props.farmBuyId,
-		};
-		// wx.miniProgram.navigateTo({
-		//     url: `/pages/subPages/share_page/index?type=treeExample&pageParams=${JSON.stringify(params)}`,
-		// });
-	};
+	onShareAppMessage((res) => {
+		return {
+			title: '我分享了我的果树,快来查看吧~',
+			path: `/pages/tabBar/tree/subPages/friendTree?sampleId=${props.sampleId}`, // 分享的小程序页面路径  
+			imageUrl: `http://birdseye-api.feiniaotech.sysuimars.cn/mini/z_farm_buy/genImage/${props.farmBuyId}?key=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9&x1=25&y1=220&fontSize1=40&x2=55&y2=250&fontSize2=16&timestamp=${Date.now()}`,
+		}
+	})
 
 	const showPopup = ref(false);
 	const userInfo = uni.getStorageSync('userInfo')
@@ -129,7 +131,7 @@
 	const contentDom = ref(null);
 
 	const handleDownload = () => {
-		savePhotoDom.value.handleDownload(contentDom.value);
+		// savePhotoDom.value.handleDownload(contentDom.value);
 	};
 
 	const getPosterData = (farmBuyId) => {
@@ -307,7 +309,8 @@
 			border: 1px solid #fff;
 			background: #fff;
 			text-align: center;
-			color: #000;
+			color: #000;
+			line-height: inherit;
 		}
 
 		.share {

+ 6 - 12
pages/tabBar/tree/tree.vue

@@ -78,7 +78,7 @@
 		<!-- 编辑树名称 -->
 		<editNamePopup ref="editNameRef" @editEnd="getBySampleId"></editNamePopup>
 		<!-- 海报弹窗 -->
-		<posterPopup :showPoster="showPoster" :farmBuyId="farmBuyId" :treeName="treeName"></posterPopup>
+		<posterPopup :showPoster="showPoster" :farmBuyId="farmBuyId" :treeName="treeName" :sampleId="sampleId"></posterPopup>
 		<!-- 果树成功弹窗 -->
 		<guardSuccessPopup :show="showGuardSuccess" :treeData="treeData"></guardSuccessPopup>
 		<!-- 果树相册弹窗 -->
@@ -183,12 +183,12 @@
 	const userInfo = ref({})
 
 	onLoad(() => {
-		userInfo.value = uni.getStorageSync('userInfo')
 		featchIsLookedGuide()
 		featchCategoryList()
 	})
 	
 	onShow(()=>{
+		userInfo.value = uni.getStorageSync('userInfo')
 		const isUpdateName = uni.getStorageSync('isUpdateName')
 		if(isUpdateName === 'true'){
 			featchLightTree()
@@ -451,16 +451,10 @@
 	}
 
 	onShareAppMessage((res) => {
-		if (res.from === 'button') {
-			const params = {
-				sampleId: treeData.value.buyList[0].sampleId,
-				farmId: treeData.value.buyList[0].farmId,
-			}
-			return {
-				title: '我分享了我的果树,快来查看吧~',
-				path: `/pages/tabBar/tree/subPages/friendTree?params=${JSON.stringify(params)}`, // 分享的小程序页面路径  
-				imageUrl: `http://birdseye-api.feiniaotech.sysuimars.cn/mini/z_farm_buy/genImage/${farmBuyId.value}?key=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9&x1=25&y1=220&fontSize1=40&x2=55&y2=250&fontSize2=16&timestamp=${Date.now()}`,
-			}
+		return {
+			title: '我分享了我的果树,快来查看吧~',
+			path: `/pages/tabBar/tree/subPages/friendTree?sampleId=${sampleId.value}`, // 分享的小程序页面路径  
+			imageUrl: `http://birdseye-api.feiniaotech.sysuimars.cn/mini/z_farm_buy/genImage/${farmBuyId.value}?key=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9&x1=25&y1=220&fontSize1=40&x2=55&y2=250&fontSize2=16&timestamp=${Date.now()}`,
 		}
 	})
 </script>