|
@@ -81,6 +81,7 @@
|
|
|
|
|
|
<body>
|
|
|
<div class="container">
|
|
|
+ <span class="ipts"></span>
|
|
|
<div class="rule-wrap">
|
|
|
<img class="rule" src="../static/img/anniversaryCelebrate/rule.png" />
|
|
|
</div>
|
|
@@ -303,12 +304,12 @@
|
|
|
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
|
|
|
<script type="text/javascript" src="https://js.cdn.aliyun.dcloud.net.cn/dev/uni-app/uni.webview.1.5.2.js"></script>
|
|
|
<script type="text/javascript">
|
|
|
- // var baseUrl = 'http://14.18.190.141:1280'
|
|
|
+ // var baseUrl = 'http://prese.phone.androidscloud.com'
|
|
|
let timer,flag = true;
|
|
|
var url = window.location.href;
|
|
|
url = url.split('/')
|
|
|
var loc = window.location.search,
|
|
|
- n1 = loc.length,//地址的总长度 many-one-card
|
|
|
+ n1 = loc.length,//地址的总长度
|
|
|
n2 = loc.indexOf("="),//取得=号的位置
|
|
|
id = loc.substr(n2 + 1, n1 - n2),//从=号后面的内容
|
|
|
u = navigator.userAgent,
|
|
@@ -316,6 +317,7 @@
|
|
|
isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
|
|
|
miniprogram = false,
|
|
|
anniversarySwitch = 0,
|
|
|
+ receiveSwitch = 1,
|
|
|
animationFlag = true,
|
|
|
residueDegree = 0,
|
|
|
awardTimes = 0,
|
|
@@ -344,6 +346,10 @@
|
|
|
isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
|
|
|
// 初始化数据
|
|
|
init();
|
|
|
+ if(id){
|
|
|
+ getPhoneNumber();
|
|
|
+ getUserCard();
|
|
|
+ }
|
|
|
function init() {
|
|
|
$.ajax({
|
|
|
url: baseUrl + '/api/activity/v1/anniversary/getAnniversary',
|
|
@@ -358,6 +364,7 @@
|
|
|
if(res.status === 0){
|
|
|
residueDegree = res.data.residueDegree;
|
|
|
anniversarySwitch = res.data.anniversarySwitch;
|
|
|
+ receiveSwitch = res.data.receiveSwitch;
|
|
|
result = res.data.lighten;
|
|
|
totalTime = res.data.notReceivedDuration;
|
|
|
receivedDuration = res.data.receivedDuration;
|
|
@@ -386,7 +393,7 @@
|
|
|
$('.icon1')[0].src = '../static/img/anniversaryCelebrate/icon4.png';
|
|
|
$('.icon2')[0].src = '../static/img/anniversaryCelebrate/icon3.png';
|
|
|
}
|
|
|
- if(anniversarySwitch !== 0){
|
|
|
+ if(anniversarySwitch == 1 || (receiveSwitch == 0 && anniversarySwitch == 2)){
|
|
|
let awardText = anniversarySwitch == 1 ? '<div>活动暂未开启</div>请稍安勿躁' : '<div>活动已结束</div>期待下次的见面'
|
|
|
$('.no-start-dialog').eq(0).append(awardText);
|
|
|
$('.no-start-dialog').animate({top: '50%'},"fast");
|
|
@@ -466,13 +473,7 @@
|
|
|
},false);
|
|
|
function handleAward(times,type) {
|
|
|
if(!id){
|
|
|
- if (window.__wxjs_environment === 'miniprogram') { // 小程序
|
|
|
- wx.miniProgram.navigateTo({
|
|
|
- url: '/pages/index/index'
|
|
|
- })
|
|
|
- } else {
|
|
|
- download();
|
|
|
- }
|
|
|
+ download();
|
|
|
return
|
|
|
}
|
|
|
awardTimes = times;
|
|
@@ -522,7 +523,7 @@
|
|
|
str += `<div class="card-item one-card-item">
|
|
|
<div class="card-item-wrap">
|
|
|
<img class="one-card" src="../static/img/anniversaryCelebrate/day-card.png" />
|
|
|
- <div class="card-text">星曜${list[0].awardDurations}天卡</div>
|
|
|
+ <div class="card-text card-texts">星曜${list[0].awardDurations}天卡</div>
|
|
|
</div>
|
|
|
</div>`
|
|
|
} else {
|
|
@@ -594,7 +595,7 @@
|
|
|
str += `<div class="card-item many-card-item">
|
|
|
<div class="card-item-wrap card-item-wraps">
|
|
|
<img class="many-card" src="../static/img/anniversaryCelebrate/day-card.png" />
|
|
|
- <div class="card-text">星曜${list[i].awardDurations}天卡</div>
|
|
|
+ <div class="card-text card-texts">星曜${list[i].awardDurations}天卡</div>
|
|
|
</div>
|
|
|
</div>`
|
|
|
} else {
|
|
@@ -796,13 +797,8 @@
|
|
|
$('.get-times')[0].addEventListener('click',getTimeHandle,false);
|
|
|
function getTimeHandle() {
|
|
|
if(!id){
|
|
|
- if (window.__wxjs_environment === 'miniprogram') { // 小程序
|
|
|
- wx.miniProgram.navigateTo({
|
|
|
- url: '/pages/index/index'
|
|
|
- })
|
|
|
- } else {
|
|
|
- download();
|
|
|
- }
|
|
|
+ download();
|
|
|
+ // location.href = 'http://f.mpay8.cn/l/cmK4MSiolegJcfl';
|
|
|
return
|
|
|
}
|
|
|
operate('znq_2022_h5_获取次数按钮');
|
|
@@ -817,32 +813,31 @@
|
|
|
url: '/packageA/order/renew/index?record=' + userCardId
|
|
|
})
|
|
|
}
|
|
|
- }else if(uni.webView) {
|
|
|
- if(phoneRemainQuantity > 0){
|
|
|
- uni.webView.navigateTo({
|
|
|
- url: '/pages/order/order'
|
|
|
- })
|
|
|
- } else {
|
|
|
- uni.webView.navigateTo({
|
|
|
- url: '/pages/order/renew'
|
|
|
- })
|
|
|
- }
|
|
|
- } else if (isAndroid) { // 安卓
|
|
|
+ } else if (isAndroid && window.native) { // 安卓
|
|
|
if(phoneRemainQuantity > 0){
|
|
|
window.native.startPurchase('SVIP', 365);
|
|
|
} else {
|
|
|
window.native.startRenew();
|
|
|
}
|
|
|
- } else if (isiOS) {
|
|
|
+ } else if (isiOS && window.webkit.messageHandlers) {
|
|
|
if(phoneRemainQuantity > 0){
|
|
|
window.webkit.messageHandlers.startPurchase.postMessage({ type: 1, day: 365 });
|
|
|
} else {
|
|
|
window.webkit.messageHandlers.startRenew.postMessage({ type: 1, day: 365 });
|
|
|
}
|
|
|
+ } else {
|
|
|
+ if(phoneRemainQuantity > 0){
|
|
|
+ uni.webView.navigateTo({
|
|
|
+ url: '/pages/order/order'
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ uni.webView.navigateTo({
|
|
|
+ url: '/pages/order/renew'
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
- getUserCard();
|
|
|
function getUserCard(){
|
|
|
if(!id){
|
|
|
return
|
|
@@ -1262,9 +1257,9 @@
|
|
|
}
|
|
|
$('.share-wrap')[0].addEventListener('click',() => {
|
|
|
operate('znq_2022_h5_分享');
|
|
|
- if (isAndroid) {
|
|
|
+ if (isAndroid && window.native) {
|
|
|
window.native.share('双子星云手机闪曜周年庆!大礼回馈,最高免费赠送188天!', '双子星云手机闪曜周年庆!大礼回馈,最高免费赠送188天!', `${baseUrl}/h5/microserviceUserH5/vcloud/anniversaryCelebrate.html`, '../static/img/anniversaryCelebrate/share-bg.png')
|
|
|
- } else if (isiOS) {
|
|
|
+ } else if (isiOS && window.webkit.messageHandlers) {
|
|
|
window.webkit.messageHandlers.share.postMessage({
|
|
|
title: '双子星云手机闪曜周年庆!大礼回馈,最高免费赠送188天!',
|
|
|
content: '双子星云手机闪曜周年庆!大礼回馈,最高免费赠送188天!',
|
|
@@ -1277,16 +1272,11 @@
|
|
|
},false);
|
|
|
function download() {
|
|
|
operate('znq_2022_h5_下载');
|
|
|
- if(window.__wxjs_environment === 'miniprogram'){
|
|
|
- wx.miniProgram.navigateTo({
|
|
|
- url: '/pages/home/home'
|
|
|
- })
|
|
|
+ let ua = navigator.userAgent.toLowerCase();
|
|
|
+ if(ua.match(/MicroMessenger/i)=="micromessenger"){
|
|
|
+ location.href = 'http://f.mpay8.cn/l/cmK4MSiolegJcfl';
|
|
|
} else if (isAndroid) {
|
|
|
- if (baseUrl.includes('prese.phone.androidscloud.com')) {
|
|
|
- window.location.href = 'http://14.18.190.144:18888/suanchou'
|
|
|
- } else {
|
|
|
- window.location.href = 'http://www.androidscloud.com/suanchou?timestamp=' + Math.random();
|
|
|
- }
|
|
|
+ window.location.href = 'http://www.androidscloud.com/suanchou?timestamp=' + Math.random();
|
|
|
} else if (isiOS) {
|
|
|
document.location.href = 'https://www.pgyer.com/gemini6?timestamp=' + Math.random();
|
|
|
} else {
|
|
@@ -1298,7 +1288,7 @@
|
|
|
oInput.setAttribute("readonly", "readonly"); //设置只读,否则移动端使用复制功能时可能会造成软件盘弹出
|
|
|
setTimeout(() => {
|
|
|
oInput.value = window.location.href;
|
|
|
- document.body.appendChild(oInput)
|
|
|
+ $('.ipts')[0].appendChild(oInput)
|
|
|
selectText(oInput, 0, oInput.value.length);
|
|
|
document.execCommand("Copy"); // 执行浏览器复制命令
|
|
|
toastr.error(`复制成功`);
|