230320a303 2 anni fa
parent
commit
704ec25bf8
3 ha cambiato i file con 61 aggiunte e 11 eliminazioni
  1. 1 0
      index.html
  2. 59 0
      src/js/main.js
  3. 1 11
      wxnews.html

+ 1 - 0
index.html

@@ -65,6 +65,7 @@
     </div>
   </div>
   <!-- Swiper JS -->
+  <script type="text/javascript" src="https://res2.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
   <script src="./src/swiper/swiper.min.js"></script>
   <script src="./src/js/clipboard.min.js"></script>
   <script src="./src/js/main.js"></script>

+ 59 - 0
src/js/main.js

@@ -222,6 +222,11 @@ ajax({
 
 
 
+
+
+		
+
+
 		
 	}
 })
@@ -232,3 +237,57 @@ ajax({
 
 
 
+
+ajax({
+	type:'post',
+	url:'https://api.honglouplus.com/api/h5/vr',
+	data: formData,
+	success:function(msgShareStr){ 
+		var resShareObj = JSON.parse(msgShareStr)
+		configJsSDKAndDoSomething(resShareObj.jssdk, '南昌各楼盘航拍全景地图(不断更新)', 'https://img.honglounews.com/20230612053506-4632.jpg_adm0', '南昌各区域新房、二手房楼盘进度,微信洪楼Plus小程序查看户型、学区、一房一价、成交价等等更多')
+	}
+})
+
+
+
+
+
+var shareImgUrl = 'https://icon.honglouplus.com/plus.png';
+function configJsSDKAndDoSomething(config, title, imgUrl, desc){
+    wx.config({
+        debug: false,
+        appId: config.appId,
+        timestamp: config.timestamp,
+        nonceStr: config.nonceStr,
+        signature: config.signature,
+        jsApiList: config.jsApiList,
+		openTagList: ['wx-open-launch-weapp'],
+    })
+    wx.error(function(error){
+        console.log(error);
+    });
+    wx.ready(function () {
+        wx.updateAppMessageShareData({
+	        title: title,
+	        desc: desc,
+	        link: location.href,
+	        imgUrl: imgUrl,
+	        success: function () {
+	            console.log("success");
+	        }
+	     });
+	     wx.updateTimelineShareData({
+	        title: title,
+	        link: location.href,
+	        imgUrl: imgUrl,
+	        success: function () {
+	            console.log("success2");
+	        }
+	     });
+
+
+    });
+}
+
+
+

+ 1 - 11
wxnews.html

@@ -176,7 +176,7 @@ if (novelId) {
 var shareImgUrl = 'https://icon.honglouplus.com/plus.png';
 function configJsSDKAndDoSomething(config, title, imgUrl, desc){
     wx.config({
-        debug: true,
+        debug: false,
         appId: config.appId,
         timestamp: config.timestamp,
         nonceStr: config.nonceStr,
@@ -205,16 +205,6 @@ function configJsSDKAndDoSomething(config, title, imgUrl, desc){
 	            console.log("success2");
 	        }
 	     });
-
-		 wx.checkJsApi({
-			jsApiList: ['updateAppMessageShareData', 'updateTimelineShareData'], // 需要检测的JS接口列表,所有JS接口列表见附录2,
-			success: function(res) {
-				alert(JSON.stringify(res))
-			// 以键值对的形式返回,可用的api值true,不可用为false
-			// 如:{"checkResult":{"chooseImage":true},"errMsg":"checkJsApi:ok"}
-			}
-			});
-
     });
 }
 </script>