From 6d2537a481b9426e37aeb57848ab30a6c29b6bfe Mon Sep 17 00:00:00 2001
From: cshenfu <men883234@gmail.com>
Date: 星期四, 18 五月 2023 17:21:03 +0800
Subject: [PATCH] save openid

---
 pages/index/home.vue |   13 +++++++++----
 App.vue              |    4 ++--
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/App.vue b/App.vue
index b907653..7948261 100755
--- a/App.vue
+++ b/App.vue
@@ -5,7 +5,8 @@
 	} from 'vuex'
 	import setting from "@/common/config";
 	export default {
-		onLoad(op) {
+		
+		created() {
 			let code = ''
 			let open_id2 = this.getURLParams()
 			if(open_id2.indexOf("?") != -1){
@@ -15,7 +16,6 @@
 				uni.setStorageSync('openid',code);
 			}
 			let st_open = uni.getStorageSync('openid')
-			console.log("eeeeeeeee",st_open)
 		},
 		methods: {
 			getURLParams() {
diff --git a/pages/index/home.vue b/pages/index/home.vue
index 8425105..ab1ea67 100755
--- a/pages/index/home.vue
+++ b/pages/index/home.vue
@@ -19,7 +19,7 @@
 			<view class="header">
 				<view class="title text-bold">鍔熻兘鐗规��</view>
 			</view>
-			<!-- <text>{{ user_data }}</text> -->
+			<!-- <text>{{ shar_openid }}</text> -->
 			<u-transition :show="true" mode="slide-up">
 				<view class="grid">
 					<view class="item">
@@ -100,7 +100,8 @@
 				showTab: false,
 				tabIndex: 0,
 				setting_data:'null',
-				user_data:'null'
+				user_data:'null',
+				shar_openid:'null'
 			}
 		},
 		computed: {
@@ -119,7 +120,11 @@
 			
 		},
 		created() {
+			let st_open = uni.getStorageSync('openid')
+			this.shar_openid = st_open
 			var url_local = location.href.split("#")[0]
+			let open_id_data = this.$store.state.userInfo.openid
+			var urlLink = "http://ai.shsening.com/gpth5/#/pages/index/home?openid="+open_id_data
 			this.$request("/api/Member/wxH5ShareId",'POST',{
 				url:url_local
 			}).then((res) => {
@@ -145,7 +150,7 @@
 					  wx.updateAppMessageShareData({
 						title: "ChatFox", // 鍒嗕韩鏍囬
 						desc: "ChatFox", // 鍒嗕韩鎻忚堪
-						link: location.href, // 鍒嗕韩閾炬帴锛岃閾炬帴鍩熷悕鎴栬矾寰勫繀椤讳笌褰撳墠椤甸潰瀵瑰簲鐨勫叕浼楀彿 JS 瀹夊叏鍩熷悕涓�鑷�
+						link: urlLink, // 鍒嗕韩閾炬帴锛岃閾炬帴鍩熷悕鎴栬矾寰勫繀椤讳笌褰撳墠椤甸潰瀵瑰簲鐨勫叕浼楀彿 JS 瀹夊叏鍩熷悕涓�鑷�
 						imgUrl: "@/static/h5/download-app/ios.png", // 鍒嗕韩鍥炬爣
 						success: function () {
 						  // 璁剧疆鎴愬姛
@@ -163,7 +168,7 @@
 					  //鍒嗕韩鍒版湅鍙嬪湀
 					  wx.updateTimelineShareData({
 					   title: "ChatFox", // 鍒嗕韩鏍囬
-					   link: location.href, // 鍒嗕韩閾炬帴锛岃閾炬帴鍩熷悕鎴栬矾寰勫繀椤讳笌褰撳墠椤甸潰瀵瑰簲鐨勫叕浼楀彿 JS 瀹夊叏鍩熷悕涓�鑷�
+					   link: urlLink, // 鍒嗕韩閾炬帴锛岃閾炬帴鍩熷悕鎴栬矾寰勫繀椤讳笌褰撳墠椤甸潰瀵瑰簲鐨勫叕浼楀彿 JS 瀹夊叏鍩熷悕涓�鑷�
 					   imgUrl: "@/static/h5/download-app/ios.png", // 鍒嗕韩鍥炬爣
 						success: function () {
 						  // 璁剧疆鎴愬姛

--
Gitblit v1.9.1