|
@@ -65,9 +65,9 @@
|
|
|
<img class="activity-rule-btn" src="../static/img/changePhoneActivity/activity-rule-btn.png" />
|
|
|
<img class="activity-rule-text" src="../static/img/changePhoneActivity/activity-rule-text.png" />
|
|
|
</div>
|
|
|
- <img class="rule1" src="../static/img/changePhoneActivity/rule1.png" />
|
|
|
+ <!-- <img class="rule1" src="../static/img/changePhoneActivity/rule1.png" />
|
|
|
<img class="rule2" src="../static/img/changePhoneActivity/rule2.png" />
|
|
|
- <img class="rule3" src="../static/img/changePhoneActivity/rule3.png" />
|
|
|
+ <img class="rule3" src="../static/img/changePhoneActivity/rule3.png" /> -->
|
|
|
</div>
|
|
|
<div class="footer">
|
|
|
<img class="footer_bg_img" src="../static/img/changePhoneActivity/footer_bg_img.png" />
|
|
@@ -110,7 +110,8 @@
|
|
|
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终端
|
|
|
+ isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1, //android终端
|
|
|
+ imgs = [[1,'../static/img/changePhoneActivity/rule1.png'],[2,'../static/img/changePhoneActivity/rule2.png'],[3,'../static/img/changePhoneActivity/rule3.png']];
|
|
|
//埋点
|
|
|
operate('dt_yhs_活动页面浏览');
|
|
|
function operate(pointName,type){
|
|
@@ -130,6 +131,24 @@
|
|
|
},
|
|
|
})
|
|
|
}
|
|
|
+ //异步加载图片
|
|
|
+ async function loadAsync() {
|
|
|
+ let promise = function(index,url) {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ const image = new Image();
|
|
|
+ image.src = url;
|
|
|
+ image.className = 'rule'+index;
|
|
|
+ image.onload = function() {
|
|
|
+ $('.middle')[0].appendChild(image);
|
|
|
+ resolve('ok');
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ for(let [index,url] of imgs) {
|
|
|
+ await promise(index,url);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ loadAsync();
|
|
|
//点击分享
|
|
|
$('.share')[0].addEventListener('click',()=>{
|
|
|
if (isiOS) {
|
|
@@ -242,18 +261,22 @@
|
|
|
}
|
|
|
//调用免费换机接口
|
|
|
function changePhone(){
|
|
|
+ let data = {
|
|
|
+ inviteTime: new Date().Format("yyyy-MM-dd hh:mm:ss"),
|
|
|
+ type: fromType,
|
|
|
+ account: account,
|
|
|
+ password: password
|
|
|
+ }
|
|
|
+ if(!id){
|
|
|
+ delete data.inviteTime
|
|
|
+ }
|
|
|
let ajaxObj = {
|
|
|
url: baseUrl + '/api/public/v1/activity/change/phone',
|
|
|
type: 'post',
|
|
|
headers: {
|
|
|
'Authorization': id //id
|
|
|
},
|
|
|
- data:JSON.stringify({
|
|
|
- inviteTime: new Date().Format("yyyy-MM-dd hh:mm:ss"),
|
|
|
- type: fromType,
|
|
|
- account: account,
|
|
|
- password: password
|
|
|
- }),
|
|
|
+ data:JSON.stringify(data),
|
|
|
contentType: "application/json",
|
|
|
dataType: 'json',
|
|
|
cache: false,
|
|
@@ -268,7 +291,7 @@
|
|
|
$('.mask').show();
|
|
|
document.documentElement.style.overflow='hidden';
|
|
|
}
|
|
|
- },
|
|
|
+ }
|
|
|
}
|
|
|
if(!id){
|
|
|
delete ajaxObj.headers
|