lilei 4 år sedan
förälder
incheckning
e2a60edbc4

+ 7 - 3
新模板/开业活动39.9/shareWx.js

@@ -16,15 +16,19 @@ var shareCls = {
 		};
 		//二次分享处理函数调用
 		this.shareAgainFn(shareObj.link);
+		
 		$.ajax({
-			url: "https://shop.zy-yc.cn/wechat_access/api/v1/wechatCommon/noauth/getWechatShareData",
-			type:'POST',
+			url: "https://wx.test.chelingzhu.com/clzwx/redirect/jsapi",
+			type:'get',
 			dataType:'json',
+			headers: {
+				'X-HEADER-APPID': '!z2Yc.aes|j/r6hk33Kyyfehctv+KGW0HnQCXBK61W5sJRNoN9JqM='
+			},
 			data: {
 				url: url
 			},
 			success:function(res){
-				 console.log(res)
+				 console.log(res,'jsapi')
 				 var wxData = res.wxData
 				 wx.config({
 				   //debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。

BIN
新模板/开业活动39.9/hdthem.zip → 新模板/开业活动39.9/开业活动39.9.zip


+ 4 - 4
新模板/新年活动/index.html

@@ -221,20 +221,20 @@
 			justify-content: center;
 			margin-bottom: 1em;
 			margin-top: -1em;
-			background: url(img/tit2.png) no-repeat center center;
+			background: url(./img/tit2.png) no-repeat center center;
 			background-size: auto 100%;
 			height: 3em;
 			color: #b10c1a;
-			font-weight: 900;
+			font-weight: lighter;
 		}
 		.store-name span{
 			font-size: 1.2em;
-			margin: 0 0.2em;
+			margin-top: 0.2em;
 		}
 		.active-time{
 			color: #f5de98;
 			padding: 0.3em;
-			font-size: 0.6em;
+			font-size: 0.8em;
 			font-style: italic;
 			padding-right: 4em;
 		}

+ 3 - 0
新模板/新年活动/script.js

@@ -35,6 +35,9 @@ var closeYy = function (){
 	modalZz.style.display = 'none'
 }
 window.onload = function(){
+	// 分享初始化
+	shareCls.getWxCofing(reqUrl)
+	
 	if(staticHtmlPath){  //  发布
 		onLoading()  //  加载中
 		checkActiveValid()

BIN
新模板/新年活动/shareThumb.jpg


+ 112 - 0
新模板/新年活动/shareWx.js

@@ -0,0 +1,112 @@
+// 分享模块
+var shareCls = {
+	getWxCofing (shareBaseUrl){
+		var url = location.href.split('#')[0];
+		console.log(url,baseUrl + '/shareThumb.jpg')
+		// 分享内容
+		var shareObj = {
+			  title: "新年焕新血拼季", // 分享标题
+			  desc: '新年焕新血拼季', // 分享描述
+			  link: url, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
+			  imgUrl: baseUrl + '/shareThumb.jpg', // 分享图标
+			  success : function() {
+				  // 用户确认分享后执行的回调函数
+				  console.log("用户确认分享后执行的回调函数")
+			  }
+		};
+		//二次分享处理函数调用
+		this.shareAgainFn(shareObj.link);
+		
+		$.ajax({
+			url: "https://wx.chelingzhu.com/clzwx/redirect/jsapi",
+			type:'get',
+			dataType:'json',
+			headers: {
+				'X-HEADER-APPID': '!z2Yc.aes|j/r6hk33Kyyfehctv+KGW0HnQCXBK61W5sJRNoN9JqM='
+			},
+			data: {
+				url: url
+			},
+			success:function(res){
+				 console.log(res,'jsapi')
+				 var wxData = res
+				 wx.config({
+				   //debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
+				   appId: wxData.appId, // 必填,公众号的唯一标识
+				   timestamp: wxData.timestamp, // 必填,生成签名的时间戳
+				   nonceStr: wxData.nonceStr, // 必填,生成签名的随机串
+				   signature: wxData.signature,// 必填,签名
+				   jsApiList: [
+				 	  'checkJsApi',
+				 	  'onMenuShareAppMessage',
+				 	  'onMenuShareTimeline',
+				 	  'updateAppMessageShareData',
+				 	  'updateTimelineShareData',
+					  'getLocation',
+					  'openLocation'
+				   ] // 必填,需要使用的JS接口列表
+				 });
+				 
+				 // config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。
+				 wx.error(function(res){
+				 	console.log(res,'wx error')
+				 }); 
+				 //需在用户可能点击分享按钮前就先调用
+				 wx.ready(function () {
+				   if(wx.onMenuShareAppMessage){
+				 	  //分享给朋友
+				 	  wx.onMenuShareAppMessage(shareObj);
+				   }
+				   if(wx.onMenuShareTimeline){
+				 	  // 分享到朋友圈
+				 	  wx.onMenuShareTimeline(shareObj);
+				   }
+				   if(wx.updateAppMessageShareData){
+				 	  // 自定义“分享给朋友”及“分享到QQ”按钮的分享内容
+				 	  wx.updateAppMessageShareData(shareObj)
+				   }
+				   if(wx.updateTimelineShareData){
+				 	  // 自定义“分享到朋友圈”及“分享到QQ空间”按钮的分享内容
+				 	  wx.updateTimelineShareData(shareObj)
+				   }
+				   if(location.href.indexOf("store.html")>0){
+					   wx.getLocation({
+					       type: 'gcj02', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
+					       success: function (res) {
+								console.log(res, '地理位置')
+								vm.lng = res.longitude
+								vm.lat = res.latitude
+								vm.getData()
+				           },
+						   cancel: function (res) {
+							   vm.getData()
+						   },
+						   fail: function (res) {
+								vm.getData()
+							}
+					   });
+				   }
+				   
+				 });
+			}
+		})
+	},
+	getQueryString(name){
+	        let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
+	        let r = window.location.search.substr(1).match(reg);
+	        if (r != null)
+	            return unescape(r[2]);
+	        return null;
+	    },
+	shareAgainFn(url){
+		let from = this.getQueryString('from');
+		let appinstall = this.getQueryString('appinstall');
+		let sec = this.getQueryString('sec');
+		let timekey = this.getQueryString('timekey');
+		if (from || appinstall || sec || timekey) {
+			window.location.href = url;
+		}
+	}
+}
+
+

+ 5 - 4
新模板/新年活动/tpl.html

@@ -77,7 +77,7 @@
 					<div class="store-info-box">
 						<span>门店电话:</span>
 						<span>
-							<a href="tel:400-1616-312">
+							<a id="tel-link" href="javascript:;">
 								<i id="tel">XXXXXXX</i>
 								<svg t="1589357171261" class="icon" style="vertical-align: sub;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1184" width="16" height="16"><path d="M1020.765599 154.386263C1020.765599 89.326865 987.28345 57.088501 913.487954 37.054507 839.692583 17.020526 777.566181 3.165394 777.566181 3.165394 720.824641-10.981854 663.169494 23.635711 649.003341 80.452889L610.800805 233.675027C596.617668 290.560389 631.183258 348.098737 688.030695 362.272396 688.030695 362.272396 702.326846 366.678777 743.500477 375.919969 674.660513 559.358011 527.497727 691.361427 377.214242 745.028871 373.701051 730.938506 366.674793 702.757788 366.674793 702.757788 352.511387 645.951274 294.943405 611.289315 238.125689 625.455569L80.380247 664.785939C23.668179 678.925831-10.99544 736.57873 3.169215 793.389915L35.742252 923.532923C45.473616 980.250012 94.753824 1022.287923 152.863901 1022.287923 632.192772 1022.287923 1020.765599 633.715134 1020.765599 154.386263ZM121.897793 908.750484 87.987187 772.24241C85.504739 762.285654 91.648609 752.067042 101.527703 749.603912L259.273145 710.273542C269.212555 707.795389 279.364257 713.907789 281.856821 723.90528L302.608163 807.134381C309.284388 833.911333 336.103424 849.229037 358.537622 842.533069L358.537622 842.533069C590.664487 773.249875 773.382895 589.859611 841.784663 357.448461L841.784663 357.448461C848.891716 333.300864 827.631247 306.988082 794.011982 298.605863L709.17815 277.454424C699.177799 274.961048 693.114226 264.867589 695.618778 254.82252L733.821313 101.600394C736.30501 91.639055 746.508662 85.512531 756.418601 87.983366L902.466976 119.420589C919.560643 123.34343 933.351039 137.26732 933.351039 154.386263 933.351039 585.437409 583.914959 934.873401 152.863901 934.873401 137.544 934.873401 124.465783 923.717081 121.897793 908.750484Z" p-id="1185" fill="#1396dc"></path></svg>
 							</a>
@@ -180,16 +180,16 @@
 			background-size: auto 100%;
 			height: 3em;
 			color: #b10c1a;
-			font-weight: 900;
+			font-weight: lighter;
 		}
 		.store-name span{
 			font-size: 1.2em;
-			margin: 0 0.2em;
+			margin-top: 0.2em;
 		}
 		.active-time{
 			color: #f5de98;
 			padding: 0.3em;
-			font-size: 0.6em;
+			font-size: 0.8em;
 			font-style: italic;
 			padding-right: 4em;
 		}
@@ -513,4 +513,5 @@
 	<script src="${active.staticMouldTheme.basePath}/leftTime.min.js"></script>
 	<script src="${active.staticMouldTheme.basePath}/script.js"></script>
 	<script src="${active.staticMouldTheme.basePath}/spin.min.js"></script>
+	<script src="${active.staticMouldTheme.basePath}/shareWx.js" charset="utf-8"></script>
 </html>

BIN
新模板/新年活动/theme.zip → 新模板/新年活动/新年活动.zip