Jelajahi Sumber

模板迭代

chenrui 5 tahun lalu
induk
melakukan
bf0ea2801a
5 mengubah file dengan 477 tambahan dan 108 penghapusan
  1. 9 13
      index.html
  2. 123 32
      tpl.html
  3. 115 21
      海报/theme - jiyou/script.js
  4. 115 21
      海报/theme - meiyan/script.js
  5. 115 21
      海报/theme/script.js

File diff ditekan karena terlalu besar
+ 9 - 13
index.html


+ 123 - 32
tpl.html

@@ -153,34 +153,39 @@
 				width: 100%;
 				float: left;
 			}
-			
-			/*门店信息样式*/
-			.zy-h5-store-info{
+			.joiner-info{
 				padding: 1em;
-				font-size: 15px;
 			}
-			.zy-h5-store-info > p{
+			.joiner-info > p{
 				text-align: center;
 				padding: 0.5em 0.8em;
 				border: 1px solid #eee;
 				border-radius: 5em;
 				margin-bottom: 1em;
 			}
-			.zy-h5-store-info > p span{
+			.joiner-info > p span{
 				color: #378BEA;
 			}
-			.zy-h5-store-info > div{
+			/*门店信息样式*/
+			.zy-h5-store-info{
+				display: none;
+			}
+			.zy-h5-store-info > .store-info-cont{
+				padding: 0 1em 1em;
+				font-size: 15px;
+			}
+			.zy-h5-store-info > .store-info-cont > .store-info-box{
 				padding: 0.5em 0;
 				position: relative;
 			}
-			.zy-h5-store-info > div span:first-child{
+			.zy-h5-store-info > .store-info-cont > .store-info-box span:first-child{
 				display: inline-block;
 				position: absolute;
 				left: 0;
 				top: 0.5em;
 				line-height: 1.5em;
 			}
-			.zy-h5-store-info > div span:last-child{
+			.zy-h5-store-info > .store-info-cont > .store-info-box span:last-child{
 				display: inline-block;
 				padding-left: 75px;
 				text-align: right;
@@ -188,10 +193,81 @@
 				width: 100%;
 				line-height: 1.5em;
 			}
-			.zy-h5-store-info > div span:last-child a{
+			.zy-h5-store-info > .store-info-cont > .store-info-box span:last-child a{
 				color: #000;
 				text-decoration: none;
 			}
+			.zy-h5-store-info >.qg-cont{
+				border: 10px solid #ededed;
+				border-width: 10px 0;
+				padding: 0 1em 1em;
+			}
+			.zy-h5-store-info .header-con{
+				display: flex;
+				justify-content: space-between;
+				align-items: center;
+			}
+			.zy-h5-store-info .header-con > p{
+				font-size: 14px;
+				margin: 0;
+				padding: 10px 0 8px;
+			}
+			.zy-h5-store-info .header-con > p:first-child{
+				font-weight: bold;
+				position: relative;
+				padding-left: 10px;
+				font-size: 14px!important;
+			}
+			.zy-h5-store-info .header-con > p:last-child{
+				font-size: 13px;
+			}
+			.zy-h5-store-info .header-con > p:last-child > span{
+				color: #ff5500;
+				font-size: 14px;
+				padding: 0 3px;
+				font-weight: bold;
+			}
+			.zy-h5-store-info .header-con > p:first-child > em{
+				position: absolute;
+				left: 0;
+				top: 14px;
+				display: block;
+				width: 3px;
+				height: 12px;
+				background-color: #ff5500;
+			}
+			.zy-h5-store-info >.qg-cont > #scroll{
+				overflow: hidden;
+				height: 115px;
+				width: 100%;
+				position: relative;
+			}
+			.zy-h5-store-info >.qg-cont > #scroll > ul{
+				height: auto;
+				text-align: left;
+				list-style: none;
+				padding: 0;
+				margin: 0;
+			}
+			.zy-h5-store-info >.qg-cont > #scroll > ul > .info-con{
+				display: flex;
+				justify-content: space-between;
+				align-items: center;
+				line-height: 24px;
+			}
+			.zy-h5-store-info >.qg-cont > #scroll > ul > .info-con > .qg-people{
+				font-size: 13px;
+				color: #666;
+				margin: 0;
+			}
+			.zy-h5-store-info >.qg-cont > #scroll > ul > .info-con > .qg-state{
+				font-size: 13px;
+				color: #999;
+				margin: 0;
+			}
+			.zy-h5-store-info #tel{
+				font-style: initial;
+			}
 			/*底部栏样式*/
 			.zy-h5-fx-bar{
 				height: 7em;
@@ -354,30 +430,45 @@
 					</div>
 				</div>
 			</div>
-			
 			<!--门店信息-->
 			<div class="zy-h5-store-info">
-				<p>已有<span id="joinerNum">${active.initBuyNum!}</span>人参与</p>
-				<div>
-					<span>门店/公司:</span>
-					<span>
-						${active.activeCompany!}
-					</span>
-				</div>
-				<div>
-					<span>地址/说明:</span>
-					<span>
-						${active.activeCompanyInfo!}
-				    </span>
+				<!-- 向上滚动 -->
+				<div class="qg-cont">
+					<div class="header-con">
+						<p><em></em>参与动态</p>
+						<p>已有<span id="joinerNum">${active.initBuyNum!}</span>人参与</p>
+					</div>
+					<div id="scroll">
+					    <ul id="scroll-con"></ul>
+					</div>
 				</div>
-				<div>
-					<span>客服电话:</span>
-					<span style="vertical-align: middle;">
-						<a href="tel:${active.servicePhone!}">
-							${active.servicePhone!}
-							<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="18" height="18"><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>
-				    </span>
+				<div class="store-info-cont">
+					<div class="header-con">
+						<p><em></em>门店信息</p>
+					</div>
+					<div class="store-info-box">
+						<span>门店:</span>
+						<span id="store">XXX汽车服务中心
+							<!-- ${active.activeCompany!} -->
+						</span>
+					</div>
+					<div class="store-info-box">
+						<span>地址:</span>
+						<span id="address">XX市XX区XXX369号
+							<!-- ${active.activeCompanyInfo!} -->
+					    </span>
+					</div>
+					<div class="store-info-box">
+						<span>电话:</span>
+						<span style="vertical-align: middle;">
+							<a href="tel:${active.servicePhone!}">
+								<i id="tel">400XXXXXXX
+									<!-- ${active.servicePhone!} -->
+								</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="18" height="18"><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>
+					    </span>
+					</div>
 				</div>
 			</div>
 			<!-- 底部浮动栏 -->
@@ -437,7 +528,7 @@
 				document.querySelector('.zy-h5-bf-bar').style.display = 'none'
 				document.querySelector('.zy-h5-fx-bar').style.display = 'none'
 			}
-			var acitveId = "${active.id!}"
+			var activeId = "${active.id!}"
 			var baseUrl = "${active.staticMouldTheme.basePath}"
 			var baseType = "${basePathType}"
 			var staticHtmlPath = "${active.staticHtmlPath!}"

+ 115 - 21
海报/theme - jiyou/script.js

@@ -1,18 +1,28 @@
 var getNode = function(id){
 	return document.getElementById(id)
 }
-var yuyue = getNode("yuyue")
-var share = getNode("share")
-var modal = getNode("zy-h5-modal")
-var modalZz = getNode("zy-h5-fix-z")
-var submitModal = getNode("submitModal")
-var canselModal = getNode("canselModal")
-var userPhone = getNode("userPhone")
+var yuyue = getNode("yuyue")  //  预约按钮
+var share = getNode("share")  //  分享按钮
+var modal = getNode("zy-h5-modal")  //  预约弹框
+var modalZz = getNode("zy-h5-fix-z")  //  弹框遮罩层
+var submitModal = getNode("submitModal")  //  提交预约
+var canselModal = getNode("canselModal")  //  取消预约
+var userPhone = getNode("userPhone")  //  预约手机号
+var joinerNum = getNode("joinerNum")  //  参与人数
+var store = getNode("store")  //  门店
+var address = getNode("address")  //  地址
+var tel = getNode("tel")  //  电话
+var upScroll = getNode("upScroll")  //  参与人信息  外层盒子
+var upScrollO = getNode("upScroll-o")  //  参与人信息  盒子1
+var upScrollT = getNode("upScroll-t")  //  参与人信息  盒子2
+
+var storeId = getQueryString('orgId') || 0  //  门店id
+var companyId = ''
 // test,  测试     local:本地     pre :预发布      pro:生产
 if(baseType == 'test'){
 	var reqUrl = 'http://192.168.16.100:9110/saas/clz/'
 }else if(baseType == 'local'){
-	var reqUrl = 'http://127.0.0.1:9110/saas/clz/'
+	var reqUrl = 'http://192.168.16.104:9110/saas/clz/'
 }else if(baseType == 'pre'){
 	var reqUrl = 'http://md.test.zyucgj.com/saas/clz/'
 }else if(baseType == 'pro'){
@@ -25,17 +35,14 @@ var closeYy = function (){
 	modalZz.style.display = 'none'
 }
 window.onload = function(){
-	
-	getActivityData()
+	getActivityData()  //  获取活动信息
 	//  获取活动信息
 	function getActivityData(){
 		//  获取活动信息 (海报和门店二维码)
 		$.ajax({
-			url: reqUrl + 'active/findActiveAttach/' + acitveId,
+			url: reqUrl + 'active/findActiveAttach/' + activeId,
 			type: 'get',
-			header: {
-				contentType: 'application/json;charset=UTF-8',
-			},
+			header: { contentType: 'application/json;charset=UTF-8' },
 			// 设置的是请求参数
 			data: {},
 			dataType: 'json',
@@ -43,13 +50,36 @@ window.onload = function(){
 				if(res.status == 200){
 					const data = res.data
 					if(staticHtmlPath){  //  发布
-						const joinerNum = parseInt(data.initBuyNum) + parseInt(data.joinerNum)
-						document.getElementById('joinerNum').innerHTML = joinerNum
+						const joinerNumVal = parseInt(data.initBuyNum) + parseInt(data.joinerNum)
+						joinerNum.innerHTML = joinerNumVal
+						$('.zy-h5-store-info').show()
 					}
 				}
 			},
 		})
 	}
+	//  根据门店id处理对应页面展示
+	if(storeId){
+		//  获取门店信息
+		$.ajax({
+			url: reqUrl + 'cross/store/' + storeId,
+			type: 'get',
+			header: { contentType: 'application/json;charset=UTF-8' },
+			// 设置的是请求参数
+			data: {},
+			dataType: 'json',
+			success: function (res) {
+				if(res.status == 200){
+					const data = res.data
+					store.innerHTML = data.name
+					address.innerHTML = data.addrCityName + data.addrDistrictName + data.addrDetail
+					tel.innerHTML = data.managerMobile
+					companyId = data.companyId
+					joinerList(companyId)  //  参与人列表数据
+				}
+			},
+		})
+	}
 	// 打开预约弹框
 	yuyue.onclick = function(){
 		modal.style.display = 'block'
@@ -71,10 +101,11 @@ window.onload = function(){
 			alert("手机号码错误,请重填");  
 			return false; 
 		}
-		
 		const obj = JSON.stringify({
-			"joinerMobile": mobile,
-			"activeId": acitveId,
+			"joinerMobile": mobile,  //  参与手机号
+			"activeId": activeId,  //  活动id
+			"tenantId": storeId,  //  门店id
+			"companyId": companyId  //  公司id
 		})
 		//  立即参与
 		$.ajax({
@@ -85,7 +116,6 @@ window.onload = function(){
 			data: obj,
 			dataType: 'json',
 			success: function (res) {
-				console.log(res)
 				if(res.status == 200){
 					closeYy()
 				}
@@ -95,6 +125,70 @@ window.onload = function(){
 	}
 	// 分享
 	share.onclick = function(){
-		window.location.href = 'http://static.chelingzhu.com/active/poster.html?id=' + acitveId + '&reqUrl=' + reqUrl
+		window.location.href = 'http://static.chelingzhu.com/active/poster.html?id=' + activeId + '&reqUrl=' + reqUrl
+	}
+	//  门店活动统计(参与者轮播)
+	function joinerList(companyId){
+		let obj = JSON.stringify({
+			activeId: activeId,  //  活动id
+			tenantId: storeId,  //  门店id
+			companyId: companyId,  //  公司id
+			status: 9  //  9是假数据的标识
+		})
+		//  获取门店信息
+		$.ajax({
+			url: reqUrl + 'cross/active/joinerByActive/1/1000',
+			type: 'post',
+			contentType: 'application/json;charset=UTF-8',
+			// 设置的是请求参数
+			data: obj,
+			dataType: 'json',
+			success: function (res) {
+				if(res.status == 200){
+					const data = res.data.list
+					let html = ''
+					for(let i = 0; i < data.length; i++){
+						html += `<li class="info-con">
+				        	<p class="qg-people">${data[i].joinerMobile}</p>
+				        	<p class="qg-state">抢购成功</p>
+				        </li>`
+					}
+					document.getElementById("scroll-con").innerHTML = html
+					//  参与人信息 向上滚动
+					data.length > 0 ? upDownScroll() : ''
+				}
+			},
+		})
+	}
+	//  上下滚动
+	function upDownScroll(){
+		var scrollTimer
+		$("#scroll").hover(function(){
+			clearInterval(scrollTimer)
+		}, function() {
+			scrollTimer = setInterval(function() {
+				scrollContent($("#scroll"))
+			}, 2000)
+		}).trigger("mouseout")
+	}
+	function scrollContent(obj) {
+		var $self = obj.find("ul:first")
+		var lineHeight = $self.find("li:first").height() //获取行高
+		$self.animate({
+			"margin-top": -lineHeight + "px"
+		}, 1000, function() {
+			$self.css({
+				"margin-top": "0px"
+			}).find("li:first").appendTo($self) //appendTo能直接移动元素而不是复制,被appendto的元素位置发生变化
+		})
+	}
+}
+// 正则获取地址栏参数
+function 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
 }

+ 115 - 21
海报/theme - meiyan/script.js

@@ -1,18 +1,28 @@
 var getNode = function(id){
 	return document.getElementById(id)
 }
-var yuyue = getNode("yuyue")
-var share = getNode("share")
-var modal = getNode("zy-h5-modal")
-var modalZz = getNode("zy-h5-fix-z")
-var submitModal = getNode("submitModal")
-var canselModal = getNode("canselModal")
-var userPhone = getNode("userPhone")
+var yuyue = getNode("yuyue")  //  预约按钮
+var share = getNode("share")  //  分享按钮
+var modal = getNode("zy-h5-modal")  //  预约弹框
+var modalZz = getNode("zy-h5-fix-z")  //  弹框遮罩层
+var submitModal = getNode("submitModal")  //  提交预约
+var canselModal = getNode("canselModal")  //  取消预约
+var userPhone = getNode("userPhone")  //  预约手机号
+var joinerNum = getNode("joinerNum")  //  参与人数
+var store = getNode("store")  //  门店
+var address = getNode("address")  //  地址
+var tel = getNode("tel")  //  电话
+var upScroll = getNode("upScroll")  //  参与人信息  外层盒子
+var upScrollO = getNode("upScroll-o")  //  参与人信息  盒子1
+var upScrollT = getNode("upScroll-t")  //  参与人信息  盒子2
+
+var storeId = getQueryString('orgId') || 0  //  门店id
+var companyId = ''
 // test,  测试     local:本地     pre :预发布      pro:生产
 if(baseType == 'test'){
 	var reqUrl = 'http://192.168.16.100:9110/saas/clz/'
 }else if(baseType == 'local'){
-	var reqUrl = 'http://127.0.0.1:9110/saas/clz/'
+	var reqUrl = 'http://192.168.16.104:9110/saas/clz/'
 }else if(baseType == 'pre'){
 	var reqUrl = 'http://md.test.zyucgj.com/saas/clz/'
 }else if(baseType == 'pro'){
@@ -25,17 +35,14 @@ var closeYy = function (){
 	modalZz.style.display = 'none'
 }
 window.onload = function(){
-	
-	getActivityData()
+	getActivityData()  //  获取活动信息
 	//  获取活动信息
 	function getActivityData(){
 		//  获取活动信息 (海报和门店二维码)
 		$.ajax({
-			url: reqUrl + 'active/findActiveAttach/' + acitveId,
+			url: reqUrl + 'active/findActiveAttach/' + activeId,
 			type: 'get',
-			header: {
-				contentType: 'application/json;charset=UTF-8',
-			},
+			header: { contentType: 'application/json;charset=UTF-8' },
 			// 设置的是请求参数
 			data: {},
 			dataType: 'json',
@@ -43,13 +50,36 @@ window.onload = function(){
 				if(res.status == 200){
 					const data = res.data
 					if(staticHtmlPath){  //  发布
-						const joinerNum = parseInt(data.initBuyNum) + parseInt(data.joinerNum)
-						document.getElementById('joinerNum').innerHTML = joinerNum
+						const joinerNumVal = parseInt(data.initBuyNum) + parseInt(data.joinerNum)
+						joinerNum.innerHTML = joinerNumVal
+						$('.zy-h5-store-info').show()
 					}
 				}
 			},
 		})
 	}
+	//  根据门店id处理对应页面展示
+	if(storeId){
+		//  获取门店信息
+		$.ajax({
+			url: reqUrl + 'cross/store/' + storeId,
+			type: 'get',
+			header: { contentType: 'application/json;charset=UTF-8' },
+			// 设置的是请求参数
+			data: {},
+			dataType: 'json',
+			success: function (res) {
+				if(res.status == 200){
+					const data = res.data
+					store.innerHTML = data.name
+					address.innerHTML = data.addrCityName + data.addrDistrictName + data.addrDetail
+					tel.innerHTML = data.managerMobile
+					companyId = data.companyId
+					joinerList(companyId)  //  参与人列表数据
+				}
+			},
+		})
+	}
 	// 打开预约弹框
 	yuyue.onclick = function(){
 		modal.style.display = 'block'
@@ -71,10 +101,11 @@ window.onload = function(){
 			alert("手机号码错误,请重填");  
 			return false; 
 		}
-		
 		const obj = JSON.stringify({
-			"joinerMobile": mobile,
-			"activeId": acitveId,
+			"joinerMobile": mobile,  //  参与手机号
+			"activeId": activeId,  //  活动id
+			"tenantId": storeId,  //  门店id
+			"companyId": companyId  //  公司id
 		})
 		//  立即参与
 		$.ajax({
@@ -85,7 +116,6 @@ window.onload = function(){
 			data: obj,
 			dataType: 'json',
 			success: function (res) {
-				console.log(res)
 				if(res.status == 200){
 					closeYy()
 				}
@@ -95,6 +125,70 @@ window.onload = function(){
 	}
 	// 分享
 	share.onclick = function(){
-		window.location.href = 'http://static.chelingzhu.com/active/poster.html?id=' + acitveId + '&reqUrl=' + reqUrl
+		window.location.href = 'http://static.chelingzhu.com/active/poster.html?id=' + activeId + '&reqUrl=' + reqUrl
+	}
+	//  门店活动统计(参与者轮播)
+	function joinerList(companyId){
+		let obj = JSON.stringify({
+			activeId: activeId,  //  活动id
+			tenantId: storeId,  //  门店id
+			companyId: companyId,  //  公司id
+			status: 9  //  9是假数据的标识
+		})
+		//  获取门店信息
+		$.ajax({
+			url: reqUrl + 'cross/active/joinerByActive/1/1000',
+			type: 'post',
+			contentType: 'application/json;charset=UTF-8',
+			// 设置的是请求参数
+			data: obj,
+			dataType: 'json',
+			success: function (res) {
+				if(res.status == 200){
+					const data = res.data.list
+					let html = ''
+					for(let i = 0; i < data.length; i++){
+						html += `<li class="info-con">
+				        	<p class="qg-people">${data[i].joinerMobile}</p>
+				        	<p class="qg-state">抢购成功</p>
+				        </li>`
+					}
+					document.getElementById("scroll-con").innerHTML = html
+					//  参与人信息 向上滚动
+					data.length > 0 ? upDownScroll() : ''
+				}
+			},
+		})
+	}
+	//  上下滚动
+	function upDownScroll(){
+		var scrollTimer
+		$("#scroll").hover(function(){
+			clearInterval(scrollTimer)
+		}, function() {
+			scrollTimer = setInterval(function() {
+				scrollContent($("#scroll"))
+			}, 2000)
+		}).trigger("mouseout")
+	}
+	function scrollContent(obj) {
+		var $self = obj.find("ul:first")
+		var lineHeight = $self.find("li:first").height() //获取行高
+		$self.animate({
+			"margin-top": -lineHeight + "px"
+		}, 1000, function() {
+			$self.css({
+				"margin-top": "0px"
+			}).find("li:first").appendTo($self) //appendTo能直接移动元素而不是复制,被appendto的元素位置发生变化
+		})
+	}
+}
+// 正则获取地址栏参数
+function 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
 }

+ 115 - 21
海报/theme/script.js

@@ -1,18 +1,28 @@
 var getNode = function(id){
 	return document.getElementById(id)
 }
-var yuyue = getNode("yuyue")
-var share = getNode("share")
-var modal = getNode("zy-h5-modal")
-var modalZz = getNode("zy-h5-fix-z")
-var submitModal = getNode("submitModal")
-var canselModal = getNode("canselModal")
-var userPhone = getNode("userPhone")
+var yuyue = getNode("yuyue")  //  预约按钮
+var share = getNode("share")  //  分享按钮
+var modal = getNode("zy-h5-modal")  //  预约弹框
+var modalZz = getNode("zy-h5-fix-z")  //  弹框遮罩层
+var submitModal = getNode("submitModal")  //  提交预约
+var canselModal = getNode("canselModal")  //  取消预约
+var userPhone = getNode("userPhone")  //  预约手机号
+var joinerNum = getNode("joinerNum")  //  参与人数
+var store = getNode("store")  //  门店
+var address = getNode("address")  //  地址
+var tel = getNode("tel")  //  电话
+var upScroll = getNode("upScroll")  //  参与人信息  外层盒子
+var upScrollO = getNode("upScroll-o")  //  参与人信息  盒子1
+var upScrollT = getNode("upScroll-t")  //  参与人信息  盒子2
+
+var storeId = getQueryString('orgId') || 0  //  门店id
+var companyId = ''
 // test,  测试     local:本地     pre :预发布      pro:生产
 if(baseType == 'test'){
 	var reqUrl = 'http://192.168.16.100:9110/saas/clz/'
 }else if(baseType == 'local'){
-	var reqUrl = 'http://127.0.0.1:9110/saas/clz/'
+	var reqUrl = 'http://192.168.16.104:9110/saas/clz/'
 }else if(baseType == 'pre'){
 	var reqUrl = 'http://md.test.zyucgj.com/saas/clz/'
 }else if(baseType == 'pro'){
@@ -25,17 +35,14 @@ var closeYy = function (){
 	modalZz.style.display = 'none'
 }
 window.onload = function(){
-	
-	getActivityData()
+	getActivityData()  //  获取活动信息
 	//  获取活动信息
 	function getActivityData(){
 		//  获取活动信息 (海报和门店二维码)
 		$.ajax({
-			url: reqUrl + 'active/findActiveAttach/' + acitveId,
+			url: reqUrl + 'active/findActiveAttach/' + activeId,
 			type: 'get',
-			header: {
-				contentType: 'application/json;charset=UTF-8',
-			},
+			header: { contentType: 'application/json;charset=UTF-8' },
 			// 设置的是请求参数
 			data: {},
 			dataType: 'json',
@@ -43,13 +50,36 @@ window.onload = function(){
 				if(res.status == 200){
 					const data = res.data
 					if(staticHtmlPath){  //  发布
-						const joinerNum = parseInt(data.initBuyNum) + parseInt(data.joinerNum)
-						document.getElementById('joinerNum').innerHTML = joinerNum
+						const joinerNumVal = parseInt(data.initBuyNum) + parseInt(data.joinerNum)
+						joinerNum.innerHTML = joinerNumVal
+						$('.zy-h5-store-info').show()
 					}
 				}
 			},
 		})
 	}
+	//  根据门店id处理对应页面展示
+	if(storeId){
+		//  获取门店信息
+		$.ajax({
+			url: reqUrl + 'cross/store/' + storeId,
+			type: 'get',
+			header: { contentType: 'application/json;charset=UTF-8' },
+			// 设置的是请求参数
+			data: {},
+			dataType: 'json',
+			success: function (res) {
+				if(res.status == 200){
+					const data = res.data
+					store.innerHTML = data.name
+					address.innerHTML = data.addrCityName + data.addrDistrictName + data.addrDetail
+					tel.innerHTML = data.managerMobile
+					companyId = data.companyId
+					joinerList(companyId)  //  参与人列表数据
+				}
+			},
+		})
+	}
 	// 打开预约弹框
 	yuyue.onclick = function(){
 		modal.style.display = 'block'
@@ -71,10 +101,11 @@ window.onload = function(){
 			alert("手机号码错误,请重填");  
 			return false; 
 		}
-		
 		const obj = JSON.stringify({
-			"joinerMobile": mobile,
-			"activeId": acitveId,
+			"joinerMobile": mobile,  //  参与手机号
+			"activeId": activeId,  //  活动id
+			"tenantId": storeId,  //  门店id
+			"companyId": companyId  //  公司id
 		})
 		//  立即参与
 		$.ajax({
@@ -85,7 +116,6 @@ window.onload = function(){
 			data: obj,
 			dataType: 'json',
 			success: function (res) {
-				console.log(res)
 				if(res.status == 200){
 					closeYy()
 				}
@@ -95,6 +125,70 @@ window.onload = function(){
 	}
 	// 分享
 	share.onclick = function(){
-		window.location.href = 'http://static.chelingzhu.com/active/poster.html?id=' + acitveId + '&reqUrl=' + reqUrl
+		window.location.href = 'http://static.chelingzhu.com/active/poster.html?id=' + activeId + '&reqUrl=' + reqUrl
+	}
+	//  门店活动统计(参与者轮播)
+	function joinerList(companyId){
+		let obj = JSON.stringify({
+			activeId: activeId,  //  活动id
+			tenantId: storeId,  //  门店id
+			companyId: companyId,  //  公司id
+			status: 9  //  9是假数据的标识
+		})
+		//  获取门店信息
+		$.ajax({
+			url: reqUrl + 'cross/active/joinerByActive/1/1000',
+			type: 'post',
+			contentType: 'application/json;charset=UTF-8',
+			// 设置的是请求参数
+			data: obj,
+			dataType: 'json',
+			success: function (res) {
+				if(res.status == 200){
+					const data = res.data.list
+					let html = ''
+					for(let i = 0; i < data.length; i++){
+						html += `<li class="info-con">
+				        	<p class="qg-people">${data[i].joinerMobile}</p>
+				        	<p class="qg-state">抢购成功</p>
+				        </li>`
+					}
+					document.getElementById("scroll-con").innerHTML = html
+					//  参与人信息 向上滚动
+					data.length > 0 ? upDownScroll() : ''
+				}
+			},
+		})
+	}
+	//  上下滚动
+	function upDownScroll(){
+		var scrollTimer
+		$("#scroll").hover(function(){
+			clearInterval(scrollTimer)
+		}, function() {
+			scrollTimer = setInterval(function() {
+				scrollContent($("#scroll"))
+			}, 2000)
+		}).trigger("mouseout")
+	}
+	function scrollContent(obj) {
+		var $self = obj.find("ul:first")
+		var lineHeight = $self.find("li:first").height() //获取行高
+		$self.animate({
+			"margin-top": -lineHeight + "px"
+		}, 1000, function() {
+			$self.css({
+				"margin-top": "0px"
+			}).find("li:first").appendTo($self) //appendTo能直接移动元素而不是复制,被appendto的元素位置发生变化
+		})
+	}
+}
+// 正则获取地址栏参数
+function 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
 }

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini