|
@@ -12,7 +12,7 @@
|
|
|
<script src="../static/js/vender/toastr/toastr.min.js"></script>
|
|
|
<script src="../static/js/vender/config.js"></script>
|
|
|
<style>
|
|
|
-
|
|
|
+
|
|
|
</style>
|
|
|
</head>
|
|
|
|
|
@@ -26,10 +26,10 @@
|
|
|
<div class="limit">PC端用户不参与本次活动</div>
|
|
|
</div>
|
|
|
<div class="middle-container">
|
|
|
- <img class="footer-cloud" src="../static/img/doubleChristmasActivity/footer-cloud.png" />
|
|
|
+ <img class="footer-cloud" src="../static/img/doubleChristmasActivity/footer-cloud.png" />
|
|
|
<div class="step-container">
|
|
|
- <img class="tips" src="../static/img/doubleChristmasActivity/tip.png" />
|
|
|
- <div class="main-step-content">
|
|
|
+ <img class="tips" src="../static/img/doubleChristmasActivity/tip.png" />
|
|
|
+ <div class="main-step-content">
|
|
|
<div class="top-step">
|
|
|
<div class="step-item">
|
|
|
<img class="buyphone" src="../static/img/doubleElevenActivity/buyphone.png" />
|
|
@@ -51,7 +51,7 @@
|
|
|
<img class="join-activity" src="../static/img/doubleElevenActivity/button-join-activity.png" />
|
|
|
<div class="activity-btn-content">
|
|
|
<span class="activity-btn-text">立即参与</span>
|
|
|
- <img class="icon-left" src="../static/img/doubleElevenActivity/icon-left.png" />
|
|
|
+ <img class="icon-left" src="../static/img/doubleElevenActivity/icon-left.png" />
|
|
|
</div>
|
|
|
</div>
|
|
|
<img class="middle-cloud" src="../static/img/doubleChristmasActivity/middle-cloud.png" />
|
|
@@ -73,8 +73,8 @@
|
|
|
<span class="reward-text">天</span>
|
|
|
</div>
|
|
|
<div class="reward-tip-row">
|
|
|
- <img class="reward-tip-img" src="../static/img/doubleChristmasActivity/reward-tip-img.png" />
|
|
|
- <div class="reward-tip">精彩不停的充值福利专场已经来临充值越多折扣越大</div>
|
|
|
+ <img class="reward-tip-img" src="../static/img/doubleChristmasActivity/reward-tip-img.png" />
|
|
|
+ <div class="reward-tip">精彩不停的充值福利专场已经来临充值越多折扣越大</div>
|
|
|
</div>
|
|
|
<div class="reward-list">
|
|
|
<div class="reward-last-tip">已获得奖励请在分配奖励栏中进行时长分配</div>
|
|
@@ -99,7 +99,7 @@
|
|
|
<img class="right-ear" src="../static/img/doubleChristmasActivity/right-ear.png" />
|
|
|
<div class="slider" id="slider">
|
|
|
<div class="slider-list flex" id="slider-list"></div>
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
<div class="page-row">
|
|
|
<div class="schedule-line">
|
|
|
<div class="schedule-child-line"></div>
|
|
@@ -107,7 +107,7 @@
|
|
|
<div class="page">1/4页</div>
|
|
|
</div>
|
|
|
<div class="distribution-reward-btn">
|
|
|
- <img class="reward-btn-img" src="../static/img/doubleChristmasActivity/distribution-reward-btn.png" />
|
|
|
+ <img class="reward-btn-img" src="../static/img/doubleChristmasActivity/distribution-reward-btn.png" />
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -145,7 +145,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="rule-container">
|
|
|
- <img class="rule-tips" src="../static/img/doubleChristmasActivity/rule.png" />
|
|
|
+ <img class="rule-tips" src="../static/img/doubleChristmasActivity/rule.png" />
|
|
|
<div class="rule-content">
|
|
|
<div class="rule-point">一、活动时间:2021年12月18日-2022年1月3日。</div>
|
|
|
<div class="rule-point">二、任务奖励与获取说明</div>
|
|
@@ -163,15 +163,16 @@
|
|
|
<div class="rule-point">3.双子星官方对活动具有最终解释权。</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
+
|
|
|
</div>
|
|
|
</div>
|
|
|
<script>
|
|
|
toastr.options.positionClass = 'toast-center-center';
|
|
|
toastr.options.timeOut = '1500';
|
|
|
</script>
|
|
|
+ <script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
|
|
|
<script type="text/javascript">
|
|
|
- let timer,flag = true;
|
|
|
+ let timer, flag = true;
|
|
|
var url = window.location.href;
|
|
|
url = url.split('/');
|
|
|
var topVal = -0.5;
|
|
@@ -182,10 +183,23 @@
|
|
|
u = navigator.userAgent,
|
|
|
ua = navigator.userAgent.toLowerCase(),
|
|
|
isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
|
|
|
- isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
|
|
|
- let s = loc.substr(1,loc.length-1);//取得=号的位置
|
|
|
+ isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1, //android终端
|
|
|
+ isMiniprogram = false;
|
|
|
+ if (ua.match(/MicroMessenger/i) == "micromessenger") {
|
|
|
+ //ios的ua中无miniProgram,但都有MicroMessenger(表示是微信浏览器)
|
|
|
+ wx.miniProgram.getEnv((res) => {
|
|
|
+ if (res.miniprogram) {
|
|
|
+ isMiniprogram = true;
|
|
|
+ } else {
|
|
|
+ isMiniprogram = false;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ isMiniprogram = false;
|
|
|
+ }
|
|
|
+ let s = loc.substr(1, loc.length - 1);//取得=号的位置
|
|
|
let parms = s.split('&');
|
|
|
- parms.map((item) =>{
|
|
|
+ parms.map((item) => {
|
|
|
let arr = item.split('=');
|
|
|
let key = arr[0];
|
|
|
obj[key] = arr[1];
|
|
@@ -193,46 +207,50 @@
|
|
|
getList();
|
|
|
getLists();
|
|
|
//点击立即参与按钮
|
|
|
- $('.join-activity-btn')[0].addEventListener('click',() => {
|
|
|
- if(isAndroid){ // 安卓
|
|
|
- window.native.startPurchase(1,365);
|
|
|
- }else{
|
|
|
- window.webkit.messageHandlers.startPurchase.postMessage({type:2,day:365});
|
|
|
+ $('.join-activity-btn')[0].addEventListener('click', () => {
|
|
|
+ if (isAndroid) { // 安卓
|
|
|
+ window.native.startPurchase(1, 365);
|
|
|
+ } if (isMiniprogram) { // 小程序
|
|
|
+ wx.miniProgram.navigateTo({
|
|
|
+ url: '/packageA/order/buy/index'
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ window.webkit.messageHandlers.startPurchase.postMessage({ type: 2, day: 365 });
|
|
|
}
|
|
|
})
|
|
|
//点击去完成
|
|
|
- $('.reward-list')[0].addEventListener('click',(e) => {
|
|
|
- if(e.target.className === 'reward-btn'){
|
|
|
- if(isAndroid){ // 安卓
|
|
|
- window.native.startPurchase(1,365);
|
|
|
- }else{
|
|
|
- window.webkit.messageHandlers.startPurchase.postMessage({type:2,day:365});
|
|
|
+ $('.reward-list')[0].addEventListener('click', (e) => {
|
|
|
+ if (e.target.className === 'reward-btn') {
|
|
|
+ if (isAndroid) { // 安卓
|
|
|
+ window.native.startPurchase(1, 365);
|
|
|
+ } else {
|
|
|
+ window.webkit.messageHandlers.startPurchase.postMessage({ type: 2, day: 365 });
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
//点击tab选项卡
|
|
|
- $('.tab-row')[0].addEventListener('click',(e) => {
|
|
|
+ $('.tab-row')[0].addEventListener('click', (e) => {
|
|
|
const index = e.target.dataset.index;
|
|
|
- if(!index){
|
|
|
+ if (!index) {
|
|
|
return
|
|
|
}
|
|
|
- if(index == 0){
|
|
|
- $('.tab-item')[1].className = 'tab-item';
|
|
|
+ if (index == 0) {
|
|
|
+ $('.tab-item')[1].className = 'tab-item';
|
|
|
$('.tab-bg')[0].className = 'tab-bg tab-left';
|
|
|
- $('.reward-container').eq(0).css('display','block');
|
|
|
- $('.distribution-container').eq(0).css('display','none');
|
|
|
- $('.distribution-container').eq(1).css('display','none');
|
|
|
- }else{
|
|
|
- $('.tab-item')[0].className = 'tab-item';
|
|
|
+ $('.reward-container').eq(0).css('display', 'block');
|
|
|
+ $('.distribution-container').eq(0).css('display', 'none');
|
|
|
+ $('.distribution-container').eq(1).css('display', 'none');
|
|
|
+ } else {
|
|
|
+ $('.tab-item')[0].className = 'tab-item';
|
|
|
$('.tab-bg')[0].className = 'tab-bg tab-right';
|
|
|
- $('.reward-container').eq(0).css('display','none');
|
|
|
- $('.distribution-container').eq(0).css('display','block');
|
|
|
- $('.distribution-container').eq(1).css('display','block');
|
|
|
+ $('.reward-container').eq(0).css('display', 'none');
|
|
|
+ $('.distribution-container').eq(0).css('display', 'block');
|
|
|
+ $('.distribution-container').eq(1).css('display', 'block');
|
|
|
}
|
|
|
$('.tab-item')[index].className = 'tab-item tab-active';
|
|
|
})
|
|
|
//调用获取数据列表接口
|
|
|
- function getList(){
|
|
|
+ function getList() {
|
|
|
// $.ajax({
|
|
|
// url: baseUrl + '/api/user/v1/activity/orderRedEnvelopeSharing',
|
|
|
// type: 'post',
|
|
@@ -245,36 +263,36 @@
|
|
|
// success: function (res) {
|
|
|
// if(res.status === 0){
|
|
|
// if(res.data && res.data.length > 0){
|
|
|
- let res = {
|
|
|
- data:[{
|
|
|
- shareCount: 10,
|
|
|
- totalMoney: 30
|
|
|
- },{
|
|
|
- shareCount: 40,
|
|
|
- totalMoney: 90
|
|
|
- },{
|
|
|
- shareCount: 80,
|
|
|
- totalMoney: 180
|
|
|
- },{
|
|
|
- shareCount: 240,
|
|
|
- totalMoney: 365
|
|
|
- },{
|
|
|
- shareCount: 800,
|
|
|
- totalMoney: 730
|
|
|
- },{
|
|
|
- shareCount: 3022,
|
|
|
- totalMoney: 2022
|
|
|
- },{
|
|
|
- shareCount: 3022,
|
|
|
- totalMoney: 2022
|
|
|
- }]
|
|
|
- }
|
|
|
- var str = '',
|
|
|
- len = res.data.length;
|
|
|
- for (var i = 0; i < len; i++) {
|
|
|
- var totalMoney = res.data[i].totalMoney,
|
|
|
- shareCount = res.data[i].shareCount;
|
|
|
- str += `<div class="reward-row">
|
|
|
+ let res = {
|
|
|
+ data: [{
|
|
|
+ shareCount: 10,
|
|
|
+ totalMoney: 30
|
|
|
+ }, {
|
|
|
+ shareCount: 40,
|
|
|
+ totalMoney: 90
|
|
|
+ }, {
|
|
|
+ shareCount: 80,
|
|
|
+ totalMoney: 180
|
|
|
+ }, {
|
|
|
+ shareCount: 240,
|
|
|
+ totalMoney: 365
|
|
|
+ }, {
|
|
|
+ shareCount: 800,
|
|
|
+ totalMoney: 730
|
|
|
+ }, {
|
|
|
+ shareCount: 3022,
|
|
|
+ totalMoney: 2022
|
|
|
+ }, {
|
|
|
+ shareCount: 3022,
|
|
|
+ totalMoney: 2022
|
|
|
+ }]
|
|
|
+ }
|
|
|
+ var str = '',
|
|
|
+ len = res.data.length;
|
|
|
+ for (var i = 0; i < len; i++) {
|
|
|
+ var totalMoney = res.data[i].totalMoney,
|
|
|
+ shareCount = res.data[i].shareCount;
|
|
|
+ str += `<div class="reward-row">
|
|
|
<img class="reward-row-bg" src="../static/img/doubleChristmasActivity/reward-row-bg.png" />
|
|
|
<div class="reward-row-content">
|
|
|
<img class="reward-img" src="../static/img/doubleChristmasActivity/reward.png" />
|
|
@@ -285,9 +303,9 @@
|
|
|
<img class="reward-btn" src="../static/img/doubleChristmasActivity/finish-btn.png" />
|
|
|
</div>
|
|
|
</div>`
|
|
|
- }
|
|
|
- str +=`<div class="reward-last-tip">已获得奖励请在分配奖励栏中进行时长分配</div>`
|
|
|
- $('.reward-list').eq(0).append(str);
|
|
|
+ }
|
|
|
+ str += `<div class="reward-last-tip">已获得奖励请在分配奖励栏中进行时长分配</div>`
|
|
|
+ $('.reward-list').eq(0).append(str);
|
|
|
// }
|
|
|
// }else{
|
|
|
// stopManyClick(() => {
|
|
@@ -298,9 +316,9 @@
|
|
|
// })
|
|
|
}
|
|
|
//获取分配列表数据
|
|
|
- function getLists(){
|
|
|
+ function getLists() {
|
|
|
const sliderLen = Array.from($('.slider-item')).length;
|
|
|
- if(sliderLen > 4){
|
|
|
+ if (sliderLen > 4) {
|
|
|
return
|
|
|
}
|
|
|
// $.ajax({
|
|
@@ -315,24 +333,24 @@
|
|
|
// success: function (res) {
|
|
|
// if(res.status === 0){
|
|
|
// if(res.data && res.data.length > 0){
|
|
|
- let res = {
|
|
|
- data:[{
|
|
|
- shareCount: 10,
|
|
|
- totalMoney: 30
|
|
|
- },{
|
|
|
- shareCount: 40,
|
|
|
- totalMoney: 90
|
|
|
- },{
|
|
|
- shareCount: 80,
|
|
|
- totalMoney: 180
|
|
|
- }]
|
|
|
- }
|
|
|
- var str = '',
|
|
|
- len = res.data.length;
|
|
|
- for (var i = 0; i < len; i++) {
|
|
|
- var totalMoney = res.data[i].totalMoney,
|
|
|
- shareCount = res.data[i].shareCount;
|
|
|
- str += `<div class="reward-row">
|
|
|
+ let res = {
|
|
|
+ data: [{
|
|
|
+ shareCount: 10,
|
|
|
+ totalMoney: 30
|
|
|
+ }, {
|
|
|
+ shareCount: 40,
|
|
|
+ totalMoney: 90
|
|
|
+ }, {
|
|
|
+ shareCount: 80,
|
|
|
+ totalMoney: 180
|
|
|
+ }]
|
|
|
+ }
|
|
|
+ var str = '',
|
|
|
+ len = res.data.length;
|
|
|
+ for (var i = 0; i < len; i++) {
|
|
|
+ var totalMoney = res.data[i].totalMoney,
|
|
|
+ shareCount = res.data[i].shareCount;
|
|
|
+ str += `<div class="reward-row">
|
|
|
<img class="reward-row-bg" src="../static/img/doubleChristmasActivity/reward-row-bg.png" />
|
|
|
<div class="reward-row-content">
|
|
|
<img class="icon_xingyao" src="../static/img/doubleChristmasActivity/home_list_icon_xingyao.png" />
|
|
@@ -350,14 +368,14 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>`
|
|
|
- }
|
|
|
- let sliderItemDom = res.data.length === 0 ? `<div class="slider-item no-slider">暂无可分配的云手机</div>` : `<div class="slider-item">${str}</div>`;
|
|
|
- $('#slider-list').append(sliderItemDom);
|
|
|
- if(res.data.length === 0){
|
|
|
- $('.left-ear').eq(0).css('display','none');
|
|
|
- $('.right-ear').eq(0).css('display','none');
|
|
|
- $('.page-row').eq(0).css('display','none');
|
|
|
- }
|
|
|
+ }
|
|
|
+ let sliderItemDom = res.data.length === 0 ? `<div class="slider-item no-slider">暂无可分配的云手机</div>` : `<div class="slider-item">${str}</div>`;
|
|
|
+ $('#slider-list').append(sliderItemDom);
|
|
|
+ if (res.data.length === 0) {
|
|
|
+ $('.left-ear').eq(0).css('display', 'none');
|
|
|
+ $('.right-ear').eq(0).css('display', 'none');
|
|
|
+ $('.page-row').eq(0).css('display', 'none');
|
|
|
+ }
|
|
|
// }
|
|
|
// }else{
|
|
|
// stopManyClick(() => {
|
|
@@ -368,13 +386,13 @@
|
|
|
// })
|
|
|
}
|
|
|
//点击加号
|
|
|
- $('.slider-list')[0].addEventListener('click',(e) => {
|
|
|
- if(e.target.className === 'compute-icon add'){
|
|
|
+ $('.slider-list')[0].addEventListener('click', (e) => {
|
|
|
+ if (e.target.className === 'compute-icon add') {
|
|
|
let number = $('.ipt').eq(0).val();
|
|
|
number++;
|
|
|
- if(number < 30){
|
|
|
+ if (number < 30) {
|
|
|
$('.ipt').eq(0).val(number);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
stopManyClick(() => {
|
|
|
toastr.error('分配时常不能大于未分配时常');
|
|
|
})
|
|
@@ -382,13 +400,13 @@
|
|
|
}
|
|
|
});
|
|
|
//点击减号
|
|
|
- $('.slider-list')[0].addEventListener('click',(e) => {
|
|
|
- if(e.target.className === 'compute-icon cut'){
|
|
|
+ $('.slider-list')[0].addEventListener('click', (e) => {
|
|
|
+ if (e.target.className === 'compute-icon cut') {
|
|
|
let number = $('.ipt').eq(0).val();
|
|
|
- if(number > 0){
|
|
|
+ if (number > 0) {
|
|
|
number--;
|
|
|
$('.ipt').eq(0).val(number);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
stopManyClick(() => {
|
|
|
toastr.error('分配的时常不能小于0');
|
|
|
})
|
|
@@ -397,30 +415,30 @@
|
|
|
});
|
|
|
//埋点
|
|
|
operate('dt_双11_h5_活动页面');
|
|
|
- function operate(pointName,type){
|
|
|
+ function operate(pointName, type) {
|
|
|
$.ajax({
|
|
|
url: baseUrl + '/api/public/v1/systemBuriedPoint/stat',
|
|
|
type: 'post',
|
|
|
- data:JSON.stringify({
|
|
|
+ data: JSON.stringify({
|
|
|
pointName: pointName
|
|
|
}),
|
|
|
- contentType:"application/json",
|
|
|
+ contentType: "application/json",
|
|
|
dataType: 'json',
|
|
|
cache: false,
|
|
|
success: function (res) {
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
})
|
|
|
}
|
|
|
//防止提示一秒内重复显示
|
|
|
function stopManyClick(fn) {
|
|
|
- if (flag) {
|
|
|
+ if (flag) {
|
|
|
fn();
|
|
|
}
|
|
|
flag = false;
|
|
|
- if(timer){clearTimeout(timer);}
|
|
|
- timer = setTimeout(() => {flag = true}, 1500);
|
|
|
- }
|
|
|
+ if (timer) { clearTimeout(timer); }
|
|
|
+ timer = setTimeout(() => { flag = true }, 1500);
|
|
|
+ }
|
|
|
</script>
|
|
|
<script src="../static/js/vender/move.js"></script>
|
|
|
</body>
|