|
@@ -34,7 +34,194 @@ var closeYy = function (){
|
|
modal.style.display = 'none'
|
|
modal.style.display = 'none'
|
|
modalZz.style.display = 'none'
|
|
modalZz.style.display = 'none'
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+// 倒计时
|
|
|
|
+function function_name(time,obj) {
|
|
|
|
+ $.leftTime(time,function(d){
|
|
|
|
+ if(d.status){
|
|
|
|
+ var $dateShow1=$(obj);
|
|
|
|
+ $dateShow1.find(".d").html(d.d);
|
|
|
|
+ $dateShow1.find(".h").html(d.h);
|
|
|
|
+ $dateShow1.find(".m").html(d.m);
|
|
|
|
+ $dateShow1.find(".s").html(d.s);
|
|
|
|
+ // 倒计时结束
|
|
|
|
+ if(parseInt(d.d)==0 && parseInt(d.h)==0 && parseInt(d.m)==0 && parseInt(d.s)==0){
|
|
|
|
+ document.getElementById('zy-h5-bf-bar').innerHTML = '活动已结束'
|
|
|
|
+ document.getElementById('zy-h5-bf-bar').style.display = 'block'
|
|
|
|
+ document.getElementById('zy-h5-bf-bar').style.fontSize = '13px'
|
|
|
|
+ document.getElementById('zy-h5-bf-bar').style.color = '#666'
|
|
|
|
+ document.getElementById('zy-h5-bf-bar').style.padding = '11px 0'
|
|
|
|
+ document.getElementById('zy-h5-bf-bar').style.textAlign = 'center'
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+}
|
|
|
|
+// 校验活动是否还在进行
|
|
|
|
+function checkActiveValid(){
|
|
|
|
+ $.ajax({
|
|
|
|
+ url: reqUrl + 'zycar-mgr/active/checkActiveValid/' + activeId,
|
|
|
|
+ type: 'get',
|
|
|
|
+ header: { contentType: 'application/json;charset=UTF-8' },
|
|
|
|
+ // 设置的是请求参数
|
|
|
|
+ data: {},
|
|
|
|
+ dataType: 'json',
|
|
|
|
+ success: function (res) {
|
|
|
|
+ if(res.status == 200){
|
|
|
|
+ if(res.data){
|
|
|
|
+ getActivityData() // 获取活动信息
|
|
|
|
+ }else{
|
|
|
|
+ closeLoading() // 关闭加载状态
|
|
|
|
+ alert('该活动已经结束!')
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
+// 获取活动信息
|
|
|
|
+function getActivityData(){
|
|
|
|
+ // 获取活动信息 (海报和门店二维码)
|
|
|
|
+ $.ajax({
|
|
|
|
+ url: reqUrl + 'active/findActiveAttach/' + activeId,
|
|
|
|
+ type: 'get',
|
|
|
|
+ header: { contentType: 'application/json;charset=UTF-8' },
|
|
|
|
+ // 设置的是请求参数
|
|
|
|
+ data: {},
|
|
|
|
+ dataType: 'json',
|
|
|
|
+ success: function (res) {
|
|
|
|
+ if(res.status == 200){
|
|
|
|
+ const data = res.data
|
|
|
|
+ if(staticHtmlPath){ // 发布
|
|
|
|
+ const joinerNumVal = parseInt(data.initBuyNum) + parseInt(data.joinerNum)
|
|
|
|
+ joinerNum.innerHTML = joinerNumVal
|
|
|
|
+ $('.zy-h5-store-info').show()
|
|
|
|
+ }
|
|
|
|
+ // 根据门店id处理对应页面展示
|
|
|
|
+ if(storeId){ // 门店端发布活动会传有门店id参数
|
|
|
|
+ // 获取门店信息
|
|
|
|
+ $.ajax({
|
|
|
|
+ url: reqUrl + 'cross/store/' + storeId,
|
|
|
|
+ type: 'get',
|
|
|
|
+ header: { contentType: 'application/json;charset=UTF-8' },
|
|
|
|
+ // 设置的是请求参数
|
|
|
|
+ data: {},
|
|
|
|
+ dataType: 'json',
|
|
|
|
+ success: function (result) {
|
|
|
|
+ if(result.status == 200){
|
|
|
|
+ const data = result.data
|
|
|
|
+ storeHead.innerHTML = data.name || ''
|
|
|
|
+ store.innerHTML = data.name || ''
|
|
|
|
+ let addrCityName = data.addrCityName || ''
|
|
|
|
+ let addrDistrictName = data.addrDistrictName || ''
|
|
|
|
+ let addrDetail = data.addrDetail || ''
|
|
|
|
+ address.innerHTML = addrCityName + addrDistrictName + addrDetail
|
|
|
|
+ tel.innerHTML = data.managerMobile
|
|
|
|
+ document.getElementById("tel-link").href = 'tel:' + data.managerMobile
|
|
|
|
+ companyId = data.companyId
|
|
|
|
+ joinerList(companyId) // 参与人列表数据
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ })
|
|
|
|
+ }else{ // 运营端发布活动无门店id参数
|
|
|
|
+ joinerList() // 参与人列表数据
|
|
|
|
+ }
|
|
|
|
+ closeLoading() // 关闭加载状态
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
+// 关闭加载状态
|
|
|
|
+function closeLoading(){
|
|
|
|
+ if(staticHtmlPath){ // 发布
|
|
|
|
+ // 关闭加载状态
|
|
|
|
+ document.getElementById('foo').style.display = 'none'
|
|
|
|
+ modalZz.style.display = 'none'
|
|
|
|
+ // 不是微信端打开的页面
|
|
|
|
+ if(!browser.versions.weixin){
|
|
|
|
+ document.querySelector('.zy-h5-bf-bar').style.display = 'none'
|
|
|
|
+ document.querySelector('.zy-h5-fx-bar').style.display = 'none'
|
|
|
|
+ }else{
|
|
|
|
+ document.querySelector('.zy-h5-bf-bar').style.display = 'flex'
|
|
|
|
+ document.querySelector('.zy-h5-fx-bar').style.display = 'block'
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+// 加载中
|
|
|
|
+function onLoading(){
|
|
|
|
+ // 隐藏参与和分享按钮
|
|
|
|
+ document.querySelector('.zy-h5-bf-bar').style.display = 'none'
|
|
|
|
+ document.querySelector('.zy-h5-fx-bar').style.display = 'none'
|
|
|
|
+ modalZz.style.display = 'block' // 遮罩层
|
|
|
|
+ var opts = {
|
|
|
|
+ lines: 9, // The number of lines to draw
|
|
|
|
+ length: 0, // The length of each line
|
|
|
|
+ width: 10, // The line thickness
|
|
|
|
+ radius: 15, // The radius of the inner circle
|
|
|
|
+ corners: 1, // Corner roundness (0..1)
|
|
|
|
+ rotate: 0, // The rotation offset
|
|
|
|
+ color: '#2979ff', // #rgb or #rrggbb
|
|
|
|
+ speed: 1, // Rounds per second
|
|
|
|
+ trail: 60, // Afterglow percentage
|
|
|
|
+ shadow: false, // Whether to render a shadow
|
|
|
|
+ hwaccel: false, // Whether to use hardware acceleration
|
|
|
|
+ className: 'spinner', // The CSS class to assign to the spinner
|
|
|
|
+ zIndex: 2e9, // The z-index (defaults to 2000000000)
|
|
|
|
+ top: 'auto', // Top position relative to parent in px
|
|
|
|
+ left: 'auto' // Left position relative to parent in px
|
|
|
|
+ };
|
|
|
|
+ var target = document.getElementById('foo');
|
|
|
|
+ var spinner = new Spinner(opts).spin(target);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 正则获取地址栏参数
|
|
|
|
+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
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 门店活动统计(参与者轮播)
|
|
|
|
+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 = `<div class="kh-list-tr kh-list-tr-head">
|
|
|
|
+ <div class="kh-list-td">手机号</div>
|
|
|
|
+ <div class="kh-list-td">报名状态</div>
|
|
|
|
+ </div>`
|
|
|
|
+ for(let i = 0; i < data.length; i++){
|
|
|
|
+ html += `<div class="kh-list-tr kh-list-tr-head">
|
|
|
|
+ <div class="kh-list-td">${data[i].joinerMobile}</div>
|
|
|
|
+ <div class="kh-list-td">已报名</div>
|
|
|
|
+ </div>`
|
|
|
|
+ }
|
|
|
|
+ document.getElementById("kh-list").innerHTML = html
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
+// 右上角分享转发
|
|
|
|
+
|
|
window.onload = function(){
|
|
window.onload = function(){
|
|
|
|
+ // 分享初始化
|
|
|
|
+ shareCls.getWxCofing(reqUrl)
|
|
|
|
+
|
|
if(staticHtmlPath){ // 发布
|
|
if(staticHtmlPath){ // 发布
|
|
onLoading() // 加载中
|
|
onLoading() // 加载中
|
|
checkActiveValid()
|
|
checkActiveValid()
|
|
@@ -43,142 +230,6 @@ window.onload = function(){
|
|
}
|
|
}
|
|
// 倒计时
|
|
// 倒计时
|
|
function_name($('#dateShow1').data("date"), '#dateShow1')
|
|
function_name($('#dateShow1').data("date"), '#dateShow1')
|
|
-
|
|
|
|
- function function_name(time,obj) {
|
|
|
|
- $.leftTime(time,function(d){
|
|
|
|
- if(d.status){
|
|
|
|
- var $dateShow1=$(obj);
|
|
|
|
- $dateShow1.find(".d").html(d.d);
|
|
|
|
- $dateShow1.find(".h").html(d.h);
|
|
|
|
- $dateShow1.find(".m").html(d.m);
|
|
|
|
- $dateShow1.find(".s").html(d.s);
|
|
|
|
- // 倒计时结束
|
|
|
|
- if(parseInt(d.d)==0 && parseInt(d.h)==0 && parseInt(d.m)==0 && parseInt(d.s)==0){
|
|
|
|
- document.getElementById('zy-h5-bf-bar').innerHTML = '活动已结束'
|
|
|
|
- document.getElementById('zy-h5-bf-bar').style.display = 'block'
|
|
|
|
- document.getElementById('zy-h5-bf-bar').style.fontSize = '13px'
|
|
|
|
- document.getElementById('zy-h5-bf-bar').style.color = '#666'
|
|
|
|
- document.getElementById('zy-h5-bf-bar').style.padding = '11px 0'
|
|
|
|
- document.getElementById('zy-h5-bf-bar').style.textAlign = 'center'
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- // 校验活动是否还在进行
|
|
|
|
- function checkActiveValid(){
|
|
|
|
- $.ajax({
|
|
|
|
- url: reqUrl + 'zycar-mgr/active/checkActiveValid/' + activeId,
|
|
|
|
- type: 'get',
|
|
|
|
- header: { contentType: 'application/json;charset=UTF-8' },
|
|
|
|
- // 设置的是请求参数
|
|
|
|
- data: {},
|
|
|
|
- dataType: 'json',
|
|
|
|
- success: function (res) {
|
|
|
|
- if(res.status == 200){
|
|
|
|
- if(res.data){
|
|
|
|
- getActivityData() // 获取活动信息
|
|
|
|
- }else{
|
|
|
|
- closeLoading() // 关闭加载状态
|
|
|
|
- alert('该活动已经结束!')
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- // 获取活动信息
|
|
|
|
- function getActivityData(){
|
|
|
|
- // 获取活动信息 (海报和门店二维码)
|
|
|
|
- $.ajax({
|
|
|
|
- url: reqUrl + 'active/findActiveAttach/' + activeId,
|
|
|
|
- type: 'get',
|
|
|
|
- header: { contentType: 'application/json;charset=UTF-8' },
|
|
|
|
- // 设置的是请求参数
|
|
|
|
- data: {},
|
|
|
|
- dataType: 'json',
|
|
|
|
- success: function (res) {
|
|
|
|
- if(res.status == 200){
|
|
|
|
- const data = res.data
|
|
|
|
- if(staticHtmlPath){ // 发布
|
|
|
|
- const joinerNumVal = parseInt(data.initBuyNum) + parseInt(data.joinerNum)
|
|
|
|
- joinerNum.innerHTML = joinerNumVal
|
|
|
|
- $('.zy-h5-store-info').show()
|
|
|
|
- }
|
|
|
|
- // 根据门店id处理对应页面展示
|
|
|
|
- if(storeId){ // 门店端发布活动会传有门店id参数
|
|
|
|
- // 获取门店信息
|
|
|
|
- $.ajax({
|
|
|
|
- url: reqUrl + 'cross/store/' + storeId,
|
|
|
|
- type: 'get',
|
|
|
|
- header: { contentType: 'application/json;charset=UTF-8' },
|
|
|
|
- // 设置的是请求参数
|
|
|
|
- data: {},
|
|
|
|
- dataType: 'json',
|
|
|
|
- success: function (result) {
|
|
|
|
- if(result.status == 200){
|
|
|
|
- const data = result.data
|
|
|
|
- storeHead.innerHTML = data.name || ''
|
|
|
|
- store.innerHTML = data.name || ''
|
|
|
|
- let addrCityName = data.addrCityName || ''
|
|
|
|
- let addrDistrictName = data.addrDistrictName || ''
|
|
|
|
- let addrDetail = data.addrDetail || ''
|
|
|
|
- address.innerHTML = addrCityName + addrDistrictName + addrDetail
|
|
|
|
- tel.innerHTML = data.managerMobile
|
|
|
|
- document.getElementById("tel-link").href = 'tel:' + data.managerMobile
|
|
|
|
- companyId = data.companyId
|
|
|
|
- joinerList(companyId) // 参与人列表数据
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- })
|
|
|
|
- }else{ // 运营端发布活动无门店id参数
|
|
|
|
- joinerList() // 参与人列表数据
|
|
|
|
- }
|
|
|
|
- closeLoading() // 关闭加载状态
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- // 关闭加载状态
|
|
|
|
- function closeLoading(){
|
|
|
|
- if(staticHtmlPath){ // 发布
|
|
|
|
- // 关闭加载状态
|
|
|
|
- document.getElementById('foo').style.display = 'none'
|
|
|
|
- modalZz.style.display = 'none'
|
|
|
|
- // 不是微信端打开的页面
|
|
|
|
- if(!browser.versions.weixin){
|
|
|
|
- document.querySelector('.zy-h5-bf-bar').style.display = 'none'
|
|
|
|
- document.querySelector('.zy-h5-fx-bar').style.display = 'none'
|
|
|
|
- }else{
|
|
|
|
- document.querySelector('.zy-h5-bf-bar').style.display = 'flex'
|
|
|
|
- document.querySelector('.zy-h5-fx-bar').style.display = 'block'
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- // 加载中
|
|
|
|
- function onLoading(){
|
|
|
|
- // 隐藏参与和分享按钮
|
|
|
|
- document.querySelector('.zy-h5-bf-bar').style.display = 'none'
|
|
|
|
- document.querySelector('.zy-h5-fx-bar').style.display = 'none'
|
|
|
|
- modalZz.style.display = 'block' // 遮罩层
|
|
|
|
- var opts = {
|
|
|
|
- lines: 9, // The number of lines to draw
|
|
|
|
- length: 0, // The length of each line
|
|
|
|
- width: 10, // The line thickness
|
|
|
|
- radius: 15, // The radius of the inner circle
|
|
|
|
- corners: 1, // Corner roundness (0..1)
|
|
|
|
- rotate: 0, // The rotation offset
|
|
|
|
- color: '#2979ff', // #rgb or #rrggbb
|
|
|
|
- speed: 1, // Rounds per second
|
|
|
|
- trail: 60, // Afterglow percentage
|
|
|
|
- shadow: false, // Whether to render a shadow
|
|
|
|
- hwaccel: false, // Whether to use hardware acceleration
|
|
|
|
- className: 'spinner', // The CSS class to assign to the spinner
|
|
|
|
- zIndex: 2e9, // The z-index (defaults to 2000000000)
|
|
|
|
- top: 'auto', // Top position relative to parent in px
|
|
|
|
- left: 'auto' // Left position relative to parent in px
|
|
|
|
- };
|
|
|
|
- var target = document.getElementById('foo');
|
|
|
|
- var spinner = new Spinner(opts).spin(target);
|
|
|
|
- }
|
|
|
|
// 打开预约弹框
|
|
// 打开预约弹框
|
|
yuyue.onclick = function(){
|
|
yuyue.onclick = function(){
|
|
modal.style.display = 'block'
|
|
modal.style.display = 'block'
|
|
@@ -222,7 +273,7 @@ window.onload = function(){
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
- // 分享
|
|
|
|
|
|
+ // 分享海报
|
|
share.onclick = function(){
|
|
share.onclick = function(){
|
|
if(storeId){
|
|
if(storeId){
|
|
window.location.href = 'http://static.chelingzhu.com/active/poster.html?id=' + activeId + '&reqUrl=' + reqUrl + '&orgId=' + storeId
|
|
window.location.href = 'http://static.chelingzhu.com/active/poster.html?id=' + activeId + '&reqUrl=' + reqUrl + '&orgId=' + storeId
|
|
@@ -231,47 +282,4 @@ window.onload = function(){
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
- // 门店活动统计(参与者轮播)
|
|
|
|
- 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 = `<div class="kh-list-tr kh-list-tr-head">
|
|
|
|
- <div class="kh-list-td">手机号</div>
|
|
|
|
- <div class="kh-list-td">报名状态</div>
|
|
|
|
- </div>`
|
|
|
|
- for(let i = 0; i < data.length; i++){
|
|
|
|
- html += `<div class="kh-list-tr kh-list-tr-head">
|
|
|
|
- <div class="kh-list-td">${data[i].joinerMobile}</div>
|
|
|
|
- <div class="kh-list-td">已报名</div>
|
|
|
|
- </div>`
|
|
|
|
- }
|
|
|
|
- document.getElementById("kh-list").innerHTML = html
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
-// 正则获取地址栏参数
|
|
|
|
-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
|
|
|
|
-}
|
|
|