|
@@ -26,6 +26,16 @@
|
|
|
</div>
|
|
|
<div class="star-wrap">
|
|
|
<img class="star" src="../static/img/anniversaryCelebrate/star.png" />
|
|
|
+ <img class="out-point out-point1" src="../static/img/anniversaryCelebrate/out-point.png" />
|
|
|
+ <img class="out-point out-point2" src="../static/img/anniversaryCelebrate/out-point.png" />
|
|
|
+ <img class="out-point out-point3" src="../static/img/anniversaryCelebrate/out-point.png" />
|
|
|
+ <img class="out-point out-point4" src="../static/img/anniversaryCelebrate/out-point.png" />
|
|
|
+ <img class="out-point out-point5" src="../static/img/anniversaryCelebrate/out-point.png" />
|
|
|
+ <img class="in-point in-point1" src="../static/img/anniversaryCelebrate/in-point.png" />
|
|
|
+ <img class="in-point in-point2" src="../static/img/anniversaryCelebrate/in-point.png" />
|
|
|
+ <img class="in-point in-point3" src="../static/img/anniversaryCelebrate/in-point.png" />
|
|
|
+ <img class="in-point in-point4" src="../static/img/anniversaryCelebrate/in-point.png" />
|
|
|
+ <img class="in-point in-point5" src="../static/img/anniversaryCelebrate/in-point.png" />
|
|
|
</div>
|
|
|
<div class="station-wrap">
|
|
|
<img class="station" src="../static/img/anniversaryCelebrate/station.png" />
|
|
@@ -38,11 +48,54 @@
|
|
|
<img class="five-btn btn" src="../static/img/anniversaryCelebrate/fifce.png" />
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="number-wrap">
|
|
|
- <div class="rest-times">剩余次数<span class="rest-number">1000</span>次</div>
|
|
|
- <div class="small-star-wrap">
|
|
|
- <img class="small-star" src="../static/img/anniversaryCelebrate/small-star.png" />
|
|
|
+ <div class="award-get-wrap">
|
|
|
+ <div class="number-wrap">
|
|
|
+ <div class="rest-times">剩余次数<span class="rest-number">1000</span>次</div>
|
|
|
+ <div class="process-wrap">
|
|
|
+ <div class="small-star-wrap">
|
|
|
+ <img class="small-star" src="../static/img/anniversaryCelebrate/small-star.png" />
|
|
|
+ </div>
|
|
|
+ <div class="line-wrap">
|
|
|
+ <img class="icon icon1" src="../static/img/anniversaryCelebrate/icon1.png" />
|
|
|
+ <img class="icon icon2" src="../static/img/anniversaryCelebrate/icon3.png" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
+ <img class="get-times" src="../static/img/anniversaryCelebrate/get-times.png" />
|
|
|
+ </div>
|
|
|
+ <div class="no-join-activity">激活码、优惠券、星币购买的订单不参与本次活动</div>
|
|
|
+ <div class="light-record-wrap">
|
|
|
+ <div class="record-title-wrap">标题</div>
|
|
|
+ <div class="record-main-wrap">
|
|
|
+ <div class="change-wrap">
|
|
|
+ <div class="get-award-wrap">
|
|
|
+ <img class="award-img" src="../static/img/anniversaryCelebrate/left-bg.png" />
|
|
|
+ <img class="get-award-img" src="../static/img/anniversaryCelebrate/get-award-success-show.png" />
|
|
|
+ <div class="get-award-text">领取</div>
|
|
|
+ </div>
|
|
|
+ <div class="get-award-wrap">
|
|
|
+ <img class="award-img right-bg" src="../static/img/anniversaryCelebrate/right-bg.png" />
|
|
|
+ <img class="get-award-img" src="../static/img/anniversaryCelebrate/get-award-success-hidden.png" />
|
|
|
+ <div class="get-award-text used-text">已使用</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="light-title-wrap">
|
|
|
+ <div class="light-title-text award-text">奖品</div>
|
|
|
+ <div class="light-title-text">时间</div>
|
|
|
+ <div class="light-title-text active-text">操作</div>
|
|
|
+ </div>
|
|
|
+ <div class="light-content-container">
|
|
|
+ <div class="light-content-list">
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <div class="all-light">已全部点亮1次</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="activity-intrduction-wrap">
|
|
|
+ <div>活动时间:2022年6月10日-2022年6月19日</div>
|
|
|
+ <div>活动参与套餐:星曜套餐月卡年卡(自动续费除外)</div>
|
|
|
+ </div>
|
|
|
+ <div class="law-statement">请阅读相关《法律声明》文件</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<script>
|
|
@@ -51,7 +104,7 @@
|
|
|
</script>
|
|
|
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
|
|
|
<script type="text/javascript">
|
|
|
- // var baseUrl = 'https://per.cs.se.androidscloud.com'
|
|
|
+ var baseUrl = 'http://192.168.31.198'
|
|
|
let timer,flag = true;
|
|
|
var url = window.location.href;
|
|
|
url = url.split('/')
|
|
@@ -63,8 +116,262 @@
|
|
|
ua = navigator.userAgent.toLowerCase(),
|
|
|
isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
|
|
|
isMiniprogram = false,
|
|
|
+ pages = 1,
|
|
|
isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
|
|
|
- //
|
|
|
+ // 初始化数据
|
|
|
+ init();
|
|
|
+ function init(type) {
|
|
|
+ $.ajax({
|
|
|
+ url: baseUrl + '/api/user/v1/anniversary/getAnniversary',
|
|
|
+ type: 'get',
|
|
|
+ headers: {
|
|
|
+ 'Authorization': id //id
|
|
|
+ },
|
|
|
+ contentType: "application/json",
|
|
|
+ dataType: 'json',
|
|
|
+ cache: false,
|
|
|
+ success: function (res) {
|
|
|
+ console.log(res)
|
|
|
+ if(res.status === 0){
|
|
|
+
|
|
|
+ }else{
|
|
|
+ stopManyClick(() =>{
|
|
|
+ toastr.error(res.msg)
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ })
|
|
|
+ }
|
|
|
+ getAward();/v1/anniversary/luckDraw
|
|
|
+ //点击抽奖
|
|
|
+ $('.once')[0].addEventListener('click',() => {
|
|
|
+ if(!animationFlag) return;
|
|
|
+ operate('sf_2022_h5_抽奖1次');
|
|
|
+ if(activityState === 0){
|
|
|
+ stopManyClick(() =>{
|
|
|
+ toastr.error('该活动暂未开启,请稍安勿躁');
|
|
|
+ })
|
|
|
+ }else if(activityState === 2 && luckDraw === 0){
|
|
|
+ stopManyClick(() =>{
|
|
|
+ toastr.error('活动已结束,期待下次的见面');
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ handleAward(1)
|
|
|
+ }
|
|
|
+ },false);
|
|
|
+ $('.five-times')[0].addEventListener('click',() => {
|
|
|
+ if(!animationFlag) return;
|
|
|
+ operate('sf_2022_h5_抽奖5次');
|
|
|
+ if(activityState === 0){
|
|
|
+ stopManyClick(() =>{
|
|
|
+ toastr.error('该活动暂未开启,请稍安勿躁');
|
|
|
+ })
|
|
|
+ }else if(activityState === 2 && luckDraw === 0){
|
|
|
+ stopManyClick(() =>{
|
|
|
+ toastr.error('活动已结束,期待下次的见面');
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ handleAward(5)
|
|
|
+ }
|
|
|
+ },false);
|
|
|
+ //点击再抽
|
|
|
+ $('.left-btn')[0].addEventListener('click',() => {
|
|
|
+ if(!animationFlag) return;
|
|
|
+ let val = $('.report-times').eq(0).text();
|
|
|
+ let pams = `sf_2022_h5_抽奖${val}次`;
|
|
|
+ operate(pams);
|
|
|
+ handleAward(val,'report')
|
|
|
+ },false);
|
|
|
+ function handleAward(times,type) {
|
|
|
+ animationFlag = false;
|
|
|
+ if(surplus === 0 || (times == 5 && surplus < 5)){
|
|
|
+ $('.have-times-wrap').eq(0).css('display', 'none');
|
|
|
+ $('.no-times-wrap').eq(0).css('display', 'block');
|
|
|
+ $('.award-result-dialog').animate({top: '1.86rem'},"fast");
|
|
|
+ $('.award-result-mask').show();
|
|
|
+ document.documentElement.style.overflow='hidden';
|
|
|
+ return
|
|
|
+ }
|
|
|
+ $.ajax({
|
|
|
+ url: baseUrl + '/api/user/v1/activity/obtainRewards',
|
|
|
+ type: 'post',
|
|
|
+ headers: {
|
|
|
+ 'Authorization': id //id
|
|
|
+ },
|
|
|
+ data:JSON.stringify({
|
|
|
+ frequency: times
|
|
|
+ }),
|
|
|
+ contentType: "application/json",
|
|
|
+ dataType: 'json',
|
|
|
+ cache: false,
|
|
|
+ success: function (res) {
|
|
|
+ if(res.status === 0){
|
|
|
+ $('.have-times-wrap').eq(0).css('display', 'block');
|
|
|
+ $('.no-times-wrap').eq(0).css('display', 'none');
|
|
|
+ if(type !== 'report'){
|
|
|
+ $('.award-result-dialog').animate({top: '1.86rem'},"fast");
|
|
|
+ $('.award-result-mask').show();
|
|
|
+ document.documentElement.style.overflow='hidden';
|
|
|
+ }
|
|
|
+ $('.award-result-wrap').eq(0).text('');
|
|
|
+ let str = '',
|
|
|
+ cardObj = {
|
|
|
+ '天': 'day',
|
|
|
+ '周': 'week',
|
|
|
+ '月': 'mouth',
|
|
|
+ '季': 'season',
|
|
|
+ '年': 'year'
|
|
|
+ },
|
|
|
+ imgNumber = 0,
|
|
|
+ list = res.data.list;
|
|
|
+ if(list.length === 1){
|
|
|
+ $('.award-result-wrap')[0].className = 'card-wrap award-result-wrap one-result';
|
|
|
+ str = `<div class="card-item">
|
|
|
+ <img class="one-card" src="../static/img/springFestivalActivity/${cardObj[list[0].duration]}.png" />
|
|
|
+ <div class="card-text">星曜${list[0].duration}卡</div>
|
|
|
+ </div> `
|
|
|
+ setTimeout(() => {
|
|
|
+ animationFlag = true;
|
|
|
+ },1000);
|
|
|
+ }else{
|
|
|
+ $('.award-result-wrap')[0].className = 'card-wrap award-result-wrap many-card-wrap'
|
|
|
+ for (let i = 0; i < list.length; i++) {
|
|
|
+ str += `<div class="card-item many-card-item">
|
|
|
+ <img class="card many-card" src="../static/img/springFestivalActivity/${cardObj[list[i].duration]}.png" />
|
|
|
+ <div class="card-text">星曜${list[i].duration}卡</div>
|
|
|
+ </div>`
|
|
|
+ }
|
|
|
+ var imgTimer2 = setInterval(() => {
|
|
|
+ $('.many-card-item').eq(imgNumber).css('display', 'block');
|
|
|
+ if(imgNumber >= 4){
|
|
|
+ clearInterval(imgTimer2);
|
|
|
+ animationFlag = true;
|
|
|
+ }
|
|
|
+ // <img class="light" src="../static/img/springFestivalActivity/light.gif?time=${new Date().getTime()}" />
|
|
|
+ // <img class="many-light" src="../static/img/springFestivalActivity/light.gif?time=${new Date().getTime()}" />
|
|
|
+ // $('.many-light')[imgNumber].src = `../static/img/springFestivalActivity/light.gif?time=${new Date().getTime()}`;
|
|
|
+ imgNumber++;
|
|
|
+ },400)
|
|
|
+ }
|
|
|
+ $('.report-times').eq(0).text(times);
|
|
|
+ if(parseInt(notReceive) > 0){
|
|
|
+ $('.join-result-tip').eq(0).css('opacity', '0');
|
|
|
+ $('.many-card-wrap').eq(0).css('marginTop', '0');
|
|
|
+ }
|
|
|
+ let text = parseInt(notReceive) > 0?'确定':'查看';
|
|
|
+ $('.look-btn').eq(0).text(text);
|
|
|
+ $('.award-result-wrap').eq(0).append(str);
|
|
|
+ init();
|
|
|
+ getPhoneNumber();
|
|
|
+ }else{
|
|
|
+ stopManyClick(() =>{
|
|
|
+ toastr.error(res.msg)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ })
|
|
|
+ }
|
|
|
+ //点击抽奖关闭按钮
|
|
|
+ $('.award-result-close')[0].addEventListener('click',() => {
|
|
|
+ animationFlag = true;
|
|
|
+ $('.award-result-dialog').animate({top: '-10.96rem'},"fast");
|
|
|
+ $('.award-result-mask').hide();
|
|
|
+ document.documentElement.style.overflow='auto';
|
|
|
+ },false);
|
|
|
+ // 点击领取tab切换
|
|
|
+ $('.get-award-wrap')[0].addEventListener('click',(e) => {
|
|
|
+ // $('.data-list').eq(0).text('');
|
|
|
+ // pageNum = 1;
|
|
|
+ // pages = 0;
|
|
|
+ // recordFlag = true;
|
|
|
+ // getAward();
|
|
|
+ $('.award-img').eq(1).css('display', 'none');
|
|
|
+ $('.award-img').eq(0).css('display', 'block');
|
|
|
+ $('.record-main-wrap')[0].className = 'record-main-wrap';
|
|
|
+ $('.get-award-text')[1].className = 'get-award-text used-text';
|
|
|
+ $('.get-award-text')[0].className = 'get-award-text';
|
|
|
+ },false);
|
|
|
+ $('.get-award-wrap')[1].addEventListener('click',(e) => {
|
|
|
+ // $('.data-list').eq(0).text('');
|
|
|
+ // pageNum = 1;
|
|
|
+ // pages = 0;
|
|
|
+ // recordFlag = true;
|
|
|
+ // getAward();
|
|
|
+ $('.award-img').eq(0).css('display', 'none');
|
|
|
+ $('.award-img').eq(1).css('display', 'block');
|
|
|
+ $('.record-main-wrap')[0].className = 'record-main-wrap record-main-active-wrap';
|
|
|
+ $('.get-award-text')[0].className = 'get-award-text used-text';
|
|
|
+ $('.get-award-text')[1].className = 'get-award-text';
|
|
|
+ },false);
|
|
|
+ //获取抽奖记录
|
|
|
+ function getAward(){
|
|
|
+ // $.ajax({
|
|
|
+ // url: baseUrl + '/api/user/v1/activity/platformGetRewardsH5',
|
|
|
+ // type: 'post',
|
|
|
+ // headers: {
|
|
|
+ // 'Authorization': id //id
|
|
|
+ // },
|
|
|
+ // data:JSON.stringify({
|
|
|
+ // pageNum: pageNum,
|
|
|
+ // pageSize: 10,
|
|
|
+ // receive: receive
|
|
|
+ // }),
|
|
|
+ // contentType: "application/json",
|
|
|
+ // dataType: 'json',
|
|
|
+ // cache: false,
|
|
|
+ // success: function (res) {
|
|
|
+ // if(res.status === 0){
|
|
|
+ recordFlag = true;
|
|
|
+ let str = '',
|
|
|
+ // records = res.data.records;
|
|
|
+ // pages = res.data.pages;
|
|
|
+ records = [1,2,3,4];
|
|
|
+ // if(records.length === 0){
|
|
|
+ // $('.title-row').eq(0).css('display', 'none');
|
|
|
+ // if(receive == 1 && parseInt(notReceive) > 0){
|
|
|
+ // str = '<div class="no-award">暂无已分配云手机</div>'
|
|
|
+ // }else{
|
|
|
+ // str = '<div class="no-award">没有抽奖记录,我都替你着急</div>'
|
|
|
+ // }
|
|
|
+ // }else{
|
|
|
+ // $('.title-row').eq(0).css('display', 'flex');
|
|
|
+ // }
|
|
|
+ for (var i = 0; i < records.length; i++) {
|
|
|
+ str += `<div class="light-content-wrap">
|
|
|
+ <div class="light-content-text">获得星曜7天时长</div>
|
|
|
+ <div class="light-content-time">6月10日 14:25:30</div>
|
|
|
+ <div class="get-btn btn-active">领取</div>
|
|
|
+ </div>`
|
|
|
+ }
|
|
|
+ $('.light-content-list').eq(0).append(str)
|
|
|
+ // }else{
|
|
|
+ // stopManyClick(() =>{
|
|
|
+ // toastr.error(res.msg)
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+
|
|
|
+ // },
|
|
|
+ // })
|
|
|
+ }
|
|
|
+ //点击领取按钮
|
|
|
+ $('.light-content-list')[0].addEventListener('click',(e) => {
|
|
|
+ if(e.target.className === 'light-content-list'){
|
|
|
+ return
|
|
|
+ }
|
|
|
+ receive = e.target.dataset.index;
|
|
|
+ if(receive == 1){
|
|
|
+ $('.award-change-btn')[0].className = 'award-change-btn'
|
|
|
+ }else{
|
|
|
+ $('.award-change-btn')[1].className = 'award-change-btn'
|
|
|
+ }
|
|
|
+ $('.data-list').eq(0).text('');
|
|
|
+ pageNum = 1;
|
|
|
+ pages = 0;
|
|
|
+ recordFlag = true;
|
|
|
+ getAward();
|
|
|
+ $('.award-change-btn')[receive].className = 'award-change-btn active'
|
|
|
+ },false);
|
|
|
//防止提示一秒内重复显示
|
|
|
function stopManyClick(fn) {
|
|
|
if (flag) {
|