merge
This commit is contained in:
parent
d3b9fac751
commit
5872cb0a52
@ -38,9 +38,6 @@
|
|||||||
margin-top: 0.2rem;
|
margin-top: 0.2rem;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
.headerbtn:hover .dropdown-content {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
<link rel="icon" type="image/png" sizes="32x32" href="/favicon.ico" />
|
<link rel="icon" type="image/png" sizes="32x32" href="/favicon.ico" />
|
||||||
<script>
|
<script>
|
||||||
@ -83,7 +80,9 @@
|
|||||||
style="display: none"
|
style="display: none"
|
||||||
></a>
|
></a>
|
||||||
<div class="dropdown-content">
|
<div class="dropdown-content">
|
||||||
<a href="/recommend" id="sign_href" style="display: none;">Sign up</a>
|
<a href="/recommend" id="sign_href" style="display: none"
|
||||||
|
>Sign up</a
|
||||||
|
>
|
||||||
<a href="/rankinglist" id="quest_info">Quest Info</a>
|
<a href="/rankinglist" id="quest_info">Quest Info</a>
|
||||||
<a href="javascript:void(0)" id="logout_btn">Log out</a>
|
<a href="javascript:void(0)" id="logout_btn">Log out</a>
|
||||||
</div>
|
</div>
|
||||||
@ -343,11 +342,12 @@
|
|||||||
function getUrlParam(name) {
|
function getUrlParam(name) {
|
||||||
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
|
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
|
||||||
var r = window.location.search.substr(1).match(reg);
|
var r = window.location.search.substr(1).match(reg);
|
||||||
if (r != null) return unescape(r[2]); return null;
|
if (r != null) return unescape(r[2]);
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
var invitecode = getUrlParam('code')
|
var invitecode = getUrlParam("code");
|
||||||
if (invitecode) {
|
if (invitecode) {
|
||||||
localStorage.setItem('invite_code', invitecode)
|
localStorage.setItem("invite_code", invitecode);
|
||||||
}
|
}
|
||||||
var loadPic = [];
|
var loadPic = [];
|
||||||
for (var i = 1; i < 101; i++) {
|
for (var i = 1; i < 101; i++) {
|
||||||
@ -476,9 +476,9 @@
|
|||||||
$("#wallet_login_btn").click(function () {
|
$("#wallet_login_btn").click(function () {
|
||||||
location.href = "/sinup";
|
location.href = "/sinup";
|
||||||
});
|
});
|
||||||
$('#logout_btn').click(function(){
|
$("#logout_btn").click(function () {
|
||||||
localStorage.removeItem('userinfo')
|
localStorage.removeItem("userinfo");
|
||||||
})
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$(".anmode").each(function () {
|
$(".anmode").each(function () {
|
||||||
@ -499,87 +499,79 @@
|
|||||||
th.addClass("animated");
|
th.addClass("animated");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
$(function () {
|
$(function () {
|
||||||
|
|
||||||
$(".rule_sliders").click(function () {
|
$(".rule_sliders").click(function () {
|
||||||
|
|
||||||
if (!$(this).hasClass("sliderOn")) {
|
if (!$(this).hasClass("sliderOn")) {
|
||||||
|
|
||||||
$(".rule_sliders").removeClass("sliderOn");
|
$(".rule_sliders").removeClass("sliderOn");
|
||||||
$(this).addClass("sliderOn");
|
$(this).addClass("sliderOn");
|
||||||
$(".rule_descprition").slideUp();
|
$(".rule_descprition").slideUp();
|
||||||
$(this).find(".rule_descprition").slideDown();
|
$(this).find(".rule_descprition").slideDown();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$(this).removeClass("sliderOn");
|
$(this).removeClass("sliderOn");
|
||||||
$(this).find(".rule_descprition").slideUp();
|
$(this).find(".rule_descprition").slideUp();
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
var address = '';
|
var address = "";
|
||||||
var token = ''
|
var token = "";
|
||||||
|
|
||||||
var checkActivity = function(address, cb) {
|
var checkActivity = function (address, cb) {
|
||||||
var settings = {
|
var settings = {
|
||||||
"url": "http://192.168.100.83:3000/aa1/user_status",
|
url: "http://192.168.100.83:3000/aa1/user_status",
|
||||||
"method": "POST",
|
method: "POST",
|
||||||
"headers": {
|
headers: {
|
||||||
"Content-Type": "application/json"
|
"Content-Type": "application/json",
|
||||||
},
|
},
|
||||||
"data": JSON.stringify({
|
data: JSON.stringify({
|
||||||
"account": address
|
account: address,
|
||||||
})
|
}),
|
||||||
};
|
};
|
||||||
|
|
||||||
$.ajax(settings).done(function (res) {
|
$.ajax(settings).done(function (res) {
|
||||||
if (!res.errcode) {
|
if (!res.errcode) {
|
||||||
if (res.status == 4) {
|
if (res.status == 4) {
|
||||||
$('#page_login_btn').hide();
|
$("#page_login_btn").hide();
|
||||||
$('#page_quest_btn').show();
|
$("#page_quest_btn").show();
|
||||||
} else if (res.status == 1) {
|
} else if (res.status == 1) {
|
||||||
$('#page_login_btn').show();
|
$("#page_login_btn").show();
|
||||||
$('#page_quest_btn').hide();
|
$("#page_quest_btn").hide();
|
||||||
$('#page_login_btn').attr('href', '/recommend');
|
$("#page_login_btn").attr("href", "/recommend");
|
||||||
}else {
|
} else {
|
||||||
$('#page_login_btn').show();
|
$("#page_login_btn").show();
|
||||||
$('#page_quest_btn').hide();
|
$("#page_quest_btn").hide();
|
||||||
$('#page_login_btn').attr('href', '/login');
|
$("#page_login_btn").attr("href", "/login");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
var checkLogin = function() {
|
var checkLogin = function () {
|
||||||
let userinfo = window.localStorage.getItem("userinfo");
|
let userinfo = window.localStorage.getItem("userinfo");
|
||||||
if (!userinfo) {
|
if (!userinfo) {
|
||||||
return false
|
return false;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
let udata = JSON.parse(userinfo)
|
let udata = JSON.parse(userinfo);
|
||||||
console.log(udata);
|
console.log(udata);
|
||||||
address = udata.account;
|
address = udata.account;
|
||||||
token = udata.token;
|
token = udata.token;
|
||||||
if (address) {
|
if (address) {
|
||||||
$('#logined_btn').html(formatAddress(address));
|
$("#logined_btn").html(formatAddress(address));
|
||||||
$('#wallet_login_btn').hide();
|
$("#wallet_login_btn").hide();
|
||||||
$('#logined_btn').show();
|
$("#logined_btn").show();
|
||||||
$('#page_login_btn').attr('href', '/signup');
|
$("#page_login_btn").attr("href", "/signup");
|
||||||
checkActivity(address, function() {
|
checkActivity(address, function () {});
|
||||||
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
checkLogin();
|
checkLogin();
|
||||||
$('#wallet_login_btn').click(function() {
|
$("#wallet_login_btn").click(function () {
|
||||||
location.href = '/sinup'
|
location.href = "/sinup";
|
||||||
})
|
});
|
||||||
|
});
|
||||||
})
|
|
||||||
|
|
||||||
$(".anmode").each(function () {
|
$(".anmode").each(function () {
|
||||||
var th = $(this);
|
var th = $(this);
|
||||||
@ -587,21 +579,23 @@
|
|||||||
var delay = th.data("delay");
|
var delay = th.data("delay");
|
||||||
th.css("animation-duration", dura);
|
th.css("animation-duration", dura);
|
||||||
th.css("animation-delay", delay);
|
th.css("animation-delay", delay);
|
||||||
})
|
});
|
||||||
|
|
||||||
$(window).scroll(function () {
|
$(window).scroll(function () {
|
||||||
var windowtop = $(window).scrollTop();
|
var windowtop = $(window).scrollTop();
|
||||||
$(".section").each(function (index, element) {
|
$(".section").each(function (index, element) {
|
||||||
var th = $(this);
|
var th = $(this);
|
||||||
var thtops = th.offset().top;
|
var thtops = th.offset().top;
|
||||||
if (windowtop >= (thtops - $(window).height() * 0.8)) {
|
if (windowtop >= thtops - $(window).height() * 0.8) {
|
||||||
if (!th.hasClass("animated")) {
|
if (!th.hasClass("animated")) {
|
||||||
th.addClass("animated");
|
th.addClass("animated");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})
|
});
|
||||||
|
$(".headerbtn").click(function () {
|
||||||
|
$(".dropdown-content").show();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -4,13 +4,14 @@
|
|||||||
<div class="logo-img">
|
<div class="logo-img">
|
||||||
<img class="imgs" src="../../assets/mobile/logo.png" alt="" />
|
<img class="imgs" src="../../assets/mobile/logo.png" alt="" />
|
||||||
</div>
|
</div>
|
||||||
<div class="header-login">
|
<div class="header-login" @click="header">
|
||||||
<span >WALLET CONNECT</span>
|
<span>WALLET CONNECT</span>
|
||||||
<div class="dropdown-content">
|
<div v-show="hide" class="dropdown-content">
|
||||||
<a href="javascript:void(0)" @click.stop="toQuest">Quest Info</a>
|
<a href="javascript:void(0)" @click.stop="toQuest">Quest Info</a>
|
||||||
<a href="javascript:void(0);" @click="logout">Log out</a>
|
<a href="javascript:void(0);" @click="logout">Log out</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -18,23 +19,30 @@
|
|||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: "Header",
|
name: "Header",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
hide:false
|
||||||
|
};
|
||||||
|
},
|
||||||
created() {
|
created() {
|
||||||
chain.chainManager.init().then(() => {
|
chain.chainManager.init().then(() => {
|
||||||
console.log('header wallet init')
|
console.log("header wallet init");
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
header(){
|
||||||
|
this.hide = true
|
||||||
|
},
|
||||||
logout() {
|
logout() {
|
||||||
chain.logout();
|
chain.logout();
|
||||||
localStorage.removeItem('userinfo');
|
localStorage.removeItem("userinfo");
|
||||||
location.href = '/desktop.html'
|
location.href = "/desktop.html";
|
||||||
},
|
},
|
||||||
toQuest(e) {
|
toQuest(e) {
|
||||||
this.$router.push('rankinglist')
|
this.$router.push("rankinglist");
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
@ -53,6 +61,7 @@ export default {
|
|||||||
}
|
}
|
||||||
.header-login {
|
.header-login {
|
||||||
width: 9rem;
|
width: 9rem;
|
||||||
|
margin-top: 0.2vh;
|
||||||
border-radius: 50px;
|
border-radius: 50px;
|
||||||
line-height: 4vh;
|
line-height: 4vh;
|
||||||
background: rgb(12, 0, 0);
|
background: rgb(12, 0, 0);
|
||||||
@ -65,20 +74,17 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.dropdown-content {
|
.dropdown-content {
|
||||||
display: none;
|
top: 4.2vh;
|
||||||
top:4.2vh;
|
width: 36vw;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
background-color: rgb(18, 18, 18);
|
background-color: rgb(18, 18, 18);
|
||||||
min-width: 100%;
|
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
|
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
|
||||||
// padding: 12px 16px;
|
// padding: 12px 16px;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-login:hover .dropdown-content {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
.dropdown-content a {
|
.dropdown-content a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
padding: 0.2vw 0.3vw;
|
padding: 0.2vw 0.3vw;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user